Skip navigation
Jan Klosinski
Currently Being Moderated

[bug] TLF, SelectionManager and popup

Nov 10, 2010 8:58 AM

hi,

 

it seems that Squiggly doesn't work well with TLF SelectionManager.

 

Steps to reproducs:

1. open popup

2. close popup (don't type anything in the text input)

3. open popup

 

You should see the following error:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.
     at flashx.textLayout.edit::SelectionManager$/computeSelectionIndexInContainer()[C:\Vellum\branches\v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\edit\SelectionManager.as:827]
     at flashx.textLayout.edit::SelectionManager$/http://ns.adobe.com/textLayout/internal/2008::computeSelectionIndex()[C:\Vellum\branches\v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\edit\SelectionManager.as:1111]
     at com.adobe.linguistics.spelling.ui::SparkHighlighter/getValidFirstWordIndex()[E:\glo_lib\esg\users\ravi\squiggly\0.3\AdobeSpellingUI\src\com\adobe\linguistics\spelling\ui\SparkHighlighter.as:212]
     at com.adobe.linguistics.spelling.ui::SparkHighlighter/doSpelling()[E:\glo_lib\esg\users\ravi\squiggly\0.3\AdobeSpellingUI\src\com\adobe\linguistics\spelling\ui\SparkHighlighter.as:69]
     at com.adobe.linguistics.spelling.ui::SparkHighlighter/handleFocusIn()[E:\glo_lib\esg\users\ravi\squiggly\0.3\AdobeSpellingUI\src\com\adobe\linguistics\spelling\ui\SparkHighlighter.as:94]
     at flash.display::Stage/set focus()
     at mx.core::UIComponent/setFocus()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9544]
     at spark.components::RichEditableText/setFocus()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\RichEditableText.as:2712]
     at spark.components.supportClasses::SkinnableTextBase/setFocus()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:1116]
     at mx.managers::FocusManager/setFocus()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\FocusManager.as:597]
     at CustomPopup/reset()[C:\Documents and Settings\klosinja\Local Developer\workspaces\flashbuilder\SquigglyBugs\src\CustomPopup.mxml:22]
     at PopupBug/openPopup()[C:\Documents and Settings\klosinja\Local Developer\workspaces\flashbuilder\SquigglyBugs\src\PopupBug.mxml:17]
     at PopupBug/___PopupBug_Button1_click()[C:\Documents and Settings\klosinja\Local Developer\workspaces\flashbuilder\SquigglyBugs\src\PopupBug.mxml:26]
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12528]
     at spark.components.supportClasses::ButtonBase/keyUpHandler()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\supportClasses\ButtonBase.as:987]

 

application

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:local="*"
    minWidth="955" minHeight="600" 
    >
    
    <fx:Script>
        <![CDATA[
            import mx.core.IFlexDisplayObject;
            import mx.managers.PopUpManager;
            
            public function openPopup():void
            {
                PopUpManager.addPopUp(popup, this);
                popup.reset()
            }
        ]]>
    </fx:Script>
    
    <fx:Declarations>
        <local:CustomPopup id="popup" />
    </fx:Declarations>
    
    <s:Button label="open popup" click="openPopup()" />    
    
</s:Application>

 

CustomPopup.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    width="400" height="300"
    creationComplete="SpellUI.enableSpelling(txt, 'en_US')"
    >
    
    <fx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;
        ]]>
    </fx:Script>
    
    <fx:Script>
        <![CDATA[
            import com.adobe.linguistics.spelling.SpellUI;
            
            public function reset():void
            {
                txt.text = ;
                focusManager.setFocus(txt);
            }
        ]]>
    </fx:Script>
    
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    
    <s:TextInput id="txt" />
    
    <s:Button label="close" click="PopUpManager.removePopUp(this)" />
    
</s:Panel>

 

Any suggestions?

 

thanks,

Jan

 
Replies
  • Currently Being Moderated
    Nov 11, 2010 4:58 AM   in reply to Jan Klosinski

    TLF is not supported yet in Squiggly till the 0.4 release. We are working on the TLF integration which should fix issues like this.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2010 4:04 PM   in reply to Jan Klosinski

    Thanks for reporting this issue.  We had not yet fully tested Squiggly with TLF, so your findings are very helpful.

     

    Thanks!

     

    - Bruce, Adobe

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2011 4:26 PM   in reply to beimon

    Squiggly 0.5 was recently released with native TLF support.

     

    Please let us know if this release addresses your issues.

     

    - Bruce, Adobe

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2011 2:38 PM   in reply to beimon

    I'm running into the same problem, we're using Squiggly 0.6, however I think the problem most likely lays in the SelectionManager code. The call to tlf.getTextLine(true) can return a null value and the resulting object isn't tested to see if it is null before it's accessed.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2013 4:12 AM   in reply to KRatTurner

    I'm seeing the same thing without using squiggly - came across this when googling for issues with computeSelectionIndexInContainer.

     

    As per KRatTurner, there are specific sequences I can go through to guarantee a null textline in that function.

     

    Grrr.

     

    Will search for updates.

    G

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points