You need to sign in to do that
Don't have an account?
Urgent Help!!!!!!!! Custom Search Functionality not working properly
I have two different components that search for the same object. In the first search when i enter the keyword, the same value is assigned to the second search component. I am doing this by passing the first search parameter to the second search component. The code for first search is as follows:
<apex:component controller="ProductSearchController">
<apex:form >
<table border="0">
<tr>
<td valign="top">
<apex:inputText value="{!searchParam}" id="search" size="21" style="border-color:#2C6892;border-style:solid;border-width:1px;height:18px;"/> </td>
<td >
<apex:commandButton style="background:url({!$Resource.ProductSearch}) no-repeat;width:20px;height:21px;margin:0px;margin-bottom:0px;margin-left:-4px;" action="{!SearchResults}"/>
</td>
</tr>
</table>
<p> <apex:inputCheckbox value="{!Solutions}" title="Solutions" selected="true" style="margin-left:0px;"/>Solutions
<apex:inputCheckbox value="{!Partners}" title="Partners" style="margin-left:20px;margin-bottom:0px;"/>Partners
</p>
</apex:form>
</apex:component>
The visualforce page for second earch is :
<apex:component controller="ProductSearchController">
<apex:attribute name="value" type="string" assignTo="{!SearchKeyword}" description="Search Keyword"/>
<apex:form >
<table border="0">
<tr>
<td valign="top">
<apex:inputText value="{!SearchKeyword}" id="searchKey" size="68" style="border-color:#2C6892;border-style:solid;border-width:1px;height:18px;" /> </td>
<td>
<apex:commandButton style="background:url({!$Resource.ProductSearch}) no-repeat;width:20px;height:21px;margin:0px;margin-top:0px;margin-left:-4px;" action="{!SearchResultsKey}"/> </td>
</tr>
</table>
<table border="0">
<tr>
<td valign="top">
<apex:inputCheckbox value="{!Certified}"/>Certified
<apex:inputCheckbox value="{!All}"/>All |
<apex:inputCheckbox value="{!Solutions}"/>Solutions
<apex:inputCheckbox value="{!Partners}"/>Partners </td></tr></table>
</apex:form>
</apex:component>
My issue is when i give a parameter to the first component, i am able to display the same value in the second component's search box. But when I enter a new parameter in the second component, it is not taking the new value. It is still taking the old value. The attribute value is not overwritten.
Any suggestions????
Here is my controller
Thanks in advance.
Ok I could solve the problem by myself. I changed the attribute definition as follows
<apex:attribute name="SearchKeyword" type="string" description="Search Keyword"/>
All Answers
Here is the controller
This should allow you to easily change those values. If you change the getter methods and use a contructor to set the values.
Thanks for your reply,
My issue is not with the Term and SearchTerm, my issue is with the inputfield in the second component. When i enter any search term in the first component that is carried to the second component but if I am entering a new seach value in the second component, that new value is not passed to the controller. Still it is taking the search parameter from the first component. What i need is when i enter the search parameter in the second component, i want the controller to get that updated value. Not the attribute value.
Ok I could solve the problem by myself. I changed the attribute definition as follows
<apex:attribute name="SearchKeyword" type="string" description="Search Keyword"/>