简体   繁体   中英

Primefaces dialog wrong position on resize

Test it with primefaces demo page , just scroll bottom our window, then press view , it will show a dialog on middle center window, but try resize it, dialog position will float to top.

please show me how to fix it :(.

Sorry about my English skill;

I don´t sure what you want but if you want change first position you can do it different ways:

By default dialog is positioned at center of the viewport and position option is used to change the location of the dialog. Possible values are;
• Single string value like 'center', 'left', 'right', 'top', 'bottom' representing the position within viewport.
• Comma separated x and y coordinate values like 200, 500
• Comma separated position values like 'top','right'. (Use single quotes when using a combination)

This you must write in your configuration map that you send:

Map<String,Object> configurationMap= new HashMap<String, Object>();  
configurationMap.put("position", "top");  
RequestContext.getCurrentInstance().openDialog("nameDialog", configurationMap, null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM