Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy this param is being sent as Null in my Bean?
    text
    copied!<p>I am Using JSF 2 and EJB 3.1 to create a form.</p> <p>I am using this part of the page to get me some data, so I can pass it to my bean using the confirmDialog just below</p> <pre><code>&lt;p:column headerText="#{bundle.edit}" style="width:10px; overflow:visible;"&gt; &lt;p:rowEditor/&gt; &lt;/p:column&gt; &lt;p:column headerText="#{bundle.delete}" style="width:10px; overflow:visible;"&gt; &lt;p:commandButton update=":form" oncomplete="confirmation.show()" image="ui-icon ui-icon-close" title="Delete"&gt; &lt;f:param value="#{user}" name="userAction" /&gt; &lt;/p:commandButton&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;p:confirmDialog message="Are you sure? user:#{param['userAction']} " width="500" header="Confirm" severity="alert" widgetVar="confirmation"&gt; &lt;p:commandButton value="Yes sure" update=":form" actionListener="#{userController.deleteAction(param['userAction'])}" oncomplete="confirmation.hide()" /&gt; &lt;p:commandButton value="Not yet" onclick="confirmation.hide()" type="button" /&gt; &lt;/p:confirmDialog&gt; &lt;/h:form&gt; </code></pre> <p>And this is the Bean that should get it</p> <pre><code>@Named(value = "userController") @Stateful @RequestScoped @TransactionManagement(TransactionManagementType.CONTAINER) public class UserController implements Serializable { private User current; @Inject private br.com.cflex.itm.dataaccess.UserFacade userFacade; public UserController() { } public void deleteAction(User user) { userFacade.remove(user); } </code></pre> <p>But My bean is only receiving null as User, and <strong>in the Dialog I am printing the data so I can see there is a User Object selected there.</strong></p> <p><strong>What is wrong in passing params like that ?</strong><br> <strong>Why am I getting null in my Bean?</strong> Because they are getting lost in the communication between client and server-side...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload