[flexcoders] Re: addchild error

2007-03-28 Thread wifi19

Hie, and thanks

i'd like make a windows with every page that i want to print before 
printing to select it

addpage is for print job isn't it ?


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

 You can't add a child twice.  Did you mean to call addPage?
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of wifi19
 Sent: Tuesday, March 27, 2007 1:57 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] addchild error
 
 
 
 I am having some trouble with addchild
 
 var thePrintView:FormPrintView = new FormPrintView();
 
 //myHbox.addChild(thePrintView); 
 var _caPan:Canvas = new Canvas();
 
 _caPan.height=300;
 _caPan.width = 200;
 
 
 _caPan.addChild(thePrintView);
 _caPan.addChild(thePrintView);
 
 second addchild generate a error
 
 RangeError: Error #2006: L'index indiqué sort des limites.
 at flash.display::DisplayObjectContainer/getChildAt()
 at mx.core::Container/getChildAt()
 at mx.core::UIComponent/set document()
 at 
 
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addin
 http://www.adobe.com/2006/flex/mx/internal::addin 
 gChild()
 at 
 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingC
 http://www.adobe.com/2006/flex/mx/internal::addingC 
 hild()
 at mx.core::Container/addChildAt()
 at mx.core::Container/addChild()
 at MyLoginForm/process()
 at MyLoginForm/___TitleWindow1_initialize()
 at 
 
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEv
 entFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.core::UIComponent/dispatchEvent()
 at mx.core::UIComponent/set processedDescriptors()
 at mx.core::Container/createComponentsFromDescriptors()
 at mx.containers::Panel/createComponentsFromDescriptors()
 at mx.core::Container/mx.core:Container::createChildren()
 at mx.containers::Panel/mx.containers:Panel::createChildren()
 at mx.core::UIComponent/initialize()
 at mx.core::Container/initialize()
 at MyLoginForm/initialize()
 at 
 
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal:
 http://www.adobe.com/2006/flex/mx/internal: 
 :childAdded()
 at 
 
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal:
 http://www.adobe.com/2006/flex/mx/internal: 
 :rawChildren_addChildAt()
 at mx.managers::SystemManager/addChild()
 at mx.managers::PopUpManagerImpl/addPopUp()
 at mx.managers::PopUpManager$/addPopUp()
 at print/doPrint()
 at print/__printDG_click()





RE: [flexcoders] Re: addchild error

2007-03-28 Thread Alex Harui
Ok, but why would you want to add the same view twice?  Do you want to add two 
different instances?



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wifi19
Sent: Wednesday, March 28, 2007 12:07 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: addchild error




Hie, and thanks

i'd like make a windows with every page that i want to print before 
printing to select it

addpage is for print job isn't it ?

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex 
Harui [EMAIL PROTECTED] wrote:

 You can't add a child twice. Did you mean to call addPage?
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On 
Behalf Of wifi19
 Sent: Tuesday, March 27, 2007 1:57 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] addchild error
 
 
 
 I am having some trouble with addchild
 
 var thePrintView:FormPrintView = new FormPrintView();
 
 //myHbox.addChild(thePrintView); 
 var _caPan:Canvas = new Canvas();
 
 _caPan.height=300;
 _caPan.width = 200;
 
 
 _caPan.addChild(thePrintView);
 _caPan.addChild(thePrintView);
 
 second addchild generate a error
 
 RangeError: Error #2006: L'index indiqué sort des limites.
 at flash.display::DisplayObjectContainer/getChildAt()
 at mx.core::Container/getChildAt()
 at mx.core::UIComponent/set document()
 at 
 
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addin 
http://www.adobe.com/2006/flex/mx/internal::addin 
http://www.adobe.com/2006/flex/mx/internal::addin 
http://www.adobe.com/2006/flex/mx/internal::addin  
 gChild()
 at 
 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingC 
http://www.adobe.com/2006/flex/mx/internal::addingC 
http://www.adobe.com/2006/flex/mx/internal::addingC 
http://www.adobe.com/2006/flex/mx/internal::addingC  
 hild()
 at mx.core::Container/addChildAt()
 at mx.core::Container/addChild()
 at MyLoginForm/process()
 at MyLoginForm/___TitleWindow1_initialize()
 at 
 
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEv
 entFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.core::UIComponent/dispatchEvent()
 at mx.core::UIComponent/set processedDescriptors()
 at mx.core::Container/createComponentsFromDescriptors()
 at mx.containers::Panel/createComponentsFromDescriptors()
 at mx.core::Container/mx.core:Container::createChildren()
 at mx.containers::Panel/mx.containers:Panel::createChildren()
 at mx.core::UIComponent/initialize()
 at mx.core::Container/initialize()
 at MyLoginForm/initialize()
 at 
 
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal:  
 :childAdded()
 at 
 
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal: 
http://www.adobe.com/2006/flex/mx/internal:  
 :rawChildren_addChildAt()
 at mx.managers::SystemManager/addChild()
 at mx.managers::PopUpManagerImpl/addPopUp()
 at mx.managers::PopUpManager$/addPopUp()
 at print/doPrint()
 at print/__printDG_click()




 


[flexcoders] Re: addchild error

2007-03-28 Thread wifi19
it's just a exemple

i'd like insert different pages (component FormPrintView()) with 
different page number and parameter with dataprovider.

ps: sorry for my english

my FormPrintView


mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* 
backgroundColor=#FF
paddingTop=50 paddingBottom=50 paddingLeft=50 

mx:Script
![CDATA[
import mx.core.*
// Declare and initialize the variables used in the 
component.
// The application sets the actual prodTotal value.
[Bindable]
public var pageNumber:Number = 1;
 [Bindable] 
   public var Index:Number = 1;
 [Bindable]
public var Qty:Number = 1;
[Bindable]
public var prodTotal:Number = 0;

// Control the page contents by selectively hiding the 
header and
// footer based on the page type.
public function showPage(pageType:String):void {
if(pageType == first || pageType == middle) {
// Hide the footer.
footer.includeInLayout=false;
footer.visible = false;
}
if(pageType == middle || pageType == last) {
// The header won't be used again; hide it.
header.includeInLayout=false;
header.visible = false;
}
if(pageType == last) {
// Show the footer.
footer.includeInLayout=true;
footer.visible = true;
}
//Update the DataGrid layout to reflect the results.
validateNow();
}

]]
/mx:Script

!-- The template for the printed page, with the contents for all 
pages. --
mx:VBox width=80% horizontalAlign=left
mx:Label text=Page {pageNumber}/
/mx:VBox
FormPrintHeader id=header /
!-- The data grid. The sizeToPage property is true by default, 
so the last
page has only as many grid rows as are needed for the data. --

mx:VBox width=80% horizontalAlign=left
mx:Label text=Index {Index}/
/mx:VBox
 mx:VBox width=80% horizontalAlign=left
mx:Label text=Quantite {Qty}/
/mx:VBox
  
!-- Create a FormPrintFooter control and set its prodTotal 
variable. --
FormPrintFooter id=footer pTotal={prodTotal} /

/mx:VBox

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

 Ok, but why would you want to add the same view twice?  Do you want 
to add two different instances?
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of wifi19
 Sent: Wednesday, March 28, 2007 12:07 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: addchild error
 
 
 
 
 Hie, and thanks
 
 i'd like make a windows with every page that i want to print before 
 printing to select it
 
 addpage is for print job isn't it ?
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com , Alex Harui aharui@ wrote:
 
  You can't add a child twice. Did you mean to call addPage?
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com  
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com ] On Behalf Of wifi19
  Sent: Tuesday, March 27, 2007 1:57 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com 
  Subject: [flexcoders] addchild error
  
  
  
  I am having some trouble with addchild
  
  var thePrintView:FormPrintView = new FormPrintView();
  
  //myHbox.addChild(thePrintView); 
  var _caPan:Canvas = new Canvas();
  
  _caPan.height=300;
  _caPan.width = 200;
  
  
  _caPan.addChild(thePrintView);
  _caPan.addChild(thePrintView);
  
  second addchild generate a error
  
  RangeError: Error #2006: L'index indiqué sort des limites.
  at flash.display::DisplayObjectContainer/getChildAt()
  at mx.core::Container/getChildAt()
  at mx.core::UIComponent/set document()
  at 
  
 
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addin
 http://www.adobe.com/2006/flex/mx/internal::addin 
 http://www.adobe.com/2006/flex/mx/internal::addin 
http://www.adobe.com/2006/flex/mx/internal::addin  
  gChild()
  at 
  
 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingC
 http://www.adobe.com/2006/flex/mx/internal::addingC 
 http://www.adobe.com/2006/flex/mx/internal::addingC 
http://www.adobe.com/2006/flex/mx/internal::addingC  
  hild()
  at mx.core::Container/addChildAt()
  at mx.core::Container/addChild()
  at MyLoginForm/process()
  at MyLoginForm/___TitleWindow1_initialize()
  at 
  
 
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEv
  entFunction()
  at flash.events::EventDispatcher/dispatchEvent()
  at mx.core::UIComponent/dispatchEvent()
  at mx.core::UIComponent/set processedDescriptors()
  at mx.core::Container