on 03-23-2007 10:25 AM
Hi all,
I am using a DropdownByIndex UI Element whose texts attribute is bound to an attribute called <i>STEXT</i> which is inside a value node called <i>STATE</i>. Since this field is mandatory , I have to show some error message and set focus to this field . Using the following code , I am able to show the message but am unable to set focus to this field . Any help will be appreciated and points will be awarded
IWDAttributeInfo attributeInfoState = null;
attributeInfoState = this.wdContext.nodeState().getNodeInfo().getAttribute("stext");
if ((strState==null) || (strState.length()==0))
{
msgMgr.reportContextAttributeMessage(wdContext.nodeState().getStateElementAt(0),attributeInfoState,IMessagePersDet_Comp.CHECK__MANDATORY__MSG,new Object[]{"State"},true);
}
Hi,
You want ot set the focus to ur dropdownbyindex element right? For this create a global static boolean flag;
and the onAction of your button
if (wdContext.node<bindtodropdownbyindex>().getLeadSelection() == -1) {
flag = true;
} else {
flag = false;
}
and then write following code in wdDoModify....
if (flag) {
IWDDropDownByIndex dri =
(IWDDropDownByIndex) view.getElement("DropDownByIndex1");
dri.requestFocus();
flag = false;
}
Do reward point if it helps.
Abhinav Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.