You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by upgrading <du...@yahoo.com> on 2011/10/09 14:54:13 UTC
T5.1.0.5 problem with a grid
Hi
I have a problem with a grid, i did a custom grid in a Form when i sort the
grid there isn't problem but i use a button in my form after sorting grid
after i have an exception :
java.lang.NullPointerException
org.apache.tapestry5.corelib.components.Grid$DefaultGridSortModel.getSortConstraints(Grid.java:346)
org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:463)
In my .java
// List to fill the grid
@Persist
private List<Users> listGrid;
public Object onActivate() {
/***** fill list for the grid ****/
listGrid = (List<Users>) userManager.findString("select u from
Users u inner join fetch u.role inner join fetch u.shop w");
}
// sent list to the grid
public List<Users> getList() {
return (List<Users>) listGrid;
}
@SetupRender
void initializeValue() {
i=((grid.getCurrentPage()-1) * (grid.getRowsPerPage())+1);
// Grid model
this.model = beanModelSource.createDisplayModel(Users.class,messages);
this.model.add("shop",pcSource.create(Users.class,
"shop.shoCode")).sortable(false);
this.model.add("role",pcSource.create(Users.class,
"role.rolDesignation")).sortable(false);
this.model.add("count",null);
this.model.add("remove",null);
this.model.exclude("useDateCreat","useDateModif","useId","usePassword");
this.model.reorder("count","useReference","useFirstname","useName","useLogin","useEmail","shop","role","useActive","remove");
}
tml page :
<t:grid t:id="grid" t:source="list" rowsPerPage="10" row="user"
t:model="beanModel">
<t:parameter name="countCell">${getCount()}</t:parameter>
<t:parameter name="useReferenceCell">
${user.useReference}
</t:parameter>
<t:parameter name="removeCell">
<t:checkbox name="remove" id="remove" value="remove" />
</t:parameter>
<t:parameter name="shopCell">
<t:if test="user.shop">
${user.shop.shoCode}
</t:if>
</t:parameter>
</t:grid>
Is somebody can help me to solve this problem? I have tried lot of
things.....
Thanks in advance
--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-0-5-problem-with-a-grid-tp4885091p4885091.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5.1.0.5 problem with a grid
Posted by upgrading <du...@yahoo.com>.
Hi Thiago,
Thx you for your piece of advices, it is working ;-)
Regards,
--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-0-5-problem-with-a-grid-tp4885091p4888206.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org