Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

(Struts2 -Jquery) Display data in a Grid after submitting a form.

 
Suresh Ganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can any one suggest one example to display data in a grid after submitting the form.

Here exactly what I am doing.

I have two date fields in a form. When ever I submit the form I need to search data from the backend based on the two data fields and I have to display the resulting data in a Grid.
How this can be possible?

Please find the sample code of mine below.



As shown above I need to display the date in the grid having id 'gridTable' when ever I submit the form "SampleAction.action"


Its important and urgent.

Please suggest one solution.

Thanks in advance.

Regards,
Suresh.
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try out reloadTopics in combination with formIds attribute.



Johannes
 
Suresh Ganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Johannes,

I am vaey glad to saw reply from you.
I tried with the reloadTopics. But I am getting one stackoverflow exception if I use that.
Can you please suggest why it is coming.

Thanks,
Suresh.
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the Stacktrace.

Johannes
 
Suresh Ganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please find the attached screen shot. I have traced the error in mozilla.

Thanks,
Suresh.
stacktrace.JPG
[Thumbnail for stacktrace.JPG]
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Check follwing Points:

1.) Why is your gridModel Attribute empty? This must match a collection propertie of your JSON Action.

2.) How looks your JSON Result? Is it successfully?

3.) Do you have a recursion in your gridModel? If yes you should exclude this properties from JSON result via the JSON annotion.

Johannes
 
Suresh Ganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1.) Why is your gridModel Attribute empty? This must match a collection propertie of your JSON Action.

Ans: I have declared appropriate collection for the gridModel.

2.) How looks your JSON Result? Is it successfully?

Ans: I have checked the Json result coming from the action. Using onSuscessTopics. So it is also coming good.

3.) Do you have a recursion in your gridModel? If yes you should exclude this properties from JSON result via the JSON annotion.

Ans:I didnt understand what exactly recursion is. Can you give some example for how to find and how to remove.


Thanks,
Suresh.

 
Suresh Ganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

One more thing I want to mention is, without declaring the targets attribute if the run the application it is just dowloading one .action file instead of refresing the page. can you please let me know if you can track the issue. please find the attached screen shot ot the same.
withoutMentioning-Targets-attribute.JPG
[Thumbnail for withoutMentioning-Targets-attribute.JPG]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic