[flexcoders] Maintaining Login Data in Flex

2009-01-25 Thread stinasius
Hi guys i came across a very nice post on "Maintaining Login Data in
Flex" and since i was working on a project that required
authentication using a coldfusion backend and a database, this post
caught my eye. how do use the following class to maintain login data
and access it from anywhere in my application. here is the like to the
tutorial
"http://www.anujgakhar.com/2007/11/07/maintaining-login-data-in-flex/";
and here is the class

"UserInfo.as"

package classes.UserInfo
{
public class UserInfo{
private static var myUserName:String = "";
private static var myFullName:String = "";
private static var myEmail:String = "";

public static function get UserFullName():String{
return UserInfo.myFullName;
}
public static function set 
UserFullName(param:String):void{
UserInfo.myFullName = param;
}
public static function get UserName():String{
return UserInfo.myUserName;
}
public static function set UserName(param:String):void{
UserInfo.myUserName = param;
}
public static function get Email():String{
return UserInfo.myEmail;
}
public static function set Email(param:String):void{
UserInfo.myEmail = param;
}
public static function getInstanceMemento():Object{
var o:Object = {
myUserName: UserInfo.myUserName,
myFullName: UserInfo.myFullName,
myEmail: UserInfo.myEmail
};
return o;
}
public static function 
setInstanceMemento(param:Object):void{
UserInfo.myUserName = param.myUserName;
UserInfo.myFullName = param.myFullName;
UserInfo.myEmail = param.myEmail;
}
}
}



Re: [flexcoders] Repeater Selected Index

2009-01-25 Thread Haykel BEN JEMIA
If tab2 is selected then you should see the content of tab2. If you are
seeing the content of tab1, then it seems like after refresh you are putting
the data of tab1 in tab2. What happens when you select the other tabs when
you are in this situation after refresh? Are the tabs displaying the correct
data? How are you creating the tabs and what are you doing on refresh?

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com




On Sat, Jan 24, 2009 at 7:30 AM, Jaswant  wrote:

>   I am developing an AIR application with dynamic tab using
> TabNavigator. Each Tab is rendered by using repeater. Suppose my
> repeater has 3 items then application would have 3 tabs let Tab1 Tab2,
> Tab3.
>
> My application gets refreshed automatically after each 5 seconds. Its
> working very well. Now the problem is suppose I have selected tab 2
> and application gets refreshed, then tab2 will be selected, yes it is
> okay. But in tab 2 the data of tab1 is being displayed. so what should
> I do so if tab2 is selected on application refresh then the data of
> only tab two should be displayed. That is if tab index 2 is selected
> than repeater index should also be 2.
>
> Please help!!
>
> jaswant
>
>  
>


RE: [flexcoders] Re: Explain "override public function"

2009-01-25 Thread Alex Harui
If your override is exactly as you posted:
override public function set data(value:Object):void { }

then the override never passed the value to the base class implementation so 
the value wasn't stored and the debugger will read from the "get data()" 
function and show you a null.

In the base class the setter does this:

_data = value;

And the getter does this:

return _data;

where _data is defined as:

private var _data:Object;

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tracy Spratt
Sent: Sunday, January 25, 2009 8:14 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Explain "override public function"

I don't know the circumstances, but sometimes the framework passes a null to 
set data.  It is not uncommon to see a test for null in the override. I know 
that there are some "buffer" renderers created, perhaps they get a null?

Also to the OP, do you still need an answer to "Explain 'override public 
function'"?  It is basic OOP syntax, but I'll give it a few sentences if you 
need.

Tracy Spratt
Lariat Services

Flex development bandwidth available


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Paul Andrews
Sent: Sunday, January 25, 2009 10:54 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Explain "override public function"


- Original Message -
From: "Paul Andrews" mailto:paul%40ipauland.com>>
To: mailto:flexcoders%40yahoogroups.com>>
Sent: Sunday, January 25, 2009 10:44 AM
Subject: Re: [flexcoders] Re: Explain "override public function"

> - Original Message -
> From: "malik_robinson" 
> mailto:Malik_Robinson%40yahoo.com>>
> To: mailto:flexcoders%40yahoogroups.com>>
> Sent: Sunday, January 25, 2009 5:44 AM
> Subject: [flexcoders] Re: Explain "override public function"
>
>
>>
>> Hi,
>>
>> That helps a bit. When I set a breakpoint after "override public
>> function set data(value:Object):void { } I get a value of null as if
>> nothing is there. So you say the list class sets the data property so
>> any idea what would cause it to be null for me? I am returning some XML
>> from the server and it works fine no problem, but I am just confused on
>> where to go look. My tree is pretty basic

I forgot to say - if your data attribute is null there's a problem with the
dataprovider.

Try using the default renderer if you still have trouble with yours. The
Tree control in the docs has an excellent example, so work your data into
that until you find the problem.

>>
>> > dataProvider="{myTree}"
>> itemRenderer="com.abc.views.renderers.MyRenderer"
>> labelField="@name" />
>>
>> I am confused on how and where the data gets automagically passed to
>> this Renderer.
>
> The tree controll will take the data from the data provider and set the
> data
> property of the item renderer as required when it is instantiated. It's
> not
> really something that you have to really consider. All your item renderer
> needs to know is that it has a data property and that is what it should
> use
> when rendering.
>
>> -Malik

snip