I am creating a grid in my JSP something like below
<sjg:grid gridModel="gridModel"
---- other options -- >
</sjg:grid>
In my struts.xml
I am giving this action configuration
<action name = "jsonAction" calss == "Action class" method = "methodName" >
<interceptor-ref name="modelDriven" />
<interceptor-ref name="basicStack" />
<result name="success" type="json" >
</result>
</action>
In my action class
public myClass extends ActionSupport implements ModelDriven<BeanClass>
{
//My list haveing getters and setters
public gridModel getGridModel()
{
return gridModel;
}
public void setGridModel(List gridModel)
{
this.gridModel = gridModel;
}
public String methodName()
{
//code here to get the list
}
public BeanClass getModel()
{
return new BeanClass();
}
}
What my doubt is I can build the grid when I don't use ModelDriven
Interceptor. If I use it then I am unable to bind the list in jqGrid.
I did Google the issue but I can't find the proper solution. As far as I can know the issue is happening when using modelDriven
interceptor. This interceptor will keep the action object on top of the ValueStack
Even I tried to use the [1].top
but no luck.
EDIT:
I am implementing ModelDriven
interface as you said I am missing some specialization I think I have done what you said but still no luck. Don't know where I am missing.
I just did what you said do I need to change anything in my <sjg:grid gridModel = "Here?">
?
Still can't get the data in jqGrid.