7 Replies Latest reply on Dec 5, 2007 10:08 PM by atta707

    wordWarp for  TextInput

      i m working on a chat application, i have problem for TextInput.... as i m using TextInput as a user to enter their messages.....if when user enter long text then it should be warped to next line.......but it is not doing so... and i cannot got any wordWarp property for TextInput control... and one more thing i cannot use TextArea fot this.....as it makes prob for me in some other issues.

      so please is there any way to set wordwarp fot TextInput??

      Thanks in advance
        • 1. Re: wordWarp for  TextInput
          atta707 Level 2
          No. Unless, of course, you're willing to subclass it or create a new component.

          • 2. Re: wordWarp for  TextInput
            Clark_Kent101 Level 1
            Why wouldn't you be able to use a TextArea? I know you've said it would cause problems but I'm trying to decipher what would be more difficult, trying some hacky way of getting word wrap to work with a TextInput, or dealing with some of those 'other' issues when using a TextArea.
            • 3. Re: wordWarp for  TextInput
              What problems would a TextArea cause? Text Areas are awesome! If you have a problem with them, you have a problem with me. ;)

              If you tell me the issue with the TextArea option, I may be able to help.
              • 4. Re: wordWarp for  TextInput
                shrimusic Level 1
                i m using textArea instead of inputText...... for NOW.
                i explain what is the prob i m facing using this textArea...... user enter the message to send in textArea...... and there is a button "send", there are two events can happen.....1. they may click on send, 2. they may hit "Enter key"... right!!
                if they click mouse on "send" button then there is no prob.
                if they hit "enter" key........ then message commonely send as per code..... but u know what happnes if u have curson in textArea and u hit "enter" key.... it takes the cursor to next line...........means after sending the message......the cursor stays at second line......(as this not happen if we use inputText).....

                this is what real thing.......

                hope u may help me...
                • 5. Re: wordWarp for  TextInput
                  atta707 Level 2
                  That's easy!

                  listen for keyDown or keyUp events, call the code to send the message when you get the enter key code, 13.

                  • 6. Re: wordWarp for  TextInput
                    shrimusic Level 1
                    thnx for your response,
                    but, as u said... i m tracking the send button on KeyDown event with 13 code of enter key... and it is working fine... the problem is not that one......!
                    see after u enter a message in text area.. the u hit "enter" key.. then according to our keydown code...... it takes the text whatever entered in text area for further processes..... but after hitting the enter key... cursor remains in "TextArea"...which makes cursor to move to next line...leaving first line blank....while u try this with "inputText"... that dont do this......it sets the cursor again to begning of first line.........

                    i think u got mine prob
                    please help me
                    • 7. Re: wordWarp for  TextInput
                      atta707 Level 2
                      I'm afraid i don't fully understand the problem. As far as I've understood if you call event.preventDefault() once you've handled the enter key it should work. Please post some code if it's possible.