【问题标题】:How to pass selected multiselect picklist and pageblock table values from one vf page to another如何将选定的多选选项列表和页块表值从一个 vf 页面传递到另一个页面
【发布时间】:2019-02-04 10:00:38
【问题描述】:

我在 visualforce 页面中有一个多选选项列表和页面块表我想将选定的多选选项列表值和修改的页面块表值发送到下一个 visualforce 页面

这是我的 vf 页面代码

    <apex:pageBlockSection title="Filter based on profiles" collapsible="true" >
                   <apex:selectList style="margin-left: 60%;width:150%"  value="{!multival}" size="10" multiselect="true" >
                  <apex:selectOptions value="{!Name}"></apex:selectOptions>
                </apex:selectList> 
                </apex:pageBlockSection>
<apex:commandButton style="margin-left: 30%;width:5%" value="Next" action="{!redirect}"/> 

这是我的第一个控制器代码

 public String multival {get;set;}
 public pagereference redirect(){ 
    PageReference redirect = new PageReference('/apex/nextPage? 
 att='+multival);
    redirect.setRedirect(true);
    return redirect;      

}

这是我的第二个控制器代码

public class selectedList {
 public String multival {get;set;}
    public selectedList (){
         multival = ApexPages.currentPage().getParameters().get('att');
    }
}

如何将选定的多选选项列表值传递到我的下一页?

【问题讨论】:

    标签: salesforce apex-code visualforce


    【解决方案1】:

    在您的第二个 vf 页面上使用相同的控制器。您可以重定向到第二个页面,但如果它使用相同的控制器,您可以访问所有变量值。

    请参阅此处以创建 visualforce 向导: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_wizard.htm

    【讨论】:

      猜你喜欢
      • 2013-05-22
      • 1970-01-01
      • 2019-05-09
      • 1970-01-01
      • 2015-02-01
      • 1970-01-01
      • 2019-05-09
      • 2020-11-16
      • 1970-01-01
      相关资源
      最近更新 更多