-
1. Re: suggestionbox dynamically
nbelaevski Jan 8, 2010 8:30 AM (in response to danielft)Hi,
Expression string should be "#{myBean.autocomplete}".
-
2. Re: suggestionbox dynamically
danielft Jan 9, 2010 12:11 PM (in response to nbelaevski)thanks for replying me, but i think this is not the problem, i concat the "#{" and "}" in the method that create the expression.
it not work yet
-
3. Re: suggestionbox dynamically
scorsagg Jan 10, 2010 1:40 PM (in response to danielft)Hi,
While creating the method expression, the parameter order is wrong according to the code you have posted. it should be createMethodExpression(ctx,"#{myBean.autoComplete}",and the rest of the params....
Regards,
Srikanth
-
4. Re: suggestionbox dynamically
danielft Jan 10, 2010 2:08 PM (in response to scorsagg)i think it is ok. the faces context is my secound param, and i concat the strings to make the expression correct. -
5. Re: suggestionbox dynamically
scorsagg Jan 10, 2010 3:12 PM (in response to danielft)Sorry, that was my mistake...by oversight I did not see the other method you had posted.
But could you tell what does not happen? The event itself does not get called or the fetched value is not populated?
I assume you are adding the suggestion box component to the heirarchy of a form. Once of the reasons I have seen for the action not getting called is that the component does not have a form up in its heirarchy.
Regards,
Srikanth
-
6. Re: suggestionbox dynamically
danielft Jan 11, 2010 6:33 PM (in response to danielft)There is nothing wrong with the code i've posted.
the problem is that i was creating the input element dynamically to and it was't redering the id.
Let me explain: I want create a component that create a input and sujention in a single tag. i created the input component like this:
dsinput = (UIInput) ctx.getApplication().createComponent(UIInput.COMPONENT_TYPE); dsinput.setId(getId()+"_ds"); ...
the input was added, but withou id. Why? becase this in com.sun.faces.renderkit.html_basic.HtmlBasicRenderer .
protected boolean shouldWriteIdAttribute(UIComponent component) { String id; return (null != (id = component.getId()) && !id.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)); }
the solution? simple! i just added a prefix to the input id. it is working!
Thanks for the help!