function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SunnySunSunnySun 

A Visualforce Page with Filtering

Hi,all!

Then I code a visualforce page with filter function,I use some selectoption . I use inputHidden to deliver what I selected.

I can get the value in this page's controller. but when I want to based on these conditions to refresh the page, I found I can't send these conditions to the new page.

This is my code for refresh the page.

 

public PageReference selectChange(){
     PageReference pageRef = ApexPages.currentPage();
     pageRef.getParameters().put('FyValue', FyValue);
     pageRef.getParameters().put('ACCValue', ACCValue);
     pageRef.getParameters().put('ProductNameValue', ProductNameValue);
     pageRef.getParameters().put('CropNameValue', CropNameValue);
     pageRef.getParameters().put('PackageValue', PackageValue);
     pageRef.getParameters().put('BrandValue', BrandValue);
     pageRef.getParameters().put('ItermValue', ItermValue);
     pageRef.setRedirect(true);
     return pageRef;
    }

 I use  pageRef.getParameters().put('FyValue', FyValue); to send the conditions. But I found I Failure.

So,I want to know How should I do!

Any help will be admiration!

 

 

bob_buzzardbob_buzzard

In what way did you fail?  I've used this technique to send information through to the next page many times before.

 

When you are redirected to your new page, what is the full URL?

SunnySunSunnySun

Thanks for your answer!

 

PageReference pageRef = ApexPages.currentPage();
		 system.debug('---'+FyValue+'---'+ACCValue+'---'+ProductNameValue+'-----') ;
		 pageRef.getParameters().put('FyValue', FyValue);
		 pageRef.getParameters().put('ACCValue', ACCValue);
		 pageRef.getParameters().put('ProductNameValue', ProductNameValue);
		 pageRef.getParameters().put('CropNameValue', CropNameValue);
		 pageRef.getParameters().put('PackageValue', PackageValue);
		 pageRef.getParameters().put('BrandValue', BrandValue);
		 pageRef.getParameters().put('ItermValue', ItermValue);
                 pageRef.setRedirect(true);
		 return pageRef;

I can debug those value. But I can't send thos value.

The url connot be understood. Than,could you gave me a demo?

Include page and controller.

Parameters of the definition and how to called PageReference.

 

bob_buzzardbob_buzzard

Coming back to this a bit late - what did the URL look like?  it may be that you need to encode the parameters using the EncodingUtil class.