使用h时设置了错误的id:selectOneRadio和f:selectItem

时间:2014-05-23 09:05:40

标签: html jsf-2 radio-button

这是我的代码:

<h:panelGroup id="deliveryAddress" columns="2">
    <h:selectOneRadio id="deliveryAddressRadioGroup" value="#{mybean.deliveryAddress}" layout="pageDirection" onclick="resetTextField()">
        <f:selectItem id="pickedUp" itemValue="wird abgeholt (WET B4)" itemLabel="#{msg.subscriptionFormFieldDeliveryAddressPickedUp}"/>
        <f:selectItem id="send2OrderingPerson" itemValue="Versand an Bestellenden" itemLabel="#{msg.subscriptionFormFieldDeliveryAddressSend2OrderingPerson}"/>
        <f:selectItem id="send2SubscrOwner" itemValue="Versand an Abonnementsbesitzer" itemLabel="#{msg.subscriptionFormFieldDeliveryAddressSend2SubscrOwner}"/>
        <f:selectItem id="send2SupportGroup" itemValue="Versand an Support-Gruppe" itemLabel="#{msg.subscriptionFormFieldDeliveryAddressSend2SupportGroup}"/>
    </h:selectOneRadio>
</h:panelGroup>

由此我希望单个按钮的ID为pickedUpsend2OrderingPersonsend2SubscrOwnersend2SupportGroup。 (或至少detailForm:xxx)。

相反,如果我查看生成的代码,我会得到:

<span id="detailForm:deliveryAddress">
    <table id="detailForm:deliveryAddressRadioGroup">
        <tbody>
            <tr>
                <td>
                    <input id="detailForm:deliveryAddressRadioGroup:0" type="radio" onclick="resetTextField()" value="wird abgeholt (WET B4)" name="detailForm:deliveryAddressRadioGroup">
                    <label for="detailForm:deliveryAddressRadioGroup:0"> will be piched up (WET B4)</label>
                </td>
                </tr>
                <tr>
                    <td>
                        <input id="detailForm:deliveryAddressRadioGroup:1" type="radio" onclick="resetTextField()" value="Versand an Bestellenden" name="detailForm:deliveryAddressRadioGroup">
                        <label for="detailForm:deliveryAddressRadioGroup:1"> send to ordering person</label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input id="detailForm:deliveryAddressRadioGroup:2" type="radio" onclick="resetTextField()" value="Versand an Abonnementsbesitzer" name="detailForm:deliveryAddressRadioGroup" checked="checked">
                        <label for="detailForm:deliveryAddressRadioGroup:2"> send to subscription's owner</label>
                    </td>
                </tr>
                <tr>
                    <td>
                            <input id="detailForm:deliveryAddressRadioGroup:3" type="radio" onclick="resetTextField()" value="Versand an Support-Gruppe" name="detailForm:deliveryAddressRadioGroup">
                            <label for="detailForm:deliveryAddressRadioGroup:3"> send to support group</label>
                    </td>
                </tr>
        </tbody>
    </table>
</span>

出了什么问题?

0 个答案:

没有答案