You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Tran <da...@hotmail.com> on 2003/03/13 00:49:55 UTC

Re: Conditional Displaying form properties - Seek Advice - Solved

The actual syntax for DynaForm is

myForm.map.mypropertiy

Thank you for everything
-Dan
----- Original Message -----
From: "Dan Tran" <da...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, March 12, 2003 3:14 PM
Subject: Re: Conditional Displaying form properties - Seek Advice


> Thank you to both David and Rick,
>
> I replace myForm to the form name in my strut config file.
> Then I recieve the following exception
>
> org.apache.jasper.JasperException: An error occurred while evaluating
custom
> action attribute "value" with value "${loginUserForm.action == 'delete'}":
> Unable to find a value for "action" in object of class
> "org.apache.struts.validator.DynaValidatorForm" using operator "."
>
> Then I replace "${loginUserForm.action == 'delete'}" for
> "${loginUserForm[action ]== 'delete'}" since
> my form is a DynaForm
>
> however, I dont think ${loginUserForm[action] contains the intended value.
>
> am I using the correct syntax?
>
> Again, thank you for all advices
>
> -Dan
>
> ----- Original Message -----
> From: "David Graham" <dg...@hotmail.com>
> To: <st...@jakarta.apache.org>
> Sent: Wednesday, March 12, 2003 2:49 PM
> Subject: Re: Conditional Displaying form properties - Seek Advice
>
>
> > Struts puts your form bean in the request or session scope so you can
> access
> > it just like any other bean:
> >
> > <c:if test="${myForm.action == 'add'}" >
> >
> > "myForm" is the name you gave your form in struts-config.xml
> >
> > David
> >
> >
> >
> > >From: "Dan Tran" <da...@hotmail.com>
> > >Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > >To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > >Subject: Re: Conditional Displaying form properties - Seek Advice
> > >Date: Wed, 12 Mar 2003 14:34:49 -0800
> > >
> > >Hi David
> > >
> > >here is the code, but i dont know how to set up the properties for c:if
> > >
> > >   <c:if> test="${action == 'add'}" >
> > >        do something
> > >   </c:if>
> > >
> > >where action is one of the properties of my form.
> > >
> > >what is corrector the setup the test variable in my snippet code?
> > >
> > >Thanks ahead
> > >
> > >-Dan
> > >
> > >----- Original Message -----
> > >From: "David Graham" <dg...@hotmail.com>
> > >To: <st...@jakarta.apache.org>
> > >Sent: Wednesday, March 12, 2003 2:27 PM
> > >Subject: Re: Conditional Displaying form properties - Seek Advice
> > >
> > >
> > > > You can use the <c:if> JSTL tag to perform conditional logic.
> > > >
> > > > David
> > > >
> > > >
> > > >
> > > > >From: "Dan Tran" <da...@hotmail.com>
> > > > >Reply-To: "Struts Users Mailing List"
> <st...@jakarta.apache.org>
> > > > >To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > >Subject: Conditional Displaying form properties - Seek Advice
> > > > >Date: Wed, 12 Mar 2003 14:25:43 -0800
> > > > >
> > > > >Hi I would like to display/disable a set of form's properties base
on
> > > > >another properties in the form.
> > > > >
> > > > >some thing like this
> > > > >
> > > > ><html-el:form ....>
> > > > >
> > > > ><table>
> > > > >     if ( theForm.aProperty)
> > > > >     {
> > > > >        <tr>
> > > > >            <td>
> > > > >                <html-el:text property="myprob" />
> > > > >            /td>
> > > > >        </tr>
> > > > >     }
> > > > ></table>
> > > > ></html-el:form>
> > > > >
> > > > >
> > > > >Advice is greatly appricated.
> > > > >
> > > > >-Dan
> > > >
> > > >
> > > > _________________________________________________________________
> > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > http://join.msn.com/?page=features/virus
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > _________________________________________________________________
> > Protect your PC - get McAfee.com VirusScan Online
> > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>

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