Hi,

I see no contradiction in having your UI (declaratively) defined  by a
service and having panels (with associated HTML markup): that markup
could "match" what you wanted on your "definition". As you also suggest,
you could use repeaters to create META-components that read your
definition and produce the UI. For instance, an field group component, a
grid, that reads the definition and generates a form and the form
components out of it. The same for tables, tabs, etc. I wouldn't try to
generate HTML directly (e.g using Labels), then what would be the
advantage of using wicket? If your abstract definition of the UI is
"pure enough"  then it shouldn't be a problem to produce similar UIs for
Wicket and a Swing application.

Ernesto

mito wrote:
> 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!
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to