Tuesday 15 April 2014

sapui5 - UI5: Add Tree to IconTabFilter Content -



sapui5 - UI5: Add Tree to IconTabFilter Content -

i have icon tab filter upon user selecting it, show tree.

the logic of how handle user selection of icon provided here

handle icontab selection

the problem have js create tree node not working. logic below: -

var omodel = new sap.ui.model.json.jsonmodel({ "idocs1" : [ { "docnum" : "00063463", "mestyp" : "matmas", "status" : "53", "sndprn" : "extsys1", "direct" : "inbound", "message" : "material 00002342 created", "messages" : [ { "message" : "material 00002342 created" } ], "segments" : [ { "segment" : "e1maram", "fields" : [ { "fieldname" : "matnr" } ] } ] } ] }); sap.ui.getcore().setmodel(omodel); var tgtpath = "/idocs1/0/segments"; var otree = new sap.ui.commons.tree("tree"); otree.bindaggregation("nodes", tgtpath, function( sid, ocontext) { var treepath = ocontext.getpath(); var bindtextname = ''; if (treepath.indexof("fields") !== -1) { bindtextname = "fieldname"; } else { bindtextname = "segment"; } alert("here = " + ocontext + " ---- " + bindtextname); homecoming new sap.ui.commons.treenode() .bindproperty("text", bindtextname); }); var mybutton = new sap.ui.commons.button("btn"); mybutton.settext("hello world!"); mybutton .placeat("idviewroot--idviewdetail--toolbar-content"); otree .placeat("idviewroot--idviewdetail--toolbar-content");

this logic in method, invoked when user selects specific icontab.

i have button in place ensure add together icontab content (when tree logic commented out).

i have noticed if seek , create 2 buttons of same id, above code (i.e method) invoked twice.

if enable tree logic, method beingness called twice, getting errors duplicate tree node.

any help much appreciated.

thanks

martin

is there reason why add together content later? can add together specific content each icontab shown when user clicks on it. should solve problem.

if not convenient case, think should set content either on icontabbar or icontabfilter after clicking on icontab , not putting in content.

sapui5

No comments:

Post a Comment