On 01.07.2004 20:55, Peter Velychko wrote:

But try the sample with two upload widgets that are not required (see
example below).

<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition";
         xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>
  <fd:widgets>
    <fd:field id="user" required="true">
      <fd:datatype base="string"/>
      <fd:label>User name</fd:label>
    </fd:field>
    <fd:upload id="upload" mime-types="text/plain">
      <fd:label>Upload a text file</fd:label>
      <fd:hint>You must choose a text file</fd:hint>
    </fd:upload>
    <fd:upload id="upload2" mime-types="text/plain">
      <fd:label>Upload a text file</fd:label>
      <fd:hint>You must choose a text file</fd:hint>
    </fd:upload>
  </fd:widgets>
</fd:form>

Confirmed. The reason: the click on the button releases the uploaded file and sets the field part of the upload widget to null. On validating this it does not cause an error of course (while it caused one and worked like expected when having required="true"). The important difference is now that the button "..." you click on is not different to the normal submit widget, the form does not know that this submit was indeed only an action. For fixing it the request parameter 'forms_submit_id' must be set to the upload widget's id.


Fixed it in CVS.

Joerg

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



Reply via email to