Re: Property that references property
How do you designate which parameter to replace with? You use %1 etc? ** Martin 2008/8/31 Ritesh Trivedi <[EMAIL PROTECTED]>: > > Also just found this in StringResourceModel javadoc... So I guess you can > certainly do what I mentioned earlier. > > * parameters - The parameters parameter allows an array of objects to > be passed for > * substitution on the found string resource (see below) using a standard > * java.text.MessageFormat object. Each parameter may be an > ordinary Object, in which > * case it will be processed by the standard formatting rules associated > with > * java.text.MessageFormat. Alternatively, the parameter may be > an instance of > * IModel in which case the getObject() method > will be applied prior > * to the parameter being passed to the > java.text.MessageFormat. This allows such > * features dynamic parameters that are obtained using a > PropertyModel object or even > * nested string resource models. > > > Ritesh Trivedi wrote: >> >> I havent tried this myself, but if its not working I guess you could pass >> getString("property.maxWidth") value as a parameter to however you are >> accessing myProperty (possibly StringResourceModel). >> >> Hope that helps. >> >> >> >> Martin Makundi wrote: >>> >>> Hi! >>> >>> Sometimes I think it would be useful to refer properties from >>> properties. Example: >>> >>> WicketApplication.properties -file: >>> myProperty=The maximum width allowed is ${property.maxWidth} pixels >>> property.maxWidth=30 >>> >>> Now I would like to use the maxWidth simultaneously for both >>> validation purposes and to display an instruction message that changes >>> according to the parameter maxWidth. But Wicket does not seem to have >>> the smarts of referring to a property from within a property. >>> >>> Has someone figured out a simple workaround trick or pattern to >>> accomplish this, or does it require a serious add-on 'hack' on Wicket? >>> >>> ** >>> Martin >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/Property-that-references-property-tp19241680p19243889.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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Property that references property
Also just found this in StringResourceModel javadoc... So I guess you can certainly do what I mentioned earlier. * parameters - The parameters parameter allows an array of objects to be passed for * substitution on the found string resource (see below) using a standard * java.text.MessageFormat object. Each parameter may be an ordinary Object, in which * case it will be processed by the standard formatting rules associated with * java.text.MessageFormat. Alternatively, the parameter may be an instance of * IModel in which case the getObject() method will be applied prior * to the parameter being passed to the java.text.MessageFormat. This allows such * features dynamic parameters that are obtained using a PropertyModel object or even * nested string resource models. Ritesh Trivedi wrote: > > I havent tried this myself, but if its not working I guess you could pass > getString("property.maxWidth") value as a parameter to however you are > accessing myProperty (possibly StringResourceModel). > > Hope that helps. > > > > Martin Makundi wrote: >> >> Hi! >> >> Sometimes I think it would be useful to refer properties from >> properties. Example: >> >> WicketApplication.properties -file: >> myProperty=The maximum width allowed is ${property.maxWidth} pixels >> property.maxWidth=30 >> >> Now I would like to use the maxWidth simultaneously for both >> validation purposes and to display an instruction message that changes >> according to the parameter maxWidth. But Wicket does not seem to have >> the smarts of referring to a property from within a property. >> >> Has someone figured out a simple workaround trick or pattern to >> accomplish this, or does it require a serious add-on 'hack' on Wicket? >> >> ** >> Martin >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Property-that-references-property-tp19241680p19243889.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]
Re: Property that references property
I havent tried this myself, but if its not working I guess you could pass getString("property.maxWidth") value as a parameter to however you are accessing myProperty (possibly StringResourceModel). Hope that helps. Martin Makundi wrote: > > Hi! > > Sometimes I think it would be useful to refer properties from > properties. Example: > > WicketApplication.properties -file: > myProperty=The maximum width allowed is ${property.maxWidth} pixels > property.maxWidth=30 > > Now I would like to use the maxWidth simultaneously for both > validation purposes and to display an instruction message that changes > according to the parameter maxWidth. But Wicket does not seem to have > the smarts of referring to a property from within a property. > > Has someone figured out a simple workaround trick or pattern to > accomplish this, or does it require a serious add-on 'hack' on Wicket? > > ** > Martin > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Property-that-references-property-tp19241680p19243861.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]