2

I'm currently tring to make visualforce form. The flow is the following

  • input page
  • confirm page
  • complete page

how can I retrive POST parameter in confirm-page? I want retrieve each parameters at appropriate tag like below...

<tr>
<td>Text1 input value: </td><td>abc</td>
<td>Text2 input value: </td><td>xyz</td>
</tr>

--

input page

<apex:page >
<form id="SubmitForm" action="/apex/confirm" method="post" >
<div>
      <input type="text" id="Text1" name="Text1" value="abc" />
      <input type="text" id="Text2" name="Text2" value="xyz" />
      <input type="submit" value="submit" />
</div>
</form>
</apex:page>

controler

public with sharing class GetUrlParamsController{

    public Map<String, String> getUrlParamMap(){

        return ApexPages.currentPage().getParameters();
    }

    public Set<String> getUrlParamKeySet(){

        return ApexPages.currentPage().getParameters().keySet();
    }
}

confirm page

<apex:page controller="GetUrlParamsController">
  <apex:form >
    <apex:repeat value="{!UrlParamKeySet}" var="key" >


      <div>
        <apex:outputText value="{!key}:{!UrlParamMap[key]}" />
      </div>


    </apex:repeat>
  </apex:form>
</apex:page>

closed as unclear what you're asking by David Reed, glls, Sebastian Kessel, Dave Humm, Martin Lezer Mar 5 '18 at 10:09

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you mean how to retrieve the parameters in complete page? – jagmohan Mar 4 '18 at 6:25
0

Your code should be working fine. You can render the data on confirm.page in table using a apex:pageBlockTable as follows

<apex:page controller="GetUrlParamsController">
    <apex:form >
        <apex:pageBlock>
            <apex:pageBlockTable value="{!urlParamKeySet}" var="key" columns="2">
                <apex:column>
                    {!key} input value
                </apex:column>
                <apex:column>
                    {!UrlParamMap[key]}
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.