struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piltrafeta <piltraf...@gmail.com>
Subject Re: Getting a s:select selected value
Date Tue, 03 Jun 2008 19:43:17 GMT

Actually session.coordValues has a list with numbers from 1 to 10, and this
is correct...
The thing is that it takes maxCoord as an array. And it returns only the
first element, which means the value in the first select of the list of
records.

I've tried creating only one form for all the records and what i obtains in
my maxCoord is a list with the values for each record.



Laurie Harper wrote:
> 
> The most likely explanation would be that your option values collection 
> (session.coordValues) has empty or inconsistent key values. Check that 
> it contains what you think it does.
> 
> L.
> 
> piltrafeta wrote:
>> Hi ,
>> i have a jsp with some forms like this :
>> <s:form action="acceptUser" method="post">
>>   <tr>    
>>     <td>
>>   	 	<s:a href="#" onclick="accept(%{#users.value._id})"> Accept </s:a>
>> 	</td>
>> 	<td><s:url id="url" action="rejectUser" includeParams="none" >
>>     	<s:param name="idUser" value="%{#users.value._id}" />
>>     	</s:url>
>> 		<s:a href="%{url}"> Reject </s:a>
>> 	<!--<s:form action="rejectUser" method="post">
>> 	<s:a href="#" onclick="onLinkClick(%{#users.value._id})"> Reject </s:a>
>> 	</s:form>-->
>> 	</td>
>> 	<td><s:property value="#users.value._name"/></td>
>>     <td><s:property value="#users.value._username"/></td>
>>    	<td><s:select name="maxCoord" 
>>           			headerValue="" headerKey="" list="#session.coordValues" 
>>           			size="1" multiple="false" />
>>    	</td>
>>   </tr>
>>   <s:hidden name="idUser"/>
>>   </s:form>
>> 
>> and in my JavaActionClass i have a attribute with the same name as the
>> select element :
>>         private String maxCoord;
>> 	public String accept() {
>> 		print(maxCoord);
>> 		return SUCCESS;
>> 	}
>>         public String getMaxCoord() {
>> 		return maxCoord;
>> 	}
>> 	public void setMaxCoord(String maxCoord) {
>> 		this.maxCoord = maxCoord;
>> 	}
>> when i'm printing the maxCoord value, i only obtanins the correct value
>> if i
>> select the first form in my jsp class... if i chose any of the other i
>> get
>> an empty string.
>> Can you halp me with this please ?
>> Thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Getting-a-s%3Aselect-selected-value-tp17566943p17631862.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


Mime
View raw message