6

Can I set the value for rendered attribute of h:commandLink from JavaScript?

<h:commandLink id="profileLink" rendered="#{bean.enable}">

1 Answer 1

7

No. The rendered attribute is for the server side, not for the client side. In plain HTML/JS in the client cide you can just toggle the CSS display property.

// Get element by client ID.
var element = document.getElementById('formid:buttonid');

// Hide it.
element.style.display = 'none';

// Show it.
element.style.display = 'inline'; // or 'block' if it's a HTML block element
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.