Re: [Wicket-user] Some beginner's questions
- On a large form, which has many fields it would be nice to be able to auto-wire fields to model properties automatically. (ie. I have a text field called userName in html form and I have property called userName in my model). This would speed up development a lot. You can use (Bound)CompoundPropertyModel for this. See Jonathan's article on Wicket Models , which you can find here: http://wicket.sourceforge.net/wiki/doku.php?id=models The actual code needed to wire your form to your java is really small in this case. Just declare the fields using the field wicket-ID's, and make sure they match the property in your POJO. I already use CompoundPropertyModel, so I have code like: add(new TextField(code)); add(new TextField(descr)); add(new TextField(shortName)); I was hoping to avoid this code also for trivial cases. I don't know if this would work for everyone, but we have most of business-level validation logic in models so simple validation in wicket layer (like just checking that field is a number) is enough. You can use your business validation logic in your own implementations of IValidator and use those in your presentation layer, giving your user more direct feedback. I'll have to check this. Sounds useful. - Empty TextFields seem to be stored into model as Strings with zero lengths. Our previous UI system maps empty strings to nulls. Is there a way to tweak this anywhere in wicket ? I don't know. Perhaps someone else on the list can answer this. Maybe it would be possible to derive my own class from TextField and override updateModel ? - Is it OK to create instances of page objects myself, ie. doing something like this: getPage().setResponsePage(new PersonListPage(coll)); or should pages be instantiated by some factory class ? If you wish to do so. Factories are useful if you need more configuration or want to change the behaviour in a subclass, but it is not a requirement of Wicket. Your example works and is by no means an anti-pattern. Ok, and thanks for your response. Ari S. --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
One thing I can imagine is a form with a panel attached, that you feed a java bean. Based on the properties of that java bean (using introspection), you could add form fields to the form. This is quite easy to accomplish for simple introspection, though if you really want to do a good job, it's more work because you should then do the whole java beans trick with property descriptors etc. Is that more like what you need? Eelco Ari Suutari wrote: - On a large form, which has many fields it would be nice to be able to auto-wire fields to model properties automatically. (ie. I have a text field called userName in html form and I have property called userName in my model). This would speed up development a lot. You can use (Bound)CompoundPropertyModel for this. See Jonathan's article on Wicket Models , which you can find here: http://wicket.sourceforge.net/wiki/doku.php?id=models The actual code needed to wire your form to your java is really small in this case. Just declare the fields using the field wicket-ID's, and make sure they match the property in your POJO. I already use CompoundPropertyModel, so I have code like: add(new TextField(code)); add(new TextField(descr)); add(new TextField(shortName)); I was hoping to avoid this code also for trivial cases. I don't know if this would work for everyone, but we have most of business-level validation logic in models so simple validation in wicket layer (like just checking that field is a number) is enough. You can use your business validation logic in your own implementations of IValidator and use those in your presentation layer, giving your user more direct feedback. I'll have to check this. Sounds useful. - Empty TextFields seem to be stored into model as Strings with zero lengths. Our previous UI system maps empty strings to nulls. Is there a way to tweak this anywhere in wicket ? I don't know. Perhaps someone else on the list can answer this. Maybe it would be possible to derive my own class from TextField and override updateModel ? - Is it OK to create instances of page objects myself, ie. doing something like this: getPage().setResponsePage(new PersonListPage(coll)); or should pages be instantiated by some factory class ? If you wish to do so. Factories are useful if you need more configuration or want to change the behaviour in a subclass, but it is not a requirement of Wicket. Your example works and is by no means an anti-pattern. Ok, and thanks for your response. Ari S. --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
Basically, I think this component looks like a panel that displays a list of other panels; (a) the list's model is the list of properties of the bean; (b) for each property: see what it's type is (and for the advanced implementation look op property descriptor stuff, and see if special editors are attached etc). Now when we know which type it is, we construct a nested panel for it that in turn has the needed input field on it. E.g. when it is a boolean, we construct a 'CheckboxInputPanel' (which has a checkbox on it), and when it is something else, we construct a 'TextfieldInputPanel' (which has a text field on it). We might also have a map with custom panels for certain types and/ or properties; It is probably wise NOT to include the form itself on it, as that makes its usage actually less flexible, while not really adding power to it. What I describe above, we actually have done allready (though not by introspection) for our project here. Works really well. Eelco Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
The other case I was originally posting about (ie. having full screen design in html) is pretty much standard wicket use, only with small optimization related to coding work (ie. instantiate suitable wicket components like TextField, DropDownChoice, RadioChoice based on bean's attribute type). That's something you could do with panels. The advantage of using panels here is that you can have a form like: form ... ul wicket:id=myFormFieldsListView !-- list view for all fields -- lispan wicket:id=myFieldPanel //li !-- for each field insert a panel -- /ul /form now, in one case your panel can be: wicket:panel input type=text wicket:id=input size=50 / /wicket:panel while in another it can be: wicket:panel input type=checkbox wicket:id=input / /wicket:panel or: wicket:panel select wicket:id=select optionoption 1/option optionoption 2/option /select /wicket:panel So... with a panel you can defer what you actual contents/ component sub tree will look like. Our form won't mind, and you can nest as deep as you want. Maybe I misunderstood your suggestion ? When saying you could add form fields to the form did you mean html contents or just wicket field etc. instances ? I meant adding a wicket (form)component with HTML attached. By using panels you have both the component, and the markup (e.g. with just the input type=text...) Ari S. Eelco --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
Eek! My 2 cents: resource bundles are utterly useless here. We want to avoid ending up in a configuration nightmare like Hibernate has. You should create a new interface called WicketBean that guarantees that the bean has setStyle(), setLocale() and that's it and beyond that you construct the bean, set its locale, style and then query it for its property values. If the bean chooses to use resource bundles for its strings, fine, but that's its own business. Who the heck is going to need to change the form-name.property-name in a resource bundle? That's never going to happen. You'll set it once and never change it. Gili Ari Suutari wrote: then the labels for the form components are the name of the property by default or you can override by specifying an entry for something like form-name.property-name in a resource bundle. This would work very well. Our old system has this done just like this. Ari S. Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
Ok, there's more options. I'll file a RFE then and we can discuss it there. The point right now is whether we gave enough idea's to Ari to have his own go at it. Let's not forget that we don't have to have a solution (read: component) for every problem/idea we encounter, as long as it's easy to create custom components. And with Wicket it *is* very easy to create your own. Eelco Gili wrote: Eek! My 2 cents: resource bundles are utterly useless here. We want to avoid ending up in a configuration nightmare like Hibernate has. You should create a new interface called WicketBean that guarantees that the bean has setStyle(), setLocale() and that's it and beyond that you construct the bean, set its locale, style and then query it for its property values. If the bean chooses to use resource bundles for its strings, fine, but that's its own business. Who the heck is going to need to change the form-name.property-name in a resource bundle? That's never going to happen. You'll set it once and never change it. Gili Ari Suutari wrote: then the labels for the form components are the name of the property by default or you can override by specifying an entry for something like form-name.property-name in a resource bundle. This would work very well. Our old system has this done just like this. Ari S. Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Some beginner's questions
Jon, Resource bundles solve the problem of localized strings. To my understanding, we are not talking about localized strings. Instead people seem to be suggesting that different locales should invoke different getters/setters and this should be configurable via resource bundles. First, I find it silly that one would configure method names via resource bundles -- I expect the locale and style to act as class or method parameters, not make up part of the method name. Secondly, even if you did this how often do method names change? APIs rarely change extremely rarely... Gili Jonathan Locke wrote: i disagree. if you want to customize/localize the label, you'll change it. it's wicket's philosophy not to invent new solutions to problems that are already solved well enough. resource bundles can be suffixed with locale/style and already work wonderfully in wicket. i see no reason to re-invent this particular wheel. Gili wrote: Eek! My 2 cents: resource bundles are utterly useless here. We want to avoid ending up in a configuration nightmare like Hibernate has. You should create a new interface called WicketBean that guarantees that the bean has setStyle(), setLocale() and that's it and beyond that you construct the bean, set its locale, style and then query it for its property values. If the bean chooses to use resource bundles for its strings, fine, but that's its own business. Who the heck is going to need to change the form-name.property-name in a resource bundle? That's never going to happen. You'll set it once and never change it. Gili Ari Suutari wrote: then the labels for the form components are the name of the property by default or you can override by specifying an entry for something like form-name.property-name in a resource bundle. This would work very well. Our old system has this done just like this. Ari S. Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list
Re: [Wicket-user] Some beginner's questions
no, i'm not talking about that! i'm talking about the localizable /labels/ for the edited properties... Gili wrote: Jon, Resource bundles solve the problem of localized strings. To my understanding, we are not talking about localized strings. Instead people seem to be suggesting that different locales should invoke different getters/setters and this should be configurable via resource bundles. First, I find it silly that one would configure method names via resource bundles -- I expect the locale and style to act as class or method parameters, not make up part of the method name. Secondly, even if you did this how often do method names change? APIs rarely change extremely rarely... Gili Jonathan Locke wrote: i disagree. if you want to customize/localize the label, you'll change it. it's wicket's philosophy not to invent new solutions to problems that are already solved well enough. resource bundles can be suffixed with locale/style and already work wonderfully in wicket. i see no reason to re-invent this particular wheel. Gili wrote: Eek! My 2 cents: resource bundles are utterly useless here. We want to avoid ending up in a configuration nightmare like Hibernate has. You should create a new interface called WicketBean that guarantees that the bean has setStyle(), setLocale() and that's it and beyond that you construct the bean, set its locale, style and then query it for its property values. If the bean chooses to use resource bundles for its strings, fine, but that's its own business. Who the heck is going to need to change the form-name.property-name in a resource bundle? That's never going to happen. You'll set it once and never change it. Gili Ari Suutari wrote: then the labels for the form components are the name of the property by default or you can override by specifying an entry for something like form-name.property-name in a resource bundle. This would work very well. Our old system has this done just like this. Ari S. Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
Re: [Wicket-user] Some beginner's questions
Hi, i disagree. if you want to customize/localize the label, you'll change it. it's wicket's philosophy not to invent new solutions to problems that are already solved well enough. resource bundles can be suffixed with locale/style and already work wonderfully in wicket. i see no reason to re-invent this particular wheel. Me too. Resource bundles have been very handly for us in situations like this, because it is easy to handle such file (a finnish versio for example) to professional translation who can translate it to another language. It separates localization from application logic and user interface design. So user interface designers work on html files, translators work (mostly) on resource bundles and programmers work on java files. Isn't this what wicket is all about ? Ari S. Gili wrote: Eek! My 2 cents: resource bundles are utterly useless here. We want to avoid ending up in a configuration nightmare like Hibernate has. You should create a new interface called WicketBean that guarantees that the bean has setStyle(), setLocale() and that's it and beyond that you construct the bean, set its locale, style and then query it for its property values. If the bean chooses to use resource bundles for its strings, fine, but that's its own business. Who the heck is going to need to change the form-name.property-name in a resource bundle? That's never going to happen. You'll set it once and never change it. Gili Ari Suutari wrote: then the labels for the form components are the name of the property by default or you can override by specifying an entry for something like form-name.property-name in a resource bundle. This would work very well. Our old system has this done just like this. Ari S. Jonathan Locke wrote: Eelco Hillenius wrote: We could also consider making this a contrib component, or maybe even just a Wiki section. It's pretty specific, unless it is really good (full fledged java bean descriptor stuff). i was thinking an extension. the power of having this done right might be really something... i'd hate to see that get lost in the shuffle... A simple version is quite easy to implement. Might do it this weekend, or - if Ari wants to give it a shot, we can help him a bit by giving idea's. Or... now that I think of it, it might also be an example of how to construct custom components. Eelco Jonathan Locke wrote: i wonder if we should have something like BeanEditForm that does just this... property-name form-component property-name form-component ... let's make this an RFE for 1.1 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user