You need to sign in to do that
Don't have an account?
anuj pathak 2
visualforce list item
I am not able to get opportunity List in VF page , can you please suggest what i doing wrong
<apex:page controller="OppsearchController"> <apex:form > <apex:pageBlock id="pb" mode="edit"> <apex:pageBlockSection > <apex:pageBlockSectionItem > <apex:outputLabel for="Search String">Search String</apex:outputLabel> <apex:panelGroup > <apex:inputText value="{!searchString}"/> <apex:commandButton value="GO" action="{!oppResults}" status="as" reRender="pbt"/> <apex:actionStatus startText="Searching......." id="as"></apex:actionStatus> </apex:panelGroup> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Result"> <apex:pageBlockTable value="{!OppSearchResult}" var="opp" id="pbt"> <apex:column value="{!opp.name}"/> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
public class OppsearchController { List<Opportunity> OppSearchResult; public String searchString { get; set; } public List<Opportunity> getOppSearchResult() { return OppSearchResult; } public PageReference oppResult() { OppSearchResult = (List<Opportunity>)[FIND :searchString RETURNING Opportunity(Name)][0]; return null; } }
Please use below code
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Please use below code
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Greetings!!
You are not letting your variable to available on the VF page because you have not applied get; set; on the OppSearchResult list.
Please apply get; set; on the list. If this helped you please mark it as the best answer.
If there is any issue please mention it.
Thank you!
Regards,
Suraj Tripathi