File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes (Struts2 -Jquery) Display data in a Grid after submitting a form. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "(Struts2 -Jquery) Display data in a Grid after submitting a form." Watch "(Struts2 -Jquery) Display data in a Grid after submitting a form." New topic
Author

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

Suresh Ganti
Greenhorn

Joined: Jun 12, 2011
Posts: 11
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

Joined: Jan 12, 2010
Posts: 67
You can try out reloadTopics in combination with formIds attribute.



Johannes


My Java and Webprogramming Blog
Suresh Ganti
Greenhorn

Joined: Jun 12, 2011
Posts: 11
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

Joined: Jan 12, 2010
Posts: 67
Please post the Stacktrace.

Johannes
Suresh Ganti
Greenhorn

Joined: Jun 12, 2011
Posts: 11
Hi,

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

Thanks,
Suresh.


[Thumbnail for stacktrace.JPG]

Johannes Geppert
Ranch Hand

Joined: Jan 12, 2010
Posts: 67
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

Joined: Jun 12, 2011
Posts: 11
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

Joined: Jun 12, 2011
Posts: 11
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.


[Thumbnail for withoutMentioning-Targets-attribute.JPG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: (Struts2 -Jquery) Display data in a Grid after submitting a form.