You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by opick <o_...@hotmail.com> on 2007/02/01 12:35:29 UTC

Re: Highlight current row

Hi Jens,

this is exactly what we are looking for too. But it is not working in our
frameworking. It seems that the variable rowIndex is no evaluated, so the
selectedRowIndex never equals rowIndex.

Is this a new feature? Which versions of libraries are you using?

Best regards,
Oliver Pick


Jeff Bischoff wrote:
> 
> Lightbulb,
> 
> There are some hints on this in my data scroller wiki page, see [1].
> 
> The key line was contributed by Daniel Lefevre on this mailing list, and 
> it goes something like:
> 
> rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
> 'highlightRow' : null}"
> 
> 
> You can use this in combination with normal row CSS classes like this:
> 
> rowClasses="oddRow,evenRow"
> 
> 
> In this case, the rowStyleClass will only override the rowClasses 
> setting for the selected row (because a null rowStyleClass does not 
> interfere with rowClasses setting).
> 
> You can combine this with Gerald's suggestion if you also want mouseover 
> effects.
> 
> [1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> Gerald Müllan wrote:
>> Hi,
>> 
>> you mean a row when using t:dataTable?
>> 
>> E.g. there are rowOnMouseOver and rowOnMouseOut js-events, you can
>> apply any css-class easily with this event.
>> 
>> cheers,
>> 
>> Gerald
>> 
>> On 1/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>>>
>>> Does MyFaces have any way of highlighting a particular row (or setting 
>>> its
>>> CSS class to be something different from the other rows based on some
>>> criteria)?
>>>
>>> If not, are there any other component libraries that do such a thing?
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Highlight-current-row-tf3096673.html#a8597295
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-current-row-tf3096673.html#a8746749
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Highlight current row - Facelets Bug?

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

Can anyone confirm this for me? This highlight row trick works fine in 
JSP, but when I converted my application to Facelets, I get behaviour 
like opick is describing. I'm guessing that is his problem too, though 
he didn't say if he is using facelets or not.

Is this a bug in t:dataTable or facelets?

I was using this trick to highlight selected rows in my app for several 
months, and I really like it. Would love to get it working again, in 
facelets. :)

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

opick wrote:
> Hi Jeff,
> 
> the declaration is the same in our page and we are using a t:dataTable.
> We had the same EL expression mentioned here in the thread:
>  rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
> 'highlightRow' : null}"
> 
> But never the css was used, because the expression did not evaluate to true.
> To test the mechanism we changed it to dataTableBacking.selectedRowIndex ==
> 0 and then the first row got the css. Therefor we assume that there must be
> a problem with the evaluation of rowIndex within the t_datatable
> declaration.
> We are are using myFaces 1.1.4 and tomahawk 1.1.5 snapshot.
> 
> But we found an similar solution: We have an icon to selecet a new row and
> now changing the icon for the selected row. Fortunatly the rowIndex
> evaluates correctly when we use it with a column tag which is within the
> dataTable.
> 
> Best regards,
> Oliver
> 
> 
> Jeff Bischoff wrote:
>> Opick,
>>
>> I defined rowIndex var in the t:dataTable declaration as shown in the 
>> wiki like this:
>>
>> rowIndexVar="rowIndex"
>>
>> Are you using t:dataTable? I have tested this with Myfaces 1.1.3, 1.1.4, 
>> 1.1.5 and Tomahawk 1.1.2, 1.1.4, 1.1.5
>>
>> Regards,
>>
>> Jeff Bischoff
>> Kenneth L Kurz & Associates, Inc.
>>
>> opick wrote:
>>> Hi Jens,
>>>
>>> this is exactly what we are looking for too. But it is not working in our
>>> frameworking. It seems that the variable rowIndex is no evaluated, so the
>>> selectedRowIndex never equals rowIndex.
>>>
>>> Is this a new feature? Which versions of libraries are you using?
>>>
>>> Best regards,
>>> Oliver Pick
>>>
>>>
>>> Jeff Bischoff wrote:
>>>> Lightbulb,
>>>>
>>>> There are some hints on this in my data scroller wiki page, see [1].
>>>>
>>>> The key line was contributed by Daniel Lefevre on this mailing list, and 
>>>> it goes something like:
>>>>
>>>> rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
>>>> 'highlightRow' : null}"
>>>>
>>>>
>>>> You can use this in combination with normal row CSS classes like this:
>>>>
>>>> rowClasses="oddRow,evenRow"
>>>>
>>>>
>>>> In this case, the rowStyleClass will only override the rowClasses 
>>>> setting for the selected row (because a null rowStyleClass does not 
>>>> interfere with rowClasses setting).
>>>>
>>>> You can combine this with Gerald's suggestion if you also want mouseover 
>>>> effects.
>>>>
>>>> [1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
>>>>
>>>> Regards,
>>>>
>>>> Jeff Bischoff
>>>> Kenneth L Kurz & Associates, Inc.
>>>>
>>>> Gerald Müllan wrote:
>>>>> Hi,
>>>>>
>>>>> you mean a row when using t:dataTable?
>>>>>
>>>>> E.g. there are rowOnMouseOver and rowOnMouseOut js-events, you can
>>>>> apply any css-class easily with this event.
>>>>>
>>>>> cheers,
>>>>>
>>>>> Gerald
>>>>>
>>>>> On 1/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>>>>>> Does MyFaces have any way of highlighting a particular row (or setting 
>>>>>> its
>>>>>> CSS class to be something different from the other rows based on some
>>>>>> criteria)?
>>>>>>
>>>>>> If not, are there any other component libraries that do such a thing?
>>>>>> -- 
>>>>>> View this message in context: 
>>>>>> http://www.nabble.com/Highlight-current-row-tf3096673.html#a8597295
>>>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
>>
> 



Re: Highlight current row

Posted by Jeff Bischoff <jb...@klkurz.com>.
Thanks Oliver.

I want to report this issue with either Facelets or Tomahawk, but first 
I have to narrow down who's responsible for causing it. I'll do some 
testing when I get a chance.

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

opick wrote:
> Hi Jeff,
> 
> sorry for being away for sometime.
> Yes, we are using facelets in our application.
> 
> Best regards,
> Oliver 
> 
> 
> Jeff Bischoff wrote:
>> One more thing Oliver: Are you using Facelets?
>>
>> Jeff Bischoff wrote:
>>> Well that certainly is an unpleasant bug. Perhaps it has something to do 
>>> with the snapshot? I have tested this approach with tomahawk 1.1.5, but 
>>> obviously that changes every day. :)
>>>
>>> Glad you found an alternative solution that works for you.
>>>
>>
>>
>>
> 



Re: [Solved] Highlight current row

Posted by opick <o_...@hotmail.com>.
Hi Jeff,

sorry for being away for sometime.
Yes, we are using facelets in our application.

Best regards,
Oliver 


Jeff Bischoff wrote:
> 
> One more thing Oliver: Are you using Facelets?
> 
> Jeff Bischoff wrote:
>> Well that certainly is an unpleasant bug. Perhaps it has something to do 
>> with the snapshot? I have tested this approach with tomahawk 1.1.5, but 
>> obviously that changes every day. :)
>> 
>> Glad you found an alternative solution that works for you.
>> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-current-row-tf3096673.html#a8952477
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Highlight current row

Posted by Jeff Bischoff <jb...@klkurz.com>.
One more thing Oliver: Are you using Facelets?

Jeff Bischoff wrote:
> Well that certainly is an unpleasant bug. Perhaps it has something to do 
> with the snapshot? I have tested this approach with tomahawk 1.1.5, but 
> obviously that changes every day. :)
> 
> Glad you found an alternative solution that works for you.
> 



Re: Highlight current row

Posted by Jeff Bischoff <jb...@klkurz.com>.
Well that certainly is an unpleasant bug. Perhaps it has something to do 
with the snapshot? I have tested this approach with tomahawk 1.1.5, but 
obviously that changes every day. :)

Glad you found an alternative solution that works for you.

opick wrote:
> Hi Jeff,
> 
> the declaration is the same in our page and we are using a t:dataTable.
> We had the same EL expression mentioned here in the thread:
>  rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
> 'highlightRow' : null}"
> 
> But never the css was used, because the expression did not evaluate to true.
> To test the mechanism we changed it to dataTableBacking.selectedRowIndex ==
> 0 and then the first row got the css. Therefor we assume that there must be
> a problem with the evaluation of rowIndex within the t_datatable
> declaration.
> We are are using myFaces 1.1.4 and tomahawk 1.1.5 snapshot.
> 
> But we found an similar solution: We have an icon to selecet a new row and
> now changing the icon for the selected row. Fortunatly the rowIndex
> evaluates correctly when we use it with a column tag which is within the
> dataTable.
> 
> Best regards,
> Oliver
> 
> 
> Jeff Bischoff wrote:
>> Opick,
>>
>> I defined rowIndex var in the t:dataTable declaration as shown in the 
>> wiki like this:
>>
>> rowIndexVar="rowIndex"
>>
>> Are you using t:dataTable? I have tested this with Myfaces 1.1.3, 1.1.4, 
>> 1.1.5 and Tomahawk 1.1.2, 1.1.4, 1.1.5
>>
>> Regards,
>>
>> Jeff Bischoff
>> Kenneth L Kurz & Associates, Inc.
>>
>> opick wrote:
>>> Hi Jens,
>>>
>>> this is exactly what we are looking for too. But it is not working in our
>>> frameworking. It seems that the variable rowIndex is no evaluated, so the
>>> selectedRowIndex never equals rowIndex.
>>>
>>> Is this a new feature? Which versions of libraries are you using?
>>>
>>> Best regards,
>>> Oliver Pick
>>>
>>>
>>> Jeff Bischoff wrote:
>>>> Lightbulb,
>>>>
>>>> There are some hints on this in my data scroller wiki page, see [1].
>>>>
>>>> The key line was contributed by Daniel Lefevre on this mailing list, and 
>>>> it goes something like:
>>>>
>>>> rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
>>>> 'highlightRow' : null}"
>>>>
>>>>
>>>> You can use this in combination with normal row CSS classes like this:
>>>>
>>>> rowClasses="oddRow,evenRow"
>>>>
>>>>
>>>> In this case, the rowStyleClass will only override the rowClasses 
>>>> setting for the selected row (because a null rowStyleClass does not 
>>>> interfere with rowClasses setting).
>>>>
>>>> You can combine this with Gerald's suggestion if you also want mouseover 
>>>> effects.
>>>>
>>>> [1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
>>>>
>>>> Regards,
>>>>
>>>> Jeff Bischoff
>>>> Kenneth L Kurz & Associates, Inc.
>>>>
>>>> Gerald Müllan wrote:
>>>>> Hi,
>>>>>
>>>>> you mean a row when using t:dataTable?
>>>>>
>>>>> E.g. there are rowOnMouseOver and rowOnMouseOut js-events, you can
>>>>> apply any css-class easily with this event.
>>>>>
>>>>> cheers,
>>>>>
>>>>> Gerald
>>>>>
>>>>> On 1/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>>>>>> Does MyFaces have any way of highlighting a particular row (or setting 
>>>>>> its
>>>>>> CSS class to be something different from the other rows based on some
>>>>>> criteria)?
>>>>>>
>>>>>> If not, are there any other component libraries that do such a thing?
>>>>>> -- 
>>>>>> View this message in context: 
>>>>>> http://www.nabble.com/Highlight-current-row-tf3096673.html#a8597295
>>>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
>>
> 



Re: Highlight current row

Posted by opick <o_...@hotmail.com>.
Hi Jeff,

the declaration is the same in our page and we are using a t:dataTable.
We had the same EL expression mentioned here in the thread:
 rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
'highlightRow' : null}"

But never the css was used, because the expression did not evaluate to true.
To test the mechanism we changed it to dataTableBacking.selectedRowIndex ==
0 and then the first row got the css. Therefor we assume that there must be
a problem with the evaluation of rowIndex within the t_datatable
declaration.
We are are using myFaces 1.1.4 and tomahawk 1.1.5 snapshot.

But we found an similar solution: We have an icon to selecet a new row and
now changing the icon for the selected row. Fortunatly the rowIndex
evaluates correctly when we use it with a column tag which is within the
dataTable.

Best regards,
Oliver


Jeff Bischoff wrote:
> 
> Opick,
> 
> I defined rowIndex var in the t:dataTable declaration as shown in the 
> wiki like this:
> 
> rowIndexVar="rowIndex"
> 
> Are you using t:dataTable? I have tested this with Myfaces 1.1.3, 1.1.4, 
> 1.1.5 and Tomahawk 1.1.2, 1.1.4, 1.1.5
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> opick wrote:
>> Hi Jens,
>> 
>> this is exactly what we are looking for too. But it is not working in our
>> frameworking. It seems that the variable rowIndex is no evaluated, so the
>> selectedRowIndex never equals rowIndex.
>> 
>> Is this a new feature? Which versions of libraries are you using?
>> 
>> Best regards,
>> Oliver Pick
>> 
>> 
>> Jeff Bischoff wrote:
>>> Lightbulb,
>>>
>>> There are some hints on this in my data scroller wiki page, see [1].
>>>
>>> The key line was contributed by Daniel Lefevre on this mailing list, and 
>>> it goes something like:
>>>
>>> rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
>>> 'highlightRow' : null}"
>>>
>>>
>>> You can use this in combination with normal row CSS classes like this:
>>>
>>> rowClasses="oddRow,evenRow"
>>>
>>>
>>> In this case, the rowStyleClass will only override the rowClasses 
>>> setting for the selected row (because a null rowStyleClass does not 
>>> interfere with rowClasses setting).
>>>
>>> You can combine this with Gerald's suggestion if you also want mouseover 
>>> effects.
>>>
>>> [1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
>>>
>>> Regards,
>>>
>>> Jeff Bischoff
>>> Kenneth L Kurz & Associates, Inc.
>>>
>>> Gerald Müllan wrote:
>>>> Hi,
>>>>
>>>> you mean a row when using t:dataTable?
>>>>
>>>> E.g. there are rowOnMouseOver and rowOnMouseOut js-events, you can
>>>> apply any css-class easily with this event.
>>>>
>>>> cheers,
>>>>
>>>> Gerald
>>>>
>>>> On 1/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>>>>> Does MyFaces have any way of highlighting a particular row (or setting 
>>>>> its
>>>>> CSS class to be something different from the other rows based on some
>>>>> criteria)?
>>>>>
>>>>> If not, are there any other component libraries that do such a thing?
>>>>> -- 
>>>>> View this message in context: 
>>>>> http://www.nabble.com/Highlight-current-row-tf3096673.html#a8597295
>>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-current-row-tf3096673.html#a8803301
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Highlight current row

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

I defined rowIndex var in the t:dataTable declaration as shown in the 
wiki like this:

rowIndexVar="rowIndex"

Are you using t:dataTable? I have tested this with Myfaces 1.1.3, 1.1.4, 
1.1.5 and Tomahawk 1.1.2, 1.1.4, 1.1.5

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

opick wrote:
> Hi Jens,
> 
> this is exactly what we are looking for too. But it is not working in our
> frameworking. It seems that the variable rowIndex is no evaluated, so the
> selectedRowIndex never equals rowIndex.
> 
> Is this a new feature? Which versions of libraries are you using?
> 
> Best regards,
> Oliver Pick
> 
> 
> Jeff Bischoff wrote:
>> Lightbulb,
>>
>> There are some hints on this in my data scroller wiki page, see [1].
>>
>> The key line was contributed by Daniel Lefevre on this mailing list, and 
>> it goes something like:
>>
>> rowStyleClass="#{dataTableBacking.selectedRowIndex == rowIndex ? 
>> 'highlightRow' : null}"
>>
>>
>> You can use this in combination with normal row CSS classes like this:
>>
>> rowClasses="oddRow,evenRow"
>>
>>
>> In this case, the rowStyleClass will only override the rowClasses 
>> setting for the selected row (because a null rowStyleClass does not 
>> interfere with rowClasses setting).
>>
>> You can combine this with Gerald's suggestion if you also want mouseover 
>> effects.
>>
>> [1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
>>
>> Regards,
>>
>> Jeff Bischoff
>> Kenneth L Kurz & Associates, Inc.
>>
>> Gerald Müllan wrote:
>>> Hi,
>>>
>>> you mean a row when using t:dataTable?
>>>
>>> E.g. there are rowOnMouseOver and rowOnMouseOut js-events, you can
>>> apply any css-class easily with this event.
>>>
>>> cheers,
>>>
>>> Gerald
>>>
>>> On 1/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>>>> Does MyFaces have any way of highlighting a particular row (or setting 
>>>> its
>>>> CSS class to be something different from the other rows based on some
>>>> criteria)?
>>>>
>>>> If not, are there any other component libraries that do such a thing?
>>>> -- 
>>>> View this message in context: 
>>>> http://www.nabble.com/Highlight-current-row-tf3096673.html#a8597295
>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>
>>
>>
>