Adobe Dreamweaver Forums



Last 10 THreads :         delete all channels previously created by "save selection" (Last Post : John_A_Horner@adobeforums.com - Replies : 0 - Views : 1 )           »          Snippet Pod Problems (Last Post : Captiv8r - Replies : 3 - Views : 4 )           »          Mail Sending status  (Last Post : Fetch - Replies : 3 - Views : 4 )           »          Array of Queries (Last Post : Ian Skinner - Replies : 4 - Views : 5 )           »          image alignment (Last Post : Walt F. Schaefer - Replies : 1 - Views : 2 )           »          Problem with "Title" and DW CS4 (Last Post : emt79 - Replies : 2 - Views : 3 )           »          IE6 render issue (Last Post : graphix75 - Replies : 3 - Views : 4 )           »          Help with Dreamweaver CS4 (Last Post : admin - Replies : 1 - Views : 29 )           »          CreateODBCDate and cfqueryparam with cf_sql_date (Last Post : hannibalcanibal - Replies : 0 - Views : 1 )           »          Load bmp images in a flex app (Last Post : eholz1 - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-19-2008, 11:55 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Funky Repeater Problem (Please help !!!)

In my attached code, if you edit one item of the first VBox first TextArea,
after typing the first character you can't type anymore.

If you edit one item of the second VBox first TextArea, after leaving that
TextArea you can't change anymore of the TextAreas in VBox 2.


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundGradientColors="[0xffffff, 0xffffff]"
horizontalAlign="left">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.*;

[Bindable] private var ac1:ArrayCollection = new ArrayCollection([
"This is the first string in the application ArrayCollection.",
"This is the second string in the application ArrayCollection.",
"This is the third string in the application ArrayCollection.",
"This is the fourth string in the application ArrayCollection."
]);

[Bindable] private var ac2:ArrayCollection = new ArrayCollection([
"This is the first string in the application ArrayCollection.",
"This is the second string in the application ArrayCollection.",
"This is the third string in the application ArrayCollection.",
"This is the fourth string in the application ArrayCollection."
]);

private function myChangeHandler(event:Event):void{
ac1.setItemAt(entryText1[event.currentTarget.instanceIndices].text,
event.currentTarget.instanceIndices);
}

private function myFocusOutHandler(event:FocusEvent):void{
ac2.setItemAt(entryText2[event.currentTarget.instanceIndices].text,
event.currentTarget.instanceIndices);
}
]]>
</mx:Script>
<mx:Label text="Change Event"/>
<mx:VBox width="100%" height="100%">
<mx:Repeater id="rp1" dataProvider="{ac1}">
<mx:TextArea id="entryText1" text="{rp1.currentItem}" editable="true"
width="100%" height="20" change="myChangeHandler(event);"
borderThickness="0" selectable="true"/>
</mx:Repeater>
</mx:VBox>
<mx:Label text="Focus Event"/>
<mx:VBox width="100%" height="100%">
<mx:Repeater id="rp2" dataProvider="{ac2}">
<mx:TextArea id="entryText2" text="{rp2.currentItem}" editable="true"
width="100%" height="20" focusOut="myFocusOutHandler(event);"
borderThickness="0" selectable="true"/>
</mx:Repeater>
</mx:VBox>
</mx:Application>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-20-2008, 01:24 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Funky Repeater Problem (Please help !!!)


"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message
news:gg28mt$a2l$1@forums.macromedia.com...
> In my attached code, if you edit one item of the first VBox first
> TextArea,
> after typing the first character you can't type anymore.
>


It seems like what's happening is that you get into a feedback loop where
you change an item in the ac and it causes the whole repeater to render
again. I got it closer with this, but it's still a bit screwy in the focus
dept.

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

backgroundGradientColors="[0xffffff, 0xffffff]"

horizontalAlign="left">

<mx:Script>

<![CDATA[

import mx.collections.ArrayCollection;

import mx.controls.*;


[Bindable] private var ac1:ArrayCollection = new ArrayCollection([

"This is the first string in the application ArrayCollection.",

"This is the second string in the application ArrayCollection.",

"This is the third string in the application ArrayCollection.",

"This is the fourth string in the application ArrayCollection."

]);


[Bindable] private var ac2:ArrayCollection = new ArrayCollection([

"This is the first string in the application ArrayCollection.",

"This is the second string in the application ArrayCollection.",

"This is the third string in the application ArrayCollection.",

"This is the fourth string in the application ArrayCollection."

]);


private function myChangeHandler(event:Event):void{

/* deliberately make an error, since the Flex team

used that brilliant mechanism as the only way to

determine the repeater is done executing. */

try {

var makeError:Object = rp1.currentItem;

} catch (error:Error) {

//the repeater has executed, so we now want to

ac1.setItemAt(entryText1[event.currentTarget.instanceIndices].text,

event.currentTarget.instanceIndices);

return;

} finally {

//do nothing. we wanted an error

}


}


private function myFocusOutHandler(event:FocusEvent):void{

ac2.setItemAt(entryText2[event.currentTarget.instanceIndices].text,

event.currentTarget.instanceIndices);

}

]]>

</mx:Script>

<mx:Label text="Change Event"/>

<mx:VBox width="100%" height="100%">

<mx:Repeater id="rp1" dataProvider="{ac1}">

<mx:TextArea id="entryText1" text="{rp1.currentItem}" editable="true"

width="100%" height="20" valueCommit="myChangeHandler(event);"

borderThickness="0" selectable="true"/>

</mx:Repeater>

</mx:VBox>

<mx:Label text="Focus Event"/>

<mx:VBox width="100%" height="100%">

<mx:Repeater id="rp2" dataProvider="{ac2}">

<mx:TextArea id="entryText2" text="{rp2.currentItem}" editable="true"

width="100%" height="20" focusOut="myFocusOutHandler(event);"

borderThickness="0" selectable="true"/>

</mx:Repeater>

</mx:VBox>

</mx:Application>


Reply With Quote
  #3 (permalink)  
Old 11-20-2008, 05:34 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Funky Repeater Problem (Please help !!!)

Thanks for the suggestion. I think I may use some other component for what I am
trying to do. This funky focus issue is fairly irritating.

As for what I am trying to do, I'm building a file list in the application,
where the list is a bunch of paths to files, such as Windows .rc files.

The paths are stored in an ArrayCollection, but I need to present them to the
user so they have the opportunity to edit the paths if necessary.

I would have preferred putting them all in one TextArea, but I didn't know how
to use myTextArea.text += ac.getItemAt(myIndex); and be able to add a newline
so each AC entry is on the next line in the TextArea.

Then after the user updates the text in the TextArea, I would just write out
whatever remains in the TextArea.text to file, but once again, the newlines
must be retained in the file I write to.

In this scenario there is no updating of the AC, but I need those newlines to
take effect within the TextArea and in the written file.

Thanks again for your help Amy!

Reply With Quote


  #4 (permalink)  
Old 11-20-2008, 01:43 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Funky Repeater Problem (Please help !!!)


"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message
news:gg2sdq$34p$1@forums.macromedia.com...
> Thanks for the suggestion. I think I may use some other component for what
> I am
> trying to do. This funky focus issue is fairly irritating.
>
> As for what I am trying to do, I'm building a file list in the
> application,
> where the list is a bunch of paths to files, such as Windows .rc files.
>
> The paths are stored in an ArrayCollection, but I need to present them to
> the
> user so they have the opportunity to edit the paths if necessary.
>
> I would have preferred putting them all in one TextArea, but I didn't know
> how
> to use myTextArea.text += ac.getItemAt(myIndex); and be able to add a
> newline
> so each AC entry is on the next line in the TextArea.
>
> Then after the user updates the text in the TextArea, I would just write
> out
> whatever remains in the TextArea.text to file, but once again, the
> newlines
> must be retained in the file I write to.
>
> In this scenario there is no updating of the AC, but I need those newlines
> to
> take effect within the TextArea and in the written file.
>
> Thanks again for your help Amy!


Why not just use a List? If you use itemIsEditor, I think that it will
update your AC for you.


Reply With Quote
  #5 (permalink)  
Old 11-21-2008, 04:44 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Funky Repeater Problem (Please help !!!)

I ended up just using a TextArea and writing the file from there. That way the user can easily delete entire blocks of lines. Line endings render fine.

Thanks for your help Amy!
Reply With Quote
  #6 (permalink)  
Old 11-21-2008, 04:44 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Funky Repeater Problem (Please help !!!)


"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message
news:gg5dqk$d4h$1@forums.macromedia.com...
>I ended up just using a TextArea and writing the file from there. That way
>the user can easily delete entire blocks of lines. Line endings render
>fine.
>
> Thanks for your help Amy!


Not sure how helpful I was, but you're welcome ;-)


Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:11 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk