[flexcoders] Re: initializing components in a viewstate (non base view)

2007-05-02 Thread gotjosh819i
I commented out all of the bindings and ran teh code again, I got the 
same error.

so I took out the change event function : viewSelectedProfile() then 
the error stopped.

Here is the datagrid code:
mx:DataGrid id=dgUserList width=100% height=100% 
headerStyleName=normalTenBold 
dataProvider={userListDP} initialize=test(event)
change=viewSelectedProfile(event   
mx:columns
mx:DataGridColumn id=dgcStatus headerText=Status 
dataField=isActive width=50/
mx:DataGridColumn id=dgcLastName headerText=Last Name 
dataField=user_lname width=100/
mx:DataGridColumn id=dgcFirstName headerText=First Name 
dataField=user_fname width=100/
mx:DataGridColumn id=dgcPhone headerText=Phone 
dataField=user_phone width=100/

mx:DataGridColumn id=dgcEmail headerText=Email 
dataField=user_email  width=200 /  

mx:DataGridColumn id=dgcRoles visible=true 
headerText=Roles dataField=roles  width=200 
itemRenderer=com.sync.view.community.RolesList /
/mx:columns
/mx:DataGrid


change event function:
private function viewSelectedProfile(e:Event):void {
this.currentState = 'viewSelected';
//trace(e.currentTarget.selectedItem.roles);
}


Any ideas why this is throwing a mouseHandler datagrid error?  it has 
something to do with the viewstate being changed again bc the error 
doesnt throw when i comment out this.currentState = 'viewSelected'


--- In flexcoders@yahoogroups.com, gotjosh819i [EMAIL PROTECTED] 
wrote:

 Hello all,  I am stuck on an issue and have run out of ideas to 
debug 
 it. (see below)
 
 I am having an issue with a binding.  I have a datagrid and the 
 onchange event triggers the viewstate to change and some 
 labels/images appear, some of which have data bindings to the 
 datagrid selection.
 
 I think the problem is that those label/image components within the 
 view are not initialized and the error is thrown since the data 
 binding doesnt know those items exist, even though the 
creationPolicy 
 is set to all at the top level. (the mxml file that has the 
viewstate 
 in it).
 
 Since its not being initialized I get this error each time I click 
on 
 a datagrid row.
 
 TypeError: Error #1009: Cannot access a property or method of a 
null 
 object reference.
   at mx.controls::DataGrid/mx.controls:DataGrid::mouseUpHandler
 ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\DataGrid.as:4218]
 
 I am positive those items are not being init'd bc i put a 
initialize 
 test function that traces the components when they are initialized 
 just to see if the error is occuring after they are initialized or 
 before they are.  This is happening before and the item never gets 
 init'd.
 
 private function test(e:Event):void {
   trace(item init:  + e.currentTarget);
 }
 
 one of the items hidden in a viewstate:
 mx:HBox
   
   mx:Label styleName=normalTenBold text=Status: width=75 
 textAlign=right/
   
   mx:Image source={(dgUserList.selectedItem.isActive)?
 iconStatusOn:iconStatusOff}  width=19 height=20 
initialize=test
 (event)/
   
 /mx:HBox
 
 
 The odd thing is that the canvas which is just before the HBox 
above, 
 is being init'd, then the error occurs and the image component 
doesnt 
 init.
 
 last thing: the error in the debugger pulls up DataGrid.as and 
points 
 to line 4217:
 
   if (headerVisible)
 pos.y--;
 
 
 any ideas on how to get past this issue?  
 
 - thanks in advance ~ Josh





[flexcoders] Re: initializing components in a viewstate (non base view)

2007-05-02 Thread gotjosh819i
I have narrowed it down to a transition effect - probably something i 
forgot to do :(

--- In flexcoders@yahoogroups.com, gotjosh819i [EMAIL PROTECTED] 
wrote:

 I commented out all of the bindings and ran teh code again, I got 
the 
 same error.
 
 so I took out the change event function : viewSelectedProfile() 
then 
 the error stopped.
 
 Here is the datagrid code:
 mx:DataGrid id=dgUserList width=100% height=100% 
 headerStyleName=normalTenBold 
 dataProvider={userListDP} initialize=test(event)
 change=viewSelectedProfile(event 
   mx:columns
   mx:DataGridColumn id=dgcStatus headerText=Status 
 dataField=isActive width=50/
   mx:DataGridColumn id=dgcLastName headerText=Last Name 
 dataField=user_lname width=100/
   mx:DataGridColumn id=dgcFirstName headerText=First Name 
 dataField=user_fname width=100/
   mx:DataGridColumn id=dgcPhone headerText=Phone 
 dataField=user_phone width=100/  
   
   mx:DataGridColumn id=dgcEmail headerText=Email 
 dataField=user_email  width=200 /

   
   mx:DataGridColumn id=dgcRoles visible=true 
 headerText=Roles dataField=roles  width=200 
 itemRenderer=com.sync.view.community.RolesList /
   /mx:columns
 /mx:DataGrid
 
 
 change event function:
 private function viewSelectedProfile(e:Event):void {
   this.currentState = 'viewSelected';
   //trace(e.currentTarget.selectedItem.roles);
 }
 
 
 Any ideas why this is throwing a mouseHandler datagrid error?  it 
has 
 something to do with the viewstate being changed again bc the error 
 doesnt throw when i comment out this.currentState = 'viewSelected'
 
 
 --- In flexcoders@yahoogroups.com, gotjosh819i joshuaprodgers@ 
 wrote:
 
  Hello all,  I am stuck on an issue and have run out of ideas to 
 debug 
  it. (see below)
  
  I am having an issue with a binding.  I have a datagrid and the 
  onchange event triggers the viewstate to change and some 
  labels/images appear, some of which have data bindings to the 
  datagrid selection.
  
  I think the problem is that those label/image components within 
the 
  view are not initialized and the error is thrown since the data 
  binding doesnt know those items exist, even though the 
 creationPolicy 
  is set to all at the top level. (the mxml file that has the 
 viewstate 
  in it).
  
  Since its not being initialized I get this error each time I 
click 
 on 
  a datagrid row.
  
  TypeError: Error #1009: Cannot access a property or method of a 
 null 
  object reference.
  at mx.controls::DataGrid/mx.controls:DataGrid::mouseUpHandler
  ()
[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\DataGrid.as:4218]
  
  I am positive those items are not being init'd bc i put a 
 initialize 
  test function that traces the components when they are 
initialized 
  just to see if the error is occuring after they are initialized 
or 
  before they are.  This is happening before and the item never 
gets 
  init'd.
  
  private function test(e:Event):void {
  trace(item init:  + e.currentTarget);
  }
  
  one of the items hidden in a viewstate:
  mx:HBox
  
  mx:Label styleName=normalTenBold text=Status: width=75 
  textAlign=right/
  
  mx:Image source={(dgUserList.selectedItem.isActive)?
  iconStatusOn:iconStatusOff}  width=19 height=20 
 initialize=test
  (event)/  
  
  /mx:HBox  
  
  
  The odd thing is that the canvas which is just before the HBox 
 above, 
  is being init'd, then the error occurs and the image component 
 doesnt 
  init.
  
  last thing: the error in the debugger pulls up DataGrid.as and 
 points 
  to line 4217:
  
if (headerVisible)
  pos.y--;
  
  
  any ideas on how to get past this issue?  
  
  - thanks in advance ~ Josh
 





[flexcoders] Re: Initializing components in views

2007-01-27 Thread Marlon Moyer

Nevermind, I was editing the wrong component file :(

creationcomplete on the base component in the view works fine.

On 1/26/07, Marlon Moyer [EMAIL PROTECTED] wrote:


I've got a component, a simple form, that I need to figure out how to
clear out the contents between uses.  The first time the view is activated,
the fields are clear.  The second time the view in activated, the old values
are prefilled.  What event do I need to tie into so that the form is cleared
every time it's activated?

Thanks

Marlon




RE: [flexcoders] Re-initializing

2005-05-01 Thread Matt Chotin










When you say not all the changes percolate
what do you mean? Calling invalidate() on a container should normally cause
everything to update layout-wise.











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 
Sent: Friday, April 29, 2005 6:36
AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
Re-initializing





I have an app in which users are allowed to add and delete children
from 
containers.

The changes only seem to fully percolate through
when the whole app is 
reinitialized through a browser refresh. What is
the way to trigger that 
from a command within the app?

- Tom
















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 the Yahoo! Terms of Service.












[flexcoders] Re-initializing

2005-04-29 Thread Tom Fitzpatrick
I have an app in which users are allowed to add and delete children from 
containers.

The changes only seem to fully percolate through when the whole app is 
reinitialized through a browser refresh. What is the way to trigger that 
from a command within the app?

- Tom






 
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/