You need to sign in to do that
Don't have an account?
ab84
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:
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>