javascript - sapui5 - Two master pages -
i've got 2 master pages dynamic lists.
master page 1:
<page title="title" showbackbutton="true" id="master1"> <list id="idlistauctions" mode="singleselectmaster" select="onpressgotomaster2" items="{auctions>/auctionsglobal/0/auctionstypes}"> <items> <standardlistitem title="{auctions>auctiontype}" type="navigation" /> </items> </list> </page> master page 2:
<list id="idlistauctionsdetail" mode="singleselectmaster" select="handlelistselect" items="{auctiontypes/auctions}"> <items> <standardlistitem> <!-- output items master page 1 --> </standardlistitem> </items> </list> my javascript:
onpressgotomaster2 : function(oevent) { console.log( oevent.getparameter("listitem").getbindingcontext() ); //undefined this.byid("hdcsplitapp").tomaster(this.createid("master2"),'slide', oevent.getparameter("listitem").getbindingcontext()); }, my json file:
{ "auctionsglobal": [{ "auctionstypes": [{ "auctiontype": "delivery", "auctions": [{ "auctionid": "12345" }, { "auctionid": "54321" }] }, { "auctiontype": "contract", "auctions": [{ "auctionid": "98745" }, { "auctionid": "56478" }] }] }] } i want display items selected "auction" master1 on master2 page. there seems no data on master2. i've tried don't it.
since using named model binding list, model name should passed getbindingcontext argument.
further, use setbindingcontext set binding context of list second master page context obtained getbindingcontext.
here working example.
Comments
Post a Comment