Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Component/s: Framework, ICE-Components
-
Labels:None
-
Environment:MyFaces 2 ICEfaces 2 datatables
-
Assignee Priority:P1
-
Affects:Compatibility/Configuration
Description
<span id="iceform:datTbl:2:number" class="iceOutTxt">1</span>
in MyFaces, the same element is identified as:
<span id="iceform:datTbl:2:2:number" class="iceOutTxt">1</span>
While it doesn't appear to strictly break any application functionality that I can identify, it does cause distress to many of our Selenium tests where we attempt to find elements within a datatable.
Issue Links
- blocks
-
ICE-5868 MyFaces 2 compatibility
-
- Closed
-
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Added some logging to the OutputTextRender for a small table. It clearly shows that the call to getClientId() from the component is returning the row index twice:
MyFaces logging:
OutputTextRenderer.encodeBegin: iceform:datTbl:0:0:number from com.icesoft.faces.component.ext.HtmlOutputText@f57e027
OutputTextRenderer.encodeBegin: iceform:datTbl:1:1:number from com.icesoft.faces.component.ext.HtmlOutputText@f57e027
OutputTextRenderer.encodeBegin: iceform:datTbl:2:2:number from com.icesoft.faces.component.ext.HtmlOutputText@f57e027
Mojarra logging:
OutputTextRenderer.encodeBegin: iceform:datTbl:0:number from com.icesoft.faces.component.ext.HtmlOutputText@3154bfa8
OutputTextRenderer.encodeBegin: iceform:datTbl:1:number from com.icesoft.faces.component.ext.HtmlOutputText@3154bfa8
OutputTextRenderer.encodeBegin: iceform:datTbl:2:number from com.icesoft.faces.component.ext.HtmlOutputText@3154bfa8
The main change now is that a UIData's getClientId() should just follow the same behaviour as a non-UIData, and not include the rowIndex into the clientId anymore. While getContainerClientId() will take on that responsibility. This requires that sub-classes' rendering code make use of getContainerClientId() instead of getClientId() when rendering row specific information, and getClientId() when rendering stuff for the whole component.
I took Deryk's patch, and adapted it a bit. Worked through the sub-classes of UISeries, searching for calls to getClientId(), modifying them as appropriate. Compat dataTable had a problem interoperating with compat columns, which columns was trying to work around by incorporating the dataTable's rowIndex into its own clientId calculations. Fixed that, so that only dataTable would have to be responsible for its rowIndex and not columns. And both would follow the new technique from UISeries.
I tried fixing some little nit picking detail where panelTabSet in a non-UIData (not using value) scenario would still append ":0" to itself. But that ended up breaking a bunch of subtle things, so I ended up reverting all that.
icefaces3
Subversion 26886
A regression was found where the RowSelector was broken, which I hadn't noticed since the showcase uses pre-styling. It turned out that there was code which expected clientId to have rowIndex in it, and was stripping that out, so when I made getClientId() to not have the rowIndex, then the stripping code removed other info. This code could be called from iterating and non-iterating code, so it just needed the stripping code to be removed, and to always use getClientId() instead of getContainerClientId() sometimes.
It also highlighted how the search for getClientId() use had maybe not been thorough enough, since I had searched for UISeriesBase.getClientId() and in some cases it was being used as UIComponent.getClientId(), so I searched for a broader usage.
icefaces3
Subversion 26929