You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "sam.raghav" <ka...@gmail.com> on 2009/07/25 05:55:49 UTC

Data loading problem in select tag using ajax in struts2

Dear all,

I am new to struts. I have some code like this.

registration.jsp
------------------
<body onload = "doRequestGETState(' StateAction?stateBn.state= ' + '');">

</body>

registrationInput.jsp
<s:fielderror/>
<s:actionerror/>

<s:select name="regBn.stateId" list="stateList" cssStyle="width: 180px;"
title="State" tabindex="1" onchange="doRequestGETState('
StateAction?stateBn.state=' + this.value); "
listValue="stateName" listKey="stateId" value="stateBn.state" headerKey=""
headerValue="Select State"/>

<s:select name="regBn.city" list="cityList" cssStyle="width: 180px;"
title="City" tabindex="1"
listValue="cityName" listKey="cityId" headerKey="" headerValue="Select City"
/>


struts.xml
--------------
<action name="StateAction" class="com.iMovers.res.action.StateAction">
<result name="success">/registrationInput.jsp</result>
</action>

<action name="RegistrationAction"
class="com.iMovers.res.action.RegistrationAction">
<result name="input">/registrationInput.jsp</result>
</action>


Problem is on validating registrationInput.jsp and coming back to
registrationInput.jsp I am getting error

"The requested list key 'stateList' could not be resolved as a
collection/array/map/enumeration/iterator type."

If I will change the result name from registrationInput.jsp to
registration.jsp then I can not display error message.

Please let me know If there is any way to come out of it.

Thanks and regards 
-- 
View this message in context: http://www.nabble.com/Data-loading-problem-in-select-tag-using-ajax-in-struts2-tp24654688p24654688.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Data loading problem in select tag using ajax in struts2

Posted by Dave Newton <ne...@yahoo.com>.
Same answer I gave you on JavaRanch.

Dave

sam.raghav wrote:
> Dear all,
> 
> I am new to struts. I have some code like this.
> 
> registration.jsp
> ------------------
> <body onload = "doRequestGETState(' StateAction?stateBn.state= ' + '');">
> 
> </body>
> 
> registrationInput.jsp
> <s:fielderror/>
> <s:actionerror/>
> 
> <s:select name="regBn.stateId" list="stateList" cssStyle="width: 180px;"
> title="State" tabindex="1" onchange="doRequestGETState('
> StateAction?stateBn.state=' + this.value); "
> listValue="stateName" listKey="stateId" value="stateBn.state" headerKey=""
> headerValue="Select State"/>
> 
> <s:select name="regBn.city" list="cityList" cssStyle="width: 180px;"
> title="City" tabindex="1"
> listValue="cityName" listKey="cityId" headerKey="" headerValue="Select City"
> />
> 
> 
> struts.xml
> --------------
> <action name="StateAction" class="com.iMovers.res.action.StateAction">
> <result name="success">/registrationInput.jsp</result>
> </action>
> 
> <action name="RegistrationAction"
> class="com.iMovers.res.action.RegistrationAction">
> <result name="input">/registrationInput.jsp</result>
> </action>
> 
> 
> Problem is on validating registrationInput.jsp and coming back to
> registrationInput.jsp I am getting error
> 
> "The requested list key 'stateList' could not be resolved as a
> collection/array/map/enumeration/iterator type."
> 
> If I will change the result name from registrationInput.jsp to
> registration.jsp then I can not display error message.
> 
> Please let me know If there is any way to come out of it.
> 
> Thanks and regards 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org