Salve, sto lavorando a un progetto a lavoro e non riesco a fare in modo che l'icona ( in questo caso activity items) scompaia se clicco su una PR mentre dovrebbe restare visibile se clicco su PO. In pratica , se clicco su una Purchase Request , l'icona deve sparire con tutta la simple form annessa .... io riesco a non far vedere la simple form ma l'icona resta sempre visibile .... Ecco la parte di codice in questione (ovviamente c'è anche il resto ma dall'ID della lista dovrei far scomparire l'icona). Grazie (ho scritto anche sul blog SAP ma ancora mi rispondono)
onPressMaster: function(oEvent) {
var pos1 = oEvent.getSource().getSelectedItem().sId.lastIndexOf("-");
var lung = oEvent.getSource().getSelectedItem().sId.length;
var posList = parseInt((oEvent.getSource().getSelectedItem().sId.substr(pos1 + 1, lung - 1)), 10);
var item = this.recuperaDatiMaster(posList);
this.settaTestataDetail(item);
this.settaHint(item);
this.settaTable(item);
this.settaNote(item);
this.settaAllegati(item);
this.settaHistory(item);
var hide = this.getView().getModel("hint").getData()[0];
var a= hide.Doc.lastIndexOf("-");
var modello = this.getView().getModel("PO").getData();
var nascondi= this.getView().byId("activityButton").getIcon();
if(modello.type === "PR")
{
this.getView().byId("activityButton").setIcon(null);
}
<IconTabFilter id="activityButton" icon="sap-icon://activity-items">
<Table id="materialTable" items="{material>/}" inset="false">
<columns>
<Column hAlign="Left">
<Text text="{i18n>itemNumber}"/>
</Column>
<Column hAlign="Left">
<Text text="{i18n>CodeMaterial}"/>
</Column>
<Column hAlign="Left" demandPopin="true" minScreenWidth="Tablet">
<Text text="{i18n>ShortText}"/>
</Column>
<Column hAlign="Left" demandPopin="true" minScreenWidth="Tablet">
<Text text="{i18n>Quantity}"/>
</Column>
<Column hAlign="Left" demandPopin="true" minScreenWidth="Tablet">
<Text text="{i18n>NetPrice}"/>
</Column>
<Column hAlign="Left" demandPopin="true" minScreenWidth="Tablet">
<Text text="{i18n>uom}"/>
</Column>
<Column hAlign="Left" demandPopin="true" minScreenWidth="Tablet">
<Text text="{i18n>DeliveryDate}" wrapping="true"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>Plant}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>Requestor}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>CostObject}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>Vendor}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>BuyerName}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>Societa}"/>
</Column>
<Column hAlign="Left" demandPopin="true" popinDisplay="Inline" minScreenWidth="3000000px">
<Text text="{i18n>DefinizioneOrgAcquisti}"/>
</Column>
</columns>