Bound NSTextField displays Selection Placeholder instead of Null Placeholder

  • Hello,

      this is must be embarrassingly simple, still I can't figure out what I'm
    doing wrong this time.

    I have an NSTextField bound to some NSString property via the selection proxy of
    an array controller. When the property value is nil, the field displays the
    selection placeholder, not the null placeholder. Why?

    When I bind the field to the object directly (not via controller), I get the
    null placeholder. Are the controllers not capable of doing this?

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
  • On Jul 30, 2012, at 1:36 AM, Markus Spoettl wrote:

    > Hello,
    >
    > this is must be embarrassingly simple, still I can't figure out what I'm doing wrong this time.
    >
    > I have an NSTextField bound to some NSString property via the selection proxy of an array controller. When the property value is nil, the field displays the selection placeholder, not the null placeholder. Why?
    >
    > When I bind the field to the object directly (not via controller), I get the null placeholder. Are the controllers not capable of doing this?

    This is because the controller has no selection. When working with a controller, whether it has a selection or not is dominant. Your first line of attack is to determine why the controller has no selection...

    HTH,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
  • On 7/30/12 4:54 PM, Keary Suska wrote:
    >> I have an NSTextField bound to some NSString property via the selection
    >> proxy of an array controller. When the property value is nil, the field
    >> displays the selection placeholder, not the null placeholder. Why?
    >>
    >> When I bind the field to the object directly (not via controller), I get
    >> the null placeholder. Are the controllers not capable of doing this?
    >
    >
    > This is because the controller has no selection. When working with a
    > controller, whether it has a selection or not is dominant. Your first line of
    > attack is to determine why the controller has no selection...

    No, the controller does have a valid selection and other fields bound to other
    keypaths of the same controller/selection (in other words same object, because
    it's a single-object selection) do show values.

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
  • On Jul 30, 2012, at 10:32 AM, Markus Spoettl wrote:

    > On 7/30/12 4:54 PM, Keary Suska wrote:
    >>> I have an NSTextField bound to some NSString property via the selection
    >>> proxy of an array controller. When the property value is nil, the field
    >>> displays the selection placeholder, not the null placeholder. Why?
    >>>
    >>> When I bind the field to the object directly (not via controller), I get
    >>> the null placeholder. Are the controllers not capable of doing this?
    >>
    >>
    >> This is because the controller has no selection. When working with a
    >> controller, whether it has a selection or not is dominant. Your first line of
    >> attack is to determine why the controller has no selection...
    >
    > No, the controller does have a valid selection and other fields bound to other keypaths of the same controller/selection (in other words same object, because it's a single-object selection) do show values.

    Maybe I didn't understand what you are saying. As far as NSTextField is concerned, nil and empty string are roughly the same, so if you have the "placeholder" value specified, that value will show for nil as well as empty. If you have specified that, and clear it, do you get the null value placeholder?

    Best,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
  • On 7/30/12 10:46 PM, Keary Suska wrote:
    >> No, the controller does have a valid selection and other fields bound to
    >> other keypaths of the same controller/selection (in other words same
    >> object, because it's a single-object selection) do show values.
    >
    >
    > Maybe I didn't understand what you are saying. As far as NSTextField is
    > concerned, nil and empty string are roughly the same, so if you have the
    > "placeholder" value specified, that value will show for nil as well as empty.
    > If you have specified that, and clear it, do you get the null value
    > placeholder?

    The problem I have is that a nil string property value causes the NSTextField to
    show the No-Selection-Placeholder instead of the Null-Value-Placeholder. I am
    binding the NSTextField value to the "selection" proxy object of the array
    controller (I also tried object controller, it behaves the same). The selection
    is valid and not empty. I also tried custom, binding-defined placeholders, it is
    still showing the wrong placeholder.

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
previous month july 2012 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