aspose file tools*
The moose likes Struts and the fly likes Send a value from textfield in s:form into the json action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Send a value from textfield in s:form into the json action" Watch "Send a value from textfield in s:form into the json action" New topic
Author

Send a value from textfield in s:form into the json action

Armin Vetek
Greenhorn

Joined: Aug 21, 2010
Posts: 29
Hi,

I have a page which consists from two parts.
First part is a criteria form with some textfields and a search button.
Second part is a table with a result set. I am using jquery-grid to present the data in the table.

I do not know how to send a criteria input from critera form to a jsonAction.

My code snippet look like that:
1.JSP PAGE
<s:form action="requestList" >
<s:textfield key="criteria"></s:textfield>
<s:submit name="searchButton" key="global.search"/>
</s:form>
<s:url id="remoteurl" action="jsontable" />

<sjg:grid
id="customerstable"
dataType="json"
href="%{remoteurl}">
<sjg:gridColumn
name="id"
index="id" />
</sjg:grid>

2.The jsp page is refreshed when I click search button. JQuery-grid is also encapsulated in the jsp page and also the jquery-grid is refreshed at the same time. I do not know how to send the criteria value from s:form into the jSonTableAction.

jSonTableAction is used to populate the gridModel.

Regards,
Javanus


http://www.javanus.com/blogs
Armin Vetek
Greenhorn

Joined: Aug 21, 2010
Posts: 29
I put the criteria value to the session in the action one and I get the value from the session in the action two.

Regards,
Javanus
 
Don't get me started about those stupid light bulbs.
 
subject: Send a value from textfield in s:form into the json action