Re: [flexcoders] Passing values from popup window to MXML component

2009-11-11 Thread Funand Learning
Hi,

I have written a function and after checking the username and password, to 
toggle the buttons, but I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.

Here is the function I wrote

public function checkCredentials():void {
if(loginWin1.userInput.text == 'funandlearning'  
loginWin1.passwordInput.text == 'funandlearning')
{
Alert.show(Login Successful);
PopUpManager.removePopUp(loginWin1);
//var main:Main = new Main();
main.logout.visible = false;
}
else
{
Alert.show('Try again');
PopUpManager.removePopUp(loginWin1);
}
}

LoginPopUp contains the code for displaying on the popupwindow, and Main is 
another component which contains code for calling popup window and it contain 
other UI code for header. Is this the right way to do?

Thanks





From: Omotola Anjorin shot2f...@yahoo.com
To: flexcoders@yahoogroups.com
Sent: Mon, November 9, 2009 6:33:48 AM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

   
Yeah you can do what rohit said by adding a logout button at the same place and 
toggling the visiblity.

This way,


From you main application you can do something like this.


if(loginWin. userInput. text=='funandlearni ng'  loginWin.passwordIn 
put.text= ='funandlearning' )
{
Alert.show( Login Successful) ;
loginWin.loginButto n.visible = false
 loginWin.logoutButt on.visible = true
}

You can also use the same button but play around the text property.

Cheers



From: Rohit Sharma rohit.sharma1982@ gmail.com
To: flexcod...@yahoogro ups.com
Sent: Mon, November 9, 2009 12:21:02 PM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

  
  You can add a logout button at the same place as login button and toggle the 
visibilities of these buttons depending upon the
   state of your component.

   


On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com 
wrote:














  


 
  
 
Hello All,

I was trying to create a login Page. The page has one main MXML application 
file with couple of MXML components. The First component contains the 
following:

Component1.mxml:

?xml version=1.0 encoding=utf- 8?

width=60% height=261

mx:Script
![CDATA[
import mx.managers. PopUpManager;
import mx.controls. Alert;
import
 components.LoginPop Up;
import mx.events.CloseEven t;

public var loginWin:LoginPopUp ;

private function loginHandler( ):void {
loginWin = new LoginPopUp() ;
loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler);
PopUpManager. addPopUp( loginWin, this,true) ;
PopUpManager. centerPopUp( loginWin) ;
   
 
}

public function closeHandler( event:CloseEvent ):void
{
PopUpManager. removePopUp( loginWin) ;

}


public function checkCredentials( ):void{

   
 if(loginWin. userInput. text=='funandlearni ng'  loginWin.passwordIn 
 put.text= ='funandlearning' )
{
Alert.show( Login Successful) ;

}
else
{
Alert.show( Login Failed);
}
}
   
 

]]
/mx:Script



mx:HBox width=90% height=55 borderColor= #F85023 id=headerButtons
borderStyle= outset horizontalAlign= left verticalAlign= middle
backgroundColor= #938480
mx:Spacer width=10%/
mx:Button id=loginMain label=Login click=loginHandler ( )/
mx:Button id=logout label=LogOut /
/mx:HBox

mx:HBox width=100% height=82%
mx:HBox width=25%
 height=82% borderStyle= outset borderColor= #F85023
/mx:HBox
mx:HBox width=65% height=82% borderColor= #F85023 borderStyle= 
 outset
/mx:HBox
/mx:HBox
/mx:VBox

component2.mxml has the following code for the popup

?xml version=1.0 encoding=utf- 8?

xmlns:main= components. * layout=vertical
  title=Please login showCloseButton= true

!-- defined state to toggle between register and login
 --
mx:states
mx:State name=Register basedOn=
mx:AddChild relativeTo= {loginForm} 
 position=lastChild  creationPolicy= all
mx:FormItem label=Email
mx:TextInput id=email

RE: [SPAM] Re: [flexcoders] Passing values from popup window to MXML component

2009-11-11 Thread Tracy Spratt
What reference is null?

 

Yes, that architecture is common.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Funand Learning
Sent: Wednesday, November 11, 2009 12:07 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] Passing values from popup window to MXML
component

 

  

Hi,

I have written a function and after checking the username and password, to
toggle the buttons, but I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object
reference.

Here is the function I wrote

public function checkCredentials():void {
if(loginWin1.userInput.text == 'funandlearning' 
loginWin1.passwordInput.text == 'funandlearning')
{
Alert.show(Login Successful);
PopUpManager.removePopUp(loginWin1);
//var main:Main = new Main();
main.logout.visible = false;
}
else
{
Alert.show('Try again');
PopUpManager.removePopUp(loginWin1);
}
}

LoginPopUp contains the code for displaying on the popupwindow, and Main is
another component which contains code for calling popup window and it
contain other UI code for header. Is this the right way to do?

Thanks

 

  _  

From: Omotola Anjorin shot2f...@yahoo.com
To: flexcoders@yahoogroups.com
Sent: Mon, November 9, 2009 6:33:48 AM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

  

Yeah you can do what rohit said by adding a logout button at the same place
and toggling the visiblity.

This way,


From you main application you can do something like this.


if(loginWin. userInput. text=='funandlearni ng'  loginWin.passwordIn
put.text= ='funandlearning' )
{
Alert.show( Login Successful) ;
loginWin.loginButto n.visible = false
loginWin.logoutButt on.visible = true
}

You can also use the same button but play around the text property.

Cheers

  _  

From: Rohit Sharma rohit.sharma1982@ gmail.com
To: flexcod...@yahoogro ups.com
Sent: Mon, November 9, 2009 12:21:02 PM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

  

  You can add a logout button at the same place as login button and toggle
the visibilities of these buttons depending upon the
   state of your component.

   

On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com
mailto:funandlearni...@yahoo.com  wrote:

  

Hello All,

I was trying to create a login Page. The page has one main MXML application
file with couple of MXML components. The First component contains the
following:

Component1.mxml:

?xml version=1.0 encoding=utf- 8?

width=60% height=261

mx:Script
![CDATA[
import mx.managers. PopUpManager;
import mx.controls. Alert;
import components.LoginPop Up;
import mx.events.CloseEven t;

public var loginWin:LoginPopUp ;

private function loginHandler( ):void {
loginWin = new LoginPopUp() ;
loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler);
PopUpManager. addPopUp( loginWin, this,true) ;
PopUpManager. centerPopUp( loginWin) ;

}

public function closeHandler( event:CloseEvent ):void
{
PopUpManager. removePopUp( loginWin) ;

}


public function checkCredentials( ):void{

if(loginWin. userInput. text=='funandlearni ng' 
loginWin.passwordIn put.text= ='funandlearning' )
{
Alert.show( Login Successful) ;

}
else
{
Alert.show( Login Failed);
}
}


]]
/mx:Script



mx:HBox width=90% height=55 borderColor= #F85023
id=headerButtons
borderStyle= outset horizontalAlign= left verticalAlign=
middle
backgroundColor= #938480
mx:Spacer width=10%/
mx:Button id=loginMain label=Login click=loginHandler ( )/
mx:Button id=logout label=LogOut /
/mx:HBox

mx:HBox width=100% height=82%
mx:HBox width=25% height=82% borderStyle= outset borderColor=
#F85023
/mx:HBox
mx:HBox width=65% height=82% borderColor= #F85023
borderStyle= outset
/mx:HBox
/mx:HBox
/mx:VBox

component2.mxml has the following code for the popup

?xml version=1.0 encoding=utf- 8?

xmlns:main= components. * layout=vertical
  title=Please login

RE: [SPAM] Re: [flexcoders] Passing values from popup window to MXML component

2009-11-10 Thread Tracy Spratt
Or use states.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Omotola Anjorin
Sent: Monday, November 09, 2009 7:34 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] Passing values from popup window to MXML
component

 

  

Yeah you can do what rohit said by adding a logout button at the same place
and toggling the visiblity.

This way,

From you main application you can do something like this.


if(loginWin. userInput. text=='funandlearning'  loginWin.passwordIn
put.text= ='funandlearning')
{
Alert.show(Login Successful);
loginWin.loginButton.visible = false
loginWin.logoutButton.visible = true
}

You can also use the same button but play around the text property.

Cheers

  _  

From: Rohit Sharma rohit.sharma1...@gmail.com
To: flexcoders@yahoogroups.com
Sent: Mon, November 9, 2009 12:21:02 PM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

  

  You can add a logout button at the same place as login button and toggle
the visibilities of these buttons depending upon the
   state of your component.

   

On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com
mailto:funandlearni...@yahoo.com  wrote:

  

Hello All,

I was trying to create a login Page. The page has one main MXML application
file with couple of MXML components. The First component contains the
following:

Component1.mxml:

?xml version=1.0 encoding=utf-8?

width=60% height=261

mx:Script
![CDATA[
import mx.managers. PopUpManager;
import mx.controls. Alert;
import components.LoginPop Up;
import mx.events.CloseEven t;

public var loginWin:LoginPopUp ;

private function loginHandler( ):void {
loginWin = new LoginPopUp() ;
loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler);
PopUpManager. addPopUp( loginWin, this,true) ;
PopUpManager. centerPopUp( loginWin) ;

}

public function closeHandler( event:CloseEvent ):void
{
PopUpManager. removePopUp( loginWin) ;

}


public function checkCredentials( ):void{

if(loginWin. userInput. text=='funandlearning' 
loginWin.passwordIn put.text= ='funandlearning')
{
Alert.show(Login Successful);

}
else
{
Alert.show(Login Failed);
}
}


]]
/mx:Script



mx:HBox width=90% height=55 borderColor=#F85023
id=headerButtons
borderStyle=outset horizontalAlign=left verticalAlign=middle
backgroundColor=#938480
mx:Spacer width=10%/
mx:Button id=loginMain label=Login click=loginHandler( )/
mx:Button id=logout label=LogOut /
/mx:HBox

mx:HBox width=100% height=82%
mx:HBox width=25% height=82% borderStyle=outset
borderColor=#F85023
/mx:HBox
mx:HBox width=65% height=82% borderColor=#F85023
borderStyle=outset
/mx:HBox
/mx:HBox
/mx:VBox

component2.mxml has the following code for the popup

?xml version=1.0 encoding=utf-8?

xmlns:main=components.* layout=vertical
  title=Please login showCloseButton=true

!-- defined state to toggle between register and login --
mx:states
mx:State name=Register basedOn=
mx:AddChild relativeTo={loginForm}
 position=lastChild creationPolicy=all
mx:FormItem label=Email
mx:TextInput id=email/
/mx:FormItem
/mx:AddChild

mx:SetProperty target={loginButton} name=label
value=Register/
mx:RemoveChild target={registerLink}/

mx:AddChild relativeTo={linkSpacer} position=before
mx:LinkButton label=Return to Login
click=currentState='';this.title='Please Login'/
/mx:AddChild
/mx:State
/mx:states
mx:Script
![CDATA[
import mx.events.CloseEven t;
import mx.managers. PopUpManager;
import mx.controls. Alert;


]]
/mx:Script
mx:Form id=loginForm
mx:FormItem label=Username:
mx:TextInput id=userInput/
/mx:FormItem
mx:FormItem label=Password:
mx:TextInput id=passwordInput displayAsPassword=true/
/mx:FormItem

/mx:Form
mx:ControlBar
 mx:LinkButton 
label=Need to Register? id=registerLink

[flexcoders] Passing values from popup window to MXML component

2009-11-09 Thread Funand Learning
Hello All,

I was trying to create a login Page. The page has one main MXML application 
file with couple of MXML components. The First component contains the following:

Component1.mxml:

?xml version=1.0 encoding=utf-8?

width=60% height=261

mx:Script
![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Alert;
import components.LoginPopUp;
import mx.events.CloseEvent;

public var loginWin:LoginPopUp;

private function loginHandler():void {
loginWin = new LoginPopUp();
loginWin.addEventListener(CloseEvent.CLOSE,closeHandler);
PopUpManager.addPopUp(loginWin,this,true);
PopUpManager.centerPopUp(loginWin);

}

public function closeHandler(event:CloseEvent):void
{
PopUpManager.removePopUp(loginWin);

}


public function checkCredentials():void{

if(loginWin.userInput.text=='funandlearning'  
loginWin.passwordInput.text=='funandlearning')
{
Alert.show(Login Successful);

}
else
{
Alert.show(Login Failed);
}
}


]]
/mx:Script



mx:HBox width=90% height=55 borderColor=#F85023 id=headerButtons
borderStyle=outset horizontalAlign=left verticalAlign=middle
backgroundColor=#938480
mx:Spacer width=10%/
mx:Button id=loginMain label=Login click=loginHandler()/
mx:Button id=logout label=LogOut /
/mx:HBox

mx:HBox width=100% height=82%
mx:HBox width=25% height=82% borderStyle=outset 
borderColor=#F85023
/mx:HBox
mx:HBox width=65% height=82% borderColor=#F85023 
borderStyle=outset
/mx:HBox
/mx:HBox
/mx:VBox

component2.mxml has the following code for the popup

?xml version=1.0 encoding=utf-8?

xmlns:main=components.* layout=vertical
  title=Please login showCloseButton=true

!-- defined state to toggle between register and login --
mx:states
mx:State name=Register basedOn=
mx:AddChild relativeTo={loginForm}
 position=lastChild creationPolicy=all
mx:FormItem label=Email
mx:TextInput id=email/
/mx:FormItem
/mx:AddChild

mx:SetProperty target={loginButton} name=label 
value=Register/
mx:RemoveChild target={registerLink}/

mx:AddChild relativeTo={linkSpacer} position=before
mx:LinkButton label=Return to Login 
click=currentState='';this.title='Please Login'/
/mx:AddChild
/mx:State
/mx:states
mx:Script
![CDATA[
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
import mx.controls.Alert;


]]
/mx:Script
mx:Form id=loginForm
mx:FormItem label=Username:
mx:TextInput id=userInput/
/mx:FormItem
mx:FormItem label=Password:
mx:TextInput id=passwordInput displayAsPassword=true/
/mx:FormItem

/mx:Form
mx:ControlBar
 mx:LinkButton 
label=Need to Register? id=registerLink
click=currentState='Register';this.title='Register'
/
mx:Spacer width=100% id=linkSpacer/
mx:Button label=Login id=loginButton click=checkCredentials()/
mx:Button label=Cancel click=PopUpManager.removePopUp(this)/
/mx:ControlBar

/mx:TitleWindow

I need help in knowing how to change the login button in component1.mxml to 
logout button when the login functionaility from the popuup window is successful

Thanks.



  

Re: [flexcoders] Passing values from popup window to MXML component

2009-11-09 Thread Rohit Sharma
  You can add a logout button at the same place as login button and toggle
the visibilities of these buttons depending upon the
   state of your component.



On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning
funandlearni...@yahoo.comwrote:



 Hello All,

 I was trying to create a login Page. The page has one main MXML application
 file with couple of MXML components. The First component contains the
 following:

 Component1.mxml:

 ?xml version=1.0 encoding=utf-8?

 width=60% height=261

 mx:Script
 ![CDATA[
 import mx.managers.PopUpManager;
 import mx.controls.Alert;
 import components.LoginPopUp;
 import mx.events.CloseEvent;

 public var loginWin:LoginPopUp;

 private function loginHandler():void {
 loginWin = new LoginPopUp();
 loginWin.addEventListener(CloseEvent.CLOSE,closeHandler);
 PopUpManager.addPopUp(loginWin,this,true);
 PopUpManager.centerPopUp(loginWin);

 }

 public function closeHandler(event:CloseEvent):void
 {
 PopUpManager.removePopUp(loginWin);

 }


 public function checkCredentials():void{

 if(loginWin.userInput.text=='funandlearning' 
 loginWin.passwordInput.text=='funandlearning')
 {
 Alert.show(Login Successful);

 }
 else
 {
 Alert.show(Login Failed);
 }
 }


 ]]
 /mx:Script



 mx:HBox width=90% height=55 borderColor=#F85023
 id=headerButtons
 borderStyle=outset horizontalAlign=left verticalAlign=middle
 backgroundColor=#938480
 mx:Spacer width=10%/
 mx:Button id=loginMain label=Login click=loginHandler()/
 mx:Button id=logout label=LogOut /
 /mx:HBox

 mx:HBox width=100% height=82%
 mx:HBox width=25% height=82% borderStyle=outset
 borderColor=#F85023
 /mx:HBox
 mx:HBox width=65% height=82% borderColor=#F85023
 borderStyle=outset
 /mx:HBox
 /mx:HBox
 /mx:VBox

 component2.mxml has the following code for the popup

 ?xml version=1.0 encoding=utf-8?

 xmlns:main=components.* layout=vertical
   title=Please login showCloseButton=true

 !-- defined state to toggle between register and login --
 mx:states
 mx:State name=Register basedOn=
 mx:AddChild relativeTo={loginForm}
  position=lastChild creationPolicy=all
 mx:FormItem label=Email
 mx:TextInput id=email/
 /mx:FormItem
 /mx:AddChild

 mx:SetProperty target={loginButton} name=label
 value=Register/
 mx:RemoveChild target={registerLink}/

 mx:AddChild relativeTo={linkSpacer} position=before
 mx:LinkButton label=Return to Login
 click=currentState='';this.title='Please Login'/
 /mx:AddChild
 /mx:State
 /mx:states
 mx:Script
 ![CDATA[
 import mx.events.CloseEvent;
 import mx.managers.PopUpManager;
 import mx.controls.Alert;


 ]]
 /mx:Script
 mx:Form id=loginForm
 mx:FormItem label=Username:
 mx:TextInput id=userInput/
 /mx:FormItem
 mx:FormItem label=Password:
 mx:TextInput id=passwordInput displayAsPassword=true/
 /mx:FormItem

 /mx:Form
 mx:ControlBar
  mx:LinkButton
 label=Need to Register? id=registerLink
 click=currentState='Register';this.title='Register'
 /
 mx:Spacer width=100% id=linkSpacer/
 mx:Button label=Login id=loginButton
 click=checkCredentials()/
 mx:Button label=Cancel click=PopUpManager.removePopUp(this)/
 /mx:ControlBar

 /mx:TitleWindow

 I need help in knowing how to change the login button in component1.mxml to
 logout button when the login functionaility from the popuup window is
 successful

 Thanks.

  



Re: [flexcoders] Passing values from popup window to MXML component

2009-11-09 Thread Omotola Anjorin
Yeah you can do what rohit said by adding a logout button at the same place and 
toggling the visiblity.

This way,

From you main application you can do something like this.


if(loginWin. userInput. text=='funandlearning'  loginWin.passwordIn 
put.text= ='funandlearning')
{
Alert.show(Login Successful);
loginWin.loginButton.visible = false
 loginWin.logoutButton.visible = true
}

You can also use the same button but play around the text property.

Cheers



From: Rohit Sharma rohit.sharma1...@gmail.com
To: flexcoders@yahoogroups.com
Sent: Mon, November 9, 2009 12:21:02 PM
Subject: Re: [flexcoders] Passing values from popup window to MXML component

  
  You can add a logout button at the same place as login button and toggle the 
visibilities of these buttons depending upon the
   state of your component.

   


On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com 
wrote:














  


 
  
 
Hello All,

I was trying to create a login Page. The page has one main MXML application 
file with couple of MXML components. The First component contains the 
following:

Component1.mxml:

?xml version=1.0 encoding=utf-8?

width=60% height=261

mx:Script
![CDATA[
import mx.managers. PopUpManager;
import mx.controls. Alert;
import
 components.LoginPop Up;
import mx.events.CloseEven t;

public var loginWin:LoginPopUp ;

private function loginHandler( ):void {
loginWin = new LoginPopUp() ;
loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler);
PopUpManager. addPopUp( loginWin, this,true) ;
PopUpManager. centerPopUp( loginWin) ;
   
 
}

public function closeHandler( event:CloseEvent ):void
{
PopUpManager. removePopUp( loginWin) ;

}


public function checkCredentials( ):void{

   
 if(loginWin. userInput. text=='funandlearning'  loginWin.passwordIn 
 put.text= ='funandlearning')
{
Alert.show(Login Successful);

}
else
{
Alert.show(Login Failed);
}
}
   
 

]]
/mx:Script



mx:HBox width=90% height=55 borderColor=#F85023 id=headerButtons
borderStyle=outset horizontalAlign=left verticalAlign=middle
backgroundColor=#938480
mx:Spacer width=10%/
mx:Button id=loginMain label=Login click=loginHandler( )/
mx:Button id=logout label=LogOut /
/mx:HBox

mx:HBox width=100% height=82%
mx:HBox width=25%
 height=82% borderStyle=outset borderColor=#F85023
/mx:HBox
mx:HBox width=65% height=82% borderColor=#F85023 
 borderStyle=outset
/mx:HBox
/mx:HBox
/mx:VBox

component2.mxml has the following code for the popup

?xml version=1.0 encoding=utf-8?

xmlns:main=components.* layout=vertical
  title=Please login showCloseButton=true

!-- defined state to toggle between register and login
 --
mx:states
mx:State name=Register basedOn=
mx:AddChild relativeTo={loginForm}
 position=lastChild creationPolicy=all
mx:FormItem label=Email
mx:TextInput id=email/
/mx:FormItem
/mx:AddChild

mx:SetProperty
 target={loginButton} name=label value=Register/
mx:RemoveChild target={registerLink}/

mx:AddChild relativeTo={linkSpacer} position=before
mx:LinkButton label=Return to Login 
 click=currentState='';this.title='Please Login'/
/mx:AddChild
/mx:State
/mx:states
mx:Script
![CDATA[
import
 mx.events.CloseEven t;
import mx.managers. PopUpManager;
import mx.controls. Alert;


]]
/mx:Script
mx:Form id=loginForm
mx:FormItem label=Username:
mx:TextInput id=userInput/
/mx:FormItem
mx:FormItem label=Password:
mx:TextInput id=passwordInput displayAsPassword=true/
   
 /mx:FormItem

/mx:Form
mx:ControlBar
 mx:LinkButton 
label=Need to Register? id=registerLink
click=currentState='Register';this.title='Register'
/
mx:Spacer width=100% id=linkSpacer/
mx:Button label=Login id=loginButton click=checkCredentials( )/
mx:Button label=Cancel click=PopUpManager. removePopUp( this)/
/mx:ControlBar

/mx:TitleWindow

I need help

[flexcoders] Passing values using mx:WebService

2009-02-03 Thread m_ollman
Hiya flexcoders

Trying to pass values to a SOAP request. Having some fun :-)

Working with mx:WebService - got it working by placing the SOAP
request inside of the mx:request tag and adding the namespace in
mx:application-
xmlns:typ=http://ruleburst.com/ruleserver/9.1/rulebase/types;

(code @ EOM )

However when I try to dynamically pass selectedItem to the
mx:request they don not come through. I'm aware of adding values to
the mx:request ie. 

mx:operation name=getList
mx:request
q2{dept.selectedItem.data}/q2
q5{dept2.selectedItem.data}/q5
/mx:request
/mx:operation

but keep getting an end of file error.

Question is how do I turn the SOAP request into and mx:request request?

Thanks in advance 
rgds
martin




mx:request format=xml

typ:assess-request
   typ:session-data
  typ:list-entity entity-type=global
 typ:entity id=global_1
typ:attribute-outcome id=LL
outcome-style=attribute-only/
typ:attribute-outcome id=LC998
outcome-style=attribute-only/
typ:attribute-outcome id=AssessmentLevel
outcome-style=attribute-only/
typ:attribute-outcome id=ProcessingTime
outcome-style=attribute-only/
typ:attribute id=Q2
   typ:text-valGERM/typ:text-val
 /typ:attribute
   typ:attribute id=Q5
 typ:text-valGERM/typ:text-val
 /typ:attribute
   typ:attribute id=XYZ988
 typ:boolean-valtrue/typ:boolean-val
   /typ:attribute
/typ:entity
  /typ:list-entity
/typ:session-data
/typ:assess-request
/mx:request



RE: [flexcoders] Passing values using mx:WebService

2009-02-03 Thread Tracy Spratt
I like mxml for a lot of things, but invoking data service calls is not
one of them.  One big problem I have is that declarative binding is hard
to debug.  My pattern is this:

 

var wsOperation:Operation = ws.getList;

wsOperation.resultFormat = e4x;

var atCall:AsyncToken;

var sQ2:String = dept.selectedItem.data; // trace this value to be sure
it is good

var sQ5:String = dept2.selectedItem.data; // trace this value to be sure
it is good

var oRequest:Object = {q2 sQ2, q5: sQ5 };

atCall  = wsOperation.send(oRequest);

atCall.callId = sCallId;

...

 

Are you trying to format the SOAP request yourself?  Just pass the
correctly typed vars in the operation arguments.

 

Also, the component namespace, xmlns in the mxml tags should not have
anything to do with a WebService call.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of m_ollman
Sent: Tuesday, February 03, 2009 10:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Passing values using mx:WebService

 

Hiya flexcoders

Trying to pass values to a SOAP request. Having some fun :-)

Working with mx:WebService - got it working by placing the SOAP
request inside of the mx:request tag and adding the namespace in
mx:application-
xmlns:typ=http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types 

(code @ EOM )

However when I try to dynamically pass selectedItem to the
mx:request they don not come through. I'm aware of adding values to
the mx:request ie. 

mx:operation name=getList
mx:request
q2{dept.selectedItem.data}/q2
q5{dept2.selectedItem.data}/q5
/mx:request
/mx:operation

but keep getting an end of file error.

Question is how do I turn the SOAP request into and mx:request
request?

Thanks in advance 
rgds
martin

mx:request format=xml

typ:assess-request
typ:session-data
typ:list-entity entity-type=global
typ:entity id=global_1
typ:attribute-outcome id=LL
outcome-style=attribute-only/
typ:attribute-outcome id=LC998
outcome-style=attribute-only/
typ:attribute-outcome id=AssessmentLevel
outcome-style=attribute-only/
typ:attribute-outcome id=ProcessingTime
outcome-style=attribute-only/
typ:attribute id=Q2
typ:text-valGERM/typ:text-val
/typ:attribute
typ:attribute id=Q5
typ:text-valGERM/typ:text-val
/typ:attribute
typ:attribute id=XYZ988
typ:boolean-valtrue/typ:boolean-val
/typ:attribute
/typ:entity
/typ:list-entity
/typ:session-data
/typ:assess-request
/mx:request





[flexcoders] Passing Values between windows

2008-06-19 Thread bredwards358
In the application I'm currently developing, end users need to log in
to utilize it. Also I need to keep track of who is logged in so that I
can input that into a local database after certain actions. I've tried
using a public variable in a commonly used class, however since an
instance of that class is newly declared when a new window opens up
the value is set back to null, making it unusable. I've heard of using
an actionscript file inside a package used by the App containing the
variables but since the examples I've seen have them as static and
const variables and thus can't be changed from their default values.
So my question is this, is it possible in AIR to pass the value of a
variable from the native application window to another window component?

To help clear things up, essentially the user logs in and the username
is set as the value of a variable declared someplace, then in another
window, an action takes place, info is recorded in the database and
the app looks up the username in the variable, and records it along
with the other stuff in the db.



[flexcoders] Passing Values to popup components and then passing back

2007-09-26 Thread ming4u2
Hi,

I am working on an exisiting application and trying to pass value to 
opup components.  I don't know if I am not doing it right but the 
values are not being passed and then calling the correct HHTP call 
for the data.  Can anyone point me to the right direction besides the 
Adobe live docs, which really doenst help much.

The page that calls the popup

public function changeHandler():void
  {
var adminPopUp:componentDetail = 
componentDetail(PopUpManager.createPopUp
(this,Pages.Components.componentDetail,true));
if(viewcomponentlisting.selectedItem){
componentDetail(adminPopUp).AssetID = 
viewcomponentlisting.selectedItem.AssetID;
componentDetail
(adminPopUp).LifeCycleID = 
viewcomponentlisting.selectedItem.LifeCycleID;
componentDetail(adminPopUp).title = 
viewcomponentlisting.selectedItem.Description;
PopUpManager.centerPopUp(adminPopUp);
}
else {
var alert:Alert = Alert.show
([EMAIL PROTECTED],AssetID,Alert.OK | Alert.CANCEL,this);  
return;
}
  
  } 

And then the component that is supposed to recieve the values, I set 
them to Bindable variables

[Bindable]
public var AssetID:String;

[Bindable]
public var LifeCycleID:String;


And then I am trying to pass those variables to the HTTP request.

mx:HTTPService id=getAssetLifeCycleComponentXML 
requestTimeout=30 url=someurl.com 
result=assignSelectedItemComponent(); showBusyCursor=true 
resultFormat=e4x
mx:request
AssetIDAssetID/AssetID
LifeCycleIDLifeCycleID/LifeCycleID
/mx:request
 /mx:HTTPService
mx:XMLListCollection id=assetLifeCycleComponentColl 
source={getAssetLifeCycleComponentXML.lastResult.assetlifecyclecompon
entinfo} /



RE: [flexcoders] Passing Values to popup components and then passing back

2007-09-26 Thread Tracy Spratt
Here is an example:

http://www.cflex.net/showFileDetails.cfm?ObjectID=558

 

Note, it does not use events.  If you plan to reuse the popup component,
look into using events for communication.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ming4u2
Sent: Wednesday, September 26, 2007 1:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Passing Values to popup components and then
passing back

 

Hi,

I am working on an exisiting application and trying to pass value to 
opup components. I don't know if I am not doing it right but the 
values are not being passed and then calling the correct HHTP call 
for the data. Can anyone point me to the right direction besides the 
Adobe live docs, which really doenst help much.

The page that calls the popup

public function changeHandler():void
{
var adminPopUp:componentDetail = 
componentDetail(PopUpManager.createPopUp
(this,Pages.Components.componentDetail,true));
if(viewcomponentlisting.selectedItem){
componentDetail(adminPopUp).AssetID = 
viewcomponentlisting.selectedItem.AssetID;
componentDetail
(adminPopUp).LifeCycleID = 
viewcomponentlisting.selectedItem.LifeCycleID;
componentDetail(adminPopUp).title = 
viewcomponentlisting.selectedItem.Description;
PopUpManager.centerPopUp(adminPopUp);
}
else {
var alert:Alert = Alert.show
([EMAIL PROTECTED],AssetID,Alert.OK | Alert.CANCEL,this); 
return;
}

} 

And then the component that is supposed to recieve the values, I set 
them to Bindable variables

[Bindable]
public var AssetID:String;

[Bindable]
public var LifeCycleID:String;

And then I am trying to pass those variables to the HTTP request.

mx:HTTPService id=getAssetLifeCycleComponentXML 
requestTimeout=30 url=someurl.com 
result=assignSelectedItemComponent(); showBusyCursor=true 
resultFormat=e4x
mx:request
AssetIDAssetID/AssetID
LifeCycleIDLifeCycleID/LifeCycleID
/mx:request
/mx:HTTPService
mx:XMLListCollection id=assetLifeCycleComponentColl 
source={getAssetLifeCycleComponentXML.lastResult.assetlifecyclecompon
entinfo} /

 



[flexcoders] passing values to FilterFunctions?

2007-05-24 Thread Kevin
I would like to attempt to separate my filter functions from my view  
so that I am not duplicating code when two views share similar filter  
functions.  My idea was to create a class that contains a  
ListCollection and all the appropriate FilterFunctions for that  
collection.  The FilterFunctions would then be applied by methods in  
that class.

The problem I am having is that I can't pass any parameters to the  
FilterFunction when I assign it to the specific ListCollection.  The  
FilterFunction seems like it needs to be tightly coupled with the  
view in order to work.

To work around this, for application wide filters, I am saving a  
filter value on my model and then referencing the model from my  
FilterFunction (which still isn't ideal).  However in some cases this  
isn't appropriate since the filter value doesn't really need to be  
persisted over the entire application.

Does anyone have any thoughts on how to accomplish this?

Thanks for the help,

Kevin


Re: [flexcoders] passing values to FilterFunctions?

2007-05-24 Thread Ralf Bokelberg

I'm using a FilterClass, which holds just the filterFunction and some
optional ways to configure the filtering.
Every collection, which needs filtering, gets an instance of this
FilterClass by assigning collection.filterFunction = filter.filterFunction;

Cheers,
Ralf.


On 5/24/07, Kevin [EMAIL PROTECTED] wrote:


  I would like to attempt to separate my filter functions from my view
so that I am not duplicating code when two views share similar filter
functions. My idea was to create a class that contains a
ListCollection and all the appropriate FilterFunctions for that
collection. The FilterFunctions would then be applied by methods in
that class.

The problem I am having is that I can't pass any parameters to the
FilterFunction when I assign it to the specific ListCollection. The
FilterFunction seems like it needs to be tightly coupled with the
view in order to work.

To work around this, for application wide filters, I am saving a
filter value on my model and then referencing the model from my
FilterFunction (which still isn't ideal). However in some cases this
isn't appropriate since the filter value doesn't really need to be
persisted over the entire application.

Does anyone have any thoughts on how to accomplish this?

Thanks for the help,

Kevin
 





--
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35


Re: [flexcoders] passing values to FilterFunctions?

2007-05-24 Thread Kevin
using this approach the filter functions still need to reference the  
view to get optional filter parameters correct.  For example, if you  
want to filter based on a user inputed text field you can just do this:



collection.filterFunction = filter.filterFunction (textFld.text);


since the filter functions can not accept parameters.

In thinking about this I am wondering if this would work instead:

FilterClass.filterByName(collection,textFld.text);

Then within the class, the static method filterByName will handle  
assigning a filter function to the collection and using the  
textFld.text to filter.


Is there something that I am missing with this approach.

- Kevin


On May 24, 2007, at 2:02 PM, Ralf Bokelberg wrote:

I'm using a FilterClass, which holds just the filterFunction and  
some optional ways to configure the filtering.
Every collection, which needs filtering, gets an instance of this  
FilterClass by assigning collection.filterFunction =  
filter.filterFunction;


Cheers,
Ralf.


On 5/24/07, Kevin [EMAIL PROTECTED] wrote:
I would like to attempt to separate my filter functions from my view
so that I am not duplicating code when two views share similar filter
functions. My idea was to create a class that contains a
ListCollection and all the appropriate FilterFunctions for that
collection. The FilterFunctions would then be applied by methods in
that class.

The problem I am having is that I can't pass any parameters to the
FilterFunction when I assign it to the specific ListCollection. The
FilterFunction seems like it needs to be tightly coupled with the
view in order to work.

To work around this, for application wide filters, I am saving a
filter value on my model and then referencing the model from my
FilterFunction (which still isn't ideal). However in some cases this
isn't appropriate since the filter value doesn't really need to be
persisted over the entire application.

Does anyone have any thoughts on how to accomplish this?

Thanks for the help,

Kevin




--
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35






Re: [flexcoders] passing values to FilterFunctions?

2007-05-24 Thread Ralf Bokelberg

I simply assign the input values to some properties of the filter whenever
they change.
Cheers,
Ralf.

On 5/24/07, Kevin [EMAIL PROTECTED] wrote:


  using this approach the filter functions still need to reference the
view to get optional filter parameters correct.  For example, if you want to
filter based on a user inputed text field you can just do this:

collection.filterFunction = filter.filterFunction (textFld.text);


since the filter functions can not accept parameters.

In thinking about this I am wondering if this would work instead:

FilterClass.filterByName(collection,textFld.text);

Then within the class, the static method filterByName will
handle assigning a filter function to the collection and using the 
textFld.text to filter.

Is there something that I am missing with this approach.

- Kevin


On May 24, 2007, at 2:02 PM, Ralf Bokelberg wrote:

I'm using a FilterClass, which holds just the filterFunction and some
optional ways to configure the filtering.
Every collection, which needs filtering, gets an instance of this
FilterClass by assigning collection.filterFunction = filter.filterFuncti
on;

Cheers,
Ralf.


On 5/24/07, Kevin [EMAIL PROTECTED] wrote:

 I would like to attempt to separate my filter functions from my view
 so that I am not duplicating code when two views share similar filter
 functions. My idea was to create a class that contains a
 ListCollection and all the appropriate FilterFunctions for that
 collection. The FilterFunctions would then be applied by methods in
 that class.

 The problem I am having is that I can't pass any parameters to the
 FilterFunction when I assign it to the specific ListCollection. The
 FilterFunction seems like it needs to be tightly coupled with the
 view in order to work.

 To work around this, for application wide filters, I am saving a
 filter value on my model and then referencing the model from my
 FilterFunction (which still isn't ideal). However in some cases this
 isn't appropriate since the filter value doesn't really need to be
 persisted over the entire application.

 Does anyone have any thoughts on how to accomplish this?

 Thanks for the help,

 Kevin




--
Ralf Bokelberg ralf.bokelberg@ [EMAIL PROTECTED]gmail.com
Flex  Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35


 





--
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35


Re: [flexcoders] passing values to FilterFunctions?

2007-05-24 Thread Michael Schmalle

Hi,

I find sometimes just subclassing ArrayCollection works. This way your are
defining certain types of collections that do different things.

You can then add functionality to the class with methods or whatever. This
works well for me. Then I define the different filter functions based on
that collection' current state in the class. Using an interface in the
collection then decouples the collection form any implementations.


This is one simple class I use to filter included as3 files in a file
collection. The source is from a collection defined in the model which is
bound to a list with check boxes.

package com.teotiGraphix.documentfx.model
{

import com.teotiGraphix.documentfx.files.IAS3File;

import mx.collections.ArrayCollection;

public class SourceFileQueue extends ArrayCollection
{
   public static const FILE_INCLUSION_STATE:String = fileInclusionState;

   protected var stateChanged:Boolean = false;


//--
   //
   // Public Get-Set :: Properties
   //

//--

   //--
   //  state
   //--

   private var _state:String;

   /**
* Set the collection state.
*/
   public function get state():String
   {
   return _state;
   }

   /**
* @private
*/
   public function set state(value:String):void
   {
   _state = value;
   stateChanged = true;
   refresh();
   }


//--
   //
   // Constructor
   //

//--

   /**
* Constructor.
*/
   public function SourceFileQueue(source:Array=null)
   {
   super(source);

   state = FILE_INCLUSION_STATE;
   }

   /**
* @private
*/
   override public function refresh():Boolean
   {
   if (stateChanged)
   {
   if (_state == FILE_INCLUSION_STATE)
   {
   filterFunction = isFileIncluded;
   }
   stateChanged = false;
   }

   return super.refresh();
   }

   /**
* @private
*/
   private function isFileIncluded(item:Object):Boolean
   {
   var file:IAS3File;
   if (item is IAS3File)
   {
   file = IAS3File(item);
   if (file.included) // todo
   {
   return true;
   }
   }
   return false;
   }
}
}


Peace, Mike

On 5/24/07, Ralf Bokelberg [EMAIL PROTECTED] wrote:


  I simply assign the input values to some properties of the filter
whenever they change.
Cheers,
Ralf.

On 5/24/07, Kevin  [EMAIL PROTECTED] wrote:

   using this approach the filter functions still need to reference the
 view to get optional filter parameters correct.  For example, if you want to
 filter based on a user inputed text field you can just do this:

 collection.filterFunction = filter.filterFuncti on (textFld.text);


 since the filter functions can not accept parameters.

 In thinking about this I am wondering if this would work instead:

 FilterClass.filterByName(collection, textFld.text);

 Then within the class, the static method filterByName will
 handle assigning a filter function to the collection and using the 
 textFld.text to filter.

 Is there something that I am missing with this approach.

 - Kevin


 On May 24, 2007, at 2:02 PM, Ralf Bokelberg wrote:

 I'm using a FilterClass, which holds just the filterFunction and some
 optional ways to configure the filtering.
 Every collection, which needs filtering, gets an instance of this
 FilterClass by assigning collection.filterFu nction =
 filter.filterFunction;

 Cheers,
 Ralf.


 On 5/24/07, Kevin  [EMAIL PROTECTED]  wrote:
 
  I would like to attempt to separate my filter functions from my view
  so that I am not duplicating code when two views share similar filter
  functions. My idea was to create a class that contains a
  ListCollection and all the appropriate FilterFunctions for that
  collection. The FilterFunctions would then be applied by methods in
  that class.
 
  The problem I am having is that I can't pass any parameters to the
  FilterFunction when I assign it to the specific ListCollection. The
  FilterFunction seems like it needs to be tightly coupled with the
  view in order to work.
 
  To work around this, for application wide filters, I am saving a
  filter value on my model and then referencing the model from my
  FilterFunction (which still isn't ideal). However in some cases this
  isn't appropriate since the filter value doesn't really need to be
  persisted over the entire application.
 
  Does anyone have any thoughts on how to accomplish this?
 
  Thanks for the help,
 
  Kevin
 



 --
 Ralf Bokelberg ralf.bokelberg@ [EMAIL PROTECTED]gmail.com 
 Flex  Flash Consultant based in Cologne/Germany
 Phone +49 (0) 221 530 15 35





--
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash 

[flexcoders] Passing values

2006-02-01 Thread Geoffrey
I'm trying to pass the dimensions of the main window to a component 
for positioning of a popup.  I keep getting the following error:

   Error /Main.mxml:18 
 The property being referenced does not have the static 
attribute.



Here are some code snippets:

-- Main.mxml --
mx:Panel title=Team Management width=1280 height=1024 
id=mainBox
...
   local:teamList id=teamList width=400 height=100%
ParentX={mainBox.x} ParentY={mainBox.y}/



-- teamList.mxml --
mx:Script
![CDATA[
   import mx.managers.PopUpManager;

   var parentX:Number;
   var parentY:Number;
   var xPos:Number = parentX + 2;
   var yPos:Number = parentY + this.height + 5;
   var initObj:Object = {deferred:true, x:xPos, y:yPos};

   function showWindow():Void {
  var popup:Object = PopUpManager.createPopUp(this,
 teamListModify, true, initObj);
   }
]]
/mx:Script
...
mx:Button label=Modify click=showWindow()/mx:Button



I've looked around and I can't find a solution that helps me.  I'm 
new to Flex, so I would appreciate a detailed explaination since I'm 
obviously not getting it.

Thanks,
  GTB





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/