Sensible NSMultipleValuesMarker placeholder alternatives?

  • Hello,

      I have a UI where the user selects objects and edits them in a separate
    (popup) window. The window opens, displays various combo boxes, text fields, and
    so on all bound to the model objects through an NSArrayController via the
    selection proxy. Also, when the editing window opens up, the topmost edit field
    is made first responder.

    When one object is being edited, this UI works well - nothing unexpected
    happens. However, when multiple objects are being edited, and those objects have
    different values, the text fields and combo boxes display the multiple values
    placeholder.

    Of course that's expected but it's not intuitive for the user. I find that a
    list of values (those of the different objects selected) displayed in a "nice
    way" would be more helpful, but let's accept that for the moment.

    What is more problematic is that if an edit field which displays the placeholder
    looses first responder, the model values are set to nil.

    Now, together with my default UI behavior that the topmost field becomes first
    responder when the window opens, it effectively kills the existing model values
    for that field because the user can't close the window without existing the text
    field.

    I think there should be a conscious decision and action involved by the user
    before the text values for a multi-selection get changed. Much like the behavior
    of a checkbox button. Tabing through the UI and killing all values along the
    path surely isn't very sensible.

    That doesn't seem to be possible using bindings, I'm wondering how others solve
    this?

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
  • On Jul 16, 2012, at 23:34 , Markus Spoettl wrote:

    > What is more problematic is that if an edit field which displays the placeholder looses first responder, the model values are set to nil.

    There are 2 bindings options that should let you control this behavior: "allows editing multiple values selection" and "conditionally sets editable".
  • On 7/17/12 9:35 AM, Quincey Morris wrote:
    > On Jul 16, 2012, at 23:34 , Markus Spoettl wrote:
    >
    >> What is more problematic is that if an edit field which displays the
    >> placeholder looses first responder, the model values are set to nil.
    >
    > There are 2 bindings options that should let you control this behavior: "allows
    > editing multiple values selection" and "conditionally sets editable".

    I'm not sure I follow. I do want multiple selection editing, just in a more
    user-friendly fashion. Those options prevent multi-selection multi-value
    editing, right? What am I not getting?

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
  • On Jul 17, 2012, at 02:43 , Markus Spoettl wrote:

    > I'm not sure I follow. I do want multiple selection editing, just in a more user-friendly fashion. Those options prevent multi-selection multi-value editing, right? What am I not getting?

    Ah, I see. I don't think you aren't getting anything. :)

    There's an inherent UI ambiguity in your approach, because there's no detectable difference between a text field that's empty to indicate "no change" and a text field that's empty to indicate "zero-length string". In iTunes, for example, when you're editing info for a multiple selection, there's a checkbox next to each field to disambiguate this. BUT, this only works because it's in a modal dialog -- simply dirtying a field doesn't take effect till you click Next or OK.

    I think you have two sub-problems:

    1. Detect when the text field is really being edited. That probably means you can't bind the field through the array controller directly to your data model. Instead, bind it to an intermediate property in (say) your window controller, and add window controller logic to determine what that intermediate property represents, depending on the selection state of the array controller and the editing state of the text field.

    2. Decide when to commit changes from the intermediate property to the data model. For example, perhaps if there are multiple values selected, you need to show an "Apply" button in the popup, to avoid making it too easy to for the user to do the wrong thing.

    OTOH, if you're not happy with the generic multiple-values display anyway, maybe you should redesign the popup window and its behavior. NSArrayController is likely too much of a black box (and a blunt instrument) to be useful for a subtle UI.
  • On Tue, Jul 17, 2012, at 10:13 AM, Quincey Morris wrote:
    > 1. Detect when the text field is really being edited. That probably means
    > you can't bind the field through the array controller directly to your
    > data model. Instead, bind it to an intermediate property in (say) your
    > window controller, and add window controller logic to determine what that
    > intermediate property represents, depending on the selection state of the
    > array controller and the editing state of the text field.

    Or you could add a delegate to the text field that responds to
    -control:textDidChange:. Unless the delegate receives that message, the
    text field has not been edited by the user.

    --Kyle Sluder
  • On 7/17/12 7:58 PM, Kyle Sluder wrote:
    > On Tue, Jul 17, 2012, at 10:13 AM, Quincey Morris wrote:
    >> 1. Detect when the text field is really being edited. That probably means
    >> you can't bind the field through the array controller directly to your
    >> data model. Instead, bind it to an intermediate property in (say) your
    >> window controller, and add window controller logic to determine what that
    >> intermediate property represents, depending on the selection state of the
    >> array controller and the editing state of the text field.
    >
    > Or you could add a delegate to the text field that responds to
    > -control:textDidChange:. Unless the delegate receives that message, the
    > text field has not been edited by the user.

    Thanks guys for the input!

    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