How to update a list in parent view with data from child view/window ?

I have a view named AccountListView that displays some buttons and a list of accounts.Its viewmodel is called AccountListViewModel and has a collection : ObservableCollection<AccountViewModel>. What I'd like to acomplish: whenever I press the Add/Edit
Button from the AccountListView to open a new window/usercontrol, i.e. AccountView and bind it to an instance of AccountViewModel that will have some fields to fill in and a Submit and Cancel buttons. How can I update the ObservableCollection<AccountViewModel>
from  inside the child view, so when I click on the Submit button from AccountViewModel it will return an AccountViewModel object with the data I filled in and add it to the observablecollection. Would notifications from prism be the right way ? Should
I include code from the AccountListViewModel and AccountViewModel ?

The way to communicate between view models in Prism is to use the EventAggregator. You raise an event from view model A and subscribe and handle this event in view model B. I have written a blog post about it which should be helpful here:
http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/.
In your case you could define an event that carries an AccountViewModel object and pass this one from view model A to view model B:
public class AccountViewModelEvent : CompositePresentationEvent<AccountViewModel>
Please refer to the blog post for more information and a complete code example.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

Similar Messages

  • How to Copy complete structure of a table with data from one database table to another databse table

    I need a sql query to copy structure of table with data from production table of ONLINEBTREKDB database to production table of Archive database.
    I tried this query
    select * into Archive.dbo.Production from ONLINEBTREKDB.dbo.Production p
    but problem is I am able to copy the table schema and data but not able to copy constraints(PK)
    Any Help?
    seema

    You've multiple options
    1. Use generate scripts wizard available in SQL management studio. This is particularly helpful when you want to script out lot of objects. You can also choose to script data as well inside this. This can be launched by right clicking the db, choosing tasks
    -> generate scripts and then selecting required options inside the wizard
    2. Use object explorer and right click and script out table. You can also use search functionality to find object you want inside object explorer
    http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html
    3. Use query based on INFORMATION_SCHEMA views like TABLES,COLUMNS,CONSTRAINT_COLUMN_USAGE etc to generate the script
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • BC4J,Setting a default Value In a View With Data From An Other View

    hi
    I'm developping A BC4J. I want to set the default value of a field By counting the number of rows in an other view.
    So I want to instanciate the view and execute the sql statement and get the result.
    Is that the right manner to do it or not.
    can someone help me to do that
    cheers
    ghassen

    There's lots of ways to skin this cat depending upon whether you mean "database view" or "view object" when you say "view", and individual requirements.
    Given database views v1 and v2 with a common key between them
    select v1.x, count(*) from v1,v2 where v1.key = v2.key group by v1.x;
    either in the database view or in expert mode for the view object ( I think it'll take group by, but never done it ). ( assumption is that v1.x is a primary key for v1 )...
    Try this from sql*Plus first to get a feel for how this works.
    The catch with the above is that it is "static"... if you can ADD rows to v2 in your application... they aren't visible in the count until saved and requeried.
    Another way ( I think... hopefully Oracle folk will kibitz... )
    Create your own attribute on the view object like "TheOtherCount".
    In the view object's RowImpl, find the "getTheOtherCount". Find the count of rows in the second view object or entity object or rowSetInfo through the method of your choice. ( If you've already set up a master detail relationship that is active you can just get the rowcount! ). Refer to earlier postings on how to get the rowcount, or to create a dynamic view query to get the count.
    The nice thing is that this should reflect your counts even if the second view has added or removed rows... but will probably move like a snail.
    Note that if you have a need where you want the row count updated in a frame for v1 whenever v2 is added to or removed from... well... then you need to set up some sort of event listener to do a redisplay of v1's frame, I'd think? Since the attribute you've created in the view object is not based on an entity object attribute, it has no way to know when it has been "updated" via an additional or removed row from the target.
    I'm posting the above because no one has responded yet... it may form a place to start from. And maybe someone in the know will go "No, No, No... KKirk... it doesn't work that way at all!" and fill us in on how this can be accomplished!
    Good Luck

  • How to populate Adobe LiveCycle Designer generated  PDF Forms with data from Database in Windows app

    Hi
    I have a PDF template designed in Adobe LiveCycle Designer. This template has form fields which needs to be filled with data programmatically. I am using windows application in C#.Net 2005 in which I want to retrieve data from database and merge this data into PDF form in respective fields.
    How this can be achieved?
    I searched a lot & I found that we can process the XDP file generated from PDF to acheive this. I created the XDP file out of the PDF template created in designer. But I don't know how to merge data from database into that XDP file in respective fields and again convert this XDP file back to PDF programmatically. Can anybody help me ? This is urgent.
    Thanks in advance.
    Sambhaji

    Please ignore the above code.<br />The following one is correct one.<br />using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br />using System.Text;<br />public partial class _Default : System.Web.UI.Page <br />{<br />    protected void Page_Load(object sender, EventArgs e)<br />    {<br />        Response.ContentType = "application/vnd.adobe.xdp+xml";<br />        StringBuilder responseString = new StringBuilder();<br />        responseString.Append("<?xml version='1.0' encoding='UTF-8'?>");<br />        responseString.Append("<?xfa generator='AdobeLiveCycleDesigner_V8.0' APIVersion='2.5.6290.0'?>");<br />        responseString.Append("<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>");<br />        responseString.Append("<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>");<br />        responseString.Append("<xfa:data>");<br /><br />        responseString.Append("<form1>");<br />        responseString.Append("<TextField1>Homer</TextField1>");<br />        responseString.Append("<TextField2>Simpson</TextField2>");<br />        responseString.Append("<field name ='DropDownList1'>");<br />        responseString.Append("<items save='1'>");<br />        responseString.Append("<text>1</text>");<br />        responseString.Append("<text>2</text>");<br />        responseString.Append("<text>3</text>");<br />        responseString.Append("</items>");<br />        responseString.Append("</field>");<br /><br />        responseString.Append("</form1>");<br /><br />        responseString.Append("</xfa:data>");<br />        responseString.Append("</xfa:datasets>");<br />        responseString.Append("<pdf  href='C:\\Test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />");<br />        responseString.Append("</xdp:xdp>");<br /><br />        Response.Write(responseString);<br />        Response.Flush();<br />        Response.End();<br />    }<br />}

  • Performance View with data from Custom Rule

    Hello again everybody,
    so we created a vbscript which measures time needed for a specific process inside a program.
    Now we made a rule for getting this data inside SCOM. Alerting and Health-Monitoring works fine.
    For example, we made "if TimeNeeded>5" critical Health state, works like a charm.
    But now, we want to view the data (the script runs every 30 seconds) inside a Performance view.
    - We checked if the rule works as intended. Check
    - Set the rule to "Performance Collection". Check
    - Set the right target group. Check
    - Override for specific target. Check
    - Created a perf.monitor "collected by specific rules" (added our rule) with right targeting. Check
    But the performance-view keeps unpopulated.
    What now?

    I exported the MP as XML file but the rule is not in there, only references.
    But thats not the point anyway, the rule is working.
    The only thing missing is to grab the data the script returns (via oAPI propertybag) and show it in a view. Thats all
    Maybe the question was not clear enough:
    Our script returns a value every 30 seconds, for example 6, then 4, then 8, then 10 and so on...
    All we want now is to show these values in a Performance-View.
    Graphical example:
    10|                            X
    08|                     X
    06|         X
    04|               X                              X
    02|                                    X
    00|
    I guess you now know what I mean.
    This Article
    corelan.be/index.php/2008/04/16/using-customnon-performance-counter-data-to-build-graphs-in-operations-manager-2007
    is EXACTLY what I want and what I did.
    But my Performance-View refuses to show
    ANYTHING...
    Whats the problem?

  • Workflow - how to update multiple list items

    Is it possible to update up to 3 list items with the same information using a workflow?  My scenario is where a company vehicle (registration number) has up to three drivers assigned to it - Driver Name 1, Driver Name 2 and Driver Name 3.   I
    have two separate lists - one for vehicles (fleet list) and one for drivers (driver database).  In my workflow when an item is created or changed in the fleet list, I would like the current vehicle registration to be updated in all three driver records
    in the driver database.  I am not sure if I can do this as I am unsure of what my unique look up would be as I need to be able to tie a vehicle registration to a driver name. Any advice would be much appreciated.
    Thanks

    Hi,
    Refer to the following threads about how to update multiple list items simultaneously.
    http://social.technet.microsoft.com/Forums/en-US/936d05ba-6e86-4f44-bbdb-b3c5c12b2c68/how-do-i-update-multiple-list-items-at-once-in-a-sharepoint-list
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2d342b01-1978-40c9-a203-303d145b331e/how-to-update-mulitple-list-items-at-same-time
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8d5b7424-58dc-470b-8142-90755dbdeaae/sharepoint-workflow-change-multiple-items-in-other-list
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Update data from a view

    Hi,
    trying to update data from a view with:
    - Company (table)
    - Products (table)
    In a form, the user wants to update
    e.g: both products.product_name and Company.company_name.
    Is there a way to update a view records built on 2 tables ?
    Any idea will be really appreciated
    Thks

    An other question on INSTEAD OF Trigger:
    Base Tables:
    1.
    SQL> desc pcs_companies;
    Name Null? Type
    COMPANY_ID NOT NULL NUMBER(12)
    COUNTRY VARCHAR2(350)
    COMPANY_NAME VARCHAR2(320)
    COMPANY_PHONE VARCHAR2 (320)
    COMPANY_FAX VARCHAR2(320)
    COMPANY_URL VARCHAR2(150)
    UPDATED_DATE DATE
    2.
    SQL> desc pcs_individuals;
    Name Null? Type
    INDIVIDUAL_ID NOT NULL NUMBER(12)
    COMPANY_ID NUMBER(12)
    FIRST_NAME VARCHAR2(320)
    LAST_NAME VARCHAR2(320)
    LOB VARCHAR2(300)
    JOB_ROLE VARCHAR2(300)
    TITLE VARCHAR2(300)
    GENDER VARCHAR2(3)
    EMAIL VARCHAR2(720)
    FAX VARCHAR2(720)
    PHONE_NO VARCHAR2(720)
    UPDATED_DATE DATE
    COUNTRY VARCHAR2(150)
    ADDRESS_1 VARCHAR2(720)
    ADDRESS_2 VARCHAR2(720)
    ADDRESS_3 VARCHAR2(720)
    CITY VARCHAR2(720)
    3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
    4.
    SQL> CREATE VIEW V_PCS_COMPANY_IND
    AS
    SELECT
       i.INDIVIDUAL_ID,
       c.company_id,
       c.country,
       c.Company_name,
       c.company_phone,
       i.Company_id indiv_company_id,
       i.gender,
       i.first_name,
       i.last_name,
       i.lob,
       i.job_role,
       i.title,
       i.email_address,
       i.fax,
       i.phone_no ,
       i.address_1,
       i.address_2,
       i.address_3,
       i.city
    FROM
      pcs_individuals i,
      pcs_companies c
    WHERE
      i.company_id = c.company_id
    5.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
    INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
    FOR EACH ROW
    begin
    update PCS_COMPANIES
    set
         Company_name = nvl(:new.company_name,company_name),
         company_phone = nvl(:new.company_phone,company_phone)
    where company_id = :new.company_id;
    update PCS_INDIVIDUALS
    set
         gender = nvl(:new.gender,gender),
    first_name = nvl(:new.first_name,first_name),
         last_name = nvl(:new.last_name,last_name),
         lob = nvl(:new.lob,lob),
         title = nvl(:new.title,title),
         email_address = nvl(:new.email_address,email_address),
    phone_no = nvl(:new.phone_no,phone_no),
         fax = nvl(:new.fax,fax),
         country = nvl(:new.country,country),
         address_1 = nvl(:new.address_1,address_1),
         address_2 = nvl(:new.address_2,address_2),
         address_3 = nvl(:new.address_3,address_3),
         city = nvl(:new.city,city)
    where company_id = :new.company_id;
    end PCMS_COMP_IND_UPDATE_TR;
    6.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
    INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
    DECLARE
    ID number;
    BEGIN
    INSERT INTO pcs_companies (org_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    INSERT INTO pcs_individuals (company_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    end;
    My question
    On point 6:
    Assumption:
    - Company_id is PK of pcs.Company and FK in pcs.individuals
    - It should be feed by sequence (v_pcs_comp_id_seq)
    Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
    Thks for any advice,
    lamine

  • How to get the view link definition from the view link accessor

    Hi,
    I am using Jdev 10.1.3 and ADF BC. I am trying to do deep copy in a master/details view, after the new child record is created, I want to update the foreign key attribute. I know I can get the list of attribute definitions from the row in the view object, which include the view link accessors, I am wondering if I can get the view link definition from the view link accessors, so that I can get the source and destination attribute names.
    Thanks!

    Hi,
    you should get this through
    ViewObject vo = this.findViewObject("LocationsView1");
    int indx = vo.getAttributeIndexOf("DepartmentsView");
    ViewAttributeDefImpl vAttrDefImpl = (ViewAttributeDefImpl) vo.getAttributeDef(indx);
    ViewLinkDefImpl vdefImpl = (ViewLinkDefImpl) vAttrDefImpl.findViewLinkDefImpl();
    Note that this code starts from the ApplicationModuleImpl class, which is why I used this.findViewObject().
    Frank

  • How to extract data from maintenance view

    Hi experts,
    How can I select the data from maintenance view. As you know select query doesn't work on the maintenance view. And View name will be known at run time only.
    Thanks
    Yogesh Gupta

    > Let me tell you that I am a SAP certified ABAP consultant having experience of 4.5 years.
    I suspect that we will be hearing more comments about that.
    > Whatever question I asked can't be replied with the basic training (if yes please tell me even one).
    Debugging a macro?
    Another one => FM or BAPI to create the Activity Group in 4.0B No answer is possible? You have to be joking!
    And in How to get email ID fo a SAP user you obviously didn't even try Graham's answer!
    > I closed some of the answered questions since I didn't get the answers for them for a long time and SDN site doesn't allow to keep more than 10 questions open.
    The "comment field" is not mandatory. You don't need to flood the forum with your questions again.
    > I do respect your  concerns but I have no intention to abuse this site as it has been very helpful for me.
    That is the most important part. Thank you. But you seem to be unaware of the "search" functionality.
    If you can imagine that you are not the first person to ask a certain question, then you can be sure that someone else already has and you can find the answers on your own. If you still have doubts, then ask a specific question providing the details.
    Based on your other questions, you are on release 4.0B. Is that still correct?
    Cheers and thanks for responding,
    Julius
    Edited by: Julius Bussche on Jan 23, 2009 12:06 AM

  • How to retrieve data from a view.

    HI,
    I want to retrieve the values of the <b>Field MNTXT from the view V_T530</b>.
    Please let me know how i can retrieve data from this view.The Select statement doesnt work on a view.
    Regards,
    Bhavika

    Hi kumar,
    By using select stattement you can fetch from view. 
    Here viaufkst is view.
    For it is working. please check.
    select (g_selfields_tab) from viaufkst
              into corresponding fields of table order_itab
                       for all entries in order
                              where                "(g
                              aufnr in order and
                              equnr in equip and
                              priok in prior and
                              iphas = '3' and
                              ilart in acttyp and
                              qmnum in notif and
                              werks = plant and
                              auart in ortyp and
                              getri in date.
    please try.
    with Regards,

  • How to extraxct  data from a view.

    hi,
        i'm tying to extrct data from a view vbdka, with select. but i;m getting a syntax error that it anot a DB Table or DB view, pls tell me how to extract data from that view.
    thanks.

    hi,
    just check out if u have declared the table or not n see if it is not a structure also
    madhuri.

  • How to update a version 6.0 of Acrobat Reader Professional when upgrading windows XP to 8.1 ?

    How to update a version 6.0 of Acrobat Reader Professional when upgrading windows XP to 8.1 ?

    There is no product called Acrobat Reader Professional. There are two possibilities with different answers.
    1. You have Acrobat Professional (no "Reader"). You will have to buy the latest, Acrobat 11 (XI) Pro. No upgrade pricing is available for version 8.
    2. You have Adobe Reader (no "Professional"). You can download the latest free Adobe Reader http://get.adobe.com/reader

  • How to select data from Maintance View in Program

    Dear All ,
    How to select data from Maintance View V_T052 in abap Program.
    Regards,
    Archana

    TABLES: t179, t179t.
    DATA: v_t179_int TYPE TABLE OF v_t179.
    SELECT * FROM t179
      JOIN t179t ON
        t179prodh = t179tprodh
      INTO CORRESPONDING FIELDS OF TABLE v_t179_int.
    Reward points...

  • How to retrive data  from  database views or projection views

    how to retrive data  from  database views or projection views

    Hi chintam,
    1. Very simple
    2. Just like normal select statement.
    3. Select * from VIEWNAME.
    4. (Instead of the tablename, we just have to give the viewname)
    regards,
    amit m.

  • How to find the list of applications registered with OID?

    Could some one please help me?
    how to find the list of applications registered with OID?

    Is there any table from which we would be able to see?

Maybe you are looking for

  • Satellite P855-105 - 3D is not working

    Problem with a brandnew Satelite P855-105 with the glasses Free 3D Display: Brandnew unit - Factory installed. Even playing of one of the 3 3D Videos preloaded from Toshiba does not workt. The Toshiba Player start's but it displays 2 pictures side by

  • Droid 3 = ***!!!

    So, after about 8-10 replacements Droid 3's in just over a year (1 was via insurance), I'm ready to switch!!! This phone is the biggest pile of crap because of its ****** camera! We got a replacement phone last week and out of the box the camera forc

  • Help me with a program

    Hello I hope someone can help me!!!!!!! I have made a program to make math here it is. now it works but i want to change from "Integer" to "double" , but this don't work my compiler says always error can someone help me! when you can please sent me a

  • Problem with True Type font

    I have a Windows True Type font (Palatino Linotype, purchased directly from Linotype) that I use in my PowerPoint presentations in order to provide compatibility with my benighted PC-based clients. I just installed Leopard (a Christmas present from m

  • Macbook air, mountain lion, FaceTime

    Hi there guys, I've purchased a macbook air that came with Mountain Lion. And also that came with FaceTime installed. My question is I can still purchase FaceTime on App Store. Are there any differences between the one that comes installed on ML? Or