-
1. Re: Need advice on dynamically added calendars
oneworld95 Jul 20, 2009 4:47 PM (in response to oneworld95)I found this page on how to create a RichFaces control programmatically, but I'm still clueless on how to add an arbitrary number of HtmlCalendar objects to the page and then store their values in the backing bean: http://www.jsfsummit.com/blog/max_katz/2008/07/building_user_interfaces_with_jsf_declarative_vs_programmatic_approach.html
In other words, as a user fills one RichCalendar, we'd add another automatically. But how do you store the data and do get/set for these? -
2. Re: Need advice on dynamically added calendars
ilya_shaikovsky Jul 21, 2009 5:30 AM (in response to oneworld95)read also this one http://in.relation.to/11633.lace Not the answer to your question but contains useful info on working with dynamical components lists.
-
3. Re: Need advice on dynamically added calendars
oneworld95 Jul 21, 2009 1:53 PM (in response to oneworld95)Thanks, Ilya. That helps but got a question: How do you add a component that's created in code to a panel or other container on the XHTML facelet page? I'm not sure how to reference the object on the page to add stuff to it at a specific location on the page. Thanks.
-
4. Re: Need advice on dynamically added calendars
ilya_shaikovsky Jul 21, 2009 4:42 PM (in response to oneworld95)as you could see in article I'm iterating the tabs with c:forEach. You could do the same. If the list will be empty - nothing just will present.
Or learn components binding if you wan't to add them fully at server side. Bind some panel which will be a container and add calendars to it's children. -
5. Re: Need advice on dynamically added calendars
oneworld95 Jul 27, 2009 1:10 PM (in response to oneworld95)After wasting a few days trying to do this the hard way, I discovered that the c:forEach method is the best way to implement dynamic controls.
Now, how do you ensure that for each HtmlTextInput control, users only enter integers and give a validation error otherwise? Thanks. -
6. Re: Need advice on dynamically added calendars
alexsmirnov Jul 31, 2009 1:16 AM (in response to oneworld95)That should be done transparently for an integer values.
-
7. Re: Need advice on dynamically added calendars
oneworld95 Aug 3, 2009 10:42 AM (in response to oneworld95)Thank you, Ilya. I've got this working using your great article (http://in.relation.to/11633.lace). Please read my blog post to see how I did it: http://devharbor.blogspot.com/2009/08/add-jsf-controls-dynamically-with.html. Its got the XHTML and Java code used.
-
8. Re: Need advice on dynamically added calendars
oneworld95 Aug 3, 2009 10:44 AM (in response to oneworld95)Sorry. Formatting issue in last post; I wish we could edit our posts later. Here's my blog post: http://devharbor.blogspot.com/2009/08/add-jsf-controls-dynamically-with.html.
Here's Ilya's article: http://in.relation.to/11633.lace
Hope this post isn't mangled like the last :) -
9. Re: Need advice on dynamically added calendars
ilya_shaikovsky Aug 3, 2009 10:48 AM (in response to oneworld95)Cool to hear that you implemented the case succesfully! Will go through the blog now! Thanks for your efforts!
-
10. Re: Need advice on dynamically added calendars
oneworld95 Aug 3, 2009 11:08 AM (in response to oneworld95)Thanks, Ilya. Please let me know your thoughts on how I implemented the app and if there are better ways of doing some of the code.