How can i read UI Components(text box,label,buttons etc.,) and positions in Panel Using JSF?.This Positions(X & Y Coordinates) will be save into xml file?.
Update:-
In my screen user can drag and drop the UI Component in different positions in panel at run time then click on save button.Those Components with positions into xml file.These my requirement.Please suggest to me what is the best approach ?
JSF components weren’t really designed to support things like that (fixed X&Y coordinates).
They mainly generate HTML output which are usually styled and positioned with CSS provided by the user, and the result is interpreted by some browser. Different browsers do not always interpret things the same way and there is no guarantee that the stylized HTML elements will work the same anyway, since there is a great variety of screen resolutions, screen and window sizes, etc.
Maybe you’d have better luck if you explain what exactly you are trying to achieve.
Having said that, in the client side you do have a way to get the positioning of the HTML elements generated by JSF, check out the examples in the answers to this question: Getting the co-ordinates of a component.
UPDATE: following the question update, what you want is to use a dashboard component. Check out the one from PrimeFaces (with code samples): https://www.primefaces.org/showcase/ui/panel/dashboard.xhtml You’ll need to store the item index and the column index for each widgetId (that may be the positions you would store in an XML).