IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

control param of HtmlCommandLink

  • 1.  control param of HtmlCommandLink

    Posted Fri February 01, 2013 07:41 AM

    Hi,

    Plz, how to get the control param value of a HtmlCommandLink in server side (i mean in my data return method)??

    thanks and regards


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 2.  RE: control param of HtmlCommandLink

    Posted Fri February 01, 2013 04:47 PM

    The command parameters should be accessible as request parameters.

    For example:

    String value = (String)resolveExpression("#{param['domaine']}");

    Or:

    String value2 = (String)getFacesContext().getExternalContext().getRequestParameterMap().get("domaine");

    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 3.  RE: control param of HtmlCommandLink

    Posted Mon February 04, 2013 11:15 AM

    Hi Eric,

    The return result is always null using the 2 over lines :frowning:
    I don’t know why, i’m using an htmlCommandLink, i don’t know if i can read them off the current portlet request via the faces ExternalContext or in a binding expression ??

    my return action :

    
    public String domaineSelected() {
    String value = (String)resolveExpression("#{param['domaineParam']}");  
    //String value2 = (String)getFacesContext().getExternalContext().getRequestParameterMap().get("domaineParam"); 
    return value;
    }	

    knowing that my param contains always a value on the url request :

    Thanks and regards


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 4.  RE: control param of HtmlCommandLink

    Posted Mon February 04, 2013 01:48 PM

    Well, that technique worked for me.

    Can you create a simple test portlet that demonstrates the problem? If so, you may need to open a support request with your findings to get a more formal review.


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 5.  RE: control param of HtmlCommandLink

    Posted Wed February 06, 2013 01:00 PM


  • 6.  RE: control param of HtmlCommandLink

    Posted Wed February 06, 2013 01:14 PM


  • 7.  RE: control param of HtmlCommandLink

    Posted Wed February 06, 2013 01:16 PM


  • 8.  RE: control param of HtmlCommandLink

    Posted Thu February 07, 2013 09:58 AM

    Hi Eric,

    I tried to create a simple project with a portlet, I create a view in which I put a control HtmlCommandLink with a param and an inputText to retrieve the value of this param.
    The example works well when I run my page on MWS local server and return the value of my param, BUT when i run it on the MWS remote server the value is null.

    MWS local server : when i click on the link

    the request :

    MWS Remote server : when i click on the link

    the request :

    the difference between the two request below is “jsf” and “jsfwmp22710”

    
    javascript:;CAF.model("jsfwmp22710:defaultForm:htmlCommandLink").go({'myparam':'helloWorld'});
    javascript:;CAF.model("jsf:defaultForm:htmlCommandLink").go({'myparam':'helloWorld'});

    I use the resolveExpression() to get the param value

    
    String value = (String)resolveExpression("#{param['myparam']}");  

    have you a suggestion for what it is?
    do i have to set something for my view ?

    Thanks and regards

    Yassine


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 9.  RE: control param of HtmlCommandLink

    Posted Thu February 07, 2013 01:39 PM

    Well, the difference in the client side control id is probably related to the address being used to render the page.

    If you are rendering a CAF view in a portlet, the control id is prefixed with the string “jsf[_portlet_namespace_here]:” to make it possible to have multiple instances of the same portlet type on one page. It makes the client side control ids unique for each portlet instance.

    Alternatively, if you are rendering a standalone caf view outside of a portlet (e.g. directly loading something like this: http://localhost:8585/YourAppName/page.view) the control id is prefixed with the string “jsf:”. The additional control id namespacing (for portlet requests) isn’t required in this case since it assumes that your CAF view is rendering the entire page so you don’t need to worry about the IDs colliding with other fragments of the page.

    I’m not sure why it is not working for you. Hopefully the engineer assigned to your support incident can provide you some assistance.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS