You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2005/10/13 19:48:37 UTC

dataTable error message - Validation Error "_id49": Value is not a valid option.

Hello,
I am using <t:dataTable> with two columns.
one is label, the other is <inputText>.
If there is any validation problem, I get the message like:
 

Validation Error "_id49": Value is not a valid option.

 

How can I replace _id49 with some meaningful id?

I notieced that component id can not bind to backing bean(or data model) method.

 

Thanks. Dave


		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

RE: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Dave <ja...@yahoo.com>.
Thanks for experiments. This seems a bug/defect. User need to know which row got a problem in a dataTable.

Frode Oldervoll <Fr...@7m.com> wrote:v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}st1\:*{behavior:url(#default#ieooui) }
Assigning an id to fields inside a dataTable should work; they still are unique per row since the dataTable index is included in the actual id. The error messages still does not seem to work, however. This looks like a bug to me.

 

Here is an example. I have this form with a dataTable inside, which again contains a set of outputLabel/inputText pairs.

 

<h:form id="testForm">

      <t:messages/>

      <t:dataTable id="testTable">

            <h:column>

                  <h:outputLabel for="testField" value="Test label"/>

                  <h:inputText required="true" id="testField"/>

            </h:column>

      </t:dataTable>

</h:form>

 

If we look at the actual HTML code generated for a couple of rows, then we see:

 

<label for="testForm:testTable_0:testField">Test label</label>

<input id=" testForm:testTable_0:testField" 

       name=" testForm:testTable_0:testField" 

       type="text" value=""/>

<label for="testForm:testTable_1:testField">Test label</label>

<input id=" testForm:testTable_1:testField" 

       name=" testForm:testTable_1:testField" 

       type="text" value=""/>

 

Even if the ids in the label and the input field matches I still get the message ¡°Validation Error in testField¡± instead of ¡°Validation error in Test label¡±.

 

-Frode

 

 

---------------------------------


From: Dave [mailto:javaone9@yahoo.com] 
Sent: 14. oktober 2005 02:52
To: MyFaces Discussion
Subject: Re: dataTable error message - Validation Error "_id49": Value is not a valid option.


 

I tried outputLabel, but it still did not work.


 


<t:dataTable


           var="student" 


           value="#{bean.students}">


    <h:column>


         <h:outputLabel for="score" value="#{student.name}"/>


    </h:column>


    <h:column>


         <h:inputText id="score" value="#{student.score}"/>


    </h:column>


</t:dataTable>




 


All the validation error messages are using the same id "score".  when I tried to use student name as id, 


 


<t:dataTable


           var="student" 


           value="#{bean.students}">


    <h:column>


         <h:outputLabel for="#{student.name}" value="#{student.name}"/>


    </h:column>


    <h:column>


         <h:inputText id="#{student.name}" value="#{student.score}"/>


    </h:column>


</t:dataTable>



 



I got error message: id must start with letter/digit/_. Obviously id must be a constant and  can not be method binding. Any ideas appreciated. thanks.


 



Mike Kienenberger <mk...@gmail.com> wrote:


Yes, that's why I suggested you'd be better off trying to use a label
and have the value bound to your row data instead. But I haven't
tried it.

Remember that components in your dataTable may represent multiple
rows, but every row is still represented by only one component. So
only by binding something to your backing data will you get different
behavior per row.

On 10/13/05, Dave wrote:
> This approach works fine if data are not in .
> For dataTable, we have a collection of data.
> Suppose the collection have ten rows. All of them will have the same id(s).
> If there is a validation error, user will not be able to know which row has
> the error.
>
> ---------
> 
> 
>
>
> Mike Kienenberger wrote:
> I'd probably go with a label instead, but you could just use
>
>
>
>
> On 10/13/05, Dave wrote:
> > what id should I assign to them statically? The data model is a list of
> > objects. Thanks.
> >
> > > var="student"
> > value="#{bean.students}">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Mike Kienenberger wrote:
> > You can statically assign an id on your page.
> >
> > I think y ou can also assign a label to your component, and that label
> > value will be used instead of the id.
> >
> > On 10/13/05, Dave wrote:
> > >
> > > Hello,
> > > I am using with two columns.
> > & gt; one is label, the other is .
> > > If there is any validation problem, I get the message like:
> > >
> > >
> > > Validation Error "_id49": Value is not a valid option.
> > >
> > >
> > >
> > > How can I replace _id49 with some meaningful id?
> > >
> > > I notieced that component id can not bind to backing bean(or data model)
> > > method.
> > >
> > >
> > >
> > > Thanks. Dave
> > >
> > > ________________________________
> > > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> > >
> > >
> >
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million s ongs. Try it free.
> >
> >
>
>
> ________________________________
> Ya hoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

---------------------------------


Yahoo! Music Unlimited - Access over 1 million songs. Try it free.




		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

RE: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Frode Oldervoll <Fr...@7m.com>.
Assigning an id to fields inside a dataTable should work; they still are
unique per row since the dataTable index is included in the actual id. The
error messages still does not seem to work, however. This looks like a bug
to me.

 

Here is an example. I have this form with a dataTable inside, which again
contains a set of outputLabel/inputText pairs.

 

<h:form id="testForm">

      <t:messages/>

      <t:dataTable id="testTable">

            <h:column>

                  <h:outputLabel for="testField" value="Test label"/>

                  <h:inputText required="true" id="testField"/>

            </h:column>

      </t:dataTable>

</h:form>

 

If we look at the actual HTML code generated for a couple of rows, then we
see:

 

<label for="testForm:testTable_0:testField">Test label</label>

<input id=" testForm:testTable_0:testField" 

       name=" testForm:testTable_0:testField" 

       type="text" value=""/>

<label for="testForm:testTable_1:testField">Test label</label>

<input id=" testForm:testTable_1:testField" 

       name=" testForm:testTable_1:testField" 

       type="text" value=""/>

 

Even if the ids in the label and the input field matches I still get the
message "Validation Error in testField" instead of "Validation error in Test
label".

 

-Frode

 

 

  _____  

From: Dave [mailto:javaone9@yahoo.com] 
Sent: 14. oktober 2005 02:52
To: MyFaces Discussion
Subject: Re: dataTable error message - Validation Error "_id49": Value is
not a valid option.

 

I tried outputLabel, but it still did not work.

 

<t:dataTable

           var="student" 

           value="#{bean.students}">

    <h:column>

         <h:outputLabel for="score" value="#{student.name}"/>

    </h:column>

    <h:column>

         <h:inputText id="score" value="#{student.score}"/>

    </h:column>

</t:dataTable>


 

All the validation error messages are using the same id "score".  when I
tried to use student name as id, 

 

<t:dataTable

           var="student" 

           value="#{bean.students}">

    <h:column>

         <h:outputLabel for="#{student.name}" value="#{student.name}"/>

    </h:column>

    <h:column>

         <h:inputText id="#{student.name}" value="#{student.score}"/>

    </h:column>

</t:dataTable>

 

I got error message: id must start with letter/digit/_. Obviously id must be
a constant and  can not be method binding. Any ideas appreciated. thanks.

 


Mike Kienenberger <mk...@gmail.com> wrote:

Yes, that's why I suggested you'd be better off trying to use a label
and have the value bound to your row data instead. But I haven't
tried it.

Remember that components in your dataTable may represent multiple
rows, but every row is still represented by only one component. So
only by binding something to your backing data will you get different
behavior per row.

On 10/13/05, Dave wrote:
> This approach works fine if data are not in .
> For dataTable, we have a collection of data.
> Suppose the collection have ten rows. All of them will have the same
id(s).
> If there is a validation error, user will not be able to know which row
has
> the error.
>
> ---------
> 
> 
>
>
> Mike Kienenberger wrote:
> I'd probably go with a label instead, but you could just use
>
>
>
>
> On 10/13/05, Dave wrote:
> > what id should I assign to them statically? The data model is a list of
> > objects. Thanks.
> >
> > > var="student"
> > value="#{bean.students}">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Mike Kienenberger wrote:
> > You can statically assign an id on your page.
> >
> > I think y ou can also assign a label to your component, and that label
> > value will be used instead of the id.
> >
> > On 10/13/05, Dave wrote:
> > >
> > > Hello,
> > > I am using with two columns.
> > & gt; one is label, the other is .
> > > If there is any validation problem, I get the message like:
> > >
> > >
> > > Validation Error "_id49": Value is not a valid option.
> > >
> > >
> > >
> > > How can I replace _id49 with some meaningful id?
> > >
> > > I notieced that component id can not bind to backing bean(or data
model)
> > > method.
> > >
> > >
> > >
> > > Thanks. Dave
> > >
> > > ________________________________
> > > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> > >
> > >
> >
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million s ongs. Try it free.
> >
> >
>
>
> ________________________________
> Ya hoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

  _____  

Yahoo!
<http://pa.yahoo.com/*http:/us.rd.yahoo.com/evt=36035/*http:/music.yahoo.com
/unlimited/>  Music Unlimited - Access over 1 million songs. Try it free.


Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Dave <ja...@yahoo.com>.
I tried outputLabel, but it still did not work.
 
<t:dataTable
           var="student" 
           value="#{bean.students}">
    <h:column>
         <h:outputLabel for="score" value="#{student.name}"/>
    </h:column>
    <h:column>
         <h:inputText id="score" value="#{student.score}"/>
    </h:column>
</t:dataTable>


 
All the validation error messages are using the same id "score".  when I tried to use student name as id, 
 
<t:dataTable
           var="student" 
           value="#{bean.students}">
    <h:column>
         <h:outputLabel for="#{student.name}" value="#{student.name}"/>
    </h:column>
    <h:column>
         <h:inputText id="#{student.name}" value="#{student.score}"/>
    </h:column>
</t:dataTable>




I got error message: id must start with letter/digit/_. Obviously id must be a constant and  can not be method binding. Any ideas appreciated. thanks.
 

Mike Kienenberger <mk...@gmail.com> wrote:
Yes, that's why I suggested you'd be better off trying to use a label
and have the value bound to your row data instead. But I haven't
tried it.

Remember that components in your dataTable may represent multiple
rows, but every row is still represented by only one component. So
only by binding something to your backing data will you get different
behavior per row.

On 10/13/05, Dave wrote:
> This approach works fine if data are not in .
> For dataTable, we have a collection of data.
> Suppose the collection have ten rows. All of them will have the same id(s).
> If there is a validation error, user will not be able to know which row has
> the error.
>
> ---------
> 
> 
>
>
> Mike Kienenberger wrote:
> I'd probably go with a label instead, but you could just use
>
>
>
>
> On 10/13/05, Dave wrote:
> > what id should I assign to them statically? The data model is a list of
> > objects. Thanks.
> >
> > > var="student"
> > value="#{bean.students}">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Mike Kienenberger wrote:
> > You can statically assign an id on your page.
> >
> > I think y ou can also assign a label to your component, and that label
> > value will be used instead of the id.
> >
> > On 10/13/05, Dave wrote:
> > >
> > > Hello,
> > > I am using with two columns.
> > > one is label, the other is .
> > > If there is any validation problem, I get the message like:
> > >
> > >
> > > Validation Error "_id49": Value is not a valid option.
> > >
> > >
> > >
> > > How can I replace _id49 with some meaningful id?
> > >
> > > I notieced that component id can not bind to backing bean(or data model)
> > > method.
> > >
> > >
> > >
> > > Thanks. Dave
> > >
> > > ________________________________
> > > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> > >
> > >
> >
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million s ongs. Try it free.
> >
> >
>
>
> ________________________________
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Mike Kienenberger <mk...@gmail.com>.
Yes, that's why I suggested you'd be better off trying to use a label
and have the value bound to your row data instead.  But I haven't
tried it.

Remember that components in your dataTable may represent multiple
rows, but every row is still represented by only one component.   So
only by binding something to your backing data will you get different
behavior per row.

On 10/13/05, Dave <ja...@yahoo.com> wrote:
> This approach works fine if data are not in <dataTable>.
> For dataTable, we have a collection of data.
> Suppose the collection have ten rows.  All of them will have the same id(s).
> If there is a validation error, user will not be able to know which row has
> the error.
>
> ---------
> <h:outputText id="bundleName" value="#{bundle.Name}"/>
> <h:inputText id="studentName" value="#{student.name}"/>
>
>
> Mike Kienenberger <mk...@gmail.com> wrote:
> I'd probably go with a label instead, but you could just use
>
>
>
>
> On 10/13/05, Dave wrote:
> > what id should I assign to them statically? The data model is a list of
> > objects. Thanks.
> >
> > > var="student"
> > value="#{bean.students}">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Mike Kienenberger wrote:
> > You can statically assign an id on your page.
> >
> > I think y ou can also assign a label to your component, and that label
> > value will be used instead of the id.
> >
> > On 10/13/05, Dave wrote:
> > >
> > > Hello,
> > > I am using with two columns.
> > > one is label, the other is .
> > > If there is any validation problem, I get the message like:
> > >
> > >
> > > Validation Error "_id49": Value is not a valid option.
> > >
> > >
> > >
> > > How can I replace _id49 with some meaningful id?
> > >
> > > I notieced that component id can not bind to backing bean(or data model)
> > > method.
> > >
> > >
> > >
> > > Thanks. Dave
> > >
> > > ________________________________
> > > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> > >
> > >
> >
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million s ongs. Try it free.
> >
> >
>
>
>  ________________________________
>  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Mike Kienenberger <mk...@gmail.com>.
There's an example of using labels here:

http://wiki.apache.org/myfaces/Create_and_Display_Messages

On 10/13/05, Mike Kienenberger <mk...@gmail.com> wrote:
> I'd probably go with a label instead, but you could just use
>
> <h:outputText id="bundleName" value="#{bundle.Name}"/>
> <h:inputText id="studentName" value="#{student.name}"/>
>
> On 10/13/05, Dave <ja...@yahoo.com> wrote:
> > what id should I assign to them statically? The data model is a list of
> > objects.  Thanks.
> >
> >  <t:dataTable
> >            var="student"
> >            value="#{bean.students}">
> >     <h:column>
> >          <h:outputText value="#{bundle.Name}"/>
> >     </h:column>
> >
> >     <h:column>
> >          <h:inputText value="#{student.name}"/>
> >     </h:column>
> > </t:dataTable>
> >
> >
> > Mike Kienenberger <mk...@gmail.com> wrote:
> > You can statically assign an id on your page.
> >
> > I think you can also assign a label to your component, and that label
> > value will be used instead of the id.
> >
> > On 10/13/05, Dave wrote:
> > >
> > > Hello,
> > > I am using with two columns.
> > > one is label, the other is .
> > > If there is any validation problem, I get the message like:
> > >
> > >
> > > Validation Error "_id49": Value is not a valid option.
> > >
> > >
> > >
> > > How can I replace _id49 with some meaningful id?
> > >
> > > I notieced that component id can not bind to backing bean(or data model)
> > > method.
> > >
> > >
> > >
> > > Thanks. Dave
> > >
> > > ________________________________
> > > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> > >
> > >
> >
> >
> >  ________________________________
> >  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> >
> >
>

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Dave <ja...@yahoo.com>.
This approach works fine if data are not in <dataTable>.
For dataTable, we have a collection of data.
Suppose the collection have ten rows.  All of them will have the same id(s). If there is a validation error, user will not be able to know which row has the error.
 
---------
<h:outputText id="bundleName" value="#{bundle.Name}"/>
<h:inputText id="studentName" value="#{student.name}"/>


Mike Kienenberger <mk...@gmail.com> wrote:I'd probably go with a label instead, but you could just use




On 10/13/05, Dave wrote:
> what id should I assign to them statically? The data model is a list of
> objects. Thanks.
>
> > var="student"
> value="#{bean.students}">
> 
> 
> 
>
> 
> 
> 
> 
>
>
> Mike Kienenberger wrote:
> You can statically assign an id on your page.
>
> I think you can also assign a label to your component, and that label
> value will be used instead of the id.
>
> On 10/13/05, Dave wrote:
> >
> > Hello,
> > I am using with two columns.
> > one is label, the other is .
> > If there is any validation problem, I get the message like:
> >
> >
> > Validation Error "_id49": Value is not a valid option.
> >
> >
> >
> > How can I replace _id49 with some meaningful id?
> >
> > I notieced that component id can not bind to backing bean(or data model)
> > method.
> >
> >
> >
> > Thanks. Dave
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> >
> >
>
>
> ________________________________
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>


		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Mike Kienenberger <mk...@gmail.com>.
I'd probably go with a label instead, but you could just use

<h:outputText id="bundleName" value="#{bundle.Name}"/>
<h:inputText id="studentName" value="#{student.name}"/>

On 10/13/05, Dave <ja...@yahoo.com> wrote:
> what id should I assign to them statically? The data model is a list of
> objects.  Thanks.
>
>  <t:dataTable
>            var="student"
>            value="#{bean.students}">
>     <h:column>
>          <h:outputText value="#{bundle.Name}"/>
>     </h:column>
>
>     <h:column>
>          <h:inputText value="#{student.name}"/>
>     </h:column>
> </t:dataTable>
>
>
> Mike Kienenberger <mk...@gmail.com> wrote:
> You can statically assign an id on your page.
>
> I think you can also assign a label to your component, and that label
> value will be used instead of the id.
>
> On 10/13/05, Dave wrote:
> >
> > Hello,
> > I am using with two columns.
> > one is label, the other is .
> > If there is any validation problem, I get the message like:
> >
> >
> > Validation Error "_id49": Value is not a valid option.
> >
> >
> >
> > How can I replace _id49 with some meaningful id?
> >
> > I notieced that component id can not bind to backing bean(or data model)
> > method.
> >
> >
> >
> > Thanks. Dave
> >
> > ________________________________
> > Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> >
> >
>
>
>  ________________________________
>  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Dave <ja...@yahoo.com>.
what id should I assign to them statically? The data model is a list of objects.  Thanks.
 
 <t:dataTable
           var="student" 
           value="#{bean.students}">
    <h:column>
         <h:outputText value="#{bundle.Name}"/>
    </h:column>
    <h:column>
         <h:inputText value="#{student.name}"/>
    </h:column>
</t:dataTable>



Mike Kienenberger <mk...@gmail.com> wrote:
You can statically assign an id on your page.

I think you can also assign a label to your component, and that label
value will be used instead of the id.

On 10/13/05, Dave wrote:
>
> Hello,
> I am using with two columns.
> one is label, the other is  [input] .
> If there is any validation problem, I get the message like:
>
>
> Validation Error "_id49": Value is not a valid option.
>
>
>
> How can I replace _id49 with some meaningful id?
>
> I notieced that component id can not bind to backing bean(or data model)
> method.
>
>
>
> Thanks. Dave
>
> ________________________________
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>

		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: dataTable error message - Validation Error "_id49": Value is not a valid option.

Posted by Mike Kienenberger <mk...@gmail.com>.
You can statically assign an id on your page.

I think you can also assign a label to your component, and that label
value will be used instead of the id.

On 10/13/05, Dave <ja...@yahoo.com> wrote:
>
> Hello,
> I am using <t:dataTable> with two columns.
> one is label, the other is <inputText>.
> If there is any validation problem, I get the message like:
>
>
> Validation Error "_id49": Value is not a valid option.
>
>
>
> How can I replace _id49 with some meaningful id?
>
> I notieced that component id can not bind to backing bean(or data model)
> method.
>
>
>
> Thanks. Dave
>
>  ________________________________
>  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>