I have Checkbox datatable, first column is Checkbox, second and other outputtext but last column is inputtext(password) and this column disabled="false"
, now I want if I click the checkbox this column change disabled="true"
, how I can solve this?
<h:body>
<p:dataTable var="car" value="#{regularityController.stlist}" paginator="true" rows="10" rowKey="#{car.g_student_no}"
selection="#{regularityController.select}" >
<f:facet name="header">
Telebeleri secin
</f:facet>
<p:column selectionMode="multiple" style="width:18px" />
<p:column headerText="Name">
<h:outputText value="#{car.s_name}" />
</p:column>
<p:column headerText="Surname" >
<h:outputText value="#{car.s_surname} " />
</p:column>
<p:column headerText="Father Name">
<h:outputText value="#{car.s_fname} " />
</p:column>
<p:column headerText="Father Name">
<p:password disabled="#" value="#{car.s_pass }"/>
</p:column>
<f:facet name="footer">
<p:commandButton value="ddd" action="#{regularityController.saveStudent()}"/>
</f:facet>
</p:dataTable>
</h:body>
do you tried with javascript: add to checkbox
onclick="document.getElementById('#{p:component('id')}').disabled=true"
add an id
to password
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.