struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Susan Bradeen" <Sus...@softlanding.com>
Subject DynaActionForm with logic:present
Date Tue, 01 Apr 2003 18:18:56 GMT
Can I use <logic:present> with DynaActionForm properties? 

If my form property is null, I don't want the property text box, to 
display in my jsp page. This works fine with an ActionForm, but using a 
DynaActionForm I get a blank text box for the property showing up. 

In the code below, the action's if-statement will not invoke, and the 
property value will not be set. Doesn't this mean that the property value 
should be null? And doesn't that mean that the <logic:present> in the jsp 
should not invoke either? 

JSP contains (in part):

 <logic:present name="myform" property="firstName" >
    <html:text property="firstName" />
  </logic:present>

Action contains:

  DynaValidatorForm myForm = (DynaValidatorForm)form;
  if (false) { myForm.set("firstName", myBean.getFirstName); }

struts-config contains:

  <form-bean name="myform" type="o.a.s.validator.DynaValidatorForm">
    <form-property name="firstName" type="java.lang.String" />
  </form-bean>

I haven't been able to find an example using this tag and this form type 
together. Can anyone please point me to an example of this? And, as usual, 
other suggestions and corrections to the above are greatly appreciated. 

Susan Bradeen
susanb@softlanding.com

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


Mime
View raw message