ICEfaces
  1. ICEfaces
  2. ICE-3882

Add a varStatus attribute to panelSeries

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2 SP1
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Affects:
      Sample App./Tutorial
    • Workaround Exists:
      Yes
    • Workaround Description:
      In your bean, instead of returning a List for your data model, return a javax.faces.model.DataModel. Then you can always add a property getter to access your DataModel's getRowIndex() method, thus accessing the panelSeries' current row index.

      Description

      Feature Request: The JSTL tag c:forEach has a varStatus which can be used to return a row index. Having this sort of an attribute for the ice:panelSeries component would be useful.

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [50070000007DbOo]
        Priority Major [ 3 ] Minor [ 4 ]
        Mark Collette made changes -
        Workaround Description In your bean, instead of returning a List for your data model, return a javax.faces.model.DataModel. Then you can always add a property getter to access your DataModel's getRowIndex() method, thus accessing the panelSeries' current row index.
        Workaround Exists [Yes]
        Ken Fyten made changes -
        Fix Version/s 1.8DR#3 [ 10143 ]
        Assignee Priority P1
        Assignee Mark Collette [ mark.collette ]
        Hide
        Mark Collette added a comment -

        The Facelets c:forEach varStatus docs:

        Variable to bind an Object that describes the current indexed state. The Object has the following properties: first[boolean], last[boolean], begin[int], end[int], index[int], step[int].

        Since PanelSeries is a UIData, it has "first", "rows", and "rowIndex", with no concept of stepping. One complication is that, while we theoretically can calculate what the last row will be, from the "first" and "rows" values, isRowAvailable() may return false in any intervening row, ending the iteration. So, accurate values for "end" and "last" is not something that can be guaranteed, without scanning ahead, which isn't really an option with the limitations of paged data models and UIData iteration overhead. Still, in typical cases, we could provide those.

        Show
        Mark Collette added a comment - The Facelets c:forEach varStatus docs: Variable to bind an Object that describes the current indexed state. The Object has the following properties: first [boolean] , last [boolean] , begin [int] , end [int] , index [int] , step [int] . Since PanelSeries is a UIData, it has "first", "rows", and "rowIndex", with no concept of stepping. One complication is that, while we theoretically can calculate what the last row will be, from the "first" and "rows" values, isRowAvailable() may return false in any intervening row, ending the iteration. So, accurate values for "end" and "last" is not something that can be guaranteed, without scanning ahead, which isn't really an option with the limitations of paged data models and UIData iteration overhead. Still, in typical cases, we could provide those.
        Hide
        Mark Collette added a comment -

        Adding it to:
        dataTable, columns, panelPositioned, panelSeries, panelTabSet

        Show
        Mark Collette added a comment - Adding it to: dataTable, columns, panelPositioned, panelSeries, panelTabSet
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18178 Fri Jan 16 10:58:38 MST 2009 mark.collette ICE-3882 : Add a varStatus attribute to panelSeries
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_properties/ice-uicolumns-props.xml
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-paneltabset-props.xml
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/UISeries.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_properties/ice-dataTable-props.xml
        Commit graph ADD /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_properties/ice-att-varstatus-props.xml
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelPositioned-props.xml
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/extended-faces-config.xml
        Commit graph ADD /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/VarStatus.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelSeries-props.xml
        Hide
        Mark Collette added a comment -

        For a simple way of testing this, I edited the component-showcase's dataTable-dataScrolling.jspx, and inserted two lines. This way, using the dataPaginator, I could change the dataTable's first property, which would then properly test the varStatus fields.

        <ice:dataTable id="data"
        var="employee"
        >>>>> varStatus="markVarStatus"
        value="#

        {dataScrollingModel.employees}

        "
        rows="#

        {dataScrollingModel.selectedDataScrollModes[dataScrollingModel.selectedDataScrollMode].rows}

        "
        scrollable="#

        {dataScrollingModel.selectedDataScrollModes[dataScrollingModel.selectedDataScrollMode].scrollingEnabled}

        "
        scrollHeight="250px"
        style="float:left"
        columnWidths="100px,100px,100px,100px"
        styleClass="dataPaginatorDataTable"
        cellpadding="0">
        <ice:column>
        <f:facet name="header">
        <ice:outputText id="column1"
        value="#

        {msgs['page.dataTable.column1']}

        "/>
        </f:facet>
        <ice:outputText id="number"
        value="#

        {employee.id}

        "/>
        >>>>> <ice:outputText value="first: #

        {markVarStatus.first}

        last: #

        {markVarStatus.last}

        begin: #

        {markVarStatus.begin}

        end: #

        {markVarStatus.end}

        index: #

        {markVarStatus.index}

        "/>
        </ice:column>

        Show
        Mark Collette added a comment - For a simple way of testing this, I edited the component-showcase's dataTable-dataScrolling.jspx, and inserted two lines. This way, using the dataPaginator, I could change the dataTable's first property, which would then properly test the varStatus fields. <ice:dataTable id="data" var="employee" >>>>> varStatus="markVarStatus" value="# {dataScrollingModel.employees} " rows="# {dataScrollingModel.selectedDataScrollModes[dataScrollingModel.selectedDataScrollMode].rows} " scrollable="# {dataScrollingModel.selectedDataScrollModes[dataScrollingModel.selectedDataScrollMode].scrollingEnabled} " scrollHeight="250px" style="float:left" columnWidths="100px,100px,100px,100px" styleClass="dataPaginatorDataTable" cellpadding="0"> <ice:column> <f:facet name="header"> <ice:outputText id="column1" value="# {msgs['page.dataTable.column1']} "/> </f:facet> <ice:outputText id="number" value="# {employee.id} "/> >>>>> <ice:outputText value="first: # {markVarStatus.first} last: # {markVarStatus.last} begin: # {markVarStatus.begin} end: # {markVarStatus.end} index: # {markVarStatus.index} "/> </ice:column>
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18179 Fri Jan 16 12:31:22 MST 2009 mark.collette ICE-3882 : Add a varStatus attribute to panelSeries
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/extended-faces-config.xml
        Hide
        Mark Collette added a comment -

        Now ice:columns, ice:dataTable, ice:panelPositioned, ice:panelSeries, ice:panelTabSet all have the varStatus proerty, which has 5 sub-properties: int begin, int end, int index, boolean first, boolean last. The indexes are inclusive.

        A lot of the time, when people wanted to know the current iteration index, we've told them to maintain the DataModel themselves in their bean, so they can query its getRowIndex() method. Now it should be a lot simpler to access that information, using varStatus.

        Subversion 18178
        icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml
        icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-att-varstatus-props.xml
        icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-panelPositioned-props.xml
        icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-panelSeries-props.xml
        icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-paneltabset-props.xml
        icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-dataTable-props.xml
        icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-uicolumns-props.xml
        icefaces\component\src\com\icesoft\faces\component\panelseries\UISeries.java
        icefaces\component\src\com\icesoft\faces\component\panelseries\VarStatus.java

        Show
        Mark Collette added a comment - Now ice:columns, ice:dataTable, ice:panelPositioned, ice:panelSeries, ice:panelTabSet all have the varStatus proerty, which has 5 sub-properties: int begin, int end, int index, boolean first, boolean last. The indexes are inclusive. A lot of the time, when people wanted to know the current iteration index, we've told them to maintain the DataModel themselves in their bean, so they can query its getRowIndex() method. Now it should be a lot simpler to access that information, using varStatus. Subversion 18178 icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-att-varstatus-props.xml icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-panelPositioned-props.xml icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-panelSeries-props.xml icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-paneltabset-props.xml icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-dataTable-props.xml icefaces\component-metadata\src\main\resources\conf\ice_properties\ice-uicolumns-props.xml icefaces\component\src\com\icesoft\faces\component\panelseries\UISeries.java icefaces\component\src\com\icesoft\faces\component\panelseries\VarStatus.java
        Mark Collette made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Affects [Sample App./Tutorial]
        Resolution Fixed [ 1 ]
        Hide
        Mark Collette added a comment -

        Fixed an incorrectly cased filename, which didn't show up on Windows, since it has a case insensitive filesystem.

        Subversion 18179
        icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml

        Show
        Mark Collette added a comment - Fixed an incorrectly cased filename, which didn't show up on Windows, since it has a case insensitive filesystem. Subversion 18179 icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml
        Hide
        Joanne Bai added a comment -

        QA tested it on trunk revision 18245 + Tomcat 6

        • dataTable and columns: New attribute varStatus was tested successfully
        • panelPositioned and panelSeries: the markVarStatus.last is not set to true for the last element
        • panelTabSet: empty values are showed for markVarStatus.first, markVarStatus.last, markVarStatus.begin, markVarStatus.end, markVarStatus.index

        (Please see the uploaded screen shot)

        A test app has been created for this issue at repo\qa\trunk\Regression\ICE-3882

        Show
        Joanne Bai added a comment - QA tested it on trunk revision 18245 + Tomcat 6 dataTable and columns: New attribute varStatus was tested successfully panelPositioned and panelSeries: the markVarStatus.last is not set to true for the last element panelTabSet: empty values are showed for markVarStatus.first, markVarStatus.last, markVarStatus.begin, markVarStatus.end, markVarStatus.index (Please see the uploaded screen shot) A test app has been created for this issue at repo\qa\trunk\Regression\ ICE-3882
        Joanne Bai made changes -
        Attachment screenshot-1.jpg [ 11486 ]
        Hide
        Joanne Bai added a comment -

        From Mark: For panelTabSet, it's only when they use a data model for the panel tabs, not the statically defined <ice:panelTab> tags.

        So, updated the test app and tested again. It appeared panelTabSet has the same issue as panelPositioned and panelSeries - the markVarStatus.last is not set to true for the last element.

        Show
        Joanne Bai added a comment - From Mark: For panelTabSet, it's only when they use a data model for the panel tabs, not the statically defined <ice:panelTab> tags. So, updated the test app and tested again. It appeared panelTabSet has the same issue as panelPositioned and panelSeries - the markVarStatus.last is not set to true for the last element.
        Hide
        Mark Collette added a comment -

        Testing identified issues to be resolved.

        Show
        Mark Collette added a comment - Testing identified issues to be resolved.
        Mark Collette made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Keith Garry Boyce added a comment -

        This has incorrect fix version.. It's fixed in trunk not Dr1

        Show
        Keith Garry Boyce added a comment - This has incorrect fix version.. It's fixed in trunk not Dr1
        Hide
        Mark Collette added a comment -

        1.8RC1 is Release Candidate 1, and comes after DR2. It can be thought of as DR3. I personally prefer just sticking with DRx until the release, but others prefer indicating that we're nearing the release of 1.8.0.

        Show
        Mark Collette added a comment - 1.8RC1 is Release Candidate 1, and comes after DR2. It can be thought of as DR3. I personally prefer just sticking with DRx until the release, but others prefer indicating that we're nearing the release of 1.8.0.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18313 Mon Feb 09 15:57:18 MST 2009 mark.collette ICE-3882 : Add a varStatus attribute to panelSeries
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/UISeries.java
        Hide
        Mark Collette added a comment -

        Had to add logic to support when the rows attribute is not set, by getting the last index from the data model.

        Subversion 18313
        icefaces\component\src\com\icesoft\faces\component\panelseries\UISeries.java

        Show
        Mark Collette added a comment - Had to add logic to support when the rows attribute is not set, by getting the last index from the data model. Subversion 18313 icefaces\component\src\com\icesoft\faces\component\panelseries\UISeries.java
        Mark Collette made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Joanne Bai added a comment -

        Tested successfully on ICEfaces trunk revision 18315 for dataTable, columns, panelPositioned, panelSeries, panelTabSet

        Show
        Joanne Bai added a comment - Tested successfully on ICEfaces trunk revision 18315 for dataTable, columns, panelPositioned, panelSeries, panelTabSet
        Ken Fyten made changes -
        Fix Version/s 1.8 [ 10161 ]
        Assignee Priority P1
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Mark Collette [ mark.collette ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Arran Mccullough
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: