cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno Dumon (JIRA)" <>
Subject [jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file
Date Wed, 22 Feb 2006 15:59:39 GMT
    [ ] 

Bruno Dumon commented on COCOON-1780:

> If you want to use an image as a button, you can use an <input type="image"> it
works fine !

Well yes, but try to combine an image and text in one button then. Just kidding, it's not
that this is important to me, but why artifically limit it to form controls that leave a request

This could as suggeted by Vincent also be done by just checking:


but then I don't see why not to set the submit widget while we're at it? It just seems a little
nicer to me to set it at the beginning and then later do the "form.getSubmitWidget() == this"
test, which better explains what we're testing.

> I think that the Upload widget is a totally different kind of widget than an action or
a submit widget (that is an action ;) ). You do not want to submit the form nor doing a custom
action, you just want the upload widget to delete its uploaded file. So I do not understand
the need to set the form submit id in this widget.

But it *is* the submit widget, and it will be set as submit widget anyway, just a little bit
later (after the readFromRequest processing).

Anyhow, adjust it as you feel appropriate. I'll already be happy if it works :-)

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>          Key: COCOON-1780
>          URL:
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.2-dev (Current SVN), 2.1.9-dev (current SVN)
>     Reporter: vincent Demay
>     Assignee: Jean-Baptiste Quenot
>      Fix For: 2.1.9-dev (current SVN)

> When a file is selected with the upload widget and a on-value-change event is fired,
the value of the widget can not be changed by user.
> here is the patch
> Index: /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
> ===================================================================
> --- /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
(revision 377974)
> +++ /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
(working copy)
> @@ -486,7 +486,7 @@
>              <xsl:text>[</xsl:text>
>              <xsl:value-of select="fi:value"/>
>              <xsl:text>] </xsl:text>
> -            <input type="button" id="{@id}:input" name="{@id}" value="..." onclick="forms_submitForm(this)"/>
> +           <input type="submit" id="{@id}:input" name="{@id}" value="..." onclick="forms_submitForm(this)"/>
>          </xsl:when>
>          <xsl:otherwise>
>            <input type="file" id="{@id}:input" name="{@id}" title="{fi:hint}" accept="{@mime-types}">

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message