Skip to Content
avatar image
Former Member

Focus on UI element

This seems to be a trivial question, but I couldn't find the answer.

How can you programmaticaly give an ui element the focus or at least make sure it's visible (similar to html anchors) ?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 26, 2007 at 01:45 PM

    Hi Pieter,

    You have a Ui Element like inputfield

    (a)If you want to focus this inputfield then

    IWDInputField input=(IWDInputField)view.get(id of inputfield);

    input.requestFocus();

    if you want make it visible:-

    input.setVisible(WDVisible.NONE);

    or

    input.setVisible(true);

    Regards,

    Praveen

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Yes you can do this.

      keep a global varibale,

      (a) boolean checkRequestFocus=false;

      (b)and update it true on your demand and check in wdDomodifyView , if it is true

      then call requestFocus on that element.

      Regards,

      Praveen

  • avatar image
    Former Member
    Oct 26, 2007 at 01:37 PM

    Hi Pieter,

    To control the visibility, there is a property called visible for each UI element. If u want to do it programmatically,u can use this code in wdDoModifyView method

    e.g. i m giving u the code for input field

    IWDInputField field = (IWDInputfield)view.getElement("ur element id");

    field.setVisible(true/false);

    regards

    Sumit

    Add comment
    10|10000 characters needed characters exceeded