Skip to Content

WebDynpro - Input Field is no highlighted

I created two Views. One view, it was called NavigationView, contains all buttons.The other view, it was called PlanView, contains InputFields. I want to display the error message and highlighted the input field when the "Save" button is pressed and some of the input field is empty.

There is following code in method onActionSave() of NavigationView:

IWDNodeElement element = wdContext.currentContextElement().getElement();

String displayname = element.getAttributeAsText("name");

if (displayname == null || displayname.equals("")) {

IWDAttributeInfo attributeInfo = element.node().getNodeInfo().getAttribute("name");

this.messageManager.reportContextAttributeMessage(

element,

attributeInfo,

IMessageMaintenace.T_ENTER_NAME,

null,

false);

}

The attributes of element keep values of all input fields in the PlanView.

After executing this source code, the error message is displayed on the user interface in the Web browser but the input field that is linked with the invalid context attribute is no highlighted.

Is there any way to highlighted the input field?

Regards,

Krasimira

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 03:03 PM

    This line looks strange to me,

    IWDNodeElement element = wdContext.currentContextElement().getElement();

    I can't access this method in sr1 dev studio. Are you sure you are getting the right element? Try wdContext.currentContextElement() if the attribute name is in the context node and just wdContext.currentBlahElement() if the attribute is in the blah node.

    Highlighting the input fields works like a dream for us, but we use the raiseInvalidContextAttributeException method, accessing the message pool messages through wdComponentAPI.getTextAccessor().getText().

    We also find webdynpro might be picky about capitalization, so if your attribute is named Name, it gives an exception

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 03:54 AM

    Hi Krasimira ,

    To highlight a inputfield or any UIElement in a view you can do the following.

    1. In the wdModifyView method first you need to create an intance of the UIElement.

    Ex: input1=(InputField)view.getElement("inputfieldID");

    (declare Input1 as a static global variable)

    2.You can use the variable input1 in any action or method and type the following in that action/method.

    input1.requestFocus();

    The above call will place the control onto the respective

    UIElement.

    Regards,

    Anilkumar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.