Hi Tracy and thank for replying -
1) ss += "<br>" I'm adding a little space with a break at the end of
the textbox because for some reason when you go to print it the last
line item wouldn't show, and this took care of it.
2) pResources.htmlText = ss writes it all in after the loop finishes
3) I'm putting my data into an ArrayCollection, yes.
Main Page -
<mx:HTTPService id="myXML" url=" getProjectXML.asp"
result="extractProjects(event)"/>
public function extractProjects(event:ResultEvent):void {
projectArray = event.result.projects.project;
}
Change event on DataGrid -
<mx:DataGrid id="myDG" dataProvider="{projectArray}"
headerStyleName="myDataGridFont" width="100%" height="100%"
click="printPButton.enabled = true" change="detailsHolder.getInfo
(myDG.selectedItem)" >
Details Page - (Both samples are on here, the actionScript and the
Repeater)
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0"
borderStyle="none">
<mx:Script>
<![CDATA[
public function getInfo(obj:Object, evt:Event):void {
var sss:String="";
// resources\\
if(obj.resources != null) {
for(var j:int = 0; j < obj.resources.item.length; j++){
ss += "<li>" + obj.resources.item[j] + "</li>";
}
ss += "<br>";
pResources.htmlText = ss;
} else {
pResources.htmlText = "";
}
pName.text = obj.name;
pLead.text = obj.lead;
pStatus.text = obj.status;
sDate.text = myDate.format(obj.startDate);
eDate.text = myDate.format(obj.endDate);
custName.text = obj.customerName;
pIssues.text = obj.issues;
pObjective.text = obj.objectives;
pDeliverable.text = obj.delioverables;
pAudience.text = obj.audience;
//
]]>
</mx:Script>
}
<mx:Label text="Resources:" styleName="detailLabels"/>
<mx:Text id="pResources" styleName="detailText" width="100%"/>
<mx:Label text="Action Steps:" styleName="detailLabels"/>
<mx:Repeater id="myR"
dataProvider="{parentDocument.myDG.selectedItem}" >
<mx:Repeater id="myR2"
dataProvider="{myR.currentItem.actionSteps.item}">
<mx:Text id="pActionSteps" htmlText="{myR2.currentItem}"
styleName="bulleted" width="100%" />
</mx:Repeater>
</mx:Repeater>
</VBox>
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]>
wrote:
>
> For starters, these two lines:
>
> ss += "<br>";
> pResources.htmlText = ss;
>
> are between the clauses in the if statement. Does that even
compile?
>
>
>
> Second, you shouldn't really need to loop. An e4x expression will
return
> an XMLList that your data-driven components can consume nicely.
Bind
> the repeater to the DG .selectedItem.item. Repeater normally does
not
> error with an empty dataProvider. You have something else going
on.
>
>
>
> But also you say ArrayCollection. Do you mean XMLListCollection?
Are
> you mangling your pretty xml somehow?
>
>
>
> You are kinda all over the place. Choose a path and post more
code.
>
>
>
> Tracy
>