-
1. Re: Rich Faces Suggestion Box fetch value ??
dx89b Dec 30, 2010 7:58 AM (in response to mahi101987)can you post an example of do you want to do , because i don't know what you means with "some other "
-
2. Re: Rich Faces Suggestion Box fetch value ??
mahi101987 Dec 30, 2010 8:06 AM (in response to dx89b)Like i mean
when i click a radio button in my page , i want the suggestion box to fetch values of say "Name" criteria
and when i click another radio button in the page , now i want suggestion box to retrieve data of say "Age" criteria.
I hope You understood this
Thanks
Mahendra
-
3. Re: Rich Faces Suggestion Box fetch value ??
dx89b Dec 30, 2010 8:19 AM (in response to mahi101987)yes , maybe i have a solution bean-side
using radio button you can set a parameter inside the bean.
now you can crate a set and a get like
setFetchValue
and
getFetchValue
like this
getFetchValue(){
switch(radio_button_value){
case 1:return getName();
case 2:return getAge();
//and so on
}
}
in the same way you can create the set
in the suggestionbox you call
fatchValue="#{mybean.fatchValue}"
i think that this can work but i don't have time to test it
-
4. Re: Rich Faces Suggestion Box fetch value ??
mahi101987 Dec 30, 2010 9:04 AM (in response to dx89b)Yeah thanks will check that out ,
By the way i have another question
After selecting a particular value from the suggestion list , how can i get that selected value back to my java bean ?
Thanks
Mahendra
-
5. Re: Rich Faces Suggestion Box fetch value ??
dx89b Dec 30, 2010 9:27 AM (in response to mahi101987)i'm sorry but before i was in a mistake because
this is the correct way to call this
h:inputText id="input_X" value="#{myBean.fatchValue}" />
rich:suggestionbox for="input_X" fetchValue="#{result.fetchValue}"
suggestionAction="#{myBean.autocomplete}"
usingSuggestObjects="true"
var="result"
>
in your autocomplete you have to set the radio_button_value on each item of the list because if not fetchValue="#{result.fetchValue}" return you the deflaut value of the case of.
-
6. Re: Rich Faces Suggestion Box fetch value ??
mahi101987 Dec 30, 2010 9:31 AM (in response to dx89b)Could You Please Elaborate
Thanks
Mahendra
-
7. Re: Rich Faces Suggestion Box fetch value ??
ilya_shaikovsky Jan 3, 2011 10:39 AM (in response to mahi101987)use a4j:support on onselect and pass the property you need using f:setPropertyActionListener to the bean.
-
8. Re: Rich Faces Suggestion Box fetch value ??
mahi101987 Jan 3, 2011 10:51 AM (in response to ilya_shaikovsky)Hi Ilya ,
Sorry to ask this ,
That was a reply to which question
If it was for the question on how to bring back the selected suggestion value back to the bean then i have one doubt
I am doing the same way as you have suggested but for putting a value into the target attribute of the f:setPropertyActionListener i am sending a value of the same object used in the suggestion list .
But this value is becoming null
anyway to overcome this
Thanks
Mahendra
-
9. Re: Rich Faces Suggestion Box fetch value ??
ilya_shaikovsky Jan 3, 2011 10:55 AM (in response to mahi101987)please add your current code.
-
10. Re: Rich Faces Suggestion Box fetch value ??
mahi101987 Jan 3, 2011 11:24 AM (in response to ilya_shaikovsky)I am displaying an object value in the suggestion list
say i have a person object , and i am displaying the person name in the suggestion list .
Here i am able to view the person name
but when i trying to set the same person name which i have selected into another variable , the problem is i am getting the previous selected person value as null
the f:setProperty Action Listenet tag is also present within the rich suggestion tag.
Image is attached for the sample code
AnyIdea on how to solve the question asked in the first post ?
Thanks
Mahendra