myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (TOMAHAWK-542) forceId does not work on dataTable
Date Thu, 28 Aug 2008 21:27:44 GMT

    [ https://issues.apache.org/jira/browse/TOMAHAWK-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626751#action_12626751
] 

Leonardo Uribe commented on TOMAHAWK-542:
-----------------------------------------

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.


> forceId does not work on dataTable
> ----------------------------------
>
>                 Key: TOMAHAWK-542
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-542
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Extended Datatable
>    Affects Versions: 1.1.3
>         Environment: tomcat 5.5, java 1.5
>            Reporter: Torsten Krah
>            Priority: Minor
>         Attachments: HtmlDataList.java, HtmlDataTableHack.java
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message