Button enabled.

  • Hi All,
    I tried and searched the list extensively for something which seems
    simple but doesnt seem to work for me.
    My nib has a simple textbox and a button,
    1) I want to bind my button to be enabled only iff their is sometext
    typed into the textbox
    2) Ideally I want as soon as I start typing into textbox it should
    call a validate method and replace the value of the allowed value.

    So say input to Textbox is "123abc" and only "abc" is valid:-
    1) Button enables as soon as something is typed into textbox
    2) As you type 123 nothing appear only abc ie the valid input appear
    in the textbox.

    *Want to achieve this through bindings, not the textbox callbacks.

    TIA,
    Miç
  • Use Custom data formatters. Read the information available at the
    following URL:

    http://developer.apple.com/documentation/Cocoa/Conceptual/
    DataFormatting/index.html?http://developer.apple.com/documentation/
    Cocoa/Conceptual/DataFormatting/Articles/CreatingACustomFormatter.html

    On Oct 16, 2007, at 11:10 AM, Michael Flack wrote:

    > Hi All,
    > I tried and searched the list extensively for something which seems
    > simple but doesnt seem to work for me.
    > My nib has a simple textbox and a button,
    > 1) I want to bind my button to be enabled only iff their is sometext
    > typed into the textbox
    > 2) Ideally I want as soon as I start typing into textbox it should
    > call a validate method and replace the value of the allowed value.
    >
    > So say input to Textbox is "123abc" and only "abc" is valid:-
    > 1) Button enables as soon as something is typed into textbox
    > 2) As you type 123 nothing appear only abc ie the valid input appear
    > in the textbox.
    >
    > *Want to achieve this through bindings, not the textbox callbacks.
    >
    > TIA,
    > Miç
    >
  • Thanks for the pointer.
    Any idea for pt 1 below(if just need to bind the NSButton enable
    property to TextField,
    to be enabled only iff atleast single character in textfield else disabled)?

    On 10/15/07, Apparao <apparao...> wrote:
    > Use Custom data formatters. Read the information available at the
    > following URL:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/
    > DataFormatting/index.html?http://developer.apple.com/documentation/
    > Cocoa/Conceptual/DataFormatting/Articles/CreatingACustomFormatter.html
    >
    >
    >
    > On Oct 16, 2007, at 11:10 AM, Michael Flack wrote:
    >
    >> Hi All,
    >> I tried and searched the list extensively for something which seems
    >> simple but doesnt seem to work for me.
    >> My nib has a simple textbox and a button,
    >> 1) I want to bind my button to be enabled only iff their is sometext
    >> typed into the textbox
    >> 2) Ideally I want as soon as I start typing into textbox it should
    >> call a validate method and replace the value of the allowed value.
    >>
    >> So say input to Textbox is "123abc" and only "abc" is valid:-
    >> 1) Button enables as soon as something is typed into textbox
    >> 2) As you type 123 nothing appear only abc ie the valid input appear
    >> in the textbox.
    >>
    >> *Want to achieve this through bindings, not the textbox callbacks.
    >>
    >> TIA,
    >> Miç
    >>
    >
    >
  • > Any idea for pt 1 below(if just need to bind the NSButton enable
    > property to TextField,
    > to be enabled only iff atleast single character in textfield else
    > disabled)?

    Implement a method in your(nib) controller class,  which will return
    bool value, based on the characters availability in the text field.

    Set the NSButton enabled properties as below:

    1. Select the Bind check box
    2. Select your controller from the Bind to: pop up
    3. Mention your bool method name in the model key path

    I didn't try this. hope it will work.

    - Apparao.

    On Oct 16, 2007, at 11:40 AM, Michael Flack wrote:

    > Thanks for the pointer.
    > Any idea for pt 1 below(if just need to bind the NSButton enable
    > property to TextField,
    > to be enabled only iff atleast single character in textfield else
    > disabled)?
    >
    > On 10/15/07, Apparao <apparao...> wrote:
    >> Use Custom data formatters. Read the information available at the
    >> following URL:
    >>
    >> http://developer.apple.com/documentation/Cocoa/Conceptual/
    >> DataFormatting/index.html?http://developer.apple.com/documentation/
    >> Cocoa/Conceptual/DataFormatting/Articles/
    >> CreatingACustomFormatter.html
    >>
    >>
    >>
    >> On Oct 16, 2007, at 11:10 AM, Michael Flack wrote:
    >>
    >>> Hi All,
    >>> I tried and searched the list extensively for something which seems
    >>> simple but doesnt seem to work for me.
    >>> My nib has a simple textbox and a button,
    >>> 1) I want to bind my button to be enabled only iff their is sometext
    >>> typed into the textbox
    >>> 2) Ideally I want as soon as I start typing into textbox it should
    >>> call a validate method and replace the value of the allowed value.
    >>>
    >>> So say input to Textbox is "123abc" and only "abc" is valid:-
    >>> 1) Button enables as soon as something is typed into textbox
    >>> 2) As you type 123 nothing appear only abc ie the valid input appear
    >>> in the textbox.
    >>>
    >>> *Want to achieve this through bindings, not the textbox callbacks.
    >>>
    >>> TIA,
    >>> Miç
    >>>
    >>
    >>
    >
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today