Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Struts
Struts2Jquery <sjg:> tag
James Peter
Ranch Hand
Posts: 115
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All,
I need to display my data using <sjg:grid tag in struts2jquery.
I want to pass the list of data bean from action class to
jsp
page and render grid. My code is like below.
public class AddressAction extends ActionSupport implements ModelDriven{ private List<AddressBean> addressList = new ArrayList<AddressBean>(); private AddressForm addressForm=new AddressForm(); ..... @Action(value = "/addresssearch", results = { @Result(location = "address-search-result.jsp", name = "success") }) public String execute() { ...... //here I am inserting data into addressList. .... public Object getModel() { return addressForm; } public String getJSON() { return execute(); } }
in the jsp
<%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%> <sjg:grid id="addressTable" caption="Address Search Results" gridModel="addressList" resizableAnimate="true" resizableGhost="true" resizableHandles="all" dataType="json" > <sjg:gridColumn name="addressLine1" index="addressLine1" title="Address Line1" width="150" /> <sjg:gridColumn name="addressLine2" index="addressLine2" title="Address Line2" width="150" /> <sjg:gridColumn name="addressLine3" index="addressLine3" title="Address Line3" sortable="false"/> </sjg:grid>
But it is not rendering the table. please let me know where i am doing wrong.
Thanks
Peter
Johannes Geppert
Ranch Hand
Posts: 67
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
please read the
grid docs in the wiki
.
for the grid you need a JSON Action which provides the data for the grid.
Johannes
My Java and Webprogramming Blog
Get me the mayor's office! I need to tell him about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Struts2JQuery plugin problem
Struts2JQuery plugin
[Jqueryplugin] [struts2] rendering grid
Struts-JQuery grid, how to set font-size to the title of each grid column?
(Struts2 -Jquery) Display data in a Grid after submitting a form.
More...