You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Harbs (JIRA)" <ji...@apache.org> on 2013/02/27 14:57:13 UTC

[jira] [Commented] (FLEX-33414) Null textInput in ComboBox

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

Harbs commented on FLEX-33414:
------------------------------

Personally, my preference would actually be to change:
" if (textInput)..." 
to
if (!textInput)
   return;

That limits the amount of code indent, but this is not really the code style of the Flex SDK in general...
                
> Null textInput in ComboBox
> --------------------------
>
>                 Key: FLEX-33414
>                 URL: https://issues.apache.org/jira/browse/FLEX-33414
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: ComboBox
>    Affects Versions: Adobe Flex SDK Previous, Apache Flex 4.9.0
>            Reporter: Harbs
>            Priority: Minor
>              Labels: easy
>
> commitProperties does a check that textInput in not bull, but at the end of the function assumes it's not null:
>         // Clear the TextInput because we were programmatically set to NO_SELECTION
>         // We call this after super.commitProperties because commitSelection might have
>         // changed the value to NO_SELECTION
>         if (selectedIndexChanged && selectedIndex == NO_SELECTION)
>             textInput.text = "";
> I have a situation where textInput was null and caused an error there.
> I propose moving the code up into the scope of the check for textInput like this:
>     override protected function commitProperties():void
>     {        
>         // Keep track of whether selectedIndex was programmatically changed
>         var selectedIndexChanged:Boolean = _proposedSelectedIndex != NO_PROPOSED_SELECTION;
>         
>         // If selectedIndex was set to CUSTOM_SELECTED_ITEM, and no selectedItem was specified,
>         // then don't change the selectedIndex
>         if (_proposedSelectedIndex == CUSTOM_SELECTED_ITEM && 
>             _pendingSelectedItem == undefined)
>         {
>             _proposedSelectedIndex = NO_PROPOSED_SELECTION;
>         }
>         
>         super.commitProperties();
>         
>         if (textInput)
>         {
>             if (maxCharsChanged)
>             {
>                 textInput.maxChars = _maxChars;
>                 maxCharsChanged = false;
>             }
>             
>             if (promptChanged)
>             {
>                 textInput.prompt = _prompt;
>                 promptChanged = false;
>             }
>             
>             if (restrictChanged)
>             {
>                 textInput.restrict = _restrict;
>                 restrictChanged = false;
>             }
>             
>             if (typicalItemChanged)
>             {
>                 if (typicalItem != null)
>                 {
>                     var itemString:String = LabelUtil.itemToLabel(typicalItem, labelField, labelFunction);
>                     textInput.widthInChars = itemString.length;
>                 }
>                 else
>                 {
>                     // Just set it back to the default value
>                     textInput.widthInChars = 10; 
>                 }
>                 
>                 typicalItemChanged = false;
>             }
>             // Clear the TextInput because we were programmatically set to NO_SELECTION
>             // We call this after super.commitProperties because commitSelection might have
>             // changed the value to NO_SELECTION
>             if (selectedIndexChanged && selectedIndex == NO_SELECTION)
>                 textInput.text = "";
>         }
>         
>     }    

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I fixed the code in ComboBox.as in the Flex source code, but it appears that it's still running off the compiled libs.
Did you recompile via a ant main and then repackage an SDK (and/or copied the right bits over to  your SDK folder)?

> What's the recommended workflow for testing changes in the source?
Basically what I do:
1. change
2. build
3. run mustella tests (usually subset or just checkin tests)
4. package new sdk
5. use new sdk

It's possible to "passage" up the compiled SDK onto itself or you don't have to repackage but that's probably a bit risky and means you ave to be very careful what you check in.

Hope that helps,
Justin


Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Posted by Harbs <ga...@gmail.com>.
Right. I guess it did not sink in yet… ;-)

I'm still getting my feet wet here…

Thanks

On Feb 27, 2013, at 10:08 PM, Frédéric THOMAS wrote:

> Did you followed what Carol said ?
> 
> cd develop
> ant
> cd develop/ide/flashbuilder
> ant make-sdk
> 
> In FlashBuilder
> Add the develop branch as an sdk
> File -> Import -> Existing Project into Workspace -> Select
> develop/frameworks/projects as the root directory -> Select mx, core,
> frameworks and textLayout
> In your FlashBuilder project, Properties -> Flex Build Path -> Add Project
> and add mx, core, frameworks and textLayout
> 
> 
> With IntelliJ, I have to reload the SDK in order to make it take the modifications.
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Wednesday, February 27, 2013 8:45 PM
> To: dev@flex.apache.org
> Subject: Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox
> 
> Can anyone give pointers on how to fix issues on my machine?
> 
> I fixed the code in ComboBox.as in the Flex source code, but it appears that it's still running off the compiled libs.
> 
> What's the recommended workflow for testing changes in the source?
> 
> Thanks,
> Harbs
> 


Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Posted by Frédéric THOMAS <we...@hotmail.com>.
Did you followed what Carol said ?

cd develop
ant
cd develop/ide/flashbuilder
ant make-sdk

In FlashBuilder
Add the develop branch as an sdk
File -> Import -> Existing Project into Workspace -> Select
develop/frameworks/projects as the root directory -> Select mx, core,
frameworks and textLayout
In your FlashBuilder project, Properties -> Flex Build Path -> Add Project
and add mx, core, frameworks and textLayout


With IntelliJ, I have to reload the SDK in order to make it take the 
modifications.

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Wednesday, February 27, 2013 8:45 PM
To: dev@flex.apache.org
Subject: Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Can anyone give pointers on how to fix issues on my machine?

I fixed the code in ComboBox.as in the Flex source code, but it appears that 
it's still running off the compiled libs.

What's the recommended workflow for testing changes in the source?

Thanks,
Harbs


Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Posted by Frédéric THOMAS <we...@hotmail.com>.
As Carol said:


-----Message d'origine----- 
From: Harbs
Sent: Wednesday, February 27, 2013 8:45 PM
To: dev@flex.apache.org
Subject: Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Can anyone give pointers on how to fix issues on my machine?

I fixed the code in ComboBox.as in the Flex source code, but it appears that 
it's still running off the compiled libs.

What's the recommended workflow for testing changes in the source?

Thanks,
Harbs


Re: [jira] [Commented] (FLEX-33414) Null textInput in ComboBox

Posted by Harbs <ga...@gmail.com>.
Can anyone give pointers on how to fix issues on my machine?

I fixed the code in ComboBox.as in the Flex source code, but it appears that it's still running off the compiled libs.

What's the recommended workflow for testing changes in the source?

Thanks,
Harbs