Custom duplication event for datagrid

hi guys , in the flexstore sample i saw a duplication functionality that executes when you add the same item to the shopping cart (instead of the shopping cart displaying the same item twice , it simply increases the quantity number of the item). Since am a bit of a noob when it comes to actionscript can anyone please show me how to do the same when dragging an item to the datagrid.

In the Flextore project, look at productListEventHandler() in ProductCart.mxml.
HTH,
Carlos

Similar Messages

  • Custom FPM Event for Button row element

    Hi Expects,
    I have created a new button row element in standard screen, where I want to add custom FPM event and handle the same in get_data( ). But by default SAP is providing few event ID's in drop down.
    Please help me how to add custom FPM event for  button row element.
    Regards,
    Reny Richard

    Hi Remy,
    Process Event method does have any signature parameters in it which allow us to disable/enable buttons.
    We can handle this in Get data method.Get Data is always triggered after Process Event. So you can write that in Get Data instead.
    ****this is a sample code to do the same. You can do a read as well if single button needs tobe handled***
    LOOP AT CT_ACTION_USAGE INTO lw_action WHERE id = (your event id for the button).
        lw_action-enabled = abap_false.
        MODIFY CT_ACTION_USAGE FROM lw_action TRANSPORTING enabled.
        EV_ACTION_USAGE_CHANGED = 'X'.
    ENDLOOP.
    ***use field symbol to avoid modify if you want***

  • Custom cell Renderer for datagrid

    For a long while now (way too long) I've being searching for
    a decent example for using components such as a checkbox or
    combobox inside of a datagrid.
    The only examples that i could find where all AS2 examples.
    The closest thing I find to an AS3 example for adding checkboxes,
    buttons etc to a datagrid was here
    http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/
    but it is in no way clear how to alter the example for other
    components.
    Could somebody please please please show me a working example
    of how to add a checkbox / button to a datagrid using flash cs3

    TypeError: Error #2007: 参数 text
    不能为空。
    at flash.text::TextField/set text()
    at fl.controls::LabelButton/set label()
    at xttmo::MyRowBgColorRender/set listData()
    at fl.controls::DataGrid/drawList()
    at xttmo::MyDataGrid/drawList()
    at fl.controls::DataGrid/draw()
    at fl.core::UIComponent/callLaterDispatcher()
    TypeError: Error #1009:
    无法访问空对象引用的属性或方法。
    at fl.controls::ComboBox/addCloseListener()
    TypeError: Error #2007: 参数 text
    不能为空。
    at flash.text::TextField/set text()
    at fl.controls::LabelButton/set label()
    at xttmo::MyRowBgColorRender/set listData()
    at fl.controls::DataGrid/drawList()
    at xttmo::MyDataGrid/drawList()
    at fl.controls::DataGrid/draw()
    at fl.core::UIComponent/callLaterDispatcher()
    TypeError: Error #1009:
    无法访问空对象引用的属性或方法。
    at fl.controls::ComboBox/close()
    at fl.controls::ComboBox/focusOutHandler()
    TypeError: Error #2007: 参数 child
    不能为空。
    at flash.display::DisplayObjectContainer/addChildAt()
    at fl.controls::BaseButton/drawBackground()
    at fl.controls::BaseButton/draw()
    at fl.core::UIComponent/callLaterDispatcher()
    package xttmo{
    import fl.controls.CheckBox;
    import fl.controls.listClasses.ICellRenderer;
    import fl.controls.listClasses.ListData;
    import flash.display.Graphics;
    import flash.display.Shape;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import fl.core.InvalidationType;
    public class MyCheckboxRender extends CheckBox implements
    ICellRenderer {
    private var _data:Object;
    private var _listData:ListData;// column row
    protected var textOverlay:Shape;
    override public function dispatchEvent(event:Event):Boolean
    if (event.type==MouseEvent.CLICK) {
    setSelected1();
    return super.dispatchEvent(event);
    public function MyCheckboxRender():void {
    super();
    this.label="";
    this.move(0, 0);
    this.setSize(23, 22);
    var _t:MyCheckboxRender=this;
    this.addEventListener(MouseEvent.CLICK,
    function(e:MouseEvent):void{;
    _t.setSelected1();
    public function set data(item:Object):void {
    _data=item;
    // name = "sex";
    public function get data():Object {
    return _data;
    /*override public function set selected(value:Boolean):void
    {// this._selected=value;
    public function setSelected1():void {
    this._selected=Boolean(! this._selected);
    public override function get selected():Boolean {
    invalidate(InvalidationType.STATE);
    return _selected;
    private function myDraw():void {
    graphics.lineStyle(1, 0xB7BABC);
    var h:uint=19;// height;
    graphics.moveTo(0, -1),
    graphics.lineTo(0, h);
    graphics.lineTo(width, h);
    this.textField.text=_data["sex"];
    this._selected=Boolean(1==_data["sex"]);
    public function set listData(item:ListData):void {
    _listData=item;
    myDraw();
    public function get listData():ListData {
    return _listData;
    override protected function drawBackground():void {
    if (_listData.index%2==0) {
    setStyle("upSkin", CellRenderer_upSkinGray);
    } else {
    setStyle("upSkin", CellRenderer_upSkin);
    super.drawBackground();

  • How to dispatch custom events from an item renderer used for Datagrid Column

    Hi,
    I am using an Item Renderer for a Data Grid Column and in that mxml, I am dispatching a custom event with data.
    But the main mxml which has the DataGrid is not able to resolve the event. How can I solve this?
    Thanks

    Hi,
    This is the constructor for Event.
    public function Event(type:String, bubbles:Boolean  = false, cancelable:Boolean  = false)
    When you created your custom event after extending from Event, for the parent container receives the event, the bubbles property must be set to true.
    Please check if you have done so. That should solve the problem. Let me know if it doesn't.
    Nishad

  • Terminating Event for BUS2017 Custom Method

    Dear Experts,
    I have an issue with the Terminating Event of the Workflow for BO : BUS2017. The event is getting triggered but receiver is not being picked.
    I have created two events GR_103 and POST_105 in the Custom BO ZBUS2017 by delegating it to BUS2017. GR_103 is the triggering event for my workflow which I have triggered in the POST_DOCUMENT Method of the Implmentation for BADI : MB_MIGO_BADI.
    GR_103 is triggered while doing MIGO (Goods Receipt) for Movement Type 103. My Workflow is triggered perfectly and then I have used a Dialog Asynchronous Task in which I have called the MIGO Transaction for Releasing the GR Blokced Stock using the Movement Type 105. I have created a Custom Method POST in the BO ZBUS2017 and I have used the FM: MIGO_DIALOG to call the MIGO. I am trying to raise the POST_105 event in the Method MB_DOCUMENT_BEFORE_UPDATE of the Interface IF_EX_MB_DOCUMENT_BADI.  I have defined the Terminating Event for the asynchronous Task as POST_105.
    Now the event POST_105 is triggered, but SWEL says 'No receiver entered'. Even the SWEINST shows the object data as the current Work Item along with Object Key, but still receiver not picked. When I try to trigger the same event in a test report by using call transaction, then the event triggers and work item gets completed without any issues.
    Please advise.
    Below is my terminating event code.
      READ TABLE xmseg INTO wa_mseg INDEX 1.
      CONCATENATE wa_mseg-mblnr wa_mseg-mjahr INTO l_objkey.
      IF wa_mseg-bwart = '105' .
        CALL FUNCTION 'SWE_EVENT_CREATE'
          EXPORTING
            objtype           = 'BUS2017'
            objkey            = l_objkey
            event             = 'POST_105'
          EXCEPTIONS
            objtype_not_found = 1
            OTHERS            = 2.
      ENDIF.
    Regards,
    Raju.

    Have a COMMIT WORK after the function call. (At least test it - I am not sure if it will have some effects in your BADI - at least you will know whether the issue is about missing commit).
    And please use SAP_WAPI_CREATE_EVENT instead of the old function you are using.
    Also, make sure that the events will look exactly the same in event monitor SWEL when triggered from your code and when using test tool. Maybe there is some minor difference/mistake (object key, etc.) that you haven't noticed.
    Regards,
    Karri
    Edited by: Karri Kemppi on Feb 7, 2012 8:14 AM

  • Click event for single column in DataGrid

    I can add an event listener to a DataGrid of type
    ListEvent.ITEM_CLICK, which is triggered when the user clicks any
    part of an entire row in a DataGrid. I want to trigger a click
    event for just one column. I only want to run a function when the
    user clicks in just the first column of the DataGrid, and not run
    trigger the event if they click in any other column. Any help would
    be much appreciated.

    Accessing the event.target returns the entire DataGrid, not
    the DataGridColum. Any way to get just the DataGrid column?

  • Custom UIView not receiving touch events for fast mouse clicks in simulator

    I'm having a problem in the simulator where if I click fast in a UIView inside a table cell that is setup to receive touch events, it doesn't receive them. But if I click slow (holding down the button for a little bit) the view gets the touch events. I can't test it on the device. Is this a known problem in the simulator?
    Thanks.

    Hi George,
    Thanks a lot for your quick response and jumping to help.
    I am so frustrated that I did not get touch event for the custom cell.
    I also tried your solution for a custom UIImageView, I put the codes of PhotoView.h, PhotoView.m and TestTouchAppDelegate.m here: Please help to look into it for me.
    // PhotoView.h
    // Molinker
    // Created by Victor on 6/18/08.
    // Copyright 2008 _MyCompanyName_. All rights reserved.
    #import <UIKit/UIKit.h>
    @interface PhotoView : UIImageView {
    CGPoint touchPoint1;
    CGPoint touchPoint2;
    @property (nonatomic) CGPoint touchPoint1;
    @property (nonatomic) CGPoint touchPoint2;
    @end
    // PhotoView.m
    // Molinker
    // Created by Victor on 6/18/08.
    // Copyright 2008 _MyCompanyName_. All rights reserved.
    #import "PhotoView.h"
    @implementation PhotoView
    @synthesize touchPoint1;
    @synthesize touchPoint2;
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    // Initialization code
    self.userInteractionEnabled = YES;
    return self;
    - (void)drawRect:(CGRect)rect {
    // Drawing code
    // Handles the start of a touch
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    UITouch *touch = [touches anyObject];
    touchPoint1 = [touch locationInView:self];
    // Handles the end of a touch event.
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    UITouch *touch = [touches anyObject];
    touchPoint2 = [touch locationInView:self];
    if(touchPoint1.x>touchPoint2.x)
    //move Left
    NSLog(@"Move Left");
    if(touchPoint1.x<touchPoint2.x)
    //move Right
    NSLog(@"Move Right");
    - (void)dealloc {
    [super dealloc];
    @end
    // TestTouchAppDelegate.m
    // TestTouch
    // Created by Victor on 6/17/08.
    // Copyright _MyCompanyName_ 2008. All rights reserved.
    #import "TestTouchAppDelegate.h"
    #import "RootViewController.h"
    #import "PhotoView.h"
    @implementation TestTouchAppDelegate
    @synthesize window;
    @synthesize navigationController;
    - (id)init {
    if (self = [super init]) {
    return self;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Configure and show the window
    //[window addSubview:[navigationController view]];
    UIImage *myImage= [UIImage imageNamed: @"scene1.jpg"];
    CGRect frame = CGRectMake (0, 20, 300, 400);
    PhotoView *myImageView1 = [[UIImageView alloc ] initWithFrame:frame];
    myImageView1.userInteractionEnabled = YES;
    myImageView1.image = myImage;
    [window addSubview:myImageView1];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    - (void)dealloc {
    [navigationController release];
    [window release];
    [super dealloc];
    @end
    Message was edited by: Victor Zhang

  • Custom eventing  for reporting --- am i using the correct ResourceEvent?

    Hi All,
    I am using a web content management tool which stores all the content created through the tool in /documents repository . This content is published in the portal under various roles  . I am working on a report to generate and report the hit counts for the pages in this repository . I have written a Km service that subscribes to GET_TEMPLATE event to generate these statistics.
    The problem i am facing is this . When i navigate through the KM folder structure to a given page in a subfolder and do a preview of the page content , the hitcount is incremented and the report reflects this increase . However if i navigate to the role where the content is published and view the content from the role , the page hit count is not incremented and the report does not show the increment .
    My questions are
    1) Do i need to write a custom KM event that notifies the repository broker about
        the page access through the roles?
    2) Is there any other standard event to which i can subscribe to get this page hit count.
    Any helpful answers will be rewarded.
    regards
    Subra

    Hi Subra,
    > is there any way to know if the tool is raising any event
    As I have been one of the developers, I can report that the tool definitely does not raise such an event explicitely. But as said above, it also shouldn't do this, as it shouldn't be needed. In addition, for the display the tool redirects to a KM navigation iView, which normally should lead to the expected event risen anyhow.
    But if it really doesn't work, you still have the option to ask btexx to check if this is a shortcoming on SAP side - which in the interest of a smooth working product should be tracked, maybe worked around...
    About the caching I can report that there is also no caching used at the moment for the display. This may change one day, for this in fact it would make sense to raise the event (even if the resource isn't called from the framework, but to enable such kind of statistics, if they won't be part of the product one day anyhow).
    Hope it helps
    Detlev
    Message was edited by:
            Detlev Beutner
    One additional remark for all people involved: I just remember to have read about the same "missing" event on SDN, but I never checked this in the end. It <i>might</i> be that the navigation iView only throws the getChildren event, as for other resources than XML forms elements, it only renders the name of the resource, not it's (or part of it's) content (so the content doesn't get accessed). This also would make sense as normally the access to the <i>Show</i> form could be differentiated from the access to the <i>RenderListItem</i> form.

  • Tooltip for datagrid's cells

    I know how to create a tooltip for datagrid and/or its
    columns. Is it possible to create a tooltip (or something similar)
    for each cell? So whenever the mouse is over a certain cell, a tip
    would be shown for that cell that depends on the value of the cell.
    Similar functionality can often be seen in web-based database apps:
    an Ajax query gets related data from a database on mouseOver.
    My need and idea is to
    - show a simple text list as a tooltip
    - the text would be fetched from a database via a web service
    - the fetch would be based on datagrid's (hidden) rowid and
    each column's (hidden) column id (which are real database columns)
    - the database structure is an n:m relation i.e. one
    rowid+colid can refer to several items that are then used in the
    tooltip
    Use case: A number is displayed in the datagrid. The need is
    to display 0-n references related to that specific figure (e.g.
    book names, notes etc) in the tooltip. Next cell's tooltip would be
    showing different references.
    Anybody any ideas or suggestions? Thanks!

    Hi,
    Did you try creating a custom itemRenderer and handling the
    mouse events for that item renderer component. There is also a
    property called dataTipFunction, please check that too.
    Hope this helps.

  • Custom calculation script for checkboxs

    Hello,
    Can anyone help me out with custom calculation script for this?  I have two mutually exclusive checkboxes that, when checked, I want to populate data into other text fields.
    If Checkbox1 is checked:
    Company1=Warehouse Alpha
    Address1=1234 Any Street
    City/State/Zip1= Los Angeles, CA 90020
    Contact Name1= Mr. Nice Guy
    Phone Number1= 213-854-8565
    Email1=[email protected]
    If Checkbox2 is checked:
    Company2=Warehouse Beta
    Address2= 5678 Awesome Blvd.
    City/State/Zip2= San Bernardino, CA 96545
    Contact Name2= Mr. Handsome
    Phone Number2= 909-824-8265
    Email2=[email protected]
    Thanks,
    Bryan

    So one has two check boxes and one wants them to be mutually exclusive. Name them the same and change the export value of the field. Try it and observe what happens as you check the different check boxes.
    You have described what happens if either box is checked but what happens when a checked box Is unckecked?
    One can place scripts in many locations. I would use a mouse up action for both the check boxes, use the same script for both check boxes.
    I would assume you are using the following names for the fields to populate:
    Company
    Address
    CityStateZip
    ContactName
    PhoneNumber
    Email
    // Mouse up action for both check boxes;
    // initial value for the fields:
    this.getField("Company"),value = "";
    this.getField("CityStateZip"),value = "";
    this.getField("ContactName"),value = "";
    this.getField("PhoneNumber"),value = "";
    this.getField("Email"),value = "";
    // test for check box value for selected box;
    if(event.value == 1) {
    this.getField("Company"),value = "Warehouse Alpha";
    this.getField("CityStateZip"),value = "1234 Any Street";
    this.getField("ContactName"),value = "Los Angeles, CA 90020";
    this.getField("PhoneNumber"),value = "213-854-8565";
    this.getField("Email"),value = "[email protected]";
    if(event.value == 2) {
    this.getField("Company"),value = "Warehouse Beta";
    this.getField("CityStateZip"),value = "5678 Awesome Blvd.";
    this.getField("ContactName"),value = "San Bernardino, CA 96545";
    this.getField("PhoneNumber"),value = "Mr. Handsome";
    this.getField("Email"),value = "[email protected]";
    // end Mouse up action for both check boxes;

  • Use of SAVE_TEXT in customer exits / BADI for purchase order

    Hi All,
    I am trying to save some long text by using SAVE_TEXT function module in a badi implementation for purchase order header text. The same is working fine if i try to update the PO header text via a report. But if i try using badi (the code is written in a PAI event for the BADI), then though the text transfer and save is successful during the code excution, but for the first time when i add any text its not visible in ME22N tcode. Since its an online event. But when i double click on that editor and the sap script editor gets opened. then i press back button, the text is appearing on the same small screen edtor . after this any number of time i edit or delete text, the save_text function module works fine.
    My issue is why for the first time always i have to double click on the editor to open the sap script editor. I have also included commit_text in this case after save_text FM.
    the requirement here goes like this. in one tab for PO header the user will enter some number (This is a customizing screen implemented through badi.) and the corresponsing discription should appear when user clicks on text tab in po header screen (me21n / me22n).
    Kindly help.
    Thanks
    Mamata

    Hi  mamata rath
    I have solve the problem which similar to yours.  the code which is as the following
    DATA: textline TYPE tdline,
            name TYPE c LENGTH 70,
            glines TYPE TABLE OF tline,
            gline  LIKE LINE OF glines,
            ls_header TYPE thead.
         CONCATENATE ch_eban-banfn ch_eban-bnfpo INTO name.
             ls_header-tdobject = 'EBAN'.
             ls_header-tdname = name.
             ls_header-tdid = 'B01'.
             ls_header-tdspras = sy-langu.
             CALL FUNCTION 'SAVE_TEXT'
               EXPORTING
    *           CLIENT                = SY-MANDT
                 header                = ls_header
    *           INSERT                = ' '
    *           SAVEMODE_DIRECT       = ' '
    *           OWNER_SPECIFIED       = ' '
    *           LOCAL_CAT             = ' '
    *         IMPORTING
    *           FUNCTION              =
    *           NEWHEADER             =
               tables
                 lines                 = glines
               EXCEPTIONS
                 ID                    = 1
                 LANGUAGE              = 2
                 NAME                  = 3
                 OBJECT                = 4
                 OTHERS                = 5
              IF sy-subrc = 0.
                  CALL FUNCTION 'COMMIT_TEXT'
                    EXPORTING
                      OBJECT                = 'EBAN'
                      NAME                  = name
    *                ID                    = '*'
    *                LANGUAGE              = '*'
    *                SAVEMODE_DIRECT       = ' '
    *                KEEP                  = ' '
    *                LOCAL_CAT             = ' '
    *              IMPORTING
    *                COMMIT_COUNT          =
    *              TABLES
    *                T_OBJECT              =
    *                T_NAME                =
    *                T_ID                  =
    *                T_LANGUAGE            =
              ENDIF.

  • How can I enter an event for the first Monday of every month?

    I used to have a Custom choice that allowed me to select day or date for repeat. Where is it?

    I don't believe there is such a custom repeat option with the iPhone's Calendar app, but if you are syncing calendar events with a supported calendar app on your computer or syncing calendar events over the air with an email account that supports it with an option to create such a custom repeating event with the online calendar, set up the custom repeating event there.

  • How to create event for BOR BUS2009 Object ?

    How to create a new event for BOR BUS2009 Object ?

    Hi,
    Please create a subtype for BOR BUS2009, say Z_BUS2009 and include your custom characteristic entities like Events, Methods, Key fields etc and finally do delegation. After delegation, all your custom changes reflects in BOR BUS2009.
    Regards,
    Prasanth

  • How to generate a report on 'Event Received' events for a resource objects

    Hello,
    I want to generate a report on all the recon events which are in 'Event Received' status, on a daily basis. Can you please let me know how to do this and what all tables are involved?
    Thanks

    Well thats pretty simple. Actually there are multiple tables in OIM database responsible for holding reconciliation data but event information is stored in one table RCE. So there are two simple ways to do that as follows:
    *1) Using OIM API ::*
    There is an API exposed (*findReconciliationEvent()*) in the tcReconciliationOperationsIntf interface. You can just pass a HashMap with one filter parameter for ReconEvent status as Event Received. In addition to it this API also requires the StartDate and EndDate (You can give current date for both arguments). This will return you a ResultSet containing all the events which are in that particular state. Just iterate through the ResultSet for all the event information ad create your report.
    *2) Using OIM database query::*
    Just write an SQL query to run in the database schema. Let's assume you have written a scheduler for the same. This is the code for your class:
    tcDataSet dsList = new tcDataSet();
    String query = " select * from RCE where RCE_STATUS='Event Received' ";
    log.debug(query);
    try {
    dsList.setQuery(getDataBase(), query);
    dsList.executeQuery();
    if (!dsList.isEmpty()){
    log.debug("Total Rows Found:" + dsList.getTotalRowCount());
    result = true;
    for (int i = 0; i < dsList.getTotalRowCount(); i++) {
    Write your custom logic here for generation of report
    }else{
    log.debug("No Events Found");
    result = false;
    } catch (tcDataSetException e) {
    e.printStackTrace();
    result = false;
    So you can do it both ways.
    Thanks
    Sunny

  • How do I set a recurring event for the last day of the month on iphone 4s calendar?

    I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.

    Hi,
    You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
    Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
    Do the same for the Fourth Monday.
    Best wishes
    John M

Maybe you are looking for