You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chatzinikos, Fotis, VF-GR Consultant" <Fo...@vodafone.net.gr> on 2005/08/18 10:16:29 UTC

Pre-population of tag using multiple tags

Hello Everybody,

 

I am trying to pre-populate a jsp page form via the reset function of an
ActionForm. All values appear correctly in the form except the select /
option combinations. Could somebody have a look at the following and
provide some pointers? (Have not used <html:select before...)

 

The ActionForm:

 

public final class ProccessPropertiesFormAction extends ActionForm

{

    private String listlength = "20" ;

    private String usesig = "0" ;

    private String signature = "" ;

    private String fullname = "" ;

    private String replyto = "" ;

    private String maxwidth = "72" ;

    private String maxheight = "20" ;

    private String defsort = "date" ;  <--- used to create the select

 

...

 

    public void reset(ActionMapping mapping, HttpServletRequest request)

    {

        User user = (User) request.getSession().getAttribute("user") ;

 

        listlength = Integer.toString(user.getPagesize()) ;

 

        if (user.getUseSig())

            usesig = "1" ;

        else

            usesig = "0" ;

 

        signature = user.getSignature();

 

        fullname = user.getRealname() ;

        replyto = user.getReplyto() ;

        maxwidth = user.getMaxwidth() ;

        maxheight = user.getMaxheight();

        defsort = user.getSortby();  // <-- (this is "date", "subject",
etc)

 

and the JSP Page:

 

...

<html:form action="/ProcessProperties">

  <tr class="row1">

    <td align="left"><bean:message key="properties.replyto"/></td>

    <td align="right"><html:text size="30" property="replyto"/></td>

  </tr>

 

  <tr class="row2">

      <td align="left">

            <bean:message key="properties.defsort"/>

      </td>

      <td colspan="2" align ="right">

            <html:select property="defsort">

                <option value="subject"><bean:message
key="properties.subject"/></option>

                <option value="date"><bean:message
key="properties.date"/></option>

                <option value="sender"><bean:message
key="properties.sender"/></option>

                <option value="size"><bean:message
key="properties.size"/></option>

                <option value="new"><bean:message
key="properties.new"/></option>

                <option value="repfor"><bean:message
key="properties.repfor"/></option>

            </html:select>

      </td>

  </tr>

...

 

Thanks in advance,

Fotis