Re: [flexcoders] TitleWindow.title won't update from a setter

2010-04-23 Thread Srinivas S.M
Hi Nick,

Try below and see whether it works

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

_iFormID = value;


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

}

Thanks
Srinivas

On Tue, Apr 20, 2010 at 3:07 PM, Nick Middleweek n...@middleweek.co.ukwrote:



 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

  



Re: [flexcoders] TitleWindow.title won't update from a setter

2010-04-21 Thread Alex Harui
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 n...@middleweek.co.uk 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


Re: [flexcoders] TitleWindow.title won't update from a setter

2010-04-21 Thread Nick Middleweek
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 aha...@adobe.com 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 n...@middleweek.co.uk 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
  



Re: [flexcoders] TitleWindow.title won't update from a setter

2010-04-21 Thread Alex Harui
Interesting.  Try calling validateNow after addPopUp.


On 4/21/10 2:55 AM, Nick Middleweek n...@middleweek.co.uk 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 aha...@adobe.com 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 n...@middleweek.co.uk 
http://n...@middleweek.co.uk  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


Re: [flexcoders] TitleWindow.title won't update from a setter

2010-04-21 Thread Nick Middleweek
Alex,

That has fixed it but has now made me realise I'm initialising my private
var _iFormID : String = ;

And the first time I was opening the Popup, I was setting the .iFormID = ,
so the setter was *not* getting called. I'm now initialising it to null and
it's working fine...


Thanks for your help...


Nick




On 21 April 2010 18:09, Alex Harui aha...@adobe.com wrote:



 Interesting.  Try calling validateNow after addPopUp.



[flexcoders] TitleWindow.title won't update from a setter

2010-04-20 Thread Nick Middleweek
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