ICEfaces
  1. ICEfaces
  2. ICE-4720

Var of <ice:panelSeries> cannot be used by children's id parameter.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Maven 2.1.0,
      ICEfaces 1.8.1,
      Facelets

      Description

      If you try to pass the var of an <ice:panelSeries> element to the id parameter of its children, the var gets ignored.

      Code snippet to reproduce:
      private String[] id = new String[]{"1","2","3","asdf"};

      <ice:panelSeries value="#{storageBean.id}" var="item">
       <ice:panelGroup id="asdf#{item}">
        <ice:outputText id="out#{item}" value="#{item}" />
       </ice:panelGroup>
      </ice:panelSeries>

      I am expecting this after the first iteration:
      <div id="j_id8:j_id9:0:asdf1" class="icePnlGrp">
       <span id="j_id8:j_id9:0:out1" class="iceOutTxt">1</span>
      </div>

      This is what gets rendered:
      <div id="j_id8:j_id9:0:asdf" class="icePnlGrp">
       <span id="j_id8:j_id9:0:out" class="iceOutTxt">1</span>
      </div>

      Sample project attached to the forum post.

        Activity

        Hide
        Armin Töpfer added a comment -

        Sample project to reproduce bug.

        Show
        Armin Töpfer added a comment - Sample project to reproduce bug.
        Hide
        Mark Collette added a comment -

        This is not a bug, but is a JSF rule that a component's id not change through its lifetime. From the forum thread, the example there was how to have a component, like a dataTable, and dynamically set it's id. But by dynamic, they mean that it's not hard-coded, and is taken from Java code, when the component is constructed, but it will then remain unchanged after construction.

        With your panelSeries, and child panelGroup and outputText, there is only one single panelGroup and one single outputText within the panelSeries. It's just that panelSeries will iterate over its data model, and re-use that panelGroup and that outputText. So, while you could use a dynamic means of giving the panelGroup and outputText their ids when they are initially constructed, you cannot change the ids later, such as when the panelSeries is iterating. The panelSeries' var only exists in iteration, so it only exists after construction, so it can't be used by specifying its childrens' ids.

        Show
        Mark Collette added a comment - This is not a bug, but is a JSF rule that a component's id not change through its lifetime. From the forum thread, the example there was how to have a component, like a dataTable, and dynamically set it's id. But by dynamic, they mean that it's not hard-coded, and is taken from Java code, when the component is constructed, but it will then remain unchanged after construction. With your panelSeries, and child panelGroup and outputText, there is only one single panelGroup and one single outputText within the panelSeries. It's just that panelSeries will iterate over its data model, and re-use that panelGroup and that outputText. So, while you could use a dynamic means of giving the panelGroup and outputText their ids when they are initially constructed, you cannot change the ids later, such as when the panelSeries is iterating. The panelSeries' var only exists in iteration, so it only exists after construction, so it can't be used by specifying its childrens' ids.
        Hide
        Mark Collette added a comment -

        If you explain why you're trying to change the ids, then I may be able to propose an alternate solution.

        Show
        Mark Collette added a comment - If you explain why you're trying to change the ids, then I may be able to propose an alternate solution.

          People

          • Assignee:
            Mark Collette
            Reporter:
            Armin Töpfer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: