This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 23, 2011, 10:58 AM
1 Posts

can I change focus (tab order) from server side script?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: tab order
  • Replies: 1
 on EditBox.onchange event I wrote this script 
var vusr=database.getView("usr\\taxcode")
var doc:NotesDocument = vusr.getDocumentByKey(getComponent("usr_taxcode1").getValue());
getComponent("usr_lastname1").setValue(doc.getItemValue("usr_lastname"));
getComponent("usr_firstname1").setValue(doc.getItemValue("usr_firstname"));
getComponent("usr_email1").setValue(doc.getItemValue("usr_email"));
getComponent("usr_password1").setValue(doc.getItemValue("usr_password"));
getComponent("usr_born_on1").setValue(doc.getItemValue("usr_born_on"));
 
now I need to add something like 
 
if ( doc.getItemValue("usr_lastname")!="") {getComponent("usr_born_on1").focus()}
 
but in javax.faces.component.UIComponent (getComponent return) I have no focus() method
 
so: can I set focus on SSJS
Feb 23, 2011, 12:21 PM
40 Posts
Re: can I change focus (tab order) from server side script?
Setting focus is a client side action, so there is no SSJS equiv. to do that. What you would need to do is write an onComplete to your event's partial refresh that sets the focus using standard CSJS.  You have to be careful to remember that the onComplete code is created and sent to the browser in the refresh that happened before the event executes, so you can't set what control to focus from inside the event, or you'll always be a "refresh behind."  The way around that is to send information back in a hidden input or the like with the ID that you want to set focus to, read that and use dojo.byId to get the field and then set focus to it.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal