JqGrid

64 views
Skip to first unread message

anant

unread,
Jul 22, 2011, 1:53:00 PM7/22/11
to wiquery-plugins
Hi,
I an trying to use the JQGrid plugin. My page shows an empty grid and
the request containing the data for the grid is received but it does
not render inside the grid. I tried this in Firefox, chrome and Ie and
i have the same problem.
the code used is shown below:

Java Code:

public class ViewClientsAjax extends Panel {
WebMarkupContainer people;
GridModel<Contact> model;
public ViewClientsAjax(String id,List<Contact> contacts) {
super(id,new CompoundPropertyModel(contacts));
model = new GridModel<Contact>(Contact.class);
model.addColumnModel(new GridColumnModel<Contact>("name","name", new
Model("NameField"), 200));
model.addColumnModel(new
GridColumnModel<Contact>("phoneNumber","phoneNumber", new
Model("Phone"), 200));
//model.setScroll(20);
//model.setPagerpos(HorizontalPosition.center);
people = new WebMarkupContainer("people");
people.setOutputMarkupId(true);
add(people);
Grid<Contact> grid = new Grid<Contact>("grid",model,new
ContactDataProvider(contacts));
people.add(grid);
grid.addEvent(new OnGridCompleteAjaxEvent<Contact>() {
private static final long serialVersionUID = 1L;
@Override
protected void onGridComplete(AjaxRequestTarget
target,Grid<Contact> grid) {
System.out.println("Grid was just loaded!");
}
});
}

}


HTML code:

<wicket:panel>
<div wicket:id="people">
<div wicket:id="grid">
</div>
</div>
</wicket:panel>

Response(from firebug console)
<?xml version='1.0' encoding='UTF-8'?><rows>
<page>1</page>
<total>1</total>
<records>
10
</records>
<row id="row0" wicket:id="rows">
<cell wicket:id="cells"><span wicket:id="cell">2]]></cell><cell
wicket:id="cells"><span wicket:id="cell">]]></cell>
</row><row id="row1" wicket:id="rows">
<cell wicket:id="cells"><span wicket:id="cell">999]]></cell><cell
wicket:id="cells"><span wicket:id="cell">]]></cell>
</row><row id="row2" wicket:id="rows">
<cell wicket:id="cells"><span wicket:id="cell">Name]]></cell><cell
wicket:id="cells"><span wicket:id="cell">]]></cell>
</row><row id="row3" wicket:id="rows">
<cell wicket:id="cells"><span wicket:id="cell">anant]]></cell><cell
wicket:id="cells"><span wicket:id="cell">(524) 353-4533]]></cell>
</row><row id="row4" wicket:id="rows">
<cell wicket:id="cells"><span wicket:id="cell">i am me]]></cell><cell
wicket:id="cells"><span wicket:id="cell">]]></cell>
</row>
</rows>

Ernesto Reinaldo Barreiro

unread,
Jul 22, 2011, 3:16:57 PM7/22/11
to wiquery...@googlegroups.com
Try setting

protected void init() {
getMarkupSettings().setStripWicketTags(true);

}

on your application class.

Regards,

Ernesto

anant

unread,
Jul 22, 2011, 3:26:04 PM7/22/11
to wiquery-plugins
That worked great. Thank You So much for the quick response. Wiquery
is great. Keep up the good work

On Jul 22, 1:16 pm, Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages