Interesting.  Try calling validateNow after addPopUp.

On 4/21/10 2:55 AM, "Nick Middleweek" <[email protected]> wrote:






Hi,

When tracing the setter, it is definately getting called. I'm currently just 
trying to set this.title from the iFormID setter.

Here's my setup...

I have an MXML ArrayCollection with the CreateVendorDialog component inside of 
the Array so it's created but not displayed (not sure if this is goood practice 
but I picked it up along somewhere :) The component ID="createVendor")

In my main Application I have a controlbar with two buttons, "Create Vendor" 
and "Create Vendor from iForm", they both call the same function but one passes 
an extra string.

private function createVendorDialog(iFormID : String = "") : void
{
   createVendor.iFormID = iFormID;
   PopupManager.addPopUp(createVendor);
   //createVendor.title  = "test";
}

The iFormID setter is getting called and this.title is being set but it's not 
rendering. The only way I can get it working is to put this code in the 
TitleWindow MXML component but that's a bit hacky isn't it?...

<mx:TitleWindow
                title = "{(iFormID.length > 0) ? 'Create Vendor by iForm' : 
'Create Vendor'}"
.
.
.
 />

Perhaps I need to take a step back somewhere?...


Thanks,
Nick



On 21 April 2010 07:39, Alex Harui <[email protected]> wrote:





Are you sure your setter is getting called?  If so, when is it called?  Maybe 
it is being called inside commitProperties after super.commitProperties.



On 4/20/10 3:07 PM, "Nick Middleweek" <[email protected] 
<http://[email protected]> > wrote:






Hi,

I've got a small MXML Component based on TitleWindow which I'm opening with 
PopupManager that has a setter and getter called iFormID.

In the setter I have this code...

public function set iFormID ( value : String ) : void
{
    if ( _iFormID == value )
        return;

    _iFormID = value;


    if(iFormID.length > 0)
    {
        this.title = "Create Vendor";
    }
    else
    {
        this.title = "Create Vendor by iForm";
    }

}


I am find that the title remains blank, but then if I close the PopUp and open 
it again, the last value the .title should have been is now visible...

Is there some a refresh issue with TitleWindow.title?

If I set the .title outside of the component, after I've used PopupManager, 
then it's set as expected but I want to control the .title from the setter 
function.


Does anyone have an idea what I should be doing?

I've also tried setting a dirty_flag, calling invalidateProperties() and 
setting the .title from within commitProperties() but no joy there either...


Thanks for any help...
Nick






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to