6 replies Latest Post - ‏2014-08-13T12:12:25Z by gsager
5 Posts

Pinned topic webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

‏2008-02-04T17:33:52Z |
I have created a portlet by using the WebSphere Portelt Factory, The Portlet is working fine when I tested on top of WebSphere application server.
After that I deployed on Portal server but that Portlet is not working fine.

Issue:- The issue is request and form is not getting submitted to the Portlet on WPS6.0. I found that webAppAccess.getRequestInputs() is coming as null value.
Created a model:-

1. I created two pages by using the Page Builder.
2. I am trying to pass input parameter values from one page to another page.
3. I could able to achieve on the Websphere application server 6.0(where it is test server to test the portlets before testing on portal server)
4. When I tested on the Websphere portal server request input parameter values are coming as null values.(${Inputs/inputname))
I have done the following steps to create a portlet:-

1. Added a Portal Adapater builder to the model.
2. Deployed through automatic deployment.
3. The portlet view page is coming.
4. When i am trying to send the Input values from page2 to page1 the values are coming as null values and throwing up an exception. Please find the exception from the attched file.(Exception.doc)
5. I cross checked so many times but still i am facing the same issue.

From the sites I have followed the below steps but still I am facing the same Issue:-

1. I have checked that I am using method="POST" in the form tag.
2. I created a method like this below as suggested by IBM in WPF Infocenter. But getRequestInuts() value is coming as null.
Iterator itr = webAppAccess.getRequestInputs().getInputNames();
IXml formData = webAppAccess.getVariables().getXml("formdata");
formData.removeChildren(); //clear old form data out of variable.
String inputName = new String();
while (itr.hasNext()) {
inputname = (String);
formData.addChildWithText(inputname, webAppAccess.getRequestInputs().getInputValue(inputname));
}<a class="jive-link-external" href="http://attachment \"Exception.doc\" deleted by Anil Kumar NCH/0A/Caterpillar">http://attachment \"Exception.doc\" deleted by Anil Kumar NCH/0A/Caterpillar
3. Actually to get the parameter values into the WPF we are using ${Inputs/inputname). But these values are coming as null values in the Webspher portal server.
4. I have done all the required things from the IBM WPF infocenter.( But still I am getting the request parameters input values are null values.

Note:- getRequestInputs() Value is coming as null value in the Websphere Portal Server.

Updated on 2008-02-07T17:28:13Z at 2008-02-07T17:28:13Z by nchanilk
  • SystemAdmin
    9029 Posts

    Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

    ‏2008-02-04T17:43:08Z  in response to nchanilk
    Exactly when are you running the code that is calling getRequestInputs()? In JSR-168 portlets, request parameters are not available in "render" phase, i.e., when executing the JSP code that renders HTML for a page. Request parameters are only availabe in "action" phase, while processing the portlet action encoded in an action URL.
  • mburati
    2544 Posts

    Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin

    ‏2008-02-04T18:50:30Z  in response to nchanilk
    As Martin states, the JSR168 specification splits requests up into multiple requests - one for an action to a single portlet (where the inputs are sent), and then a render request to all portlets on the page (with no request inputs).

    Part way down the page you referenced in the InfoCenter above, it explains that this means you cannot rely on ${Inputs/...} from page controls/data, only from actions.

    The following is directly copied from the InfoCenter link in your post above (note, that doc does neglect to state that if you're using DataPage or View and Form which save the request inputs to a Variable for you, then you can just reference the saved inputs from there).

    Accessing Input Data

    The JSR 168 Portlet request life cycle processes Action requests separately from Render requests in order to allow portlets on a page to be rendered multiple times per explicit portlet action. Due to this behavior you cannot rely on request parameters being available in the page rendering stage. For example, do not use ${Inputs/inputname} as an indirect reference for Page Control builders (Text builder, and so on). Instead, save necessary inputs to Variables or application state data and reference them in page controls from that saved state instead.

    Updated on 2008-02-04T18:50:30Z at 2008-02-04T18:50:30Z by mburati
  • SystemAdmin
    9029 Posts

    Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

    ‏2008-02-04T19:00:22Z  in response to nchanilk
    Neither of my worthy colleagues bothered to mention that you are usually doing something wrong if you are getting data from RequestInputs yourself. Instead, you should be using the PageAutomation system to move this data around for you. Just define an XML variable that has the information that you want to ask for, and point Data Page at it. In your success action, the data that the end-user entered will be in the variable, ready for you to pass to another operation, or whatever. Also, since it's in a Variable, it will be saved if you need it for refreshes.

    Generally, use of requestInputs should be limited to multi-value Select fields and checkbox groups, which are not (yet) handled by PageAutomation.
    • nchanilk
      5 Posts

      Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

      ‏2008-02-07T17:28:13Z  in response to SystemAdmin
      Hi Thanku very much,

      It's working fine after doing this.

      1. Created a variable called newValue

      2. Addede below lines in my method

      String newValue = webAppAccess.getRequestInputs().getInputValue("newValue");
      webAppAccess.getVariables().setString("newValue", newValue.toString());

      Now the newValue variable is having the inputValue.

      Thnaks & Regards,
  • SubasiniRath
    24 Posts

    Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

    ‏2014-08-13T10:22:25Z  in response to nchanilk

    Hi All

       I have a similar scenario.I have lots of text field,drop down in my page. There is one "SAVE" button , onclick of which I need to call web service.

    1. To get the userinput values for each field, I created one datapage and in variable I hv selected [

    • Create New Variable From HTML/From Input and Empty Span Elements ]. the image is attached.
    • 2.On click of [SAVE} button, I do [submit form and invoke action]and  call one action list which in turn calls a java method. But when I print this var either in action list or in java method it is not having the user entered values.
    • In action list, it is printing just the structure and in java when I access this variable using webAppAccess.getRequestInputs().getInputValue(), it is prnting null
    • ​
    • ​Any suggestions



    • gsager
      129 Posts

      Re: webAppAccess.getRequestInputs().getInputNames()Values are coming nullin WPF

      ‏2014-08-13T12:12:25Z  in response to SubasiniRath

      You don't need to get the values this way.  Your page should be created using page automation(Data page, view and form,DSUI) and when you use this kind of page the variable that is related to the page will be updated with the entered values after the user submits the form. 

      You might want to spend some time running the tutorials to get a good idea how the page automation builders work.