You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Hodges <EH...@USDataworks.com> on 2004/01/14 21:49:27 UTC

Question: How do I put iterated radio buttons in the same group?

I'm using nested:iterate to display a list of items in a table.  Each row
shows on element of the list like this:

<nested:iterate id="account" property="accounts">
  <tr>
    <td>
      <nested:radio property="master" value="Master"/>
    </td>
  </tr>
</nested:iterate>


I'd like to have one column that shows radio buttons and I'd like all of
those buttons to be in the same group so only one of them can be selected at
a time.  To do this I need them to have the same "name" property in the
resulting HTML.  The problem is that their names take the form
"account[index].master", where "index" has a different value on each row.
This puts each radio button in it's own group and allows all of them to be
selected at the same time.

Any ideas about how to make this work?


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


Re: Question: How do I put iterated radio buttons in the same group?

Posted by Kris Schneider <kr...@dotech.com>.
Try:

<html:radio property="master" idName="account"/>

Quoting Eric Hodges <EH...@USDataworks.com>:

> I'm using nested:iterate to display a list of items in a table.  Each row
> shows on element of the list like this:
> 
> <nested:iterate id="account" property="accounts">
>   <tr>
>     <td>
>       <nested:radio property="master" value="Master"/>
>     </td>
>   </tr>
> </nested:iterate>
> 
> 
> I'd like to have one column that shows radio buttons and I'd like all of
> those buttons to be in the same group so only one of them can be selected
> at
> a time.  To do this I need them to have the same "name" property in the
> resulting HTML.  The problem is that their names take the form
> "account[index].master", where "index" has a different value on each row.
> This puts each radio button in it's own group and allows all of them to be
> selected at the same time.
> 
> Any ideas about how to make this work?

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Question with beans and nested tag

Posted by Bret Kumler <bk...@firstam.com>.
I have a question for you guys.

I have a bean that has an ArrayList in it.

MyBean{
      private ArrayList theResults;
      
	public void setData (ArrayList x){
		this.theResults=x;
	}
	public ArrayList getData (){
		return this.theResults;
}

In my action I set the bean to the request.
httpServletRequest.setAttribute("gotcha", fb);

In the JSP page I want to display the values in the array.

Is this the correct syntax?

<nested:root id="a" name="gotcha" scope="request">
       <logic:iterate id="gotcha">
          <bean:write property="service_type"/>
          <bean:write property="service_type_description"/>
          <bean:write property="service_type_id"/>
       </logic:iterate>
</nested:root>


Thanks
	


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