Hi,
I've been using Wicket at home for quite a while. The company I work for has
an old Swing application and we've been trying to figure out how to migrate
it and make it web based.
Even though I've been pitching in for Wicket since day one, the team lead
decided to go with "standard" stack
(jsf,facelets,richfaces,webflow2...ughh).
Anyways, the thing is that this Swing app generates panels dynamically based
on info that is retrieved from a back-end service. This data contains all
about which components to add to the panel, validations, drop-down data,
order, how they are grouped together, etc...
Our team is having a hard time figuring out how to add this same behaviour
with the technology stack THEY picked :-)
So my question is...Can I create dynamic components with Wicket that have no
assoicated html markup?
This would allow me to make a service call and retrieve all the data I need
to generate a page on the fly by iterating through all the data and creating
instances of Wicket components dynamically.
I know this functionality can be done more easily using Wicket, but have a
problem with it.
AFAIK Wicket always expects to have associated html markup for a simple html
component (DropDownChoice for example), so I searched around the forums and
found several solutions:
1. Wrap every single Wicket html component with a Panel. I think it's a
little bit overkill no?
2. Use a RepeatingView and when I want to add a specific Wicket html
component, override its onComponentTag() so that Wicket doesn't complain
about the actual html tag being missing in the html markup. Like this:
RepeatingView rv = new RepeatingView("dynamic");
add(rv);
for (int i = 0; i < 5; i++) {
rv.add(new Label(String.valueOf(i), "label_ " + i));
rv.add(new DropDownChoice<String>("dropDown_" + i,
categories) {
@Override
protected void onComponentTag(ComponentTag tag) {
tag.setName("select");
super.onComponentTag(tag);
}
});
}
Would this be a good approach? I've done an extensive search in this forum
but that's all I got.
Does anybody have any other ideas?
I would be so happy if we ended up using Wicket where I work and in order to
do that it would definitely help if it were possible to generate these
dynamic panels. I'm sure it would be easier that doing it with jsf, for
sure!
Thanks!
--
View this message in context:
http://www.nabble.com/Dynamic-Simple-%28html%29-Components-tp21108904p21108904.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]