Dear all,
I have a problem with using the repeater with custom actionscipt
component.
for example
<mx:Repeater dataProvider="{Array}" id="form_repeater"
recycleChildren="true">
<general_item:Form_item
item_source="{form_repeater.currentItem}" /> </mx:Repeater>
i have use write the component "Form_item" using mxml and actionscript
but find that only mxml format can be success. actionscript component
even only run for once and cannot get my input paramter "item_source"
. i have attend with the source of actionscript format and mxml format
. Can someone tell me ?
mxml format
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml"
text="{item_source.fieldName}">
<mx:Script>
<![CDATA[
public var item_source:Object;
]]>
</mx:Script>
</mx:TextInput>
actionscript format
// ActionScript file
package general_comp.general_item {
import mx.core.UIComponent;
import mx.controls.Button;
import mx.controls.TextInput;
import mx.controls.Label;
import mx.controls.NumericStepper;
import mx.controls.CheckBox;
import mx.controls.DateField;
import mx.controls.Alert;
public class Form_item extends UIComponent{
public var item_source:Object;
private var item_label:Label;
private var item_textinput:TextInput;
private var item_numstepper:NumericStepper;
private var item_checkbox:CheckBox;
private var item_button:Button;
private var item_datefield:DateField;
public function Form_item(){
super();
}
override protected function createChildren():void {
super.createChildren();
item_label = new Label();
item_label.text = "hi";
addChild(item_label);
}
override protected function commitProperties():void{
super.commitProperties();
}
override protected function measure():void{
super.measure();
measuredWidth = measuredMinWidth = 410;
measuredHeight = measuredMinHeight = 30;
}
override protected function
updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth,unscaledHeight);
}
}
}
--
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/