Skip to Content
author's profile photo Former Member
Former Member

Is there a way to focus on a checkbox/radio button which failed validation?

Is there a way to set focus to check box or radio button which failed the validation check?

I heard that there is no suitable UI element for this purpose. I think the only way is put either invisable image or label UI element beside the group of radio button or check box. When there is an error, you can make the UI element becoming visiable?

Is this a bug or something just lacking in WDP?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 25, 2004 at 10:04 AM

    Hi Yew

    Yes you can,

    I tried this with the standard Radiobutton element, I

    created two of them and I mapped the 'selectedkey'

    element property of both the radio buttons to a value

    attribute undex the Context.

    Inorder to report errors I used the reportContextAttributeMessage method of the IWDMessageManager class

    Sample code

    IWDMessageManager messgMan = wdComponentAPI.getMessageManager();
    messgMan.reportContextAttributeMessage(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute("key"),IMessageApp1.SOME,null,false);
    

    Here "key" is the value attribute to which the

    selectedKey property of the elements are bound.

    IMessageApp1.SOME defines the error message which I have associated with radio button validation.

    Once the error is diplayed on the screen , the message

    can be clicked to obtain a focus on the element that has

    invalid inputs. I used a dummy action attached to a

    button to invoke the code

    check this link for IWDMessageManager usage

    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5375848e41aa4c86219c80acd054df/frameset.htm

    Regards

    Pran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2004 at 06:11 AM

    Hi Pran Bhas,

    Yes, i am using

    IWDMessageManager messgMan = wdComponentAPI.getMessageManager();

    messgMan.reportContextAttributeMessage(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute("key"),IMessageApp1.SOME,null,false);

    But it only focus on the radio button when the user click on the error message. As i know if we use the same API apply to a input text UI element, it will draw a red color outline in the input text. Is there anyway to achieve similar effect for radio button ?

    Thanks

    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.