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
ab84ab84 

Search box to open in new page

I have a search box that fills the page with search results.  I need this to show the results in a different page.  How would I do this?

My controller extension is below:
public with sharing class ideaExtension {  

   public list <idea> i1 {get;set;}  
   public string searchstring {get;set;}  
   public ApexPages.StandardSetController stdCntrlr {get; set;}
   
  
   public ideaExtension(ApexPages.StandardSetController controller) {  stdCntrlr = controller; }  
  
   public void search(){  
     string searchquery='select title,id from idea where title like \'%'+searchstring+'%\' Limit 20';  
     i1= Database.query(searchquery);  
   }  
   public void clear(){  
   i1.clear();  
   }
My visualforce is:
<apex:form >  
 <apex:inputText value="{!searchstring}" label="Input"/>   
  <apex:commandButton value="Search records" action="{!executeSearch}"/>  
   <apex:pageBlock title="Search Result">  
    <apex:pageblockTable value="{!i1}" var="i">  
     <apex:column >  
      <apex:outputlink value="/{!i.id}">{!i.Title}</apex:outputlink>  
     </apex:column>  
     <apex:column value="{!i.id}"/>  
    </apex:pageBlockTable>     
   </apex:pageBlock>   
  </apex:form>