Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: Change model in XML-template.

$
0
0

Hello, Sai!

Thank you for your help! If not difficult to answer one more question ...

 

To the properties of the model "edit_tables" I tied the buttons properties: 'visible = "{settings> / edit_tables}"'.

But when I change the model (edit_talbes = false / true), nothing happens. The buttons are not hidden.

 

Form.controller.js

//...
onTogleEditTables: function(){  var o_view = this.getView();                     //Get View   var o_models = o_view.mPreprocessors.xml.models; //Get models defined in preprocessor   var o_model_sett = o_models.settings;            //Get Settings Model     var status = o_model_sett.getProperty("/edit_tables");  o_model_sett.setProperty("/edit_tables", !status); 
},
//...

FooterToolbar.fragment.xml

<core:FragmentDefinition    xmlns="sap.m"    xmlns:core="sap.ui.core"    xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1">    <Toolbar>    <Button    text="Edit"    visible="true"    press="onTogleEditTables" />      <ToolbarSpacer />     <!-- ... -->    <Button    text="Save"    visible="{settings>/edit_tables}"    press="testMethod" />    <Button    text="Cancel"    visible="{settings>/edit_tables}"    press="testMethod" />    </Toolbar>   </core:FragmentDefinition>

What should I do to changes were seen in view?


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>