You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Simon Lessard <si...@gmail.com> on 2006/10/31 02:20:44 UTC

Bug with read-only, required fields.

Hello all,

I just found out that if you use an inputText with readOnly and required set
to true, validation will always fail, even if there's data in the underlying
bean. Anyone heard about this before?


Regards,

~ Simon

Re: Bug with read-only, required fields.

Posted by Simon Lessard <si...@gmail.com>.
Yep I could reproduce with with that simple page any bean with a default
value will work :

<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:tr="http://myfaces.apache.org/trinidad"
          xmlns:trh="http://myfaces.apache.org/trinidad/html">
  <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
  <jsp:directive.page contentType="text/html;charset=windows-1252"/>
  <f:view>
    <html>
      <trh:head title="Test">
        <meta http-equiv="Content-Type"
              content="text/html; charset=windows-1252"/>
      </trh:head>
      <trh:body>
        <tr:form>
          <tr:messages/>
          <tr:inputText label="#{stepDummy2.label}" required="true"
readOnly="true"/>
          <tr:commandButton text="commandButton 1"/>
        </tr:form>
      </trh:body>
    </html>
  </f:view>
</jsp:root>


On 10/30/06, Simon Lessard <si...@gmail.com> wrote:
>
> It was like that about a month ago. I found it while working on the
> visited attribute and the train renderer, using the same demo than when I
> first added it and it was working perfectly before. I assume it's a new bug.
> I'll try to reproduce it in a simpler environment, e.g. a field and a
> button :P
>
> On 10/30/06, Adam Winer <aw...@gmail.com> wrote:
> >
> > Yeah, I'm with Gab here - you should never hit validation at all.
> >
> > -- Adam
> >
> >
> > On 10/30/06, Gabrielle Crawford <ga...@oracle.com> wrote:
> > >
> > > Really? I thought the renderer checks "wasSubmitted" which checks for
> > > readOnly and disabled. SubmittedValue should then be set to null, and
> > in
> > > UIXEditableValue's validate if submittedValue is null validate is
> > > bypassed:
> > >
> > > Object submittedValue = getSubmittedValue();
> > >     if (submittedValue == null)
> > >       return;
> > >
> > > Thanks,
> > >
> > > Gab
> > >
> > > Simon Lessard wrote:
> > >
> > > > Hello all,
> > > >
> > > > I just found out that if you use an inputText with readOnly and
> > > > required set
> > > > to true, validation will always fail, even if there's data in the
> > > > underlying
> > > > bean. Anyone heard about this before?
> > > >
> > > >
> > > > Regards,
> > > >
> > > > ~ Simon
> > > >
> > >
> > >
> >
> >
>

Re: Bug with read-only, required fields.

Posted by Simon Lessard <si...@gmail.com>.
It was like that about a month ago. I found it while working on the visited
attribute and the train renderer, using the same demo than when I first
added it and it was working perfectly before. I assume it's a new bug. I'll
try to reproduce it in a simpler environment, e.g. a field and a button :P

On 10/30/06, Adam Winer <aw...@gmail.com> wrote:
>
> Yeah, I'm with Gab here - you should never hit validation at all.
>
> -- Adam
>
>
> On 10/30/06, Gabrielle Crawford <ga...@oracle.com> wrote:
> >
> > Really? I thought the renderer checks "wasSubmitted" which checks for
> > readOnly and disabled. SubmittedValue should then be set to null, and in
> > UIXEditableValue's validate if submittedValue is null validate is
> > bypassed:
> >
> > Object submittedValue = getSubmittedValue();
> >     if (submittedValue == null)
> >       return;
> >
> > Thanks,
> >
> > Gab
> >
> > Simon Lessard wrote:
> >
> > > Hello all,
> > >
> > > I just found out that if you use an inputText with readOnly and
> > > required set
> > > to true, validation will always fail, even if there's data in the
> > > underlying
> > > bean. Anyone heard about this before?
> > >
> > >
> > > Regards,
> > >
> > > ~ Simon
> > >
> >
> >
>
>

Re: Bug with read-only, required fields.

Posted by Matthias Wessendorf <ma...@apache.org>.
Hey David,

can you follow that thread, regarding the man-in-the-middle-tool issue ?

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-dev/200610.mbox/ajax/%3c254acf980610301820i225e5d0bl773f6cbb9ee48555@mail.gmail.com%3e

Thanks,
Matt

On 10/30/06, Matthias Wessendorf <ma...@apache.org> wrote:
> I committed the changed template by accident,
> when I was looking into the Trinidad side of  MYFACES-1467.
>
> I went into the source code repo during my changes on the client side tasks...
>
> I do a revert on that, but still we need to look at that (form the MyFaces side)
>
> However, Thomas run the TCK on that patch, which some interesting results....
>
> Sorry,
> M
>
> On 10/30/06, Adam Winer <aw...@gmail.com> wrote:
> > Yeah, I'm with Gab here - you should never hit validation at all.
> >
> > -- Adam
> >
> >
> > On 10/30/06, Gabrielle Crawford <ga...@oracle.com> wrote:
> > >
> > > Really? I thought the renderer checks "wasSubmitted" which checks for
> > > readOnly and disabled. SubmittedValue should then be set to null, and in
> > > UIXEditableValue's validate if submittedValue is null validate is
> > > bypassed:
> > >
> > > Object submittedValue = getSubmittedValue();
> > >     if (submittedValue == null)
> > >       return;
> > >
> > > Thanks,
> > >
> > > Gab
> > >
> > > Simon Lessard wrote:
> > >
> > > > Hello all,
> > > >
> > > > I just found out that if you use an inputText with readOnly and
> > > > required set
> > > > to true, validation will always fail, even if there's data in the
> > > > underlying
> > > > bean. Anyone heard about this before?
> > > >
> > > >
> > > > Regards,
> > > >
> > > > ~ Simon
> > > >
> > >
> > >
> >
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Bug with read-only, required fields.

Posted by Matthias Wessendorf <ma...@apache.org>.
I committed the changed template by accident,
when I was looking into the Trinidad side of  MYFACES-1467.

I went into the source code repo during my changes on the client side tasks...

I do a revert on that, but still we need to look at that (form the MyFaces side)

However, Thomas run the TCK on that patch, which some interesting results....

Sorry,
M

On 10/30/06, Adam Winer <aw...@gmail.com> wrote:
> Yeah, I'm with Gab here - you should never hit validation at all.
>
> -- Adam
>
>
> On 10/30/06, Gabrielle Crawford <ga...@oracle.com> wrote:
> >
> > Really? I thought the renderer checks "wasSubmitted" which checks for
> > readOnly and disabled. SubmittedValue should then be set to null, and in
> > UIXEditableValue's validate if submittedValue is null validate is
> > bypassed:
> >
> > Object submittedValue = getSubmittedValue();
> >     if (submittedValue == null)
> >       return;
> >
> > Thanks,
> >
> > Gab
> >
> > Simon Lessard wrote:
> >
> > > Hello all,
> > >
> > > I just found out that if you use an inputText with readOnly and
> > > required set
> > > to true, validation will always fail, even if there's data in the
> > > underlying
> > > bean. Anyone heard about this before?
> > >
> > >
> > > Regards,
> > >
> > > ~ Simon
> > >
> >
> >
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Bug with read-only, required fields.

Posted by Adam Winer <aw...@gmail.com>.
Yeah, I'm with Gab here - you should never hit validation at all.

-- Adam


On 10/30/06, Gabrielle Crawford <ga...@oracle.com> wrote:
>
> Really? I thought the renderer checks "wasSubmitted" which checks for
> readOnly and disabled. SubmittedValue should then be set to null, and in
> UIXEditableValue's validate if submittedValue is null validate is
> bypassed:
>
> Object submittedValue = getSubmittedValue();
>     if (submittedValue == null)
>       return;
>
> Thanks,
>
> Gab
>
> Simon Lessard wrote:
>
> > Hello all,
> >
> > I just found out that if you use an inputText with readOnly and
> > required set
> > to true, validation will always fail, even if there's data in the
> > underlying
> > bean. Anyone heard about this before?
> >
> >
> > Regards,
> >
> > ~ Simon
> >
>
>

Re: Bug with read-only, required fields.

Posted by Gabrielle Crawford <ga...@oracle.com>.
Really? I thought the renderer checks "wasSubmitted" which checks for 
readOnly and disabled. SubmittedValue should then be set to null, and in 
UIXEditableValue's validate if submittedValue is null validate is bypassed:

 Object submittedValue = getSubmittedValue();
    if (submittedValue == null)
      return;

Thanks,

Gab

Simon Lessard wrote:

> Hello all,
>
> I just found out that if you use an inputText with readOnly and 
> required set
> to true, validation will always fail, even if there's data in the 
> underlying
> bean. Anyone heard about this before?
>
>
> Regards,
>
> ~ Simon
>