Results 1 to 3 of 3

Thread: TextField as ContentPanel Header tool has text selection issues

  1. #1

    Default TextField as ContentPanel Header tool has text selection issues

    When I add a TextField<String> to a ContentPanel header using insertTool(textField, 0), the text fieldappears and functions normally, except that no selection highlighting is happening. Selecting on focus, or selecting with the mouse or keyboard fails to hightlight the text, but the text is selected (for example, selecting two characters with the keyboard and clicking delete does delete two characters as expected).

    In addition, the blinking text cursor does not appear when the field is clicked on (the cursor is an text i-beam cursor, btw), but it does appear when text is actually typed. The cursor does not move with the selection either by keyboard or mouse.

    One thing that could be contributing to the problem is the height of the TextField, which is greater than the height of the containing element (the ContentPanel header). I tried setting the TextField height, but that is being ignored, perhaps because of the text style. What controls the height of a TextField?

    Any help on why this is happening would be most welcome.
    Thanks!

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    The header has disabled the textselection. You need to enable it again.

    cp.getHeader().disableTextSelection(false);

    You need to call this after rendering. So best would be to add a Render event listener to the contentpanel and do this action in there.

  3. #3

    Default

    Quote Originally Posted by sven View Post
    The header has disabled the textselection. You need to enable it again.

    cp.getHeader().disableTextSelection(false);

    You need to call this after rendering. So best would be to add a Render event listener to the contentpanel and do this action in there.
    Sven,

    Thanks! That was exactly what I needed!

Similar Threads

  1. Replies: 2
    Last Post: 26 May 2011, 12:57 AM
  2. Replies: 0
    Last Post: 14 May 2010, 6:58 AM
  3. [CLOSED] ContentPanel's header text selection
    By ypfamily in forum Ext GWT: Bugs (2.x)
    Replies: 3
    Last Post: 2 Jul 2009, 12:19 PM
  4. Center ContentPanel Header Text
    By alanqueiroz in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 10 Feb 2009, 5:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •