This content has been marked as final.
Show 5 replies
-
1. Re: set focus programmatically
nbelaevski Mar 27, 2009 9:59 PM (in response to elf)Hello,
Have you checked HTML output? Is onshow rendered? Moreover, I'm not sure whether rich:element function can be correctly resolved in value expression. Can you please clarify why do you need expression: does MODAL_MANE_ELEMENT (modal name element, probably a typo in the code?) refer to variable that should be resolved to value when panel is rendered? -
2. Re: set focus programmatically
elf Mar 28, 2009 3:35 AM (in response to elf)Its my typo.
MODAL_NAME_ELEMENT - is ID of inputText on ther modalForm.
I tried to use:mp.setValueExpression("onshow", eF.createValueExpression(eC, "#{rich:element('" + MODAL_NAME_ELEMENT + "')}.focus()", String.class));
andmp.setOnshow("#{rich:element('" + MODAL_NAME_ELEMENT + "')}.focus()");
In first variant my server said me that rich:element function is not correct.
In second, modalPanel did not appear on UI. Sever said there is no error. Without this code everything works fine.
Please, helpr me. How can I correctly put focus in inputText field programmatically when modalPanel appear. -
3. Re: set focus programmatically
nbelaevski Mar 28, 2009 10:20 AM (in response to elf)Call rich:element function directly: http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/apidoc/org/richfaces/function/RichFunction.html#element(java.lang.String)
-
4. Re: set focus programmatically
nbelaevski Mar 28, 2009 10:21 AM (in response to elf)mp.setOnshow(RichFunction.element(MODAL_NAME_ELEMENT) + ".focus()");
-