I am using the same form to both create and update database entities.  The
following is an example of a form field:

<html-el:select property='documentStatusTypeId'
value='${note.auditIdentity.documentStatusType.id}'
onchange="editNoteForm.action=''; editNoteForm.submit(); return true;">
        <html:options collection='<%=ContextKey.DOCUMENT_STATUS_TYPES%>'
property='id' labelProperty='name' />
</html-el:select>

And from my struts-config.xml:

<form-bean name="editNoteForm"
type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
          <form-property name="noteId" type="java.lang.Integer" />
          <form-property name="documentStatusTypeId"
type="java.lang.Integer" />
... yada, yada, yada ...
</form-bean>

As you can see, if this field changes the page is reloaded.  Problem:  if
${note.auditIdentity} returns null (which would be the case if I was
creating a new entity) the property is not being populated from form bean.
How do I specify that if value is <null>, populate from form bean's
property?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 10/9/2003


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to