Cannot display facesMessages from custom action.

I've created a simple button widget that fires an action, passing a String to the action:


xmlns=“” xmlns:nxthemes=“” xmlns:ui=“” xmlns:f=“” xmlns:h=“” xmlns:nxu=“” xmlns:nxdir=“” xmlns:nxl=“” xmlns:c=“” xmlns:a4j=“”>


          value="Stop Prep"

I've used the Advanced Widget section in Studio to insert this widget into an edit view of a document. The associated JAVA action was generated with nuxeo IDE. I changed the accept() in the generated action class method to return false so I did not see the tabs. The button works except any message generated by the JAVA actions to facesMessages is not displayed. An error of: [javax.enterprise.resource.webcontainer.jsf.lifecycle] jsf.non_displayed_message is displayed in the log file.

Did setting the return value on the accept method(filter) turn off the ability to send messages to “faces” for display to the user? Do I need a different category in the action .xml file? I currently have the standard SUBVIEW_UPPER_LIST as the category. Should I be using the Nuxeo nxa4j instead of a4j in my button widget?

0 votes

1 answers




sorry, not sure i understood correctly what you're trying to do, but that kind of message shows that a component is not re-rendered. Adapting the corresponding attribute on the a4j link so the component with a message is rendered should do the trick

0 votes

I am trying to issue a message, using Java facesMessages, to the user, from inside custom action linked to a button generated by the widget above. In this case the custom action is: besPMPTOT.pmpStop('Prep').

Ok, you can issue a global message, or attach it to a JSF component using its id.

In any case, you'll need a JSF component displaying this message, and make sure it is re-rendered on ajax action.