You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "m.harig" <m....@gmail.com> on 2008/12/16 08:22:06 UTC

tag

hi all
 
 am getting no.of users from DAO class and all username are in the form of
User Object.
        
        ArrayList list = new ArrayList();
      while(rs.next()){
        User user = new User();
         user.setUsername("abc");
        list.add(user);
       }

     this is my code . 
       <%
              ArrayList userList = (ArrayList)request.getAttribute("users");
       %>


              <html:select property="username">
				<logic:iterate id="users" collection="<%=userList%>"
length="<%=""+(userList.size()-1)%>">
					<html:option value=""><bean:write name="users"
property="username"/></html:option>
				</logic:iterate>
		</html:select>

           i can populate my User object by bean write . How do i set my
username value to <html:option value="">.. anyone please let me clear
-- 
View this message in context: http://www.nabble.com/%3Chtml%3Aoption%3E-tag-tp21028416p21028416.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: tag

Posted by Dave Newton <ne...@yahoo.com>.
Use the html:options [1] or html:optionsCollection tag [2]?

[1] http://struts.apache.org/1.2.9/userGuide/struts-html.html#options
[2] http://struts.apache.org/1.2.9/userGuide/struts-html.html#optionsCollection

Dave


--- On Tue, 12/16/08, m.harig <m....@gmail.com> wrote:

> From: m.harig <m....@gmail.com>
> Subject: Re: <html:option> tag
> To: user@struts.apache.org
> Date: Tuesday, December 16, 2008, 8:23 AM
> is there anyone to answer my question%-|
> 
> 
> 
> m.harig wrote:
> > 
> > hi all
> >  
> >  am getting no.of users from DAO class and all
> username are in the form of
> > User Object.
> >         
> >         ArrayList list = new ArrayList();
> >       while(rs.next()){
> >         User user = new User();
> >          user.setUsername("abc");
> >         list.add(user);
> >        }
> > 
> >      this is my code . 
> >        <%
> >               ArrayList userList =
> > (ArrayList)request.getAttribute("users");
> >        %>
> > 
> > 
> >               <html:select
> property="username">
> > 				<logic:iterate id="users"
> collection="<%=userList%>"
> >
> length="<%=""+(userList.size()-1)%>">
> > 					<html:option
> value=""><bean:write name="users"
> > property="username"/></html:option>
> > 				</logic:iterate>
> > 		</html:select>
> > 
> >            i can populate my User object by bean write
> . How do i set my
> > username value to <html:option
> value="">.. anyone please let me clear
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/%3Chtml%3Aoption%3E-tag-tp21028416p21032987.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

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


Re: tag

Posted by "m.harig" <m....@gmail.com>.

               is there anyone to answer my question%-|



m.harig wrote:
> 
> hi all
>  
>  am getting no.of users from DAO class and all username are in the form of
> User Object.
>         
>         ArrayList list = new ArrayList();
>       while(rs.next()){
>         User user = new User();
>          user.setUsername("abc");
>         list.add(user);
>        }
> 
>      this is my code . 
>        <%
>               ArrayList userList =
> (ArrayList)request.getAttribute("users");
>        %>
> 
> 
>               <html:select property="username">
> 				<logic:iterate id="users" collection="<%=userList%>"
> length="<%=""+(userList.size()-1)%>">
> 					<html:option value=""><bean:write name="users"
> property="username"/></html:option>
> 				</logic:iterate>
> 		</html:select>
> 
>            i can populate my User object by bean write . How do i set my
> username value to <html:option value="">.. anyone please let me clear
> 

-- 
View this message in context: http://www.nabble.com/%3Chtml%3Aoption%3E-tag-tp21028416p21032987.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