DataGrid with TextArea in itemRenderer using drag and drop

I have a DataGrid and in one of the columns I am using an itemRenderer, in this itemRenderer I have a spark textArea, with this textArea I am have scrolling enabled.  Also with this dataGrid I have drag enabled (for drag/drop). 
I am seeing two problems if anyone has any suggestions:
1. When you try to scroll the textArea, dragging kicks in, so you get partial scrolling then dragging.
2. Using the up/down symbols of the scroller, the scrollbar moves but the text in the dataGrid cell does not.
Thanks,
John
This is the itemRenderer:
?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo"
implements="mx.controls.listClasses.IDropInListItemRenderer">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.conversion.TextConverter;
private var _listData:BaseListData;
[Bindable]
private var thisTextFlow:TextFlow;
public function get listData():BaseListData
return _listData;
public function set listData(value:BaseListData):void
_listData = value;
override public function set data(value:Object):void
if (value != null)
super.data = value;
thisTextFlow = TextConverter.importToFlow(data[(listData as DataGridListData).dataField], TextConverter.TEXT_FIELD_HTML_FORMAT);
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
]]>
</fx:Script>
<s:TextArea id="textArea" textFlow="{thisTextFlow}"
editable="false" borderVisible="false"
width="100%"
contentBackgroundAlpha="0"
heightInLines="4"
verticalScrollPolicy="auto" horizontalScrollPolicy="auto"/>
</mx:VBox>

Below is code that is working and is re-usable, and if a textArea has a visible scrollbar than when that scrollbar has mouse down/up it sets the dataGrid to dragEnable = false/true to take care of the problem with the textArea dragging and scrolling at the same time.
One minor thought/issue is:
1. The size of this renderer using both a VBox and a textArea - but I wanted a scrollable text area that handles textflow.
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo"
implements="mx.controls.listClasses.IDropInListItemRenderer"
creationComplete="init()">
<fx:Script>
<![CDATA[
import mx.controls.DataGrid;
import mx.events.FlexEvent;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.conversion.TextConverter;
private var dg:DataGrid;
private var _listData:BaseListData;
[Bindable]
private var thisTextFlow:TextFlow;
private function init():void
dg = DataGrid(_listData.owner);
textArea.scroller.verticalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown_handler);
textArea.scroller.horizontalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown_handler);
private function mouseDown_handler(event:MouseEvent):void
dg.dragEnabled = false;
textArea.scroller.verticalScrollBar.addEventListener(MouseEvent.MOUSE_UP, mouseUp_handler);
textArea.scroller.horizontalScrollBar.addEventListener(MouseEvent.MOUSE_UP, mouseUp_handler);
private function mouseUp_handler(event:MouseEvent):void
dg.dragEnabled = true;
textArea.scroller.verticalScrollBar.removeEventListener(MouseEvent.MOUSE_UP, mouseUp_handler);
textArea.scroller.horizontalScrollBar.removeEventListener(MouseEvent.MOUSE_UP, mouseUp_handler);
public function get listData():BaseListData
return _listData;
public function set listData(value:BaseListData):void
_listData = value;
override public function set data(value:Object):void
if (value != null)
super.data = value;
thisTextFlow = TextConverter.importToFlow(data[(listData as DataGridListData).dataField], TextConverter.TEXT_FIELD_HTML_FORMAT);
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
]]>
</fx:Script>
<s:TextArea id="textArea" textFlow="{thisTextFlow}"
editable="false" borderVisible="false"
width="100%"
contentBackgroundAlpha="0"
heightInLines="4"/>
</mx:VBox>

Similar Messages

  • Help with this ... using drag and drop

    Hi guys,
    I'm an intermediate user of Flash, but I'm stuck ... I'm
    trying to see if I can recreate this page in Flash for a friend
    (it's an awful site!):
    Mannequin
    There are two ways I thought I could do this ... as they've
    done it, you cycle through the items, click on an item and it will
    appear in a hierarchy on the mannequin ... or as I've tried to
    attempt it, by dragging the item onto the mannequin.
    This is EXTREMELY rough as I just wanted to see if it could
    be done before designing it all, so it's stick men I'm afraid! I've
    got two movieclips on the stage, one is the console and one is the
    mannequin. The console contains items of clothing which are each
    movieclips placed in their own frame, back and forward buttons and
    an add button (ignore that button).
    I've managed to set it up so that the item of clothing
    duplicates and you can drag it onto the mannequin. I have two
    problems ... the mannequin goes back to normal when I go through
    the items in the console and the items in the console appear on top
    of each other as you flick through (probably because of the
    duplicatemovie command).
    I want to be able to drag each item, establish a hierarchy on
    the mannequin (e.g. so a jacket will go over a top) ... I've
    searched this forum for drag and drop info and have seen references
    to specifying a target, but I'm stuck. I've got a feeling I'm on
    the right lines, but I've either laid it out wrong on the stage or
    I'm missing a vital piece of actionscript ... Please can anyone
    advise??? Thanks
    Test Mannequin
    Flash File

    Hi,
    It would help if you could give some more details:
    - what are you trying to do (drag and drop a whole component, drag an item within a tree, or a table, drag an item from one component to another?)
    - have you found the modules you need in the unbound modules?
    - have you read the documentation about the drag and drop actions? can you say which parts you're having problems with? The documentation is here. You'll have to select the component you are interested in and locate the action "drag" and the action "drop" to read about the parameters required.
    Best regards,
    Alex

  • Images resizing when using drag and drop

    We just recently got PS Elements 7. I have a blank image that is sized at 600 x 1662 pixels. When I want to put a photo into that blank, I make sure that the photo is 600 pixels high. With 6, what I used drag and drop from the bin, the photo fit perfectly. With 7 it is apparently resizing the photo and I have to stretch it to fit. Is this something that I have set wrong?  If I am making sure that both items should fit together based on number of pixels, why is one changing size? Something has to be changing size or the items would fit together. I am assuming that something is set wrong, because this just does not strike me a something that should happen, or the program is not a very efficient photo editor. If necessary I will go back to 5.0, although there are things that I like better in 7.
    jean @ buffaloworks

    I'm frankly surprised you had success with this in PSE 6, since the past two versions create a special kind of smart object from images dragged up from the bin. You can use copy/paste to create a regular layer, or you can drag down to a thumbnail in the bin from an open image, but the project bin doesn't let you drag up anymore, by design.
    Did you mean to say PSE 5 rather than 6? It worked normally there.

  • How do i drag indicator control type on WPF instead of using Drag and Drop points

    In my WPF application, i have a window which is docked with the screen. i want to automate to expand the window using an Indicator control type, by sliding it. As of now i use StartDrag and StopDrag using specific points, which is not correct when it runs
    in many other screens.
    Could you please let me know, is there way to slide the control (to set window display size to viewable) without using  drag and drop action using points.

    Hi Pavithra,
    >> As of now i use StartDrag and StopDrag using specific points, which is not correct when it runs in many other screens.
    To really understanding this issue, could you share us what you mean by ”which is not correct”? It would be much helpful if you could share us a screen shoot about your UI and your issue.
    >> Could you please let me know, is there way to slide the control (to set window display size to viewable) without using  drag and drop action using points
    Do you mean that the control of the WPF is invisible and you want to set the window display size to make it visible? If so, I think you could use the Mouse.MoveScrollWheel Method to change the windows view until the control is visible. The link below might
    be useful to you:
    # CodedUI cann't find the controls outside the screen view, Mouse.MoveScrollWheel doesn't work too
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/e1dba9ee-dc51-4160-9a1a-a2220c903db0/codedui-cannt-find-the-controls-outside-the-screen-view-mousemovescrollwheel-doesnt-work-too?forum=vstest
    If I misunderstood you, please feel free to let me know.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • I have been backing up iMovie 08 files to my external drive, but for some reason I can't open these files in iMovie.  I used drag and drop to copy them.

    I have been backing up iMovie 08 files to my external drive, but for some reason I can't open these files in iMovie.  I used drag and drop to copy them.

    You really should be doing backups with an actual backup application, especially one that will work automatically, and, if your external HD is large enough, back up your entire system.  These can automatically back up only what's changed since the  previous backup, and some will keep "archive" copies of things you've changed or deleted, also.
    Too many things can go wrong, such as your internal HD failing, and you'll have a major project to reinstall everything.
    You already have Time Machine, built-in to OSX.  You might want to review the Time Machine Tutorial, and perhaps browse Time Machine - Frequently Asked Questions.
    #27 in the second link mentions some alternatives, too.

  • When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?

    When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?  I have a heirarchical embedded folder structure under \Documents.  Usually, as I drag the file to be moved over the various folders, they will blink twice, then expand/open to reveal contents (in Finder).  Now, when the file to be moved is held (hovering) over the destination folder, it will not blink or expand, so there's no place to drop the file.  If I release the mouse button, the file image disappears, showing that it is "going back to the place it came from", a.k.a. was not moved.  This just started happening.  I noticed it after upgrading to Mavericks.  Is this a bug or could anything else be causing this?

    As of today, Apple Support discovered during a remote support session with me that the same thing happens on their own system.  It is isolated to "Column View"; the Icon and List views in Finder behave correctly.  Issue is being escalated to engineering, and Apple will call to report status in a couple days.  In all likelihood, this is a bug that will need to be addressed in a future update.

  • Transfering files using drag and drop to Nano P

    I havent installed the supplied disks that came with my Nano Plus but am transfering files using drag and drop from "my music" folder on my computer to the Nano. These files are stored on my computer as the Name of the Artist as the folder name with a sub folder named the CD title (default setting when using Windows media to rip) with the individual track files in that folder.
    When I drag the main folder over to my Nano it just displays the Album title on the screen but not by artist and there is no way to select by artist (you can just switch "folders" on the Nano which will then display the CD title. If I used the supplied software with my Nano to transfer the files will I be able to choose by artist, CD, Genre, etc or is this not a function of the Nano?
    Is it best to just select the individual song tracks and throw them in one large group on the Nano and then it can figure out which artist, album, genre they belong to?

    The player will only show directories that contain music files.
    The behaviour you want is common on players that manage their content with a database (typically HD-based devices), but Creative's flash players don't work that way (and the software used on the host computer doesn't have any influence on this - the user interface is controlled by the player's firmware).

  • Using drag and drop property in forms.

    Hi all,
    I want to use drag and drop property in a form during
    runtime.I am using oracle 7.3.I don't want to call any
    another application.
    Is there any way?
    Thx in advance.

    Mona ! First tell your problem in brief ..Actually what you want
    on runtime ...would you like to fetching the data from one item
    to another or change the position of any item or
    pushbutton ...or what..give detail ...obviously i can help you..
    there are many commands like set_item_property ,
    get_item_property but right now i could not understand your
    prob ..tell me in brief..
    You can ask me at [email protected]..
    -Anwar

  • Programatic Generation and positioning of  components using Drag and Drop

    Hi,
    I am relatively new to ADF and UI Designing. Im trying to generate a flowchart using drag and drop feature in ADF. This involves creation of dragging images such as start,decision .. etc from one panel to another and dynamically creating a flowchart.
    Up to now i have managed to drag images from panel1 to panel2 and create them dynamically in the bean class. However im stuck at this point .. Im not able to position the draggable components on the desired position in the panelGroup. They either appear horizontally or vertically.
    Is there any way to achieve this. Also is it possible to assign a dropTarget to a a target component which is created dynamically ?
    Thanks in anticipation ....
    Lyle

    Hi Lyle,
    I am too only 4 months old to adf ,i use jdeveloper 10g.
    In 10g for the components to be placed at desired locations i think is somewhat possible. While you can arrange them by using spaces which causes
    f:verbatim tag to appear or you can use ADF Faces Core items like Object Spacer and Object Seperator where you can set their length and width to space objects on page...
    Regards
    Rohit

  • Unable to use "drag and drop function" from outlook

    We are changing from Lotus to outlook and this has made a problem with getting pdf-files into OAWD directly .
    Procedure was like this in Lotus
    1. We get documents (FI, F-43, aso ) by email
    2. We use OAWD function "drag and drop" , document is attached to a document type and workflow is triggered
    3. We pick up documents from Business workplace , handle the document and send it to the approver (who earlier got it directly in their mailbox "lotus")
    so far so good , everything worked well
    Unfortunately we changed to outlook, non attached files can be "drag and dropped" into OAWD (I understand the part about outlook is showing links instead of "real" pdf and know this is part of the problem)
    My question, it can not be possible that we have to manually save the documents/attached files from outlook into "desktop" to later use the drag and drop function?
    I have read about the programms to solve problem , ex "inPuncto", but our experts says there will be problem with connector to workflow from OAWD.
    I have my greatest doubts about that because this must be really two diffrent moduls, one for converting from outlook and the other must be unchange (undependent of the earlier procedure). SAP can not know from what program the documents will be dragged? 
    Suggestion about some OAWD-adaptor ?
    Any suggestions about great solutions ?

    it seems there is no way.
    See note 1797073
    Is there someone with a better solution?

  • Use drag and drop to sort data in report

    Hello!
    I found a good description to sort data in a Tabular Form per drag and drop.

    Here is the url: Read Article - Drag &amp;amp; Drop tabular form rows
    It works fine if one follow the hint from Baki (For apex 4.2 one have to adapt a css class).
    Afterwards I tried the same with an Interactive Report. It nearly works.
    I once again had to adapt a css class.
    I used the
    apexir_WORKSHEET_DATA
    class instead of the
    uReportStandard
    in the JavaScript for the Interactive Report.
    Everything went fine. Except the "Save the Thing to the DB" issiu did not work.
    The following code do not work (the "APEX_APPLICATION.G_FROWID.COUNT" is allways 0):
    FOR i IN 1 .. APEX_APPLICATION.G_FROWID.COUNT 
    LOOP
    UPDATE emp SET sort_order = i WHERE rowid = APEX_APPLICATION.G_FROWID(i);
    END LOOP;
    Does anybody know why?
    Best thanks,
    Ilb

  • Erratic zooming in and out using drag and drop to copy.

    While using the drag and drop to copy method in AI 18.0(and17) there is erratic zooming in and out behavior.
    I've called Adobe and Apple about this issue and it still remains. I've also tried the Hot Fix download but the problem still remains.
    I'm using an iMac with OS 10.9.4 and the Magic Mouse.
    Please help! Thanks in advance.
    Dennis, DB Signs

    When I click and hold on a selection then drag it holding down the option key to copy it, when I release the mouse where I want it to be copied it zooms in or out(radically) once or several times and usually copies the selected item to a different place then I wanted it to.
    Now I’ve noticed that if I don’t touch the side of the mouse(keeping only one finger on the top of the mouse) I don’t have the issue.
    Thank You, Dennis Burns, DB Signs
    Phone: 320-629-8919
    Fax: 844-269-8172
    Email: [email protected]
    Website: www.dbsigns.biz

  • Moving answers in a quiz once they have been matched to a target in using drag and drop

    Hi,
    I am having a problem with some of my drag and drop quizzes that I'm wondering if anyone you might be able to help me with?
    In some drag and drop quizzes I have created, using the Infosemantics drag and drop light widget in Captivate 5.5, I can move the answer after having matched it to a target but before submittting.  Whereas in some quizzes I have created, the answers get stuck and do not let me move the answers after I have matched them to a target, even though I haven't submitted.  This leaves me no choice but to clear all my answers and start again if I have made a mistake. 
    Please can you tell me how to enable the answers to move even after they have been placed on a target? 

    Emma,
    Take a look at the troubleshooting tips on this page from the Infosemantics website:
    http://www.infosemantics.com.au/adobe-captivate-widgets/drag-and-drop/troubleshooting-widg et-issues
    Pay particular attention to the section entitled: "My drag and drop question works correctly sometimes, but not other times. "
    From the appearance of your slide, it looks like you may have removed some of the components from the quiz slide that are necessary for it to function correctly.  Try the test that this section of the troubleshooting suggests so that you can see if this is the case.  If it turns out that you have deleted some items, you'll need to recreate your quiz slide to get them back again.
    Hope this helps.

  • Start Workflow when Upload File using drag and drop

    Hi,
    I am working with SharePoint 2013.
    I have a workflow needed to be started and run only once after a document is uploaded into the document library. The document library has
    required custom columns with default values. If I set workflow starting option as 'On Created', when user got redirected to the edit form and click 'Save', there would be error as
    "The <filename> has been modified by <user> on <datetime>". Besides the unwanted error dialog, the metadata entered by users are not reflected. I understand the issue is because the workflow had already started before
    the edit form showed and it modified the file.
    So I changed the starting option to 'On Changed", created an additional column to record if the workflow has been run or not to avoid running the whole workflow more than once. This works fine for normal upload. However on drag and drop, the
    event 'On Changed' is not triggered and the workflow is not started. I checked the version of the file but in both normal upload and drag and drop, there is another version after the first version. But
    only the version of normal upload triggers the workflow.
    I read an article about some Mode = Upload on the edit form.
    https://go4answers.webhost4life.com/Example/workflow-triggered-during-upload-user-149297.aspx
    It seems that the Mode = Upload is not there anymore for normal upload, but it's still there for drag and drop. Not sure about this
    Is there a solution for my case. Basically I want to start the workflow only once when the document is uploaded normally or via drag and drop. For normal upload, user can
    edit the custom metadata right after they browse the file. For drag and drop, the
    metadata will be set as default values.
    Thank you.

    I'm still researching your issue, but as an interesting note... This is an issue only when I use a 2013 style workflow. I do not get the error when using a 2010 style workflow.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • More info on using drag and drop in AS3?

    I have coded a basic drag and drop using a rope .jpg saved as an mc. the idea is to have the user drag the rope from left to right using the mouse down and up functions. I was able to do this but I'm trying to add to the functionality by doing the following:
    dragging limited to a certain amount per drag
    no dragging up or down just left to right
    set boundries within the screensize
    I've looked and could only find as2 and basic tutes on this
    here is what I have so far
    any help?
    ropeclip_mc.addEventListener(MouseEvent.MOUSE_DOWN, ropedrag);
    ropeclip_mc.addEventListener(MouseEvent.MOUSE_UP, ropedrop);
    function ropedrag(e:MouseEvent):void
         ropeclip_mc.startDrag();
    function ropedrop(e:MouseEvent):void
         ropeclip_mc.stopDrag();
    RD

    Hi,
    Along with your code add this code to specify the dragging limited.
    var sbound:Rectangle = new Rectangle(x,y,width,height);
    x  states x position of the drag object starts.
    y  states y position of the drag object starts.
    width states width of the drag object.
    height states height of the drag object
    ropeclip_mc.startDrag(true,sbound);
    Try this.
    Saransoft

Maybe you are looking for

  • Running servlet in a differnt machine

    Hi, I have tomcat 5.x installed in my machine. I run my servlets by http://localhost:8080/<ServletName>. I want to run the same in a different machine. In my machine tomcat server is up and running. When I tried running the servlet using the link htt

  • Passing parameters to function

    hi :) how can i pass acdm_Repeater.currentItem.@help to a OpenWindow() function? what would i put inside the ()? Thanks!

  • How to rebuil undo and temp tbspc

    Hi hussein/helios Our apps undo and temp tablespaces got so big ( like 10Gb each) that it almost run out of space. Ho do i resync in back to 2Gb each. Is there a system commnad like > alter tablespace undo resync? Thanks a lot msK

  • Insp lot required while transfering qty from blocked stock to unrestricted

    Hi, say when we recieve 10 qty of  goods from vendor, 5 are ok and remaining are not ok, so inspection done and 5 qty putit in blocked stock. now with some minor rework by the vendor (vendor came to our premises and reworked) made it ok, accordingly

  • Label font size in System Preferences

    Using Macbook Pro with Lion; the font size on certain applications is too large, and I cannot see any way to change this; its not a problem in programms like Word, Mail etc - but is apparent on Sys Preference pane (screen shot below) and, for example