Maybe you could show more of your .tml (and .java) file(s). I'm new to Tap5 and all I've discovered so far in the realm of models is how to supply a one to a BeanEditor and to a Grid. I've never gone to the level of t:gridcell and from what I've learned one generally does not need to -- you can configure a lot at the t:grid level and via nested t:parameter elements.
Ezra CarstenM <[EMAIL PROTECTED]> wrote: Hi, ok, I tried this but I get a NullPointerException (line 4 of .tml). 1 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> 2 volatile="inherit:volatile"> 3 4 overrides="componentResources.containerResources"/> 5 6 7 # org.apache.tapestry.corelib.base.AbstractPropertyOutput.readPropertyForObject(AbstractPropertyOutput.java:134) # org.apache.tapestry.corelib.base.AbstractPropertyOutput.renderPropertyValue(AbstractPropertyOutput.java:117) # org.apache.tapestry.corelib.components.GridCell.beginRender(GridCell.java:28) # org.apache.tapestry.corelib.components.GridCell.beginRender(GridCell.java) Do I forget something? Thanks. Vashon-Ez wrote: > > It's a two step process. > > 1. Define a model in your Java class. It's easy to just use the standard > definition and extend it like so: > > @Inject > private BeanModelSource _beanModelSource; > > @Inject > private ComponentResources _resources; > > @Retain > private BeanModel _model; > > void pageLoaded() { > _model = _beanModelSource.create(VideoClip.class, true, > _resources); > > _model.remove("id"); > > _model.add("action", null); > } > > public BeanModel getModel() { > return _model; > } > > Note the _model.add("action", null); that sets a null conduit meaning the > grid will not try to pull values for that column from the underlying bean. > In other words, its a utility column where you can put whatever you like. > Note the name of the model is just model as its accessed via the > getModel() method. > > 2. Add a model="name-of-your-model-in-your-Java-class" to your grid in > your .tml file. In this case it is model="model" e.g.: > > > rowsPerPage="5" pagerPosition="both"> > > > context="video.id">${video.title} > > > > context="video.id">Edit > > > > I've added a bunch of other stuff, but you should get the idea. > > HTH > > CarstenM wrote: > Hi again, > > no example for this or what's wrong? > > Cheers > Carsten > > > > CarstenM wrote: >> >> Hello, >> >> still trying to use the GridRows component. >> Can someone give an example for a GridModelProvider or the GridRows >> component? >> Well, the Grid is an implementation of GridModelProvider but I would like >> to >> customize my rows. >> >> Thanks, >> Carsten >> >> >> (Thread relates to T5.0.6 - How to use GridRows) >> >> > > -- > View this message in context: > http://www.nabble.com/T5.0.6---GirdModelProvider-for-GridRows---example--tf4776423.html#a13723905 > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/T5.0.6---GirdModelProvider-for-GridRows---example--tf4776423.html#a13729112 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]