You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Matthias Wessendorf <ma...@apache.org> on 2007/09/20 06:59:50 UTC

[Trinidad] - [IE] funny issue with form and defaultCommand

changed subject to better reflect the issue.

-M

On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> Hi,
>
> by accident I noticed this funny thing with form's defaultCommand and
> IE7 (true for IE 6 as well ??)
>
> here is a demo, that has a form, containing a defaultCommand
>
> http://www.irian.at/trinidad-demo/faces/components/form.jspx
>
> Do the following:
> -enter first value
> -enter second value AND! hit enter.
>
> => Notice that the button label changes to the ID of the button :-)
>
> (sure, FF it works as expected ;-))
>
> the source-code is:
> <tr:form defaultCommand="first" binding="#{editor.component}">
> ...
>   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
>   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
>   <tr:commandButton id="first" text="First" />
> ...
> </tr:form>
>
> any comments ?
>
> -Matthias
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] - [IE] funny issue with form and defaultCommand

Posted by Matthias Wessendorf <ma...@apache.org>.
ok, did the clean-up

On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> On 9/20/07, Adam Winer <aw...@gmail.com> wrote:
> > OK, so looks like the issue is that for this submit,
> > we have:
> >
> >         var params = new Object();
> >         params[src] = src;
> >         params['source'] = src;
> >
> >         submitForm(frm,0,params);
> >
> > We set params['source'] = src; to handle Trinidad buttons.
> > We set params[src] = src; to handle non-Trinidad buttons.
> >
> > Then submitForm() has (with a lot of non-taken branches
> > snipped):
> >
> >             var hiddenField = form.elements[paramName];
> >
> >              if (hiddenField.type == 'submit')
> >                // create an input type="hidden"
> >              else
> >                   hiddenField.value = paramValue;
> >
> > I think we need to add a checkt to submitForm() that hiddenField is
> > not a button element too!
>
> I was thinking that as well.
> >
> > (BTW, Matthias:  glancing at Core.js, I noticed
> > we've got double copies of all the spinbox code!)
>
> ok, I haven't added that code, but I can do the clean-up,
> if that was your point.
>
> Greetings,
> Matthias
>
> >
> > -- Adam
> >
> >
> > On 9/19/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > reason is this
> > >
> > > <script>
> > >
> > > function changeValue(element)
> > > {
> > >   element.value = element.id;
> > > }
> > >
> > >
> > > </script>
> > >
> > > <button id="foo" onclick="changeValue(this);">bar</button>
> > >
> > > in FF, never the button-text is changed.
> > >
> > > -M
> > >
> > > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > > changed subject to better reflect the issue.
> > > >
> > > > -M
> > > >
> > > > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > > > Hi,
> > > > >
> > > > > by accident I noticed this funny thing with form's defaultCommand and
> > > > > IE7 (true for IE 6 as well ??)
> > > > >
> > > > > here is a demo, that has a form, containing a defaultCommand
> > > > >
> > > > > http://www.irian.at/trinidad-demo/faces/components/form.jspx
> > > > >
> > > > > Do the following:
> > > > > -enter first value
> > > > > -enter second value AND! hit enter.
> > > > >
> > > > > => Notice that the button label changes to the ID of the button :-)
> > > > >
> > > > > (sure, FF it works as expected ;-))
> > > > >
> > > > > the source-code is:
> > > > > <tr:form defaultCommand="first" binding="#{editor.component}">
> > > > > ...
> > > > >   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
> > > > >   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
> > > > >   <tr:commandButton id="first" text="First" />
> > > > > ...
> > > > > </tr:form>
> > > > >
> > > > > any comments ?
> > > > >
> > > > > -Matthias
> > > > > --
> > > > > Matthias Wessendorf
> > > > >
> > > > > further stuff:
> > > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > > mail: matzew-at-apache-dot-org
> > > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > mail: matzew-at-apache-dot-org
> > >
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] - [IE] funny issue with form and defaultCommand

Posted by Matthias Wessendorf <ma...@apache.org>.
created

https://issues.apache.org/jira/browse/TRINIDAD-727

applied the fix to trunk

On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> On 9/20/07, Adam Winer <aw...@gmail.com> wrote:
> > OK, so looks like the issue is that for this submit,
> > we have:
> >
> >         var params = new Object();
> >         params[src] = src;
> >         params['source'] = src;
> >
> >         submitForm(frm,0,params);
> >
> > We set params['source'] = src; to handle Trinidad buttons.
> > We set params[src] = src; to handle non-Trinidad buttons.
> >
> > Then submitForm() has (with a lot of non-taken branches
> > snipped):
> >
> >             var hiddenField = form.elements[paramName];
> >
> >              if (hiddenField.type == 'submit')
> >                // create an input type="hidden"
> >              else
> >                   hiddenField.value = paramValue;
> >
> > I think we need to add a checkt to submitForm() that hiddenField is
> > not a button element too!
>
> I was thinking that as well.
> >
> > (BTW, Matthias:  glancing at Core.js, I noticed
> > we've got double copies of all the spinbox code!)
>
> ok, I haven't added that code, but I can do the clean-up,
> if that was your point.
>
> Greetings,
> Matthias
>
> >
> > -- Adam
> >
> >
> > On 9/19/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > reason is this
> > >
> > > <script>
> > >
> > > function changeValue(element)
> > > {
> > >   element.value = element.id;
> > > }
> > >
> > >
> > > </script>
> > >
> > > <button id="foo" onclick="changeValue(this);">bar</button>
> > >
> > > in FF, never the button-text is changed.
> > >
> > > -M
> > >
> > > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > > changed subject to better reflect the issue.
> > > >
> > > > -M
> > > >
> > > > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > > > Hi,
> > > > >
> > > > > by accident I noticed this funny thing with form's defaultCommand and
> > > > > IE7 (true for IE 6 as well ??)
> > > > >
> > > > > here is a demo, that has a form, containing a defaultCommand
> > > > >
> > > > > http://www.irian.at/trinidad-demo/faces/components/form.jspx
> > > > >
> > > > > Do the following:
> > > > > -enter first value
> > > > > -enter second value AND! hit enter.
> > > > >
> > > > > => Notice that the button label changes to the ID of the button :-)
> > > > >
> > > > > (sure, FF it works as expected ;-))
> > > > >
> > > > > the source-code is:
> > > > > <tr:form defaultCommand="first" binding="#{editor.component}">
> > > > > ...
> > > > >   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
> > > > >   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
> > > > >   <tr:commandButton id="first" text="First" />
> > > > > ...
> > > > > </tr:form>
> > > > >
> > > > > any comments ?
> > > > >
> > > > > -Matthias
> > > > > --
> > > > > Matthias Wessendorf
> > > > >
> > > > > further stuff:
> > > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > > mail: matzew-at-apache-dot-org
> > > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > mail: matzew-at-apache-dot-org
> > >
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] - [IE] funny issue with form and defaultCommand

Posted by Matthias Wessendorf <ma...@apache.org>.
On 9/20/07, Adam Winer <aw...@gmail.com> wrote:
> OK, so looks like the issue is that for this submit,
> we have:
>
>         var params = new Object();
>         params[src] = src;
>         params['source'] = src;
>
>         submitForm(frm,0,params);
>
> We set params['source'] = src; to handle Trinidad buttons.
> We set params[src] = src; to handle non-Trinidad buttons.
>
> Then submitForm() has (with a lot of non-taken branches
> snipped):
>
>             var hiddenField = form.elements[paramName];
>
>              if (hiddenField.type == 'submit')
>                // create an input type="hidden"
>              else
>                   hiddenField.value = paramValue;
>
> I think we need to add a checkt to submitForm() that hiddenField is
> not a button element too!

I was thinking that as well.
>
> (BTW, Matthias:  glancing at Core.js, I noticed
> we've got double copies of all the spinbox code!)

ok, I haven't added that code, but I can do the clean-up,
if that was your point.

Greetings,
Matthias

>
> -- Adam
>
>
> On 9/19/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > reason is this
> >
> > <script>
> >
> > function changeValue(element)
> > {
> >   element.value = element.id;
> > }
> >
> >
> > </script>
> >
> > <button id="foo" onclick="changeValue(this);">bar</button>
> >
> > in FF, never the button-text is changed.
> >
> > -M
> >
> > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > changed subject to better reflect the issue.
> > >
> > > -M
> > >
> > > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > > Hi,
> > > >
> > > > by accident I noticed this funny thing with form's defaultCommand and
> > > > IE7 (true for IE 6 as well ??)
> > > >
> > > > here is a demo, that has a form, containing a defaultCommand
> > > >
> > > > http://www.irian.at/trinidad-demo/faces/components/form.jspx
> > > >
> > > > Do the following:
> > > > -enter first value
> > > > -enter second value AND! hit enter.
> > > >
> > > > => Notice that the button label changes to the ID of the button :-)
> > > >
> > > > (sure, FF it works as expected ;-))
> > > >
> > > > the source-code is:
> > > > <tr:form defaultCommand="first" binding="#{editor.component}">
> > > > ...
> > > >   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
> > > >   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
> > > >   <tr:commandButton id="first" text="First" />
> > > > ...
> > > > </tr:form>
> > > >
> > > > any comments ?
> > > >
> > > > -Matthias
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > mail: matzew-at-apache-dot-org
> >
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] - [IE] funny issue with form and defaultCommand

Posted by Adam Winer <aw...@gmail.com>.
OK, so looks like the issue is that for this submit,
we have:

        var params = new Object();
        params[src] = src;
        params['source'] = src;

        submitForm(frm,0,params);

We set params['source'] = src; to handle Trinidad buttons.
We set params[src] = src; to handle non-Trinidad buttons.

Then submitForm() has (with a lot of non-taken branches
snipped):

            var hiddenField = form.elements[paramName];

             if (hiddenField.type == 'submit')
               // create an input type="hidden"
             else
                  hiddenField.value = paramValue;

I think we need to add a checkt to submitForm() that hiddenField is
not a button element too!

(BTW, Matthias:  glancing at Core.js, I noticed
we've got double copies of all the spinbox code!)

-- Adam


On 9/19/07, Matthias Wessendorf <ma...@apache.org> wrote:
> reason is this
>
> <script>
>
> function changeValue(element)
> {
>   element.value = element.id;
> }
>
>
> </script>
>
> <button id="foo" onclick="changeValue(this);">bar</button>
>
> in FF, never the button-text is changed.
>
> -M
>
> On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > changed subject to better reflect the issue.
> >
> > -M
> >
> > On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > > Hi,
> > >
> > > by accident I noticed this funny thing with form's defaultCommand and
> > > IE7 (true for IE 6 as well ??)
> > >
> > > here is a demo, that has a form, containing a defaultCommand
> > >
> > > http://www.irian.at/trinidad-demo/faces/components/form.jspx
> > >
> > > Do the following:
> > > -enter first value
> > > -enter second value AND! hit enter.
> > >
> > > => Notice that the button label changes to the ID of the button :-)
> > >
> > > (sure, FF it works as expected ;-))
> > >
> > > the source-code is:
> > > <tr:form defaultCommand="first" binding="#{editor.component}">
> > > ...
> > >   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
> > >   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
> > >   <tr:commandButton id="first" text="First" />
> > > ...
> > > </tr:form>
> > >
> > > any comments ?
> > >
> > > -Matthias
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > mail: matzew-at-apache-dot-org
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>

Re: [Trinidad] - [IE] funny issue with form and defaultCommand

Posted by Matthias Wessendorf <ma...@apache.org>.
reason is this

<script>

function changeValue(element)
{
  element.value = element.id;
}


</script>

<button id="foo" onclick="changeValue(this);">bar</button>

in FF, never the button-text is changed.

-M

On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> changed subject to better reflect the issue.
>
> -M
>
> On 9/20/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > Hi,
> >
> > by accident I noticed this funny thing with form's defaultCommand and
> > IE7 (true for IE 6 as well ??)
> >
> > here is a demo, that has a form, containing a defaultCommand
> >
> > http://www.irian.at/trinidad-demo/faces/components/form.jspx
> >
> > Do the following:
> > -enter first value
> > -enter second value AND! hit enter.
> >
> > => Notice that the button label changes to the ID of the button :-)
> >
> > (sure, FF it works as expected ;-))
> >
> > the source-code is:
> > <tr:form defaultCommand="first" binding="#{editor.component}">
> > ...
> >   <tr:inputText label="First form, First Field:" shortDesc="Field 1" />
> >   <tr:inputText label="First form, Second Field:" shortDesc="Field 2" />
> >   <tr:commandButton id="first" text="First" />
> > ...
> > </tr:form>
> >
> > any comments ?
> >
> > -Matthias
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > mail: matzew-at-apache-dot-org
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org