Note that there are some explanatory texts on larger screens.

plurals
  1. POIn a commandLink, I use <f:param...> and got a null parm in my MBean
    primarykey
    data
    text
    <p>In my jsf I use :</p> <pre><code>&lt;f:param name="parm1" value="#{templateGP01MB.stringAnnId}" /&gt; </code></pre> <p>and receive a null parameter in my Managed Bean.</p> <p>If I write the following :</p> <pre><code>&lt;f:param name="parm1" value="5" /&gt; </code></pre> <p>I got 5 in my MBean.</p> <p>Here is my code for my JSF: </p> <pre><code> &lt;p:imageSwitch effect="turnDown" speed="10000"&gt; &lt;ui:repeat value="#{galerieFloMB.stringArray}" var="image" &gt; &lt;h:commandLink value="Voir l'annonce correspondante" actionListener="#{templateGP01MB.actionListener}" action="#{templateGP01MB.action}" &gt; &lt;!-- &lt;p:graphicImage value="/resources/images/download/#{image}" width="300" height="300" onclick="visualisationAnnonce('#{image}');" /&gt; --&gt; &lt;p:graphicImage value="/resources/images/download/#{image}" width="300" height="300" /&gt; &lt;f:attribute name="attributeName1" value="#{image}" /&gt; &lt;f:param name="parm1" value="#{templateGP01MB.stringAnnId}" /&gt; &lt;/h:commandLink&gt; &lt;/ui:repeat&gt; &lt;/p:imageSwitch&gt; &lt;/h:form&gt; </code></pre> <p>And here is my code for my MBean TemplateGP01MB.java:</p> <pre><code>public void actionListener(ActionEvent event) { photo = (String) event.getComponent().getAttributes().get("attributeName1"); annonceEtendue = getAnnonceEtendueFacade().searchByPhoto(photo); } public String action() { return "visualisationAnnonce"; } </code></pre> <p>In the MBean VisualisationAnnonceMB.java, I got :</p> <pre><code> FacesContext fc = FacesContext.getCurrentInstance(); Map&lt;String, String&gt; params = fc.getExternalContext().getRequestParameterMap(); String parm1 = params.get("parm1"); Integer integerParm1 = Integer.parseInt(parm1); </code></pre> <p>And I got a Null pointer exeption cause parm1 = null...</p> <p>Sure I am a newbie and I don't really understand evrything about jsf lyfecycle. If someone can HELP me, it would be great :)</p> <p>Thanks in advance GLO</p>
    singulars
    1. This table or related slice is empty.
    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.
    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