Re: Creating a form dynamically
This might be useful: http://herebebeasties.com/2007-08-17/wicket-bean-editor/ Regards, Erik. Ryan LaHue wrote: I'm trying to build a form dynamically and am having a little problem. Basically I have a class that takes a List and then passes them into a ListView for display on screen. The problem is that they were created elsewhere and I have no control over two things: 1) The order/type of each FormComponent 2) The wicket:id that was chosen for them when the FormComponents were created I think I've solved 1) by creating wrapper classes for each supported FormComponent type... for example, I have a DropDownChoicePanel which simply adds the DropDownChoice it is passed to its html, which is simply a . This way I can simply wrap each FormComponent in the list with a panel and add all the panels to my listview rather than the components themselves -- this solves the problem of homogenizing the listview's HTML. But 2) is causing me problems, because unless I require all FormComponents to be given a wicket:id which is prespecified and is the same as that in the DropDownChoicePanel (wicket:id="component") then it will not work. Am I going about this all wrong? Is there any way I can receive a FormComponent and then change its wicket:id so that it will always be "component" in my ListView? Or is there a solution for this problem already? Much thanks for any advice. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Creating a form dynamically
I've had good results creating my child components as panels and adding them to a RepeatingView (instead of ListView). The child panels should get their IDs from RepeatingView.newChildId(). jk On Fri, Jun 19, 2009 at 10:14:12AM -0400, James Carman wrote: > You could use Velocity to dynamically build your markup. > > On Fri, Jun 19, 2009 at 10:10 AM, Ryan LaHue wrote: > > I'm trying to build a form dynamically and am having a little problem. > > Basically I have a class that takes a List and then passes > > them into a ListView for display on screen. The problem is that they were > > created elsewhere and I have no control over two things: > > 1) The order/type of each FormComponent > > 2) The wicket:id that was chosen for them when the FormComponents were > > created > > > > I think I've solved 1) by creating wrapper classes for each supported > > FormComponent type... for example, I have a DropDownChoicePanel which simply > > adds the DropDownChoice it is passed to its html, which is simply a > wicket:id="component">. This way I can simply wrap each > > FormComponent in the list with a panel and add all the panels to my listview > > rather than the components themselves -- this solves the problem of > > homogenizing the listview's HTML. > > > > But 2) is causing me problems, because unless I require all FormComponents > > to be given a wicket:id which is prespecified and is the same as that in the > > DropDownChoicePanel (wicket:id="component") then it will not work. > > > > Am I going about this all wrong? Is there any way I can receive a > > FormComponent and then change its wicket:id so that it will always be > > "component" in my ListView? Or is there a solution for this problem > > already? > > > > Much thanks for any advice. > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Creating a form dynamically
You could use Velocity to dynamically build your markup. On Fri, Jun 19, 2009 at 10:10 AM, Ryan LaHue wrote: > I'm trying to build a form dynamically and am having a little problem. > Basically I have a class that takes a List and then passes > them into a ListView for display on screen. The problem is that they were > created elsewhere and I have no control over two things: > 1) The order/type of each FormComponent > 2) The wicket:id that was chosen for them when the FormComponents were > created > > I think I've solved 1) by creating wrapper classes for each supported > FormComponent type... for example, I have a DropDownChoicePanel which simply > adds the DropDownChoice it is passed to its html, which is simply a wicket:id="component">. This way I can simply wrap each > FormComponent in the list with a panel and add all the panels to my listview > rather than the components themselves -- this solves the problem of > homogenizing the listview's HTML. > > But 2) is causing me problems, because unless I require all FormComponents > to be given a wicket:id which is prespecified and is the same as that in the > DropDownChoicePanel (wicket:id="component") then it will not work. > > Am I going about this all wrong? Is there any way I can receive a > FormComponent and then change its wicket:id so that it will always be > "component" in my ListView? Or is there a solution for this problem > already? > > Much thanks for any advice. > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Creating a form dynamically
I'm trying to build a form dynamically and am having a little problem. Basically I have a class that takes a List and then passes them into a ListView for display on screen. The problem is that they were created elsewhere and I have no control over two things: 1) The order/type of each FormComponent 2) The wicket:id that was chosen for them when the FormComponents were created I think I've solved 1) by creating wrapper classes for each supported FormComponent type... for example, I have a DropDownChoicePanel which simply adds the DropDownChoice it is passed to its html, which is simply a . This way I can simply wrap each FormComponent in the list with a panel and add all the panels to my listview rather than the components themselves -- this solves the problem of homogenizing the listview's HTML. But 2) is causing me problems, because unless I require all FormComponents to be given a wicket:id which is prespecified and is the same as that in the DropDownChoicePanel (wicket:id="component") then it will not work. Am I going about this all wrong? Is there any way I can receive a FormComponent and then change its wicket:id so that it will always be "component" in my ListView? Or is there a solution for this problem already? Much thanks for any advice.