Seems like this overlaps strongly with meta data for pages; perhaps expanding that, and adding a meta: binding prefix, would address this better.
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/MetaDataLocator.html On Thu, Sep 29, 2011 at 7:32 AM, Barry Books <[email protected]> wrote: > Sorry about the 2 part email. > > The service to fetch the defaults is also pretty simple > > https://github.com/trsvax/tapestry-trsvax/blob/master/src/test/java/com/trsvax/tapestry/misc/services/DefaultsImpl.java > > So with these 3 parts you can do things like: > > In a comonent > @Parameter(MyDefaults.defaultKey) > private String value; > > In a tml file > ${default:MiscModule:defaultKey:abc} > > In your appModule > public void > contributeApplicationDefaults(MappedConfiguration<String, String> > configuration) > { > configuration.add(MyDefaults.defaultKey, "WackyCollaborator"); > } > > Since the Default service has access to the Location and the Component > you can override defaults based on the page or the component complete > id. Lastly since you can provide your own Default service you can > drive the final default value from your database (or whatever). > > If all the modules use something like this it would allow applications > to have fine grain control over the defaults for services and > components. For example I could default the grid pager rows to 50 on > one page and 10 one another. If I needed to I could control the zone > refresh color and style by user. > > Comments? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
