You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Greg Brown (JIRA)" <ji...@apache.org> on 2010/07/11 03:30:50 UTC

[jira] Created: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Make ListView selectedItem, etc. notifying properties
-----------------------------------------------------

                 Key: PIVOT-569
                 URL: https://issues.apache.org/jira/browse/PIVOT-569
             Project: Pivot
          Issue Type: Improvement
          Components: wtk
            Reporter: Greg Brown
            Priority: Minor
             Fix For: 2.0


These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.

Note that they should only fire when selectMode == SINGLE.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897499#action_12897499 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

After some additional thought, I think that explicit listener methods for these events is the right approach. It is more consistent with existing events, and, more importantly, these events are not redundant - they simply represent a different use case.

For example: ListView selection listeners must currently listen for selectedRangesChanged() even when the list is in single-select mode. A selectedItemChanged() event would probably make a lot more sense to those callers, since multiple ranges will never be selected. 

Another (existing) example is TextInputTextListener - this interface contains an ostensibly redundant textChanged() method that is called any time the text input's text changes. Callers could listen for charactersInserted() and charactersRemoved() directly, but this wouldn't be as convenient. The selectedRangesChanged() event in ListViewSelectionListener and TableViewSelectionListener behaves similarly.

Given that there are existing similar examples, and that tying selectedItemChanged() directly to selectedIndexChanged() would result in spurious events (when the selected index changes indirectly due to a model change), I think I would recommend not using an annotation here.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown reassigned PIVOT-569:
--------------------------------

    Assignee: Todd Volkert  (was: Greg Brown)

Assigning to Todd for TreeView.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-569:
-----------------------------

    Fix Version/s: 2.1
                       (was: 2.0)

Prototyping this feature revealed some design issues that need to be considered, so I am moving this to 2.1.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Priority: Minor
>             Fix For: 2.1
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897377#action_12897377 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

Now that I think about this more, I am wondering if an annotation might not be the right approach. The annotation implies that whenever the selected index change event is fired, the selected item change event will also be fired. However, there are cases when that may not be correct. Selected index and selected item changes are only 1:1 when the selected index is changed explicitly, or the selected item itself is deleted and the selected index is reset to -1. Otherwise, the actual selected item does not change, so an event would be incorrect.

Another down side to the annotation is that there is no actual selectedItemChanged() method a caller can implement. Callers could only be notified of this event via a bean monitor property change event. That may not be convenient, and it is not consistent with the rest of the framework.



> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-569:
-----------------------------

    Fix Version/s: 2.0
                       (was: 2.1)

> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-569:
-----------------------------

    Priority: Major  (was: Minor)

> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897147#action_12897147 ] 

Michael Allman commented on PIVOT-569:
--------------------------------------

I did this for a subclass of ListButton.  I just added an event listener for selectedIndexChanged in the constructor that dispatches a selectedItemChanged event from there.  Upon review, I should probably be checking for inequality of the selected items before firing the event in case equal objects exist at different indices of the list.

If you set up ListView to dispatch selectedItemChanged can you do that for ListButton, too?

> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897232#action_12897232 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

Yes, we'll be doing this for all data-driven components (ListButton, ListView, Spinner, TableView, and TreeView).


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899472#action_12899472 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

Resolved for ListButton, Spinner, and SuggestionPopup.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown reassigned PIVOT-569:
--------------------------------

    Assignee: Greg Brown  (was: Todd Volkert)

> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899509#action_12899509 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

Resolved for ListView and TableView.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (PIVOT-569) Make ListView selectedItem, etc. notifying properties

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown reassigned PIVOT-569:
--------------------------------

    Assignee: Todd Volkert

As discussed, this might be best implemented using an annotation that creates a dependency association between properties (e.g. "fire 'selectedItem' change events whenever 'selectedIndex' changes).


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.