Note that there are some explanatory texts on larger screens.

plurals
  1. POaction and actionListener for p:commandButton in composite component
    primarykey
    data
    text
    <p>I am making composite component where i have commandButton. But it doesn't work. </p> <p>Usage:</p> <pre><code>&lt;wk:commandButton value="Non-Ajax actionListener" actionListener="#{ioBean.saveListener}" /&gt; </code></pre> <p>Code of component: commandButton.xhtml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite"&gt; &lt;cc:interface&gt; &lt;cc:attribute name="value" /&gt; &lt;cc:attribute name="action" method-signature="void action(javax.faces.event.ActionEvent)" default="null"/&gt; &lt;cc:attribute name="actionListener" method-signature="void actionListener(javax.faces.event.ActionEvent)" default="null"/&gt; &lt;cc:attribute name="styleClass" default="button" /&gt; &lt;/cc:interface&gt; &lt;cc:implementation&gt; &lt;p:commandButton value="#{cc.attrs.value}" action="#{cc.attrs.action}" actionListener="#{cc.attrs.actionListener}" styleClass="#{styleClass}"&gt; &lt;cc:insertChildren /&gt; &lt;/p:commandButton&gt; &lt;/cc:implementation&gt; &lt;/html&gt; </code></pre> <p>And this is log:</p> <pre><code>0000006c FaceletViewDe E Inner component action not found when retargetMethodExpressions 0000006c FaceletViewDe E Inner component actionListener not found when retargetMethodExpressions 0000006c srt W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader SRVE8094W: Ostrzeżenie: nie można ustawić nagłówka. Odpowiedź została już zatwierdzona. </code></pre> <p>I think the problem is with default value for action and actionListener. But according to the PrimeFaces documentation, default value for action and actionListener is null. One option is to make four different variants where action and actionListener are null or are defined but it doedn't seem to be good solution.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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