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>
  • 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.