Trying to do this programatically
<a4j:commandLink ... onclick="#{rich:component('modalPanelID')}.show()"/>
This doesn’t work:
HtmlAjaxCommandLink commandLinkObject = new HtmlAjaxCommandLink();
...
commandLinkObject.setOnClick("#{rich:component('modalPanelID')}.show()");
Any idea why and how to make it work?
Thanx.
Because the expression is never evaluated.
With the first approach when the page is rendered the
#{rich:component...}is evaluated by Richfaces and something like the code below is rendered on the page:Because you are doing this progammatically you are bypassing this rendering. I would suggest that you just use the rendered javascript from above.