Focus issue when deleting rows from table

Following Dr. Prakash's Creator tip about adding buttons to a table component header (actionsTop facet), I'm having the follwing issue:

After deleting a row from the table, the javascript funcion disableActions() sets the disabled property to "true" of the actionsTop buttons, but Internet Explorer complains about not being able to set the focus on a disabled element (the "Delete" button, just pressed to delete a table row and thus "owner" of the page focus). The javascript code is part of Creator's theme (formElements.js):

// This method is invoked from the onload event handler of the body

function body_setInitialFocus(){

if(this.focusID ==null){

returntrue;

}

var focusElement = document.getElementById(this.focusID);

if(focusElement !=null && focusElement.tagName !="SPAN"){

focusElement.focus();// <<<<- here is the error

}

if (window.location.href.indexOf('#') != -1){

// # char found, anchor being used. forego scrolling.

// CR 6342635.

sjwuic_ScrollCookie =null;

}

if(sjwuic_ScrollCookie !=null){

sjwuic_ScrollCookie.restore();

}

returntrue;

}

The logical thing to do is add another condition for testing the disabled state of the component. Should I manually edit this script (it's part of Creator theme)? Any workaround ideas? Please note that it works fine with Firefox 2.0

Thank you.

[2319 byte] By [antoniovl] at [2007-11-26 11:26:05]
# 1

I've modified the defaulttheme script. Changing the "<<<<" flagged line to

try {

focusElement.focus();

} catch (err) {

//

}

Did the job.

Best regards.

antoniovl at 2007-7-7 3:41:39 > top of Java-index,Development Tools,Java Tools...