Hello,
I have a table ot persons, and I want to use rich:contextMenu with the rich:componentControl.
Say that I pass the personId parameter like this:
<rich:componentControl event="onclick" for="menu" operation="show" > <f:param value="#{person.personId}" name="personId"/> </rich:componentControl>
Now, from a rich:contextMenu item I want to call an action that will fetch the person from the DB and reRender a rich:panel
<rich:menuItem ajaxSingle="true" action="#{myBean.personMap[personId] = true}" reRender="anIdPrefix{personId}"> <h:outputText value="Expand Person {personId}" /> </rich:menuItem>
The action of clicking the menuItem is to change a value in a map to true, and then reRender a component.
Normally, I would use microsubstitutions fo "resolve" the personId variable inside the rich:menuitem. Normally this is resolved by putting it inside curly brackets, like this: {personId}.
However, I want to execute an action, and that requires an EL expression, which somehow messes up things. Possibly because the EL expression requires its own brackets.
Any idea how I should invoke the action with the personId as a parameter?
Cheers!
Hi Markos.
Action parameters are evaluated on the server, while macrosubstitutions are available on the client only. Can you please try adding <f:param value="{personId}" name="personId" /> and check if it's submitted to the server?