You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/01/27 10:12:31 UTC

[GitHub] [royale-asjs] javeiga-iest opened a new issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

javeiga-iest opened a new issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697
 
 
   Hi,
   I have a custom ListItemRender, I added a tooltip to each item:
   
   ```
   <j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:j="library://ns.apache.org/royale/jewel" 
       xmlns:js="library://ns.apache.org/royale/basic" 
       xmlns="http://www.w3.org/1999/xhtml" xmlns:mx="library://ns.apache.org/royale/mx"
       xmlns:html="library://ns.apache.org/royale/html">
   
       <fx:Script>
           <![CDATA[
               
               [Bindable]
               public function get label():String
               {                   
                   return data.label.toString();
               }
               
               [Bindable]
               public function get image():String
               {
                   return data.icon.toString();
               }
   		]]>
       </fx:Script>
       <j:beads>
           <js:ItemRendererDataBinding />
           <j:ToolTip toolTip="{label}"/>
       </j:beads>
   
       <j:HGroup itemsHorizontalAlign="itemsCenter" width="100%" >
           <j:Image src="{image}" visible="{true}"/>
       </j:HGroup>
   </j:ListItemRenderer>
   
   ```
   Our list:
   ```
      <j:List id="testList" itemRenderer="ImageListItemRenderer"  
      dataProvider="{data}" labelField="label" change="testListChangeHandler(event)">
         <j:beads>
            <j:HorizontalLayout itemsExpand="false" itemsHorizontalAlign="itemsLeft" />
         </j:beads>
      </j:List>
   
   ```
   
   Our event:
   
   ```
      private function testListChangeHandler(event:Event):void
      {
         ds.removeItemAt(event.target.selectedIndex);
      }
   ```
   
   Issue:
   When deleting an item from the dataProvider while the tooltip is visible. The bead does not disappear and remains visible.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] carlosrovira closed issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
carlosrovira closed issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] yishayw commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697#issuecomment-579142799
 
 
   
   > > I'll consider to make this a bead to have this practice accesible.
   
   Definitely.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697#issuecomment-578735159
 
 
   Hi Jose,
   
   just added a commit that will be needed to solve this issue.
   
   The removal of the tooltip must be handled in the item renderer. You can solve using the following code in your renderer:
   
   ```as3
   /**
    * listen to "itemRemoved" event dispatched from the List
    */
   override public function addedToParent():void
   {
       super.addedToParent();
   
       var view:ListView = this.itemRendererParent as ListView;
       host = view.host as List;
       IEventDispatcher(host).addEventListener("itemRemoved", handleItemRemoved);
   }
   
   /**
    * check if the renderer (item) is the current and in that case ensure remove listener and tip.
    */
   protected function handleItemRemoved(event:ItemRemovedEvent):void
   {
       if(event.item == this)
       {
           IEventDispatcher(host).removeEventListener("itemRemoved", handleItemRemoved);
           tt.removeTip();
       }
   }
   ```
   
   I'll consider to make this a bead to have this practice accesible.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697#issuecomment-579158350
 
 
   @javeiga-iest , @yishayw, you better use the new bead `ToolTipRemovalWhenItemRemoved` instead of the custom code exposed before.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
carlosrovira commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697#issuecomment-578736724
 
 
   forgot to mention that `tt` is the toolTip add `localId="tt"` (or the name you prefer for the ToolTip bead in the renderer.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] javeiga-iest commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible

Posted by GitBox <gi...@apache.org>.
javeiga-iest commented on issue #697: Jewel: Tooltip - removing controls with tooltips while tooltip text is visible
URL: https://github.com/apache/royale-asjs/issues/697#issuecomment-578772657
 
 
   thanks for the quickness!
   i will implement it to my code
   
   > Hi Jose,
   > 
   > just added a commit that will be needed to solve this issue.
   > 
   > The removal of the tooltip must be handled in the item renderer. You can solve using the following code in your renderer:
   > 
   > ```actionscript-3
   > /**
   >  * listen to "itemRemoved" event dispatched from the List
   >  */
   > override public function addedToParent():void
   > {
   >     super.addedToParent();
   > 
   >     var view:ListView = this.itemRendererParent as ListView;
   >     host = view.host as List;
   >     IEventDispatcher(host).addEventListener("itemRemoved", handleItemRemoved);
   > }
   > 
   > /**
   >  * check if the renderer (item) is the current and in that case ensure remove listener and tip.
   >  */
   > protected function handleItemRemoved(event:ItemRemovedEvent):void
   > {
   >     if(event.item == this)
   >     {
   >         IEventDispatcher(host).removeEventListener("itemRemoved", handleItemRemoved);
   >         tt.removeTip();
   >     }
   > }
   > ```
   > 
   > I'll consider to make this a bead to have this practice accesible.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services