Prgramatically set ParameterBindings for To DataFormWebparts on the Same Page.

I have an External List Called TTOrderbook. One of the Columns on the External List is called AmendedOrderID.  Its the Key of another TTOrderbook, to which this Order TTOrderbook.  (i'e a self referencing table)
So I need to create a SitePage that Shows a 2 TTOrderbook record The 'Main'' one and the  'Amended' One. When the Page is loaded it gets passed a parameter which is the BDCID of the 'Main Order.
I create  a site page in my Visuaal Studio Project and drop  in Two Webpartzones and add a DataformWebpart to each Zone. like this:(XSL left out for brevity)
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<table>
<tr>
<td>
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="wpzMainOrder" Title="MainOrder">
<ZoneTemplate>
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" NoDefaultStyle="TRUE" ViewFlag="8" Title="New Order/Amendment"
PageType="PAGE_DISPLAYFORM"
Default="FALSE" DisplayName="dfwpMainOrder"
partorder="1" id="dfwpMainOrder">
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" UseInternalName="true" UseServerDataFormat="True"
selectcommand="&lt;View&gt;&lt;/View&gt;" id="SPDataSourceNainOrder">
<SelectParameters>
<WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/>
<WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" />
<WebPartPages:DataFormParameter Name="MaximumRows" ParameterKey="MaximumRows" PropertyName="ParameterValues" DefaultValue="10"/>
</SelectParameters>
</SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="{{orderID}}"/>
<ParameterBinding Name="ListID" Location="None" DefaultValue="{{listID}}"/>
<ParameterBinding Name="MaximumRows" Location="None" DefaultValue="10"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<datafields>@BdcIdentity,BDC Identity;@ID,Order ID;@Type,Type;@ArbitrageName,ArbitrageName;@HedgedTradeID,HedgedTradeID;@Customer,Customer;@Portfolio,Portfolio;@BS,BS;@Entity,Entity;@Entity2,Entity2;@Product,Product;@Contract,Contract;@Contract2,Contract2;@Commodity,Commodity;@Lots,Lots;@LotsFilled,Lots Filled;@LotsRemaining,Lots Remaining;@Price,Price;@GoodTillType,Good Til Type;@GoodTill,Good Until;@Broker,Broker;@Status,Status;@Notes,Notes;@NearDate,Near Date;@FarDate,Far Date;@Created,Created;@Updated,Updated;@CreatedBy,CreatedBy;@UpdatedBy,UpdatedBy;@Maturity,Maturity;@TakenBy,Taken By;@TakenTime,Taken Time;@Adjustment,Adjustment;@PricingBasis,Pricing Basis;@CustomPricingBasis,Custom Pricing Basis;@Requestor,Requestor;@PriceMultiplier,PriceMultiplier;@LotsMultiplier,LotsMultiplier;@AmendedOrderID,AmendedOrderID;</datafields>
<XSL>
</XSL>
</WebPartPages:DataFormWebPart>
</ZoneTemplate>
</WebPartPages:WebPartZone>
</td>
<td>
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="wpzAmendedOrder" Title="AmendedOrder">
<ZoneTemplate>
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" NoDefaultStyle="TRUE" ViewFlag="8" Title="Amended Order"
PageType="PAGE_DISPLAYFORM"
Default="FALSE" DisplayName="dfwpAmendedOrder"
partorder="2" id="dfwpAmendedOrder">
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" UseInternalName="true" UseServerDataFormat="True"
selectcommand="&lt;View&gt;&lt;/View&gt;" id="SPDataSourceAmendedOrder">
<SelectParameters>
<WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/>
<WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" />
<WebPartPages:DataFormParameter Name="MaximumRows" ParameterKey="MaximumRows" PropertyName="ParameterValues" DefaultValue="10"/>
</SelectParameters>
</SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="{{orderID}}"/>
<ParameterBinding Name="ListID" Location="None" DefaultValue="{{listID}}"/>
<ParameterBinding Name="MaximumRows" Location="None" DefaultValue="10"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<datafields>@BdcIdentity,BDC Identity;@ID,Order ID;@Type,Type;@ArbitrageName,ArbitrageName;@HedgedTradeID,HedgedTradeID;@Customer,Customer;@Portfolio,Portfolio;@BS,BS;@Entity,Entity;@Entity2,Entity2;@Product,Product;@Contract,Contract;@Contract2,Contract2;@Commodity,Commodity;@Lots,Lots;@LotsFilled,Lots Filled;@LotsRemaining,Lots Remaining;@Price,Price;@GoodTillType,Good Til Type;@GoodTill,Good Until;@Broker,Broker;@Status,Status;@Notes,Notes;@NearDate,Near Date;@FarDate,Far Date;@Created,Created;@Updated,Updated;@CreatedBy,CreatedBy;@UpdatedBy,UpdatedBy;@Maturity,Maturity;@TakenBy,Taken By;@TakenTime,Taken Time;@Adjustment,Adjustment;@PricingBasis,Pricing Basis;@CustomPricingBasis,Custom Pricing Basis;@Requestor,Requestor;@PriceMultiplier,PriceMultiplier;@LotsMultiplier,LotsMultiplier;@AmendedOrderID,AmendedOrderID;</datafields>
<XSL>
</XSL>
</WebPartPages:DataFormWebPart>
</ZoneTemplate>
</WebPartPages:WebPartZone>
</td>
</tr>
</table>
</asp:Content>
and then in the codeBehind for my page I set the ListID and OrderID for the two webparts programmatically like this
protected void Page_Load(object sender, EventArgs e)
WebPartManager wpm = SPWebPartManager.GetCurrentWebPartManager(this.Page);
dfwpMainOrder = (DataFormWebPart)wpm.WebParts["dfwpMainOrder"];
dfwpAmendedOrder = (DataFormWebPart)wpm.WebParts["dfwpAmendedOrder"];
//dfwpMainOrder = (DataFormWebPart)Page.Master.FindControl("PlaceHolderMain").FindControl("wpzMainOrder").FindControl("dfwpMainOrder");
//dfwpAmendedOrder = (DataFormWebPart)Page.Master.FindControl("PlaceHolderMain").FindControl("wpzAmendedOrder").FindControl("dfwpAmendedOrder");
// Set up the Main Dataform
string bdcid = Page.Request.QueryString["id"];
mainOrderID = Convert.ToInt32((Microsoft.SharePoint.BusinessData.Infrastructure.EntityInstanceIdEncoder.DecodeEntityInstanceId(bdcid)[0]));
dfwpMainOrder.ListId = FixPortalLists.TTOrderBook.List.ID;
dfwpMainOrder.ParameterBindings = dfwpMainOrder.ParameterBindings.Replace("{{orderID}}", mainOrderID.ToString());
dfwpMainOrder.ParameterBindings = dfwpMainOrder.ParameterBindings.Replace("{{listID}}", FixPortalLists.TTOrderBook.List.ID.ToString("B"));
SPListItem mainOrder = FixPortalLists.TTOrderBook.GetItemByDBID(mainOrderID);
// Ifits an Amendment, set up the second Dataform
if (mainOrder["AmendedOrderID"] != null)
amendedOrderID = (int)mainOrder["AmendedOrderID"];
dfwpAmendedOrder.ListId = FixPortalLists.TTOrderBook.List.ID;
dfwpAmendedOrder.ParameterBindings = dfwpAmendedOrder.ParameterBindings.Replace("{{orderID}}", amendedOrderID.ToString());
dfwpAmendedOrder.ParameterBindings = dfwpAmendedOrder.ParameterBindings.Replace("{{listID}}", FixPortalLists.TTOrderBook.List.ID.ToString("B"));
else
// need to abourt loading of the secon dfwp
dfwpAmendedOrder.Enabled = false;
When I step thru debugging I can See that I am assigning a DIFFERENT OrderID to each of the webparts. But They Are both showing the  SAME record, 
I did a Database Trace and can see that the SAME record is getting requested from the database TWICE.
I'm on SP2010 SP1. Using VS2012.
How can I resolve this?

I Fugured it out.
I was passing in the order id using a parameter called ID. Both DFWPs were picking this up and using it to get the listitem. I changed the Parameter name To Order ID so that the DFWPS would not see it and changed  the Parameter bindings to pass in the
BDC id instead of the database id.
Its working now.

Similar Messages

  • Can i use one JSF component's value for other component in the same page.

    Can i use one JSF component's value for other component in the same page.
    For example
    I have a <h:selectBooleanCheckbox id="myChk"> in my jsf page, i want to access its value for another component like:
    <h:commandButton disabled="#{myChk.checked}" action="myAction" value="myValue" />
    ** "myChk.checked" >> I am just asuming "checked" property is available...

    Bind the checkbox to a UIInput myChk property. Then you can reference this property from the page, e.g.
    <h:selectBooleanCheckbox binding="#{myBean.myChk}" onchange="submit();" />
    <h:commandButton disabled="#{myBean.myChk.value}" action="myAction" value="myValue" />

  • For "select-form" in the same page, add a cancel button in editing status

    Dear JHeadstart team
    For "select-form" in the same page, I still have a trouble.
    How can I customize the Tempalte File to make the editing page have cancel button to abandon the edit.
    If I want to learn the the JHS's Template costomizing (.vm file) and where can I find more reference documents about JHS's Template costomizing (excepting "Oracle JHeadstart 10g for ADF Developer's Guide").
    thanks!

    Can you be more precise on what you want:
    - should the cancel button be displayed when creating new row AND editing existing row?
    - when pressing the Cancel button, where do you want to go, to the select page?
    Steven Davelaar,
    JHeadstart Team.

  • How to set item values when redirecting to the same page.

    I just created a redirect button that I want to redirect to the same page and set the 2 page items on the page to the same value they had before the redirect.
    But I can't write:
    Set These Items: P1_Permit_Number,P1_Fishing_Year
    With These Values: &P1_Permit_Number.,&P1_Fishing_Year.
    Because there are no values in the session state, since a submit has not been done.
    So how do I do this?
    I know how to get the values stored in the items, e.g., $v('P1_PERMIT_NUMBER')
    but where do I place that command? It's not allowed under "With These Values"
    And I don't really want to make this a submit button and create a process that says:
    P1_PERMIT_NUMBER := $v('P1_PERMIT_NUMBER') because that would complicate the page too much -- I already have other processes and branches on the pages whose conditions would have to be modified so that they don't run during this scenario.
    Thanks.

    Thanks Gary and Andy. I rewrote the function according to above instructions:
    function redirectToURL()
    var permitNumber = document.getElementById('P1_Permit_Number');
    var fishingYear = document.getElementById('P1_Fishing_Year');
    var url = 'f?p=&APP_ID.:1:&APP_SESSION.::::P1_Permit_Number,P1_Fishing_Year:' + permitNumber +',' + fishingYear;
    window.location.href = url;
    But when I entered a value for permit number and fishing year and redirected, the word "null" appeared in the Permit page item, instead of the permit number that I had entered.
    Remember that I am not submitting here. So if the syntax you showed me, i.e. getElementById('P1_Permit_Number'), searches for the item's session state, then it will be wrong, since there is no session state value for the items at this point. Perhaps that is the reason I got the null?
    If so, what can I do?

  • Condition records- setting printer for multiple vendors at the same time

    Hi all,
    I have maintained condition record for POs for Key combination of Doc type,Purch Org and vendors.Now for a particular doc type and P.Org , I have around 50 vendors. I need to change the printer for all these 50 vendors to 'printerx'.Is it possible? I tried selecting multiple vendors at a time and changed the printer but its not working.

    Hi Saurav ,
    You can achieve this through SCAT transaction.
    For running SCAT take the help of ABAP team.
    I hope u might be having the list in the form of text file.
    If not , download the same from NACH table.
    Regards
    Ramesh Ch

  • How can I ensure newer versions of the same page are opened every time I visit

    I am advised by my Uni IT screen to ensure that firefox is set to check for 'newer versions of the same page with every visit to the page'. This is to ensure proper functioning inside the University's internal tutorial program.

    # Type '''about:config''' into the location bar and press enter
    # Accept the warning message that appears, you will be taken to a list of preferences
    # Locate the preference '''browser.cache.check_doc_frequency''', double-click on it and change its value to '''1'''
    http://kb.mozillazine.org/Browser.cache.check_doc_frequency

  • Different CSS link effects on the same page?

    I have a CSS menu that looks good and works using the a:hover
    and a:link rules. I want to have the links on the rest of the page
    act differently. Can someone help me understand how to create
    different CSS rollover effects for different links on the same
    page? Pleas be specific, I’m not great with CSS or code in
    general.

    Pseudo-classes and container styles are what you need - here
    are some
    tutorials.
    http://www.mako4css.com
    http://www.thepattysite.com/linkstyles1.cfm
    http://www.projectseven.com/tutorials/pseudoclasses/index.htm
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "edwheels" <[email protected]> wrote in
    message
    news:ej2e5g$i4p$[email protected]..
    >I have a CSS menu that looks good and works using the
    a:hover and a:link
    >rules.
    > I want to have the links on the rest of the page act
    differently. Can
    > someone
    > help me understand how to create different CSS rollover
    effects for
    > different
    > links on the same page? Pleas be specific, I?m not great
    with CSS or code
    > in
    > general.
    >

  • I have multiple apple devices mainly used between me and my wife , my question is that can i have two sets of contacts backed up to icloud one for her devices and one for my devices using the same itunes account

    i have two sets of devices one ipad, iphone and mac which i use and one iphone ipad and mac which my wife uses
    now is it possible to have two sets of contacts and calendar synchronised for her devices and one for my devices using the same icloud account
    i dont want a separate itunes account as we use the same music books and apps to be automatically downloaded which is very convenient
    please guide

    You can set up different iCloud accounts on each device using different Apple IDs (to keep your mail, calendars, contacts, etc. separated), and still share the same iTunes account (in Settings>Store on your device).  There is no requirement that you use the same Apple ID for purchases and for iCloud.

  • What is setting required for Price Contol do the optional entery in master.

    Hi SAP EXPERT,
    What is setting required for Price Contol do the optional entery in Material master ?
    Regards
    Mahendra
    Edited by: MAHENDRA  NAVALE on Aug 27, 2011 2:23 PM

    HI
    In general in the material master record you can, hide display or optional for a field, but there are certain feilds should be mandatory for material creation,like base unit of measure,material description,and price contro,l valuation price,valuation class,without this you cannot create a purchase order.
    If you dont want to the price control means go for mateial type  non valuated material NLAG. because the price control is mainly linked with the material  valuation. based on the the price control  the price difference will post either sock account or price difference account.
    Goto>MM>LOGISTICS GENERAL>MATERIAL MASTER>FEILD SELECTION >ASSIGN FEILD SELECTION TO FEILD SELECTIN GROUPS(OMSR) >CHECK YOUR FEILD REFERENCE FOR PRICE CONTROL (MBEW-VPRSV) FEILD REFERNCE GROUP IS 32* > AND GOTO MAINTAIN FEILD REFERENCE FOR DATA SCREENS (OMS9) >ENTER  YOUR FEILD SELECTIN GROUP 32 (PRICE CONTROL )AND  CHOOSE MM01 MAKE IT FROM REQUIRED  TO OPTIONAL.
    Thanks
    Edited by: Nijamudeen**MM on Aug 29, 2011 10:19 AM

  • I have a library set up for my i-pop touch, how can my wife set up her i-phone on the same pc?

    I have a library set up for my i-pod touch, how can my wife set up her i-phone on the same PC but with a seperate library location?

    You can sync multiple iPods and iOS devices with the same iTunes library on one computer. Each device has its own sync preferences with iTunes and iTunes creates and updates a separate backup for each device.
    Under the same computer login account, you can have separate iTunes libraries which will require manually having to log in and out of each one with iTunes which isn't necessary.
    If you want separate iTunes libraries for you and your wife, probably best to create a separate computer login account for your wife where her iTunes library is completely seperate along with the rest of her data on the computer.

  • HT1351 I have a new iPod Touch......I was able to successfully set up a new account, but I want it to be separate from the 800 songs I already have in my iTunes library.  How do I set up a separate library on the same computer?

    I have a new iPod touch; I have an iTunes library of music for an older iPod shuffle.  I'd like to set up the iPod touch for my wife with a separate library of music - I was successful in setting up a separte account, but it seems my 800 songs are still there in the library.  How do a set up a new account on the same computer without bringing along all the music that will clog up her iPod touch?

    There's a few ways of doing it. The following document may be of some help:
    How to use multiple iPods, iPads, or iPhones with one computer

  • How do i set up multiple iCloud accounts on the same mac?

    how do i set up multiple iCloud accounts on the same mac?

    Interesting - I was sure I'd seen a note somewhere that it was only Mail, but this article:
    http://support.apple.com/kb/ts4020
    does say
    Your secondary iCloud accounts can be set up and viewed in Settings > Mail, Contacts, Calendars on your iOS device, or Apple () menu > System Preferences > Mail, Contacts, Calendars on OS X Lion. You may choose to do this if you have a second iCloud account and need to access its Mail, Contacts, or Calendar data. 
    Note: While you can configure multiple iCloud Mail accounts in iOS, Push mail will only work for the primary iCloud account in iOS. Secondary account(s) will check for mail based on the settings in Settings > Mail, Contacts, Calendars > Fetch New Data.
    It's not something I can test - I suppose the second account's data gets added to the lists in iCal and Address Book?

  • How do I set up two email address on the same account?

    Using Mail in Mac OS X 10.6.2 and moving to Mac for the first time, I have been unable to set up two email addresses on the same account. Entering them, separated by commas, as advised in the Help does not seem to work. I have tried making them both the same password and have tried separating the passwords with a comma but no luck. Unable to set up another account for the second address because it correctly tells me that the account already exists.
    Is there a way?
    Thanks for any help.
    AllanGlen

    After a comprehensive trial and error session, using a new Guest Account each time to be sure of no contamination from the previous trial, I have finally cracked it!
    The problem was logging on to the outgoing server.
    Setting up the first account was fairly straightforward but if I allow Mail to do it automatically I am unable to send because Mail has defaulted to 'Authentication Required' when my server does not require it. Setting the account manually without authentication enables send and receive to work OK.
    If i try to set up the second account automatically, Mail crashes.
    If I set it up manually and choose 'No Authentication', Mail crashes.
    If I set it up manually and choose 'Authentication Required' and enter the full email address as the User Name together with password, Mail crashes.
    If I set it up manually and choose 'Authentication Required' and enter the first part of the email address together with password, Mail crashes.
    However, if I set it up manually and choose 'Authentication Required' and enter the first part of the email address as User Name and no password, Mail accepts it and sets up the account.
    At this point the account receives mail but cannot send it.
    If I go into the Mail preferences and try to edit the outgoing server details, Mail will not accept no Authentication.
    I eventually found that if I uncheck the 'Always Use This Server' box, all account then use the server on the first account, which is correctly set up.
    Now I have my four email accounts all able send and receive.
    One little concern remains. In Outlook Express I could look at the properties of a received email and see what address it had come from, together with many other details. I haven't found out yet whether this can be done in Mail. I just wonder whether if I reply to some email, it will appear to have come from a different address from the one it was sent to.
    Thanks again for all the inputs.
    Allan

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • Can I run the currency translation for multiple years at the same time?

    Dear Friends,
    I set up currency translation on our BPC NW 7.0 system and it is working fine ONLY if I run it for any one year at a time. But if I select multiple years in the data package (FX Restatment) selection it only calculates for the first year in that selection.
    say if I run the data package for years: 2009, 2010, 2011, 2012, it only performs currency translation for the year 2009.
    Can I run the currency translation for multiple years at the same time ?
    Note: The year is determined from the YEAR property of the "Time" dimension
    appreciate any inputs,
    thanks

    You can run currency translation for multiple years.
    I think the problem it is actually related to how you are sending the parameter to currency translation script.
    Just review the script logic log and you will see with what parameters was called currency translation FXTrans.
    My expectation is that actually the script is called just with first year and that's the problem.
    Log of script logic you can find it into:
    C:\BPC|DATA\Webfolder\YourAppset\YourApplication\Private Publications\Users used to run logic\Temp
    Regards
    Sorin Radulescu

Maybe you are looking for

  • I want to install a second hard drive

    I want to install a second hard drive in my mid 2011 Imac. Is there room for expansion? Do I have to buy any special equipment or is it possible to plug the new hard drive directly in to the computer?

  • Batch management and returns

    Hi we are a soft drink manufacturer, we have batch management for raw materials but also need it for finished goods.  OK so no problem works well so far.  However we do send out trucks with product on board, those truck may not sell all of the produc

  • Large cells managment

    I'm actually using Pages'09. (I have this same problem with many different versions of MacOS X I  use: Mac OS X 10.6 → 10.9). I'm working with tables and large cell contents (well in fact I would like to work this way). When reaching the bottom borde

  • Do not want RAW files to be shown in Elements Organizer

    I take all my pictures in RAW format (ARW files) and convert them to jpeg later. I keep these JPEG and RAW files together in the same folder. So when Photoshop Elements 6.0 imports them into the Organizer, two of each image is shown (one JPEG and one

  • Manual uninstall of 2005A client

    We had a client install fail during the upgrade process from 2005A SP01 PL10 to 2005A SP01 PL43.  Now it has been left in a state where we cannot complete the install and we cannot uninstall.  Is anybody able to give me steps to manually uninstall th