You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Sandro Martini (JIRA)" <ji...@apache.org> on 2011/07/27 02:25:10 UTC

[jira] [Commented] (PIVOT-694) Improvement in ListButton clear() method

    [ https://issues.apache.org/jira/browse/PIVOT-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071454#comment-13071454 ] 

Sandro Martini commented on PIVOT-694:
--------------------------------------

Hi, in my Test application (Pivot694, the latest version has to be committed), with the following patch (reported here) seem to solve the problem.

Someone can confirm to me that this new behavior could be right (if needed I could commit it as soon as possible) ? 
Telol me something, thank you very much.

Note: the latest verion of Pivot694 has to be committed because I'm using it to verify what the clear() method on mahy components do, to have more consistency between components.

Bye,
Sandro


### Eclipse Workspace Patch 1.0
#P wtk
Index: src/org/apache/pivot/wtk/ListButton.java
===================================================================
--- src/org/apache/pivot/wtk/ListButton.java	(revision 1142425)
+++ src/org/apache/pivot/wtk/ListButton.java	(working copy)
@@ -772,6 +772,9 @@
         if (selectedItemKey != null) {
             setSelectedItem(null);
         }
+        
+        if (selectedIndex > -1)
+            setSelectedIndex(-1);
     }
 
     /**


> Improvement in ListButton clear() method
> ----------------------------------------
>
>                 Key: PIVOT-694
>                 URL: https://issues.apache.org/jira/browse/PIVOT-694
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 2.0
>         Environment: Pivot 2.0
> Win 7
>            Reporter: Luiz Gustavo Stábile de Souza
>            Assignee: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: listButton problem.png
>
>
> I'm having problems with ListButton.
> When I try to clean a ListButton the last text selected before remains selected, even with no item in the ListData of the ListButton.
> I tried listButton.clear() and listButton.getListData().clear(), but with none of this I can scape the problem.
> I debugged the application, and the listData of the ListButton is clear after getListData().clear(), but the last selected text remains showing.
> See attached image.
> Perhaps listButton.setButtonData(null)  should be performed in ListButton#clear().
> Cheers

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira