You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/12/06 14:33:35 UTC

rowIndexVar usage in EL

I want to use the rowIndexVar of a dataList in the binding attribute of
a another custom component via EL.

I get always a PropertyNotFoundException for this var.

 

snippet;

<t:dataList var="batch"

  value="#{BatchController.batches}"

  rowIndexVar="rowIndex"

  layout="simple">

 

<t:outputText value="Test + #{rowIndex}"/>

 

<rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...

 

javax.faces.el.PropertyNotFoundException: Index is null: rowIndex

 

 

But rowIndex is not null.

if I comment out my custom rm:tag then the rowIndex values are rendered
via t:outputText.

BatchController.getStatusBars returns a List.

What's going wrong here?

 

Michael


RE: rowIndexVar usage in EL

Posted by Michael Heinen <mh...@recommind.com>.
Many thanks for your answers and pointing me into the right direction.

I thought it was an EL issue.

Michael

-----Original Message-----
From: Simon Kitching [mailto:simon.kitching@rhe.co.nz] 
Sent: Mittwoch, 6. Dezember 2006 20:29
To: MyFaces Discussion
Subject: Re: rowIndexVar usage in EL


I can confirm it. You cannot refer to a table or datalist's rowIndexVar 
in a binding expression; it just cannot be done. No way.

As described here, and as Jeff notes, there is only one set of 
components used to define a row, not a set of components for each row:
 
http://myfaces.apache.org/api/apidocs/javax/faces/component/UIData.html

Regards,

Simon

Jeff Bischoff wrote:
> Michael,
> 
>  > <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...
> 
> If t:dataList is like dataTable, then you can not do this. There will
be 
> only one statusBar component created, which will render itself once
for 
> each row. Therefore, you can't do a separate binding for each row.
> 
> Can anyone who is more familiar with t:dataList confirm/deny my 
> suspicions here?
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> Michael Heinen wrote:
>> I want to use the rowIndexVar of a dataList in the binding attribute
of
>> a another custom component via EL.
>>
>> I get always a PropertyNotFoundException for this var.
>>
>>  
>>
>> snippet;
>>
>> <t:dataList var="batch"
>>
>>   value="#{BatchController.batches}"
>>
>>   rowIndexVar="rowIndex"
>>
>>   layout="simple">
>>
>>  
>>
>> <t:outputText value="Test + #{rowIndex}"/>
>>
>>  
>>
>> <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...







Re: rowIndexVar usage in EL

Posted by Simon Kitching <si...@rhe.co.nz>.
I can confirm it. You cannot refer to a table or datalist's rowIndexVar 
in a binding expression; it just cannot be done. No way.

As described here, and as Jeff notes, there is only one set of 
components used to define a row, not a set of components for each row:
   http://myfaces.apache.org/api/apidocs/javax/faces/component/UIData.html

Regards,

Simon

Jeff Bischoff wrote:
> Michael,
> 
>  > <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...
> 
> If t:dataList is like dataTable, then you can not do this. There will be 
> only one statusBar component created, which will render itself once for 
> each row. Therefore, you can't do a separate binding for each row.
> 
> Can anyone who is more familiar with t:dataList confirm/deny my 
> suspicions here?
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> Michael Heinen wrote:
>> I want to use the rowIndexVar of a dataList in the binding attribute of
>> a another custom component via EL.
>>
>> I get always a PropertyNotFoundException for this var.
>>
>>  
>>
>> snippet;
>>
>> <t:dataList var="batch"
>>
>>   value="#{BatchController.batches}"
>>
>>   rowIndexVar="rowIndex"
>>
>>   layout="simple">
>>
>>  
>>
>> <t:outputText value="Test + #{rowIndex}"/>
>>
>>  
>>
>> <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...



Re: rowIndexVar usage in EL

Posted by Jeff Bischoff <jb...@klkurz.com>.
Michael,

 > <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...

If t:dataList is like dataTable, then you can not do this. There will be 
only one statusBar component created, which will render itself once for 
each row. Therefore, you can't do a separate binding for each row.

Can anyone who is more familiar with t:dataList confirm/deny my 
suspicions here?

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Michael Heinen wrote:
> I want to use the rowIndexVar of a dataList in the binding attribute of
> a another custom component via EL.
> 
> I get always a PropertyNotFoundException for this var.
> 
>  
> 
> snippet;
> 
> <t:dataList var="batch"
> 
>   value="#{BatchController.batches}"
> 
>   rowIndexVar="rowIndex"
> 
>   layout="simple">
> 
>  
> 
> <t:outputText value="Test + #{rowIndex}"/>
> 
>  
> 
> <rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...
> 
>  
> 
> javax.faces.el.PropertyNotFoundException: Index is null: rowIndex
> 
>  
> 
>  
> 
> But rowIndex is not null.
> 
> if I comment out my custom rm:tag then the rowIndex values are rendered
> via t:outputText.
> 
> BatchController.getStatusBars returns a List.
> 
> What's going wrong here?
> 
>  
> 
> Michael
> 
> 



RE: rowIndexVar usage in EL

Posted by Michael Heinen <mh...@recommind.com>.
This '*@$(%$ took me now a few hours and I have no plan how to solve it.

 

binding="#{BatchController.statusBars[1]}" or
binding="#{BatchController.statusBars['1']}" works well.

 

But I need the rowIndex there to loop over my components.

Has anybody an idea how to access rowIndex in the below szenario in a
binding expression?

 

Desperated regards,

Michael

 

________________________________

From: Michael Heinen [mailto:mhn@recommind.com] 
Sent: Mittwoch, 6. Dezember 2006 15:04
To: MyFaces Discussion
Subject: RE: rowIndexVar usage in EL

 

Is this problem caused by the fact that rowIndex is of type Integer and
not of type int or String ?

If so, how can I transform it via EL ?

 

Michael

 

 

________________________________

From: Michael Heinen [mailto:mhn@recommind.com] 
Sent: Mittwoch, 6. Dezember 2006 14:34
To: MyFaces Discussion
Subject: rowIndexVar usage in EL

 

I want to use the rowIndexVar of a dataList in the binding attribute of
a another custom component via EL.

I get always a PropertyNotFoundException for this var.

 

snippet;

<t:dataList var="batch"

  value="#{BatchController.batches}"

  rowIndexVar="rowIndex"

  layout="simple">

 

<t:outputText value="Test + #{rowIndex}"/>

 

<rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...

 

javax.faces.el.PropertyNotFoundException: Index is null: rowIndex

 

 

But rowIndex is not null.

if I comment out my custom rm:tag then the rowIndex values are rendered
via t:outputText.

BatchController.getStatusBars returns a List.

What's going wrong here?

 

Michael


RE: rowIndexVar usage in EL

Posted by Michael Heinen <mh...@recommind.com>.
Is this problem caused by the fact that rowIndex is of type Integer and
not of type int or String ?

If so, how can I transform it via EL ?

 

Michael

 

 

________________________________

From: Michael Heinen [mailto:mhn@recommind.com] 
Sent: Mittwoch, 6. Dezember 2006 14:34
To: MyFaces Discussion
Subject: rowIndexVar usage in EL

 

I want to use the rowIndexVar of a dataList in the binding attribute of
a another custom component via EL.

I get always a PropertyNotFoundException for this var.

 

snippet;

<t:dataList var="batch"

  value="#{BatchController.batches}"

  rowIndexVar="rowIndex"

  layout="simple">

 

<t:outputText value="Test + #{rowIndex}"/>

 

<rm:statusBar binding="#{BatchController.statusBars[rowIndex]}" ...

 

javax.faces.el.PropertyNotFoundException: Index is null: rowIndex

 

 

But rowIndex is not null.

if I comment out my custom rm:tag then the rowIndex values are rendered
via t:outputText.

BatchController.getStatusBars returns a List.

What's going wrong here?

 

Michael