I need to create ui components dynamically in jsf page using managed bean.
I have ui types(inputText,textArea,Calender etc...) stored in the database.
So using these data i want to create ui components such as textfields on jsf page.
Is it possible,if yes then how to do this.
Thanks in advance.
You may want to consider Metawidget for this task, as it does much of the hard work around dynamically creating components (including PrimeFaces components) for you.
If you'd rather roll your own implementation, here is the correct way to create dynamic components in JSF: http://blog.kennardconsulting.com/2010/10/safely-manipulating-component-tree-with.html
Related
I'm evaluating XAF for our organization. It seems great and so powerful. But have some problems with its UI customization.
For example, I want to design a PersianDatePicker UI element and tell XAF to use it for DateTime properties.
Question 1: How can I design custom UI Elements (like PersianDatePicker) in Web and Win?
Question 2: How to tell XAF to use my custom UI controls in the layouts?
You can customize built-in DateTime property editors:
https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument113104
https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument113114.
You can then make them to be used as defaults or to set them in Model where it is appropriate.
PrimeFaces is a Java library which provides common frontend web components (e.g., dialogs, tables, select menus). The advantage of using PrimeFaces is that when you use a PrimeFaces component, you only need to tell it which data to use and which property you want to update server-side. The PrimeFaces library takes it from there, creating the component on the screen, displaying the data, and handling the Ajax interactions with the server-side code.
Is there any equivalent to this in the Ruby or Python web programming worlds? It seems to me like the alternative is coding your components up from scratch each time, manually handling the Ajax, etc., which sounds crazy.
How do non-Java web developers handle this?
Well, it may sound crazy, but I used RailsAdmin for this. It generates views, based on model fields and relationships. By 'generates views', I mean that it does it in a runtime (you're not going to have a copy of views in your application and etc.) Basically, this gem provides you basic functionality to manage your data from the beginning (without spending time on creating views and controllers). And ofc, it can't be used as a straight equivalent to PrimeFaces. But for prototyping stage, I think, it will do nicely.
My project is based on jsf & primefaces.
Recently there was a requirement from the customer to add 3D capabilities so I was thinking about WebGL.
My question is how can I use the data from the bean (server side)?
While via jsf API it's very simple I don’t know how to pass the values to the JS function.
Is it possible or perhaps there is some other why ?
Please advise since I am new to WebGL.
Thanks
Two solutions may be possible for you:
Embed JavaScript in JSF to bring the data from the bean to WebGL.
Create a web service that returns the data you need and call it from any ajax lib in JavaScript.
I'd like to know if it's possible to generate richfaces tabs dynamically without binding the component to the backing bean and looping through an array to populate it? I ask this because the #ViewsScoped bug will make such a solution useless in many cases. Primefaces provides dynamically generated tabs for a number of their container components but I'd really prefer to use richfaces here for a number of reasons. Thanks for your input.
I would like to create little higer-level framework on top of Struts2 which can take form element description from Action and render a complete form, in order to avoid having a separate JSP files with hardcoded form elements for every form in a large web application (so if I manage to do this I will have just a few generic JSPs for data form and few for layout). Application is extremely data-driven.
My idea is to create form description using custom objects in the Action (i.e. Button, TextInput etc.) and then to create a single JSP page that will render eveything out.
What is the best way of doing this? Can you propose some concrete way to do this?
I don't want to write something if I can reuse the existing code with some effort.
Any ideas are appreciated.
Kind regards,
Bozo
It seems to me you are trying to build a web framework on top of another, I doubt Struts2 is appropiate for that.
If you have a data-driven web app for which you dont want to write many similar JSP (or whatever view lang) pages, perhaps you'd better look at some frameworks with scaffolding abilities , eg Grails http://www.grails.org/Scaffolding
I did what I asked in the question myself - I have created a few generic JSP templates (list, edit etc.) which take application parameters and create output grids and forms using the struts2 and simple HTML tags. Using this method generic tiles definitions can also be created and used. So at the end using simple definition in the struts2 action, the grid and form is generated.