Comments on: ADF 11g Rich Faces: focus on field after button press or PPR – Including JavaScript in PPR response and ClientListeners (Client Side programming in ADF Faces Rich Client Components Part 2) https://technology.amis.nl/2008/01/04/adf-11g-rich-faces-focus-on-field-after-button-press-or-ppr-including-javascript-in-ppr-response-and-clientlisteners-client-side-programming-in-adf-faces-rich-client-components-part-2/ Friends of Oracle and Java Tue, 03 Mar 2015 09:19:43 +0000 hourly 1 http://wordpress.org/?v=4.1.1 By: Bhargav https://technology.amis.nl/2008/01/04/adf-11g-rich-faces-focus-on-field-after-button-press-or-ppr-including-javascript-in-ppr-response-and-clientlisteners-client-side-programming-in-adf-faces-rich-client-components-part-2/#comment-5117 Fri, 29 Jul 2011 15:55:03 +0000 http://technology.amis.nl/blog/?p=2771#comment-5117 Hi,

I used code @ http://manieshsailoz.blogspot.com/2010/04/how-to-set-focus-using-javascript-and.html for setting focus on a component after tab out & it works fine.

In my second usecase I have around 20 inputText field & one single valuechangelistener for all. In this listener based on certain condition I want to throw exception & after exception want to highlight the field which caused the exception. What I observe using above code is the focus is moved to next component as I tab out. If I don’t throw the exception then the setFocus is working fine. Its only after throwing exception the focus is not set correctly.

Any suggestions ?

Thanks,
Bhargav

]]>
By: venusa https://technology.amis.nl/2008/01/04/adf-11g-rich-faces-focus-on-field-after-button-press-or-ppr-including-javascript-in-ppr-response-and-clientlisteners-client-side-programming-in-adf-faces-rich-client-components-part-2/#comment-5116 Thu, 03 Mar 2011 20:14:26 +0000 http://technology.amis.nl/blog/?p=2771#comment-5116 The method:
public void commandButton1(ActionEvent actionEvent) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service =
(ExtendedRenderKitService)Service.getRenderKitService(facesContext,
ExtendedRenderKitService.class);
UIComponent ip = facesContext.getViewRoot().findComponent(“inputText2″);
String clientId = ip.getClientId(facesContext);
service.addScript(facesContext,
“setFocusId(‘”+clientId+”::content’);”);
}
work ok.
Thank.

]]>