You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jay Sartoris (JIRA)" <de...@myfaces.apache.org> on 2017/10/23 20:07:00 UTC

[jira] [Created] (MYFACES-4165) f:param values are not in request map when nested in h:commandScript

Jay Sartoris created MYFACES-4165:
-------------------------------------

             Summary: f:param values are not in request map when nested in h:commandScript
                 Key: MYFACES-4165
                 URL: https://issues.apache.org/jira/browse/MYFACES-4165
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.3.0-beta
            Reporter: Jay Sartoris
            Priority: Minor
         Attachments: CommandScriptWithParam.war

Since the UICommandLink component extends the UICommand component, we should be able to include f:param in the h:commandLink components.  
In my testing, the values are not in the request map when I try to pull them out.  They are displayed as null on the rendered page.

My xhtml file has:

{code:java}
<h:form>
    <h:commandScript name="testCommandScript" action="#{commandScriptBean.testCommandScriptParam()}" render=":output" autorun="true">
        <f:param name="param1" value="Value1" />
        <f:param name="param2" value="Value2" />
    </h:commandScript>
</h:form>
<h:outputText id="output" value="The value of output is: #{commandScriptBean.output}" />
{code}

and my bean is getting them here:

{code:java}
        Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();

        String param1 = params.get("param1");
        String param2 = params.get("param2");

        setOutput(param1+ " " + param2);
{code}

I've uploaded a sample application to demonstrate the issue. 
I'm using the 10/16 snapshot which contains the recent commandScript changes done in JIRA MyFaces-4163.  

I've tested this using the Mojarra JSF 2.3 jars and the values are properly displayed.  





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)