Skip to Content
avatar image
Former Member

Input field UI properties customization.

Can anybody tell me how to customize the dimensions of input field UI element. With my requirement I cannot go for TextEdit element as it cannot support the requestFocus() method to bring the cursor when user clicks on the button. The height and width properties are not editable. How else can I customize the dimensions.

Kind Regards

Srinivas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 19, 2007 at 08:37 AM

    hi,

    oops this is strange but if you write the same code of requestFocus() in wdDoInot(), it will give you cursor in textedit,

    so if you can go ahead with wdinit(), then it will solve the problem,

    regards

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      That nice!

      How you get access to UI control in wdDoInit???

      The better option is to use

      IWDViewController.requestFocus(
        IWDNodeElement nodeElement, 
        IWDAttributeInfo attribute
      ) 
      

      where element and attribute correspond to element and attribute displayed IWDInputField and IWDViewController is in fact wdControllerAPI of view. Worth to mention that this method may be called from any controller code like wdDoInit or button action handler.

      Valery Silaev

      SaM Solutions

      http://www.sam-solutions.net

  • avatar image
    Former Member
    Apr 19, 2007 at 08:13 AM

    Hi Srinivas,

    As far I know, TextEdit do support requestFocus() method. You can use as follows in doModifyView() method.

    TextEdit te = (TextEdit) view.getElement("name");

    te.requestFocus();

    For Input field, you can directly change width property but not height property.

    Thanks.

    Best Regards,

    Shiva

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Shiva Kumar,

      Thanks for your reply. I tried your code:

      TextEdit te = (TextEdit) view.getElement("name");

      te.requestFocus();

      It doesn't have any effect when I click the button. I still wonder, how should I relate the user action with the doModify method. Because the cursor has to be placed in the textedit area upon user action.

      Thanks and Regards

      Srinivas

  • avatar image
    Former Member
    Apr 19, 2007 at 08:20 AM

    Hai ,

    You can resize the input field by using size property,

    but yu can't change the height of the input field.

    regards,

    Naga

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Srinivas,

      Say you are displaying "MyAttribute" attribute from "MyNode" node.

      Then put the following in <b>button action handler</b>:

      final IWDNode myNode = wdContext.node<MyNode>();
      wdControllerAPI.requestFocus(
        myNode.getCurrentElement(), 
        myNode.getNodeInfo().getAttribute("MyAttribute")
      );
      

      Valery Silaev

      SaM Solutions

      http://www.sam-solutions.net

      Message was edited by:

      Valery Silaev

  • avatar image
    Former Member
    Apr 19, 2007 at 09:00 AM

    Hi Srinivas,

    You can do the following:

    1. Define a static variable of type IWDTextEdit at end of the View Implementation.

    //@@begin others
    static IWDTextEdit l_TE;
    //@@end

    2. In wdDoModifyview write this.

    if(firstTime)

    {
    	l_TE = (IWDTextEdit)view.getElement("<ID of Text Edit UI element>");
    		
    }

    3.In your action for the button, write this.

    wdContext.currentContextElement().setText_edit("<Add Your Notes Here>");
    l_TE.requestFocus();

    Text_edit : Context bind to value property of TextEdit UI Element.

    Hope it helps.

    Regards,

    Alka.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 19, 2007 at 08:10 AM

    hi Shrinivas,

    try putting width property of 100% or 50%, it will alter the width of input field.

    same way you can adjust that in matrix layout by setting matrillayout propery's width in terms of %

    sure it will work

    regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 19, 2007 at 09:04 AM

    Hi Srinivas,

    Follow the steps below to get focus to TextEdit.

    1. Declare static variable and initialize to false.

    2. On click of button, make it true

    3. In modify view, check if variable is true, use requestFocus() method.

    Note: TextEdit control gets focus but cursor will not be placed in the control and thus user needs to click on the control to enter text. Therefore this approach still fails.

    Best Regards,

    Shiva

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 19, 2007 at 09:06 AM

    Sorry for the bad advice .. 😔

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 19, 2007 at 09:16 AM

    Hai,

    you can create a context variable of type iwdtextedit,

    in wdDomodify(){

    wdContext.currentContextElement().setteUI((IWDTextEdit)view.getElement("textedit"));

    }

    in button action

    wdContext.currentContextElement().getGg().requestFocus();

    but this will also highlight the text edit not cursor placed in.

    regards,

    Naga

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks for the patience. But the problem still persists. I <b>can't</b> make the cursor to be in the text edit area on user action.

      Maybe I need to open a note.

  • Apr 19, 2007 at 11:36 AM

    Hi Sirinvas,

    Have a Look at Size,Height,width properties of your Input Field.

    Regards,

    'Ramganesan K.

    Add comment
    10|10000 characters needed characters exceeded