myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek" <martin.marinsc...@gmail.com>
Subject Re: Bug in selectOneMenu when disabled
Date Sat, 18 Feb 2006 23:12:00 GMT
Ok, this is the corresponding code. Wonder why that doesn't work. Very strange.

    public static void decodeUISelectOne(FacesContext facesContext,
                                         UIComponent component) {
        if (!(component instanceof EditableValueHolder)) {
            throw new IllegalArgumentException("Component "
                    + component.getClientId(facesContext)
                    + " is not an EditableValueHolder");
        }

        if(isDisabledOrReadOnly(component))
            return;

        Map paramMap = facesContext.getExternalContext()
                .getRequestParameterMap();
        String clientId = component.getClientId(facesContext);
        if (paramMap.containsKey(clientId)) {
            //request parameter found, set submitted value
            ((EditableValueHolder) component).setSubmittedValue(paramMap
                    .get(clientId));
        } else {
            //see reason for this action at decodeUISelectMany
            ((EditableValueHolder) component).setSubmittedValue(
RendererUtils.NOTHING );
        }
    }

maybe there is an error later on?

regards,

Martin

On 2/18/06, Grant Smith <work.grant@gmail.com> wrote:
> I haven't delved into the code yet, but the behaviour is definitely
> exhibiting itself in an application Im working on. Perhaps someone can do an
> independent analysis to confirm. I have some really ugly workarounds in my
> backing bean now that try to dodge the null that I'm really keen to get rid
> of.
>
>
> On 2/18/06, Sean Schofield <sean.schofield@gmail.com> wrote:
> > I'm ok with fixing it.  If it breaks the TCK then we could ask Sun to
> > patch the TCK.  I believe they did this for us during the initial TCK
> > testing.
> >
> > Sean
> >
> > On 2/18/06, Martin Marinschek < martin.marinschek@gmail.com> wrote:
> > > Why is that?
> > >
> > > I thought that we checked if disabled or readonly was set to true, and
> > > then stop decoding?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On 2/18/06, Grant Smith <work.grant@gmail.com> wrote:
> > > > Wow. So it turns out that Myfaces suffers from a particularly nasty
> bug
> > > > which was also present in the Sun 1.1 RI.
> > > >
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=87
> > > >
> > > >  So anyone who is disabling a dropdown, beware of this! Your backing
> bean
> > > > will become null for that property on submit.
> > > >  Now, the question is will fixing this have any effect on the TCK
> results ?
> > > > I'm in favor of fixing it, and will do it if I get some consensus.
> > > >
> > > > --
> > > > Grant Smith
> > > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> >
>
>
>
> --
> Grant Smith
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Mime
View raw message