You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@gmail.com on 2008/02/24 18:35:32 UTC

radio widget

I am having trouble addressing individual properties with radio?  To be more
precise, I have the following scenario:

<s:radio list="#attr.currQuestion.value.answers"></s:radio>
Where answers is a Map of Long,Answer pairs. I want to set listValue to a
property of the Answer, but I can't work out the current indexing scheme.

-- 
Scott
stanlick@gmail.com

Re: radio widget

Posted by st...@gmail.com.
After inspecting the freemarker template for radio, I discovered what the
tag would do if you did not specify a listValue.  It seems the handler is
pushing the current element to the stack in the iterator, so specifying

<s:radio list="#attr.currQuestion.value.answers" listValue="top.value.name
"/>

allowed me to get the value from the map's key/value entry which returned my
Answer type, at which point I was able to specify the name property to be
used as eye-candy on the web page.

Peace,
Scott