You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "vincent Demay (JIRA)" <ji...@apache.org> on 2006/02/20 09:59:48 UTC

[jira] Created: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

[PATCH] Upload Widget : Can not change selected file
----------------------------------------------------

         Key: COCOON-1780
         URL: http://issues.apache.org/jira/browse/COCOON-1780
     Project: Cocoon
        Type: Bug
  Components: Blocks: Forms  
    Versions: 2.2-dev (Current SVN), 2.1.9-dev (current SVN)    
    Reporter: vincent Demay


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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367334 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

good you noticed, it's fixed now, I hope.

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]
     
Jean-Baptiste Quenot reopened COCOON-1780:
------------------------------------------


Yes you're right it's not the same issue.  Now, we have to find what goes wrong, as <input type="hidden" name="forms_submit_id"> should be set in both cases, with <input type="button"> or <input type="submit">

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]
     
vincent Demay reopened COCOON-1780:
-----------------------------------


I tried you patch on a form with a on-value-changed listener on upload and it works.

but when there isn't any on-value-change-listener and you submit the form with another input type="submit" the fallowing error occurs
java.lang.IllegalStateException: Submit widget already set to Upload 'upload'. Cannot set also Submit 'ok'

I think it's because we set the submit-id with the upload and after we set it again.

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]
     
vincent Demay closed COCOON-1780:
---------------------------------

    Resolution: Fixed

Yes, it was fixed, thanks

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367318 ] 

vincent Demay commented on COCOON-1780:
---------------------------------------

Thanks for the patch, it's working properly now.

I just have a question, what was the problem with replacing button in submit?

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367223 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

Thanks for quick follow up.

The change in the cforms.js seems related to Ajax, while I'm not using Ajax at all. Also, the upload widget doesn't work when in Ajax mode, IIRC. So my question still stands, how could the change to cforms.js fix this problem?

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367218 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

Hmm,

I have exactly the same problem and the patch suggested above, changing button to submit, solves it.

How is the provided link to http://svn.apache.org/viewcvs.cgi?rev=376238&view=rev related?

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367220 ] 

Jean-Baptiste Quenot commented on COCOON-1780:
----------------------------------------------

The link suggests that this problem has been fixed in a different way, by allowing <input type="button"> in cforms.js

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]
     
Bruno Dumon closed COCOON-1780:
-------------------------------

    Fix Version: 2.1.9-dev (current SVN)
     Resolution: Fixed

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367361 ] 

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 parameter?

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

fullId.equals(request.getParameter(Form.SUBMIT_ID_PARAMETER)

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: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]

Jean-Baptiste Quenot reassigned COCOON-1780:
--------------------------------------------

    Assign To: Jean-Baptiste Quenot

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Philippe Gassmann (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367363 ] 

Philippe Gassmann commented on COCOON-1780:
-------------------------------------------

Sylvain has just explained to me the purpose of "submit widgets" . Now I realized that my point of view was wrong, so ok, your solution seems good !

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367320 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

@vincent: I don't think there's a problem with that, but since it worked with 'button' before, the real cause of the bug had to be something else.

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]

Jean-Baptiste Quenot updated COCOON-1780:
-----------------------------------------


I'm quite sure it has been fixed recently, see http://svn.apache.org/viewcvs.cgi?rev=376238&view=rev

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367339 ] 

vincent Demay commented on COCOON-1780:
---------------------------------------

What do you think of doing something like that to keep your idea (in order to avoid useless code): 

Index: /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
===================================================================
--- /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java	(revision 379761)
+++ /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java	(working copy)
@@ -105,11 +105,6 @@
 
         Object obj = request.get(fullId);
 
-        if (fullId.equals(request.getParameter(Form.SUBMIT_ID_PARAMETER))) {
-           form.setSubmitWidget(this);
-        }
-
-
         // If the request object is a Part, keep it
         if (obj instanceof Part) {
             Part requestPart = (Part)obj;
@@ -129,7 +124,7 @@
 
         // If it's not a part and not null, clear any existing value
         // We also check if we're the submit widget, as a result of clicking the "..." button
-        } else if (obj != null || form.getSubmitWidget() == this){
+        } else if (obj != null || fullId.equals(request.getParameter(Form.SUBMIT_ID_PARAMETER))){
             // Clear the part, if any
             if (this.part != null) {
                 this.part.dispose();



or, and I think it's better because, replace the button by a submit and remove the useless condition as in the following patch
Index: /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
===================================================================
--- /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java	(revision 379761)
+++ /cvs/cocoon/cocoon_BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java	(working copy)
@@ -105,11 +105,6 @@
 
         Object obj = request.get(fullId);
 
-        if (fullId.equals(request.getParameter(Form.SUBMIT_ID_PARAMETER))) {
-           form.setSubmitWidget(this);
-        }
-
-
         // If the request object is a Part, keep it
         if (obj instanceof Part) {
             Part requestPart = (Part)obj;
@@ -129,7 +124,7 @@
 
         // If it's not a part and not null, clear any existing value
         // We also check if we're the submit widget, as a result of clicking the "..." button
-        } else if (obj != null || form.getSubmitWidget() == this){
+        } else if (obj != null){
             // Clear the part, if any
             if (this.part != null) {
                 this.part.dispose();


> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1780?page=all ]
     
vincent Demay closed COCOON-1780:
---------------------------------

    Resolution: Fixed

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367248 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

I just committed a patch.

The cause of the problem is that the submitWidget is now assigned after the readFromRequest processing. Fixed it in the same way as for the other widgets (such as Action).

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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

>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Bruno Dumon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367344 ] 

Bruno Dumon commented on COCOON-1780:
-------------------------------------

Hi Vincent,

It's not really useless code, since it allows more flexibility in rendering. For example, it would allow to use the HTML <button> tag, allowing to put an image on the button.

The way I've fixed the Upload widget follows the same pattern as the other widgets do, such as Action. In fact, I looked a bit too much at the Action widget and that's why I got it wrong the first time.

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1780) [PATCH] Upload Widget : Can not change selected file

Posted by "Philippe Gassmann (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1780?page=comments#action_12367355 ] 

Philippe Gassmann commented on COCOON-1780:
-------------------------------------------

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

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.

> [PATCH] Upload Widget : Can not change selected file
> ----------------------------------------------------
>
>          Key: COCOON-1780
>          URL: http://issues.apache.org/jira/browse/COCOON-1780
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira