[flexcoders] Re: geting info of a user who has loged in

2009-01-12 Thread valdhor
I use PHP and WebORb for PHP so anything I show will use that.
Please do not ask for a tutorial using something else.
There should be enough here for you to extrapolate for use with any
language.

This is a quick and dirty example that hard codes things. In a real
application
I would loosely couple everything with events.

My Flex project is set up with a couple of folders called components and
ValueObjects.

The main Application file (login_example.mxml):

http://www.adobe.com/2006/mxml";
layout="absolute" xmlns:view="components.*"
 applicationComplete="doApplicationComplete()">
 
 
 
 
 
 
 


This has a view stack for each view - Admin and Home. There are also a
couple of functions.
doApplicationComplete is called on applicationComplete event and
instantiates the login
window. doLogin is called from the login component if login is
successful. It poulates the
userCredentials variable of the Admin component.

==
components/Home.mxml:

http://www.adobe.com/2006/mxml";>



This is just a container for the background of the login window at
startup.

==
components/login.mxml:

http://www.adobe.com/2006/mxml";
layout="absolute" title="Login Form"
 creationComplete="PopUpManager.centerPopUp(this)"
initialize="onInitialize()">
 
 
 
 
 
 
 
 
 
 
 
 
 
 


This is the login window. It has a form with username and password
fields. The login
button invokes the remoteObject with these fields. If these fields are
in the database
then the string "Success" will be returned and the doLogin function in
the main
application will be invoked.

==
components/Admin.mxml:

http://www.adobe.com/2006/mxml"; width="100%"
height="100%"
 creationComplete="onCreationComplete()">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


This is the Admin component. It gets instantiated when the login is
successful. The
userCredentials variable will be populated from the main application
file (In the doLogin
function). This component will then invoke the remoteObject call to get
the userInfo
and when the result comes back, populate each of the TextInput items.

==
ValueObjects/UserCredentials.as:
package ValueObjects
{
 [RemoteClass(alias="UserInfo.Classes.UserCredentials")]
 [Bindable]
 public class UserCredentials
 {
 //instance variables
 private var _username:String;
 private var _password:String;

 //accessor methods
 public function get username():String {return _username;}
 public function get password():String {return _password;}

 //mutator methods
 public function set username(username:String):void {_username =
username;}
 public function set password(password:String):void {_password =
password;}
 } // end class
}//end package

This object holds the user credentials (username and password) to be
sent to the server.

==
ValueObjects/UserInfo.as:

package ValueObjects
{
 [RemoteClass(alias="UserInfo.Classes.UserInfo")]
 [Bindable]
 public class UserInfo
 {
 //instance variables
 private var _username:String;
 private var _password:String;
 private var _firstname:String;
 private var _lastname:String;
 private var _email:String;

 //accessor methods
 public function get username():String {return _username;}
 public function get password():String {return _password;}
 public function get firstname():String {return _firstname;}
 public function get lastname():String {return _lastname;}
 public function get email():String {return _email;}

 //mutator methods
 public function set username(username:String):void {_username =
username;}
 public function set password(password:String):void {_password =
password;}
 public function set firstname(firstname:String):void {_firstname
= firstname;}
 public function set lastname(lastname:String):void {_lastname =
lastname;}
 public function set email(email:String):void {_email = email;}
 } // end class
}//end package

This object holds the user info returned by the server.

==

That's it for the Flex code.

Next up, the PHP side...

On the PHP side I have a UserInfo folder inside the Services folder of
WebORB.
Inside this folder I have a Classes folder to hold the value object

RE: [flexcoders] Re: geting info of a user who has loged in

2009-01-12 Thread Tracy Spratt
We will not write your application for you.  Well I will, at my hourly
rate, contact me off list if you want to hire me.

 

If you want any more help from me you will need to show what you are
doing.

 

To start with, post your login HTTPService declaration code and your
result handler code. 

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of johndoematrix
Sent: Monday, January 12, 2009 4:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: geting info of a user who has loged in

 

am sorry for sounding naive and inexperienced, but i am stack. i have
read thru all the solutions suggested but have failed. please can
someone help with a small tutorial on how to do this. i know am asking
for too much but please help. thanks

 



[flexcoders] Re: geting info of a user who has loged in

2009-01-12 Thread johndoematrix
am sorry for sounding naive and inexperienced, but i am stack. i have
read thru all the solutions suggested but have failed. please can
someone help with a small tutorial on how to do this. i know am asking
for too much but please help. thanks



[flexcoders] Re: geting info of a user who has loged in

2009-01-08 Thread valdhor
For simplicity's sake, I would add a public var to your Admin
component and populate it with pop.username_txt.text:

viewstack1.selectedChild = admin;
admin.username = pop.username_txt.text;

In your Admin component's creationComplete handler, you would have
another RemoteObject call to gather user data for the user that was
passed above.

I would recommend reading some tutorials about how to use ColdFusion
and Flex (I don't use ColdFusion - I use PHP):

http://flexcf.com/tutorials
http://www.adobe.com/devnet/coldfusion/articles/data_app.html
http://www.adobe.com/devnet/flex/articles/coldfusionflex_part1.html
http://tutorial512.easycfm.com/




--- In flexcoders@yahoogroups.com, "stinasius"  wrote:
>
> hi this is my the login code functionality am using that i got from
> flex cookbook example and works perfect.

[snip]

> on the admin page there are three text components "username, passsword
> and email address" which are populated with info of the user who has
> logged in. thats where am stuck(how to populate the text components
> with the info upon successful login)
>




[flexcoders] Re: geting info of a user who has loged in

2009-01-08 Thread stinasius
hi this is my the login code functionality am using that i got from
flex cookbook example and works perfect.

"login.mxml"

http://www.adobe.com/2006/mxml";
layout="absolute" title="Login Form">

   [Event(name="loginSuccessful", type="flash.events.Event")] 







   
 














  







"mainApp.mxml"


http://www.adobe.com/2006/mxml";
layout="absolute" xmlns:view="components.*">













 



on the admin page there are three text components "username, passsword
and email address" which are populated with info of the user who has
logged in. thats where am stuck(how to populate the text components
with the info upon successful login)



[flexcoders] Re: geting info of a user who has loged in

2009-01-08 Thread valdhor
John

Please post the code you have for the login functionality. I can use
that to show you how to do the info bit.


--- In flexcoders@yahoogroups.com, "johndoematrix" 
wrote:
>
> please guys help me out here.
>




[flexcoders] Re: geting info of a user who has loged in

2009-01-08 Thread johndoematrix
please guys help me out here.



[flexcoders] Re: geting info of a user who has loged in

2009-01-08 Thread johndoematrix
hi am using rpc(remote object). do you mind showing a simple example
on how to go abt this. one other thing, am using states so when one
logs in and its successful, the state changes and they can view thier
information like username, password, email and can edit it. thanks



Re: [flexcoders] Re: geting info of a user who has loged in

2009-01-06 Thread Haykel BEN JEMIA
If you implemented le login functionality, then you should have some
mechanism (httpservice, rpc ...) to exchange data with the server to send
login info and get a response back. Just use the same mechanisms to send a
request and get the data back.

Haykel Ben Jemia

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




On Tue, Jan 6, 2009 at 10:44 AM, johndoematrix wrote:

>   yes i have implemented the login functionality and its working. nw i
> am faced with the issue of showing the details of the logged in user.
> any help?
>
>  
>


[flexcoders] Re: geting info of a user who has loged in

2009-01-06 Thread johndoematrix
yes i have implemented the login functionality and its working. nw i
am faced with the issue of showing the details of the logged in user.
any help?



[flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread Jason B
yes just pass the info back to the httpservice 
maybe this example will help you 
http://blog.flexexamples.com/2007/10/29/passing-parameters-to-an-httpservice/

you call the httpservice upon login button clicked
login.send();

and then the httpservice provider passes the login to your backend code





{name.text}

 
{password.text}















John Doe";

?>



--- In flexcoders@yahoogroups.com, "johndoematrix" 
wrote:
>
> the example shown there using the datagrid's selecteditem to populate
> the textinputs. is there a way of populating them without the need of
> a datagrid, combobox or list based selected item? like when i sign in
> i can view my profile based on my userid and username used to signin.
> thanks
>




RE: [flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread Tracy Spratt
How have you implemented your login functionality?

Tracy

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of johndoematrix
Sent: Monday, January 05, 2009 11:00 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: geting info of a user who has loged in

 

the example shown there using the datagrid's selecteditem to populate
the textinputs. is there a way of populating them without the need of
a datagrid, combobox or list based selected item? like when i sign in
i can view my profile based on my userid and username used to signin.
thanks

 



[flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread johndoematrix
the example shown there using the datagrid's selecteditem to populate
the textinputs. is there a way of populating them without the need of
a datagrid, combobox or list based selected item? like when i sign in
i can view my profile based on my userid and username used to signin.
thanks



[flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread Jason B
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html





[flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread johndoematrix
any example on how to actually do this? it would be of great help. thanks



[flexcoders] Re: geting info of a user who has loged in

2009-01-05 Thread Jason B
You'll need an httpservice to get info to and from your backend language


--- In flexcoders@yahoogroups.com, "johndoematrix" 
wrote:
>
> hi guys, i have a database with user info like username, password,
> firstname, lastname, email and so on... so i created a flex login such
> that a user is prompted to login and if login is successful he/she is
> shown a page with their details from database.. how can i do that..
> the login works but i would like to pull the info of the user who
> logged in from the database and show it to them. thanks
>