I tried outputLabel, but it still did not work.
 
<t:dataTable
           var="student"
           value="#{bean.students}">
    <h:column>
         <h:outputLabel for="" 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="" 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>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 <[EMAIL PROTECTED]>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.

Reply via email to