You need to sign in to do that
Don't have an account?
Hi all I have VF search page and it has a list of products I only want to disable the other products when one product selected. The page is VF and JS code.
<tbody> <apex:repeat value="{!SearchResult}" var="SearchProduct"> <tr> <td><apex:inputCheckbox value="{!SearchProduct.Selected}"/></td> <td>{!SearchProduct.ArticleNumber}</td> <td>{!SearchProduct.ProductName}</td> <td>{!SearchProduct.PowerinKW}</td> <td>{!SearchProduct.Vacuuminmbar}</td> <td>{!SearchProduct.Airvolume}</td> <td>{!SearchProduct.FilterSize}</td> <td><button class="bsbtn bsbtn-xs" data-toggle="modal" data- target="#ProductInformation" data-dismiss="modal" type="button" onclick="ProductInfoModal('{!SearchProduct.ProductDescription.Product2.Id}');"> <span class="glyphicon glyphicon-question-sign"></span></button></td> </tr> </apex:repeat> </tbody>
What do you mean by disabling other products ?
Do you want to disabled checkboxes of other products ?
If yes then try following approach -
- Handle onclick event on apex:inputCheckbox
- Call a javascript method onclick event
- Apply similar style class to all the apex:inputCheckbox
I have created a fiddle very similar to your problem statement. Kindly refer this and try to implement the same in visualforce page.Fiddle (https://jsfiddle.net/mustafajhabuawala/eobp2a0g/)
Hope this helps.
All Answers
What do you mean by disabling other products ?
Do you want to disabled checkboxes of other products ?
If yes then try following approach -
- Handle onclick event on apex:inputCheckbox
- Call a javascript method onclick event
- Apply similar style class to all the apex:inputCheckbox
I have created a fiddle very similar to your problem statement. Kindly refer this and try to implement the same in visualforce page.Fiddle (https://jsfiddle.net/mustafajhabuawala/eobp2a0g/)
Hope this helps.
Yes, I meant to disable the other checkboxes.
I don't have another apex:inputCheckbox, it just one and there is a apex:repeat because it's dynamic search page.
Let me know if you are able to do else I will prepare a sample visualforce page and share with you.
The attribute name is styleClass
In that case you have missed some code. Cross check the fiddle again there is a piece of code to add class name -
Let me know if this works for you.