0

How to extend the length of KONtx.dialogs.TextEntry?

Hello all,

I am using dialogs.TextEntry to input end-user's data. But I realize that there is a limit in the length of the input. The max length we can input seems to be 24 characters, which is too short.
Can anyone help clarify how to extend the length of dialogs.TextEntry ?

Many thanks in advance.
Kind regards

by
  • fo
  • Dec 24, 2009
17 Replies
  • I know there is a longer Text Entry Dialog built into the Twitter Widget, but I have not seen any documentation on that functionality in the WDK

    Anyone know when that will be available to developers? (Yahoo!)
    0
  • QUOTE (WidgetRealm @ Dec 28 2009, 01:21 PM) <{POST_SNAPBACK}>
    I know there is a longer Text Entry Dialog built into the Twitter Widget, but I have not seen any documentation on that functionality in the WDK

    Anyone know when that will be available to developers? (Yahoo!)


    Thanks very much for your reply.

    As you said that we cannot extend the length of Text Entry Dialog, what else can I use?
    What I want is:
    - click a button and it shows a keyboard on the screen
    - input a string long enough
    - show the string in a text

    Hope anyone can help.
    Many thanks in advance.
    0
  • QUOTE (shiyi @ Dec 24 2009, 02:56 AM) <{POST_SNAPBACK}>
    Hello all,

    I am using dialogs.TextEntry to input end-user's data. But I realize that there is a limit in the length of the input. The max length we can input seems to be 24 characters, which is too short.
    Can anyone help clarify how to extend the length of dialogs.TextEntry ?

    Many thanks in advance.
    Kind regards

    I'm not too familiar with the TextEntry dialog, but you could always create your own component using the Keyboard component, and display the characters somewhere that allows more than 24.
    0
  • QUOTE (Steve @ Jan 6 2010, 08:49 AM) <{POST_SNAPBACK}>
    I'm not too familiar with the TextEntry dialog, but you could always create your own component using the Keyboard component, and display the characters somewhere that allows more than 24.


    Thanks very much for your reply.

    I will try to create my own component. Meanwhile, I wish you can provide me an example code if it is possible.

    Many thanks in advance.
    0
  • QUOTE (Steve @ Jan 6 2010, 08:49 AM) <{POST_SNAPBACK}>
    I'm not too familiar with the TextEntry dialog, but you could always create your own component using the Keyboard component, and display the characters somewhere that allows more than 24.


    Hello All,

    Can any one provide me a sample code for creating a component using the Keyboard component?

    Many thanks in advance
    0
  • QUOTE (shiyi @ Jan 13 2010, 05:58 AM) <{POST_SNAPBACK}>
    Hello All,

    Can any one provide me a sample code for creating a component using the Keyboard component?

    Many thanks in advance


    Try something like this. Basically create a text box, give it a width, height, etc. Then create your keyboard, and when you receive an onValueChanged event then change the text in the text element. Is this what your looking for? This is a simple example, but should allow you to understand the basic approach, and expand on it.

    CODE
    this.text = new KONtx.element.Text({
    styles : {
    vAlign : 'top',
    (more styles: width, height, wrap, etc)
    }
    }).appendTo(this);

    var self = this;
    this.keyboard = new KONtx.control.Keyboard({
    layout : 'alphanumeric',
    // controlSize : 'small',
    styles : {
    hAlign : 'center',
    vAlign : 'bottom',
    zOrder : 100
    },
    events : {
    onValueChanged : function(event) {
    var chars = event.payload.value;
    self.text.setText(chars);
    }
    }
    }).appendTo(this);
    0
  • QUOTE (Steve @ Jan 13 2010, 06:09 AM) <{POST_SNAPBACK}>
    Try something like this. Basically create a text box, give it a width, height, etc. Then create your keyboard, and when you receive an onValueChanged event then change the text in the text element. Is this what your looking for? This is a simple example, but should allow you to understand the basic approach, and expand on it.

    CODE
    this.text = new KONtx.element.Text({
    styles : {
    vAlign : 'top',
    (more styles: width, height, wrap, etc)
    }
    }).appendTo(this);

    var self = this;
    this.keyboard = new KONtx.control.Keyboard({
    layout : 'alphanumeric',
    // controlSize : 'small',
    styles : {
    hAlign : 'center',
    vAlign : 'bottom',
    zOrder : 100
    },
    events : {
    onValueChanged : function(event) {
    var chars = event.payload.value;
    self.text.setText(chars);
    }
    }
    }).appendTo(this);



    Thanks very much for your reply and your sample code.

    Actually, what I want is to create my own component using the Keyboard component. The compenent is almost the same as TextEntryButton except to show the string in a Text instead of Button.

    Is it possible?

    Many thanks in advance.
    0
  • QUOTE (shiyi @ Jan 13 2010, 08:36 AM) <{POST_SNAPBACK}>
    Thanks very much for your reply and your sample code.

    Actually, what I want is to create my own component using the Keyboard component. The compenent is almost the same as TextEntryButton except to show the string in a Text instead of Button.

    Is it possible?

    Many thanks in advance.

    The TextEntryButton is technically writing the string to a Text field inside the button. Look in the control.inputs.js file. The TextEntryButton _createContent method has the following code which creates the text object:

    CODE
    this.valueDisplay = new KONtx.element.Text({
    id: baseID+'.valueDisplay',
    styles: vsts
    }).appendTo(this);


    However, since this is only intended to span one line there are no height or wrap properties defined for the themes of this text field.

    To better answer you question, how were you planning on allowing more characters? Did you plan on having the text box span multiple lines? Or slide to the left when it reaches the end? Etc?
    0
  • QUOTE (Steve @ Jan 13 2010, 10:11 AM) <{POST_SNAPBACK}>
    The TextEntryButton is technically writing the string to a Text field inside the button. Look in the control.inputs.js file. The TextEntryButton _createContent method has the following code which creates the text object:

    CODE
    this.valueDisplay = new KONtx.element.Text({
    id: baseID+'.valueDisplay',
    styles: vsts
    }).appendTo(this);


    However, since this is only intended to span one line there are no height or wrap properties defined for the themes of this text field.

    To better answer you question, how were you planning on allowing more characters? Did you plan on having the text box span multiple lines? Or slide to the left when it reaches the end? Etc?


    Thanks for your reply.

    What I use at moment is the KONtx.dialogs.TextEntry. I click a TextButton, it show a TextEntryDialogs, in which I can input some string. When I click OK Button, I show the string I have input in a Text I want. As there is a limitation on the characters with dialogs.TextEntry, I want to create my own component almost the same as dialogs.TextEntry or TextEntryButton(the combination maybe).

    What I want is:
    - click a TextButton, it shows the component just like the TextEntryButton do.
    - input something in this component. when I click OK button, it will get the string I have input and show the string in a Text I want.

    To allow more characters, either solution will be ok.

    Else, I have test the sample code you provided. It works very well. The only problem is I don't know how to close the Keyboard when I finish input.

    Hope you can help.
    Many thanks in advance.
    0
  • a "dialog" is not the right avenue for entering lots of text. The view inside Twitter is just as a previous poster indicated, a custom view with a keyboard and a visible text element showing what was typed. We should have more examples of keyboard related stuff in the near future.

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Jan 6 2010, 02:12 PM) <{POST_SNAPBACK}>
    a "dialog" is not the right avenue for entering lots of text. The view inside Twitter is just as a previous poster indicated, a custom view with a keyboard and a visible text element showing what was typed. We should have more examples of keyboard related stuff in the near future.


    So it is NOT possible to type more than 24 chars in dialogs.TextEntry? Emails are more than 24 symbols... and we need dialog so it can create overlay over fullscreen view. Not good at all. Any suggestions for replacement?
    0
  • QUOTE (Georgi @ Mar 26 2010, 07:44 AM) <{POST_SNAPBACK}>
    So it is NOT possible to type more than 24 chars in dialogs.TextEntry? Emails are more than 24 symbols... and we need dialog so it can create overlay over fullscreen view. Not good at all. Any suggestions for replacement?

    Correct. I'm not sure that dialogs are even intended or work in fullscreen. Create your own component with the keyboard component, and create a larger text field.

    Until the remote's with a keyboard come out, I can't see anyone wanting to type long text anyways. It would take forever.
    0
  • Is it possible to create custom dialogs at all?
    0
  • Absolutely. You can start all the way down at the Class level and build from there if you would like.
    0
  • WidgetRealm: Actually, that is not correct. Dialogs are managed by the container/dock and as such are not customizable. The dialog classes in KONtx are merely wrappers which make the low level APIs easier to handle in a pattern similar to the rest of the framework.
    0
  • QUOTE (Jeremy Johnstone @ Feb 6 2010, 01:56 AM) <{POST_SNAPBACK}>
    WidgetRealm: Actually, that is not correct. Dialogs are managed by the container/dock and as such are not customizable. The dialog classes in KONtx are merely wrappers which make the low level APIs easier to handle in a pattern similar to the rest of the framework.

    Interesting. Must explore this one.
    0
  • How to change TextEntry label (to the left of text field). It is awlays "Response". I can only change "title" and "message" properties. Any property to change label?
    0

Recent Posts

in General - Yahoo! TV Widgets