-
1. Re: dymanically create datatable and column
guiltyxsin May 2, 2008 7:22 AM (in response to guiltyxsin)Any suggestions on how to accomplish this?
The repeater for the columns didn't work and I have no idea if there's any other way to dynamically create columns with the table.
Regards,
Andy -
2. Re: dymanically create datatable and column
ilya_shaikovsky May 2, 2008 7:44 AM (in response to guiltyxsin)use rich:columns component or just dataTable binding.
-
3. Re: dymanically create datatable and column
guiltyxsin May 3, 2008 2:24 AM (in response to guiltyxsin)Thanks for the suggestion.
I can't use rich:column because I want to dynamically create columns so if I add one more parameter in the database I don't need to change the html page.
Can this be achieved through dataTable binding? How should I do it?
Regards,
Andy -
4. Re: dymanically create datatable and column
raog0000 May 5, 2008 9:05 AM (in response to guiltyxsin)Ilya Shaikovsky is suggesting rich:columns; not rich:column. We have been using it very successfully for creating datatables with dynamic columns. Here is the richfaces demo link http://livedemo.exadel.com/richfaces-demo/richfaces/columns.jsf?c=columns
. -
5. Re: dymanically create datatable and column
shadowcreeper Aug 20, 2008 3:53 PM (in response to guiltyxsin)For some reason rich:columns does not work when nested inside an a4j:repeat or a ui:repeat.
Is there a known workaround other than using c:forEach? -
6. Re: dymanically create datatable and column
vlad.kamensky Aug 21, 2008 11:16 AM (in response to guiltyxsin)"shadowcreeper" wrote:
For some reason rich:columns does not work when nested inside an a4j:repeat or a ui:repeat.
Is there a known workaround other than using c:forEach?
Why do you need to repeat "rich:columns" whose purpose is to build columns dynamically ? Please note, that "rich:columns" builds dynamically multiple "rich:column" elements. -
7. Re: dymanically create datatable and column
shadowcreeper Aug 21, 2008 2:52 PM (in response to guiltyxsin)Sorry for not being specific enough on my previous post.
Why do you need to repeat "rich:columns" whose purpose is to build columns dynamically ? Please note, that "rich:columns" builds dynamically multiple "rich:column" elements.
Because they are inside a repeated dataTable:<a4j:repeat> <rich:dataTable> <rich:columns/> </rich:dataTable> </a4j:repeat>
However, if you had a list of lists which you didn't want to merge for whatever reason, then you might want to repeat them in the same rich:dataTable (I just don't need this here). -
8. Re: dymanically create datatable and column
vlad.kamensky Aug 22, 2008 2:31 AM (in response to guiltyxsin)"shadowcreeper" wrote:
However, if you had a list of lists which you didn't want to merge for whatever reason, then you might want to repeat them in the same rich:dataTable (I just don't need this here).
OK, got it. You said that c:forEach works for your case, right ? Now you need to feel the difference between forEach and ui:repeat/a4j:repeat :
http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets
As I understand, the c:forEach is an appropriate solution but it might not work in some cases (see a link). As for ui:repeat, it probably does not correlate well with rich:dataTable life cycle, though I have no exact answer why it is not working.