Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.1.7
    • Component/s: Extended Datatable
    • Labels:
      None
    • Environment:
      tomcat 5.5, java 1.5

      Description

      Using forceId="true" with a extended dataTable still gives me the
      generated one - the id gets not forced in the generated output.
      t:panelGroup e.g. with forceId works.

      According to the docs ( http://myfaces.apache.org/tomahawk/forceId.html ) it should work with all t: components.

      kind regards

      Torsten

      1. HtmlDataTableHack.java
        18 kB
        Marco Grimm
      2. HtmlDataList.java
        15 kB
        Marco Grimm

        Issue Links

          Activity

          Hide
          Christopher Hlubek added a comment -

          I've got the same issue for the t:dataList component. If it's initially displayed, the forceId works. After a commandLink was clicked and the view is rendered again, forceId is neglected.

          Another issue is, that the t:updateActionListener doesn't work, since the ids are not correct. For example the id is "list" (forceId is used) on the initial view and after a submit the id is something like "form:list".

          Show
          Christopher Hlubek added a comment - I've got the same issue for the t:dataList component. If it's initially displayed, the forceId works. After a commandLink was clicked and the view is rendered again, forceId is neglected. Another issue is, that the t:updateActionListener doesn't work, since the ids are not correct. For example the id is "list" (forceId is used) on the initial view and after a submit the id is something like "form:list".
          Hide
          Marco Grimm added a comment -

          This patch fixes not working forceId on HtmlDataTable. HtmlDataList may be updated too, because it extends HtmlDataTableHack.

          Show
          Marco Grimm added a comment - This patch fixes not working forceId on HtmlDataTable. HtmlDataList may be updated too, because it extends HtmlDataTableHack.
          Hide
          Torsten Krah added a comment -

          Thx for help.
          Can you mabye attach a unified diff file against current trunk instead of the complete class file?

          Show
          Torsten Krah added a comment - Thx for help. Can you mabye attach a unified diff file against current trunk instead of the complete class file?
          Hide
          Leonardo Uribe added a comment -

          This issue is related to TOMAHAWK-1316. The problem started when HtmlDataList extends from HtmlDataTableHack, so the code of getClientId becomes incorrect.

          Show
          Leonardo Uribe added a comment - This issue is related to TOMAHAWK-1316 . The problem started when HtmlDataList extends from HtmlDataTableHack, so the code of getClientId becomes incorrect.
          Hide
          Leonardo Uribe added a comment -

          After looking the files, the solution proposed is call HtmlComponentUtils.getClientId(this, getRenderer(context), context); on getClientId method of HtmlDataTableHack. Since this method it is called from AbstractHtmlDataList getClientId, this should be removed from it.

          But the method getClientId from AbstractHtmlDataList is bad.

          If you have this code:

          Show
          Leonardo Uribe added a comment - After looking the files, the solution proposed is call HtmlComponentUtils.getClientId(this, getRenderer(context), context); on getClientId method of HtmlDataTableHack. Since this method it is called from AbstractHtmlDataList getClientId, this should be removed from it. But the method getClientId from AbstractHtmlDataList is bad. If you have this code:
          Hide
          Leonardo Uribe added a comment -

          If you have for example this code (see dataList.jsp on tomahawk examples):

          <t:dataList id="data4"
          styleClass="standardList"
          var="country"
          value="#

          {countryList.countries}"
          layout="orderedList"
          forceId="true">
          <h:inputText value="#{country.name}" />
          </t:dataList>

          the actual code is this (this was because the getClientId previous code was very old):

          <ol id="data4" class="standardList">
          <li><input id="data4_0:_idJsp13" name="data4_0:_idJsp13" type="text" value="AUSTRIA" /></li>
          <li><input id="data4_1:_idJsp13" name="data4_1:_idJsp13" type="text" value="AZERBAIJAN" /></li>
          <li><input id="data4_2:_idJsp13" name="data4_2:_idJsp13" type="text" value="BAHAMAS" /></li>
          <li><input id="data4_3:_idJsp13" name="data4_3:_idJsp13" type="text" value="BAHRAIN" /></li>
          <li><input id="data4_4:_idJsp13" name="data4_4:_idJsp13" type="text" value="BANGLADESH" /></li>
          <li><input id="data4_5:_idJsp13" name="data4_5:_idJsp13" type="text" value="BARBADOS" /></li>
          </ol>

          the expected html rendered code should be this:

          <ol id="data4" class="standardList">
          <li><input id="data4:0:_idJsp13" name="data4:0:_idJsp13" type="text" value="AUSTRIA" /></li>
          <li><input id="data4:1:_idJsp13" name="data4:1:_idJsp13" type="text" value="AZERBAIJAN" /></li>
          <li><input id="data4:2:_idJsp13" name="data4:2:_idJsp13" type="text" value="BAHAMAS" /></li>
          <li><input id="data4:3:_idJsp13" name="data4:3:_idJsp13" type="text" value="BAHRAIN" /></li>
          <li><input id="data4:4:_idJsp13" name="data4:4:_idJsp13" type="text" value="BANGLADESH" /></li>
          <li><input id="data4:5:_idJsp13" name="data4:5:_idJsp13" type="text" value="BARBADOS" /></li>
          </ol>

          If you have this:

          <t:dataList id="data4"
          styleClass="standardList"
          var="country"
          value="#{countryList.countries}

          "
          layout="orderedList">
          <h:inputText value="#

          {country.name}" />
          </t:dataList>

          The result should be this:

          <ol id="_idJsp2:data4" class="standardList">
          <li><input id="_idJsp2:data4:0:_idJsp13" name="_idJsp2:data4:0:_idJsp13" type="text" value="AUSTRIA" /></li>
          <li><input id="_idJsp2:data4:1:_idJsp13" name="_idJsp2:data4:1:_idJsp13" type="text" value="AZERBAIJAN" /></li>
          <li><input id="_idJsp2:data4:2:_idJsp13" name="_idJsp2:data4:2:_idJsp13" type="text" value="BAHAMAS" /></li>
          <li><input id="_idJsp2:data4:3:_idJsp13" name="_idJsp2:data4:3:_idJsp13" type="text" value="BAHRAIN" /></li>
          <li><input id="_idJsp2:data4:4:_idJsp13" name="_idJsp2:data4:4:_idJsp13" type="text" value="BANGLADESH" /></li>
          <li><input id="_idJsp2:data4:5:_idJsp13" name="_idJsp2:data4:5:_idJsp13" type="text" value="BARBADOS" /></li>
          </ol>

          If you have this:

          <t:dataList id="data4"
          styleClass="standardList"
          var="country"
          value="#{countryList.countries}"
          layout="orderedList"
          >
          <t:inputText forceId="true" forceIdIndex="true" value="#{country.name}

          " />
          </t:dataList>

          The result should be this:

          <ol id="_idJsp2:data4" class="standardList">
          <li><input id="_idJsp13[0]" name="_idJsp13[0]" type="text" value="AUSTRIA" /></li>
          <li><input id="_idJsp13[1]" name="_idJsp13[1]" type="text" value="AZERBAIJAN" /></li>
          <li><input id="_idJsp13[2]" name="_idJsp13[2]" type="text" value="BAHAMAS" /></li>
          <li><input id="_idJsp13[3]" name="_idJsp13[3]" type="text" value="BAHRAIN" /></li>
          <li><input id="_idJsp13[4]" name="_idJsp13[4]" type="text" value="BANGLADESH" /></li>
          <li><input id="_idJsp13[5]" name="_idJsp13[5]" type="text" value="BARBADOS" /></li>
          </ol>

          The previous behavior is consistent, so it will be applied.

          For do this, AbstractHtmlDataList getClientId() method should be removed and moved HtmlComponentUtils.getClientId(this, getRenderer(context), context) related code to HtmlDataTableHack.

          With this solution, this issue will be closed, but TOMAHAWK-1316 will be closed as cannot duplicate, because on the latest 1.1.7-SNAPSHOT code the error is not present.

          Show
          Leonardo Uribe added a comment - If you have for example this code (see dataList.jsp on tomahawk examples): <t:dataList id="data4" styleClass="standardList" var="country" value="# {countryList.countries}" layout="orderedList" forceId="true"> <h:inputText value="#{country.name}" /> </t:dataList> the actual code is this (this was because the getClientId previous code was very old): <ol id="data4" class="standardList"> <li><input id="data4_0:_idJsp13" name="data4_0:_idJsp13" type="text" value="AUSTRIA" /></li> <li><input id="data4_1:_idJsp13" name="data4_1:_idJsp13" type="text" value="AZERBAIJAN" /></li> <li><input id="data4_2:_idJsp13" name="data4_2:_idJsp13" type="text" value="BAHAMAS" /></li> <li><input id="data4_3:_idJsp13" name="data4_3:_idJsp13" type="text" value="BAHRAIN" /></li> <li><input id="data4_4:_idJsp13" name="data4_4:_idJsp13" type="text" value="BANGLADESH" /></li> <li><input id="data4_5:_idJsp13" name="data4_5:_idJsp13" type="text" value="BARBADOS" /></li> </ol> the expected html rendered code should be this: <ol id="data4" class="standardList"> <li><input id="data4:0:_idJsp13" name="data4:0:_idJsp13" type="text" value="AUSTRIA" /></li> <li><input id="data4:1:_idJsp13" name="data4:1:_idJsp13" type="text" value="AZERBAIJAN" /></li> <li><input id="data4:2:_idJsp13" name="data4:2:_idJsp13" type="text" value="BAHAMAS" /></li> <li><input id="data4:3:_idJsp13" name="data4:3:_idJsp13" type="text" value="BAHRAIN" /></li> <li><input id="data4:4:_idJsp13" name="data4:4:_idJsp13" type="text" value="BANGLADESH" /></li> <li><input id="data4:5:_idJsp13" name="data4:5:_idJsp13" type="text" value="BARBADOS" /></li> </ol> If you have this: <t:dataList id="data4" styleClass="standardList" var="country" value="#{countryList.countries} " layout="orderedList"> <h:inputText value="# {country.name}" /> </t:dataList> The result should be this: <ol id="_idJsp2:data4" class="standardList"> <li><input id="_idJsp2:data4:0:_idJsp13" name="_idJsp2:data4:0:_idJsp13" type="text" value="AUSTRIA" /></li> <li><input id="_idJsp2:data4:1:_idJsp13" name="_idJsp2:data4:1:_idJsp13" type="text" value="AZERBAIJAN" /></li> <li><input id="_idJsp2:data4:2:_idJsp13" name="_idJsp2:data4:2:_idJsp13" type="text" value="BAHAMAS" /></li> <li><input id="_idJsp2:data4:3:_idJsp13" name="_idJsp2:data4:3:_idJsp13" type="text" value="BAHRAIN" /></li> <li><input id="_idJsp2:data4:4:_idJsp13" name="_idJsp2:data4:4:_idJsp13" type="text" value="BANGLADESH" /></li> <li><input id="_idJsp2:data4:5:_idJsp13" name="_idJsp2:data4:5:_idJsp13" type="text" value="BARBADOS" /></li> </ol> If you have this: <t:dataList id="data4" styleClass="standardList" var="country" value="#{countryList.countries}" layout="orderedList" > <t:inputText forceId="true" forceIdIndex="true" value="#{country.name} " /> </t:dataList> The result should be this: <ol id="_idJsp2:data4" class="standardList"> <li><input id="_idJsp13 [0] " name="_idJsp13 [0] " type="text" value="AUSTRIA" /></li> <li><input id="_idJsp13 [1] " name="_idJsp13 [1] " type="text" value="AZERBAIJAN" /></li> <li><input id="_idJsp13 [2] " name="_idJsp13 [2] " type="text" value="BAHAMAS" /></li> <li><input id="_idJsp13 [3] " name="_idJsp13 [3] " type="text" value="BAHRAIN" /></li> <li><input id="_idJsp13 [4] " name="_idJsp13 [4] " type="text" value="BANGLADESH" /></li> <li><input id="_idJsp13 [5] " name="_idJsp13 [5] " type="text" value="BARBADOS" /></li> </ol> The previous behavior is consistent, so it will be applied. For do this, AbstractHtmlDataList getClientId() method should be removed and moved HtmlComponentUtils.getClientId(this, getRenderer(context), context) related code to HtmlDataTableHack. With this solution, this issue will be closed, but TOMAHAWK-1316 will be closed as cannot duplicate, because on the latest 1.1.7-SNAPSHOT code the error is not present.

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Torsten Krah
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development