jsf - Reference an id in the for-Attribute of p:radioButton -
jsf - Reference an id in the for-Attribute of p:radioButton -
is possible reference id, identifies component kid of parents-parent-naming container?
for example:
<div class="browserdiv" id="browserobjects"> <p:selectoneradio id ="selectedfolder" value="${cc.attrs.value.selectedobjectpath}" layout="custom"> <f:selectitems value="${cc.attrs.value.objectlist}" var="object" itmevalue="${object.path}" itemlabel=""/> </p:selectoneradio> <table> <ui:repeat var="object" value="${cc.attrs.value.objectlist}" id ="repeat" varstatus="status" > <tr> <td class="checkboxcell"> <p:radiobutton id="radiobutton_${object.path}" for="selectedfolder" itemindex="#{status.index}"/> </td> </tr> </ui:repeat> </table> </div> i want reference id selectedfolder for-attribute in <p:radiobutton>. since <ui:repeat> namingcontainer, selectedfolder lies in namingcontainer , don't see how can referenced. possible write for="../selectedfolder"?
i cannot utilize absolute id-references because part of composite component. tried using prependid="false" in <ui:repeat>, didn't work.
use absolute client id instead of relative client id.
assuming you've
class="lang-html prettyprint-override"><h:form id="form"> <p:selectoneradio id="radio" ...> ... </p:selectoneradio> </h:form> then absolute client id form:radio. it's value see in generated html source. reference within naming container, need prefix (default) naming container separator : becomes :form:radio. so, should do:
<p:radiobutton for=":form:radio" ... /> unrelated concrete problem, you're using ${} instead of #{} everywhere. while ${} may work fine in display-only values, won't work @ whenever submit form. you'd need #{} instead. not get, set, while ${} get. stick #{} throughout jsf pages.
update per comments, it's unclear naming containers placed in composite, if necessary can resolve absolute client id of composite dynamically follows:
<p:radiobutton for=":#{cc.clientid}:radio" ... /> jsf naming-containers
Comments
Post a Comment