Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4346

The ClientBehaviorContext.Parameter is not available from requestParameterMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3-next-M2
    • 2.3-next-M3
    • None
    • None

    Description

       

      The ClientBehaviorContext.Parameter is not available from requestParameterMap.

       

      This is part of my component renderer.

       

      public String onclick(UIComponent component, FacesContext context) {
        Collection<ClientBehaviorContext.Parameter> paramList = new ArrayList<>();
        paramList.add(new javax.faces.component.behavior.ClientBehaviorContext.Parameter("my_param", "my_value"));
        Map<String, List<ClientBehavior>> behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
        String onclick = ClientBehaviorRendererUtils.buildBehaviorChain(context, component, component.getClientId(), ClientBehaviorEvents.CLICK, paramList, ClientBehaviorEvents.ACTION, paramList, behaviors, null , null);
        return onclick;
      }
      

      When i decode component parameter value is not available in requestParameterMap.

       

       

      Map<String,String> paramMap = facesContext.getExternalContext().getRequestParameterMap();
      // this works in 2.2.8
      String myParamValue = paramMap.get("my_param"); // null
      
      // in 2.3-next parameters are wrapped in params
      String paramValue = paramMap.get("params"); // [object Object]

      This is because the paramater is wrapped in params in AjaxScriptBuilder.

       

      params: {
        my_param: my_value
      }
      

      During parameter processing in the jsf send method, the encodeURIComponent(val) is called, where var is just 'my_param: "my_value"'. The result of this method is '[object=Object]'.
       

      If I locally canceled the wrapping of parameters in AjaxScritBuilder into params, then everything started working again as in my old MyFaces version 2.2.8.

      Attachments

        Activity

          People

            tandraschko Thomas Andraschko
            krpata Jan Krpata
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: