i am developing a new input control whith an tabindex property.
Therfore i have an NEWINPUTHandler … which is generating the html.
i first tried to write the tabnidex from the property directly to the html tag linke <input … tabindex= ’ + m_tabindex + ’ … >
and this is working fine -
but the njx non custom controls have another tabindex in runtime than specified in the developer.
in the javadoci found that i should use the ISetCTI interface with the setCTI for tabindex but i dont know how…
simply implement the ISetCTI interface in your handler.
The setCTI method is automatically called from the HTML generator class. You could for instance have a private field to reuse the set value when generating your HTML or pass it on to your JavaScript function.
public class MYCONTROLHandler implements ISetCTI
{
...
String m_cti;
...
public void setCTI(int value) {
m_cti = "" + value;
}
...
public void generateJavaScriptForInit(....) {
// pass the m_cti on to your Java Script
}
thank you,
implementing the iSetCTI Handler is clear to me,
but how do i set my own tabindex.
are there any naming conventions to the attibute or is it linked over an datatype in the Control-Editor that the iSetCTI handler knows which tabindex i like to have.
Hi Stefan,
Maintaining directly specified tabindex values in a page can become a kind of nightmare especially for bigger layouts after some time of development. That’s why the Ajax framework helps to resolve duplicates.
Ajax controls for which the tab order can be defined, have a tabindex property. The normal, easy to maintain case is to leave the tab order to the browser. This means: The tab order is implicitely defined by the order of the controls within the page. If you look at the generated HTML, all corresponding HTML tags have simply a tabindex=1.
A tabindex=-1 means: Tabbing to this control is not allowed.
If a tabindex >= 1 is defined for the tabindex property in an Ajax controls, the HTMLGenerator resolves duplicates. The duplicates again are resolved according to the order of the controls in the page. This means: Specifying for instance tabindex=2 for 2 different controls will result in tabindex=2 and tabindex=3 in the corresponding HTML tags of the controls.
What exactly do you want to do in your custom controls?