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

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

     [ https://issues.apache.org/jira/browse/MYFACES-4165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Andraschko resolved MYFACES-4165.
----------------------------------------
    Resolution: Fixed

> 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
>            Assignee: Thomas Andraschko
>            Priority: Minor
>             Fix For: 2.3.0
>
>         Attachments: CommandScriptWithParam.war
>
>
> Since the UICommandScript component extends the UICommand component, we should be able to include f:param in the h:commandScript 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)