-
1. Help With Autocomplete
mp911de May 12, 2011 11:47 PM (in response to rread)Hi Felix,
take a look at http://community.jboss.org/wiki/richfacesautocompletecomponentbehavior.
You should use Column-Definitions for your Auto-Complete as described in the article. Additionally, I think the Suggestion-Signature should be:
public List<IEntTest> search(Object input)
{
String prefix = (String) input;
...
}
Best regards,
Mark
-
2. Re: Help With Autocomplete
rread May 13, 2011 10:02 AM (in response to mp911de)that part i know, but what i am interested in is that when i select a option it automatically redirects me to another page, sending either the id or a instances of IEntTest
i have this but it does not fill my needs
<rich:autocomplete id="descPrueba" minChars="2" value="#{searchBean.id}" autocompleteMethod="#{searchBean.search}" var="result">
<h:inputHidden value="#{result.id}" id="ID" visible="false"/>
<h:outputText value="#{result.descripcion}"/>
<h:commandLink value="#{result.descripcion}" action="/test/edit.xhtml" />
</rich:autocomplete>
i would like it do be on the selection of the element instead on the commandlink action
-
3. Re: Help With Autocomplete
rread May 13, 2011 5:52 PM (in response to rread)In the end i come up with this but there is still something wrong cause the testEditBean does not resieve the data send by the command link
<rich:autocomplete id="descTest" minChars="2" autocompleteMethod="#{searchBean.search}" var="result">
<h:commandLink value="#{result.desc}" action="/test/edit.xhtml" >
<f:setPropertyActionListener value="#{result}" target="#{testEditBean.data}"/>
</h:commandLink>
</rich:autocomplete>
public class TestData implements Serializable {
String id;
String desc;
String value;
<getter and setters acording to Java Bean Standard>
public boolean commit(){
<Commits the data of test>
}
}
@ManagedBean
@RequestScoped
public class TestEditBean implements Serializable {
private TestData data;
<getter and setter for data>
public boolean commit(){
data.commit();
}
}
-
4. Re: Help With Autocomplete
ilya_shaikovsky May 15, 2011 11:50 AM (in response to rread)you should realize that autocomplete is Input component and the only way you could convert submitted String to some object by using JSF converters.
and if need built-in selection of value-label type consider rich:select usage.
-
5. Re: Help With Autocomplete
rread May 16, 2011 10:32 AM (in response to rread)My Requirements are these,
i have a autocompletes who keeps seaching in a database by a description, wich the user is putting in.
once he select the one he wants from what the autocompletes brings, it must automatically redirect him
to another page with either the object selected or the id of the object selected, wich must be stored in a bean for the second page to use.
Example :
User A wants enters the first page called search.xhtml
he has a autocomplete who seachers for a item by a description, he starts to fill in the discription,
as he writes the description the autocompletes, show him a list of possible object that fit that description.
Onces he sees the one he wants in the list, he select it, and he is the redirected automatically to
the edit.xhtml page, wich uses a editBean which was filled withe the object selected.