My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 236: Issue with formIds attribute with JQgrid
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  johgep
Closed:  Jul 2010


Sign in to add a comment
 
Reported by callam...@gmail.com, Jul 7, 2010

What steps will reproduce the problem?
1. Add a form with text box on JQGrid sample jsp as 
<s:form id="testForm2">
<sj:textfield id="myText" name="myText" value="abcd" />
</s:form>
2. In <sjg:grid> tag add parameter as formIds="testForm2" and in corrosponding action class add attribute " private String myText" with getter and setters.
3. put sysout for myText in actio method for JQGrid.

What is the expected output? What do you see instead?
Expected output => "abcd" should be printed on console
Instead it is returnng as NULL. Form element values are not getting set in Struts2 action in case of sjg:grid. This same is working with sj:dialog and other tags.

Which struts2 version?
2.1.8

Which struts2-jquery plugin version?
2.1.0

Please provide any additional information below.

Jul 7, 2010
Project Member #1 johgep
can you please try out latest version.
Maybe this is solved with  Issue 186 
that should be fixed with version 2.2.0
Owner: johgep
Labels: Component-Grid-Plugin
Jul 7, 2010
#2 callam...@gmail.com
Hi,

I tried with version 2.2.0 as well. But still i am not getting the form attributes. :(
Please let me know if i am doing something wrong here or missing any step. Thanks,
Jul 13, 2010
#3 callam...@gmail.com
Pls find below the JSON response.

{"gridModel":[{"city":"Mumbai","country":"India","creditLimit":120.3,"id":123,"name":"abcd"},{"city":"Mumbai","country":"India","creditLimit":120.3,"id":123,"name":"abcd"}],"homeService":null,"homeVO":null,"language":null,"languageList":[{"strId":"J","strLabel":"Java"},{"strId":"P","strLabel":"PHP"},{"strId":"C","strLabel":"C#"}],"myText":null,"myText2":null,"page":1,"reloadList":[],"rows":2,"sord":"asc"}

Pls not value of myText is null, which is a text box in form whose id is specified in the JQGrid formids attribute.

I tried this with version 2.2.0 and 2.3.0 snapshot as well. Pls let me know solution for this as this is turning out to be show-stpper for my project. Thanks in advance.

Jul 20, 2010
#4 callam...@gmail.com
Hi johgep,

can u pls look into this issue? This is becoming a show stopper for my project.

Regards,

Amit
Jul 23, 2010
Project Member #5 johgep
there is a fix in the current SVN trunk for this issue.

https://code.google.com/p/struts2-jquery/source/detail?r=1133

I try it out with following steps.

Edit grid.jsp in grid showcase.

Add a JavaScript Function:

<script>
	function reloadGrid() {
		$.publish('reloadCustomerGrid');
		return false;
	}
</script>

Add a Form:

<s:form id="gridSearchForm">
	<s:textfield name="lastname" label="Lastname"></s:textfield>
	<s:submit value="Search" onclick="reloadGrid(); return false;"/>
</s:form>

Add attributes to Grid Tag:

    <sjg:grid 
    	id="customerstable"
    	formIds="gridSearchForm" 
    	reloadTopics="reloadCustomerGrid"
...

Now with every request there was send the value of textfield lastname.


Status: Started
Labels: Milestone-2.3.1
Jul 25, 2010
Project Member #6 johgep
(No comment was entered for this change.)
Status: Fixed
Jul 26, 2010
#7 callam...@gmail.com
Hi johgep,

I really appreciate your quick turn around on this issue. Thanks..

I tried with 2.3.1 version like this

<script>
		function reloadGrid11() {
			var myGrid = $("#gridtable");
			myGrid.trigger("reloadGrid");
			
		}
	</script>

<s:form id="gridSearchForm">
			<s:textfield name="myText"></s:textfield>
			
			<input type="button" value="Search" onclick="reloadGrid11();"/>
			
		 </s:form>
		<s:url id="remoteurl" action="jsontable"></s:url>
	    <sjg:grid 
	    	id="gridtable" 
	    	caption="Customers" 
	    	dataType="json" 
	    	href="%{remoteurl}" 
	    	pager="true" 
	    	gridModel="gridModel"
	    	rowList="2,5,10,15,20"
	    	rowNum="2"
	    	rownumbers="false"	
	    	viewrecords="true"	  
	    	formIds="gridSearchForm"
...

But still i am getting myText veriable as NULL :(. I double checked that patch r1133 changes are present in struts2-jquery-grid-plugin.jar. Pls let me know if i am doing something wrong here. Thanks,

Regards,

Amit
Jul 26, 2010
Project Member #8 johgep
submitting of form values does only works when you use the reloadTopics attribute provided by this plugin.

See the sample in comment 5 , else you must use your own implementation to submit additional values.
Oct 7, 2010
#9 alonzo_b...@hotmail.com
Has this been resolved.  I'm using 2.4.1 but the reloadTopics on the grid doesn't send the form element values to the Action class.  They're all null values
Oct 10, 2010
#10 mahimabo...@gmail.com
i m also using the same grid properties.while adding record in the grid its working fine.But while editing or deleting particular record i m getting ID attribute as null only. I tried several ways to get ID after row selection .But unable to find appropriate solution . please look into this.. help me...
Mar 21, 2013
#11 arvindja...@gmail.com
I am also facing same problem, has somebody got any solutions.
Sign in to add a comment

Powered by Google Project Hosting