Modify items in datagrid

I have a datagrid that is bound to an array collection. Is
there a simpler way to modify the properties in the datagrid and
have the datagrid change to reflect the changes.. This is my
current code to alter on property and get the datagrid display to
update itself...
var item:Object = DGCollection.getItemAt (0);
item.label= "changed text";
DGCollection.itemUpdated(item);
This code will change the name of a row and update the
datagrid to display the changed text. I always thought that you
could use a one liner to do this same thing. Any ideas? or is this
how you do it

This is what I have:
[Bindable]
private var DGCollection:ArrayCollection = new
ArrayCollection ();
in a callback I receive data from the server and then i use
this line of code to populate the datagrid.
DGCollection.addItem (myObject);
and then here is my datagrid xml:
<mx:DataGrid dataProvider="{DGCollection}"
id="MyDataGrid">
<mx:columns>
<mx:DataGridColumn itemRenderer="MyRenderer1"
dataField="label" headerText="headerText"/>
<mx:DataGridColumn itemRenderer="MyRenderer2"
dataField="label" headerText="headerText"/>
</mx:columns>
</mx:DataGrid>
The data loads just fine but I thought since the datagrid was
bound to the collection that the ui what automatically update when
you change anything on the collection.
I've also tried this chunk of code to try to update the
collection:
DGCollection[myIndex].label = "test";
which doesn't work
is their a piece of code that I can use that updates the
collection automatically?

Similar Messages

  • Items in dataGrid

    Hello EveryOne
    I've datagrid & it is binded to dataProvider.
    when it displays data. I want to count the no. of rows
    visible.
    or should I say, i would like count items in datagrid similar
    as we do in .NET
    can anyOne help me.
    Thanks

    First this forum is intended for questions about Flex
    Builder. Flex language questions should be posted in the Flex
    General Discussion forum.
    Also, do not use Array as a dataProvider unless you are
    certain you will never be updating the data dynamically. Array does
    not dispatch the events necessary to cause the bound controls to
    update. Instead, use ArrayCollection. (or XML or XMLListCollection)
    A safe, generic way to get the length is:
    myDataGrid.dataProvider.length;
    Tracy

  • How to find and modify  item in a nested array collection?

    Hi,
    would anybody know how to find and modify item in a nested
    array collection:
    private var ac:ArrayCollection = new ArrayCollection([
    {id:1,name:"A",children:[{id:4,name:"AA",children:[{id:8,name:"AAA"}]},{id:5,name:"AB"}]} ,
    {id:2,name:"B",children:[{id:6,name:"BA"},{id:7,name:"BB"}]},
    {id:3,name:"C"}
    Let's say I've got object {id:8, name:"X"} , how could I find
    item in a collection with the correspoding id property, get handle
    on it and update the name property of that object?
    I'm trying to use this as a dataprovider for a tree populated
    via CF and remoting....
    Thanks a lot for help!

    Thanks a lot for your help!
    In the meantime I've come up with a recursive version of the
    code.
    This works and replaces the item on any level deep:
    private function findInAC(ac:ArrayCollection):void{
    var iMatchValue:uint=8;
    for(var i:uint=0; i<ac.length; i++){
    if(ac
    .id == iMatchValue){
    ac.name = "NEW NAME";
    break;
    if(ac
    .children !=undefined){
    findInAC( new ArrayCollection(ac.children));
    However, if I use the array collection as a dataprovider for
    a tree and change it, the tree doesn't update, unless I collapse
    and reopen it.
    Any ideas how to fix it ?

  • Updated GL7 Site to GL8 - Modified Items All necessary?

    I updated one of my sites from 7 to 8.
    Upload Modified Items wants to upload all 2000+ items, including large .mov files and tons of jpegs.
    How should I proceed?
    Do I need to upload everything, all modified items?
    I recall I can mark them all so they won't hit as modified items (but I forgot how)?
    I use Menu Machine 1.74 and Daverj ForceFrame actions.
    8-core Mac Pro, 10.5.2, CS2, GL 8.0.1
    Please advise...

    >I recall I can mark them all so they won't hit as modified items (but I forgot how)?
    Should be:
    Site > Publish Server > Sync Modification Times > All

  • Syncing Issues and ever growing Modified items list...

    Ok, I have a G4 Dual and a MBPro C2D which I use .Mac syncing to keep my iCal items synced up (sunk up? ...
    Anyway, although each calendar looks identical to each other, there seems to be some sort of confusion as when the desktop syncs, it tells me there are 413 modified items... but even if I accept it, a few hours later, 183 come up and then a few hours after than 413 again. I'm happy to remove all of the entries from one calendar and let the other feed it fresh but I am not sure of the protocol to do that correctly and I don't want to lose any entries obviously.
    Thoughts, tips, or links would be appreciated.
    -- Joshua

    The actual performance depends on the type of query and what kind of fields you query for each file. CFileFind does a batch query that can be used as a cache for certain popular fields. However if you want to read more than what it returns, then you have
    to hit the disk for each file. At this point you may as well use IShellFolder::EnumObjects to do paging which you can use a virtual list to implement (so instead of reading 1.5k files, you read from the 30-40 files on the current displayed page, and read again
    when the user switch pages).
    Visual C++ MVP

  • WPF Finding Selected ComboBox Item Within DataGrid

    Hi all... I'm having an issue trying to access the selected item value in a ComboBox within a DataGridTemplateColumn. 
    Through another question/answer I have got the ComboBox displaying the names as it should but the next step I'm having issues with is to be able to loop through each row in the DataGrid and determine the selected value of the ComboBox in that row as
    well as some other items and run some other code based on those values. 
    Any help would be appreciated. 
    Thanks,
    Greg
    <Grid>
    <DataGrid x:Name="gvDefaultCWWSchedule" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,109,10,214" AutoGenerateColumns="False" Grid.Row="0"
    AllowDrop="True" IsReadOnly="False" SelectionMode="Single" Background="Beige" CanUserAddRows="False">
    <DataGrid.Columns>
    <DataGridTemplateColumn Width="150">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <ComboBox Name="ddlUsers"
    ItemsSource="{Binding Path=Users}"
    DisplayMemberPath="{Binding Name, Mode=TwoWay}"
    SelectedValuePath="{Binding Uid, Mode=TwoWay}"
    SelectedIndex="{Binding Uid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    SelectionChanged="ComboBox_SelectionChanged"
    >
    <ComboBox.ItemTemplate>
    <DataTemplate>
    <StackPanel Orientation="Horizontal">
    <TextBlock Text="{Binding Name}" />
    </StackPanel>
    </DataTemplate>
    </ComboBox.ItemTemplate>
    </ComboBox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <DataGridTextColumn Binding="{Binding WeekNumber}" />
    </DataGrid.Columns>
    </DataGrid>
    <Button Content="Button" HorizontalAlignment="Left" Margin="729,32,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
    </Grid>
    public partial class Test : Window
    public Test()
    InitializeComponent();
    BindDefaultCWWSchedule();
    private void BindDefaultCWWSchedule()
    // THIS IS COMING FROM MY DB
    List<CurrentUser> UsersFinal = new List<CurrentUser>();
    UsersFinal.Add(new CurrentUser { Uid = 1, Name = "JOHN" });
    UsersFinal.Add(new CurrentUser { Uid = 2, Name = "BILL" });
    UsersFinal.Add(new CurrentUser { Uid = 3, Name = "MARY" });
    ObservableCollection<CWWDefaultScheduleWeek> DefaultSchedules = new ObservableCollection<CWWDefaultScheduleWeek>();
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 1, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 2, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 3, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 4, SelectedUser = null });
    gvDefaultCWWSchedule.ItemsSource = DefaultSchedules;
    private void Button_Click(object sender, RoutedEventArgs e)
    var rows = gvDefaultCWWSchedule.ItemsSource;
    ObservableCollection<CWWDefaultScheduleWeek> CWWSchedAssignments = new ObservableCollection<CWWDefaultScheduleWeek>();
    foreach (var row in rows)
    CWWDefaultScheduleWeek r = (CWWDefaultScheduleWeek)row;
    // FOR EACH ROW HERE I'M WANTING TO CREATE A LIST OF ITEMS AND RUN FURTHER CODE BASED ON IT... ISSUE IS FINDING THE ACTUAL SELECTED USER ON EACH ROW...
    CWWSchedAssignments.Add(new CWWDefaultScheduleWeek
    Users = r.Users,
    SelectedUser = r.SelectedUser,
    WeekNumber = r.WeekNumber
    private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    gvDefaultCWWSchedule.CommitEdit();
    public class CWWDefaultScheduleWeek
    public IEnumerable<CurrentUser> Users { get; set; }
    public CurrentUser SelectedUser { get; set; }
    public int WeekNumber { get; set; }
    public class CurrentUser
    public int Uid { get; set; }
    public string Name { get; set; }

    In a way, wpf is similar to web.
    More so than windows forms anyhow.
    XAML is mark up and flows like html.
    You have padding and margin which are rather familiar concepts.
    Whereas windows forms is absolute positioning and... well totally different from markup.
    You might find this sample interesting as a sort of mvvm taster.
    https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
    and event handling equivalents
    http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
    Note
    With a combo you bind the selecteditem to a propfull and then you can put a method call in the setter.  That will then be invoked when the user changes selection.
    Good luck and welcome to wpf development.
    It's a great technology.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • [Solved]Portal 10.1.4 - Request Help to Modify Item Name using PL/SQL API

    I have a region on a page that contains content items. These are PDF files that were uploaded. I want to know how I can programmatically change the description.
    I have been looking at both set_attributes() and modify_item_post_upload() functions in the API. Is this my best option, or is there an alternative.
    I have been leaning towards calling modify_item_post_upload(), but have a question on the parameters.
    I can get p_master_item_id, but what is p_item_id?
    I would like to call the method like this:
    declare
    l_masterid number;
    l_display_name varchar2(100);
    begin
    l_masterid := <some number);
    l_display_name := 'New Name for item';
    modify_item_post_upload(
    p_master_item_id => l_masterid,
    p_display_name => l_display_name
    end;
    So questions are:
    1. What modifications do I need for a simple call to change an items name?
    2. What additional functions/procedures do I need to call so the display gets updated with the new information? Do I have to clear the cache suing wxutils, or can I just call wwpro_api_invalidation.execute_cache_invalidation; ?
    If you want the "rest of the story" - I created a web front end in JDeveloper that allows specific end users to login, upload files, and delete items for a specific portal page containing content items. One of the common mistakes is a misspelling of the display name by the end user. So instead of deleting an item, then re-adding an item, the end user would like to edit the display name for just the item that has the misspelling. I have set this up in JDeveloper with an edit screen that contains just the display name. Now I need a function/procedure that I can call from the application module that will update just the display name for this particular item. I have already coded an ADF model that uses the search_item and converts the results into a result_set, and use that to create a View Object in the ADF for JDeveloper to use. Now to finish this user request, I just need to figure out the PL/SQL API part for modifying a display name. The item still needs to keep it's reference to the uploaded PDF file.
    Thanks, Ken

    Very nice! I like the code example. In looking at needing to change only the title of the item, I created a procedure that calls set_attribute. Here is the code:
    create or replace
    procedure update_newslinearchive_item (p_masterid in number, p_displayname in varchar2) as
    cursor items_cur(p_id IN NUMBER) is
    select * from wwsbr_all_items
    where masterid = p_id
    and caid = <pagegroup>
    and active = 1
    and is_current_version = 1
    and language = wwctx_api.get_nls_language;
    items_rec wwsbr_all_items%rowtype;
    begin
    dbms_output.put_line('masterid = ' || to_char(p_masterid));
    dbms_output.put_line('display_name = ' || p_displayname);
    -- Login to the portal for access to function calls
    wwctx_api.set_context('<username>','<password>');
    -- Verify that the item to be deleted is in the items table
    open items_cur(p_masterid);
    fetch items_cur into items_rec;
    if items_cur%found then
    dbms_output.put_line('record found');
    wwsbr_api.set_attribute(
    p_site_id => items_rec.caid,
    p_thing_id => items_rec.id,
    p_attribute_site_id => wwsbr_api.SHARED_OBJECTS,
    p_attribute_id => wwsbr_api.ATTRIBUTE_TITLE,
    p_attribute_value => p_displayname
    wwpro_api_invalidation.execute_cache_invalidation;
    dbms_output.put_line('Clearing Cache');
    -- Now clear the web-cache
    wxvutil.invalidate_reset;
    wxvutil.invalidate_uri('<server:port/path/to/page>,0,null);
    wxvutil.invalidate_exec('<server>',4001,'<webcache password>');
    else
    dbms_output.put_line('record NOT found');
    end if;
    close items_cur;
    exception
    when others then
    dbms_output.put_line('SQLCODE = ' || SQLCODE);
    dbms_output.put_line('SQLERRM = ' || SUBSTR(SQLERRM,1,200));
    if items_cur%isopen then
    close items_cur;
    end if;
    end update_newslinearchive_item;
    Thank you for the example for modify_item_post_upload!
    Ken

  • BAPI to modify items and create new ones in Purchase Order

    Hi, everybody!
    We need to change purchase orders (PO's) using a BAPI.
    We need not only to modify and delete the existing items in a PO, but also create new
    items in the same PO. Is it possible to do that using the bapi called BAPI_PO_CHANGE?
    If it isn't so, which BAPI should we use?
    Could anybody help us?
    Thanks in advance

    Hi
    Use the Function module BAPI_PO_CHANGE. This BAPI changes the existing line and also will append new lines to the existing POs.
    The other mandatory part is to populate the Change Parameter tables too.
    Hope this answers your question.
    Raj.

  • Modify Item details while submitting an order

    Hi Experts,
      While submitting an order I need to modify one of the field in the item table when saving. So i am writing the code in the BADI ORDER_SAVE, method CHANGE_BEFORE_UPDATE .
    I have got the item details with me now in the BADI. How can i modify the particular field ?
    Please help.
    Many Thanks,
    Neeraj

    Hi Neeraj,
       Use CRM_ORDERADM_I_MAINTAIN_OW FM to update fields in item list.
    Regards,
    Lakshmi.Y

  • How to modify item quantity in an scheduling agreement

    Hi,
    I'm trying to modify target quantity (ekpo-ktmng) in an item of a scheduling agreement (you can see it in me33l transaction).
    When the users tries to modify, using me33l, the quantity of an item in an scheduling agreement, I need to pick this value (ktmng) and modify it according to some rules.
    To catch the value I use EXIT_SAPMM06E_016 user-exit, and when the user modifies a value in the i_ekpo register of the user exit I see the new value that the user introduced. But I need to put a new value and it isn't enough with modifying this structure (i_ekpo).
    So I think in a bapi, first of all I've tried with BAPI_PO_CHANGE but I receive the following error:
    "Not possible to process a scheduling agreement using this function"
    How can I change the target quantity of an item in a scheduling agreement?
    thanks in advance

    Thanks for your reply, I'm trying with the following piece of code:
    DATA: w_ekko TYPE ekko,
          t_ekpo TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
         t_ekpo2 TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
    START-OF-SELECTION.
      SELECT SINGLE * INTO CORRESPONDING FIELDS OF w_ekko
      FROM ekko
      WHERE ebeln = '5500000001'.
      SELECT * INTO TABLE t_ekpo
      FROM ekpo
      WHERE ebeln = '5500000001'.
      t_ekpo2[] = t_ekpo[].
      READ TABLE t_ekpo2 INDEX 1.
      t_ekpo2-ktmng = '69'.
      MODIFY t_ekpo2 INDEX 1.
      CALL FUNCTION 'ME_UPDATE_AGREEMENT_PO'
        EXPORTING
          i_ekko_new       = w_ekko
      I_EKKO_OLD       =
      I_LOGSY          =
        TABLES
      XEKBES           =
          xekpo            = t_ekpo
       YEKPO            = t_ekpo2
      XSVAB            =
    But I receive a dump from SAP.
    In t_ekpo I put all the items of the scheduling agreement, the I modify one of the (first) and store it in t_ekpo2, but I'm not very sure of this is the good way of working.
    Any help would be very appreciated.
    Thanks again

  • Modify item in the Charges tab of the Service Request form

    If the line of the Action tab inside the Charges tab of the Service Request is entered by a Service Agent if the item is entered incorrectly the line can be later changed but if it is entered from Mobile Field Service the line does not allow modification. Is there any way we can modify this lines?
    Thank you.

    I want the user not be able to edit any of the fields in the Attribute tab under MyProfilehttp://rajivdewan.blogspot.com/2011/08/modify-authorization-policies-in-oim.html
    Also in the roles, resource, Proxy tab he should not be able to create request for role, resource, proxy respectivelYou can remove access from Templates. For Proxy, create authroization policy to restrict the search results
    Or
    You'll have to find the exact JSPX file to remive these tabs.

  • How to get the Highlighted Item on DataGrid?

    Hello everybody...
    I've already searched in a bunch of sites and forums, and i can't find anything...
    I need to get some data on the Highlighted (not selected) Item on my DataGrid (I intend to use MouseOver event)...
    does anyone have a clue on how to do that?
    ps. sorry for grammar mistakes... my english is not very good...

    Hi
                 I have done some exercise on that but i could not found any solution for this .. but one thing when u use mouse over effect flex will take the object of the datagrid not that object of the row u mentioned..
             when u place mouse on that datagrid it will automatically take that datagrid as object i think so ..
                       let us know if u get any solutions on that perticular task.. Because i have some what interest on this task.. This is some what new task for me to work out...
                  thanks for posting ...

  • Editing items in datagrid

    Hi,
    When hitting enter after editing an item in a datagrid, the
    next row is selected and the item editor for the same column is
    shown.
    I want the enter button to close the item editor keeping the
    same row selected.
    I'd hoped that I could extend the DataGrid class and override
    this functionality but it seems that the code is held in private
    methods.
    Has anyone come across this before or have any possible
    solutions. I've thought of a couple of solutions but they're not
    very elegant.
    Cheers

    Hi,
    1. editing should automatically edit dataProvider. If you use default editing it be automatically. If you create you own itemEditor you should check it.
    2. Both methods for editing can be. You can save each correction to DB. Also you can detect all changes and save them after pressing special button. The best variant is depends on the task.

  • BADI / Exit ME51N SAVE button, modify items is possible

    Hi all,
    I have to save certain information in a PR items on having touched the button SAVE, have seen that passes for several exits, have the parameters type import.
    The last exit for the one that passes is the EXIT_SAPLMEREQ_006, but it does not have parameters.
    Would they know some exit or badi from where I could modify the items data on having touched the button SAVE?
    Thanks.

    Hi Gautham,
    I have already tried all the exits of MEREQ001.
    But I see no any exit where can modify the data when press SAVE.
    Thanks.

  • Modify Item Description

    Dear Experts,
    Anyone know how to modify/add some text in the Item Description in Sale Order Form. I'm trying to do that; however, they alway keep asking me to add the new item.
    For example
    Item A:  Orange
    Item B:  Apple
    When I selected : Item A; Orange will show up as the item description
    So, I wanna add Orange *Free** or other text
    But it did not allow me to do so.
    Thanks again.

    Hi,
    You cannot modify the Item description field for the selected item in the Sales Order as the data regarding the item is fetched from the Item Master Data table.
    You can add a text line under the selected item to mentioned whatever you want regarding the item like *** FREE ***, **SAMPLE** etc
    For that :
    1) Open the Sales Order. Goto Form Settings in the menu above and in table format make TYPE field active and visible.
    2) Enter the Item which you want
    3) In the next Line select in the Type drop down TEXT and enter whatever your text is.
    Hope it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

Maybe you are looking for