sapui5 - Object Page with blocks -


i've got objectpagelayout:

request.view.xml

    <objectpagelayout>         <headertitle>             ...         </headertitle>         <headercontent>             ...         </headercontent>          <sections>             <objectpagesection                 mode="collapsed">                 <subsections>                     <objectpagesubsection title="fooblock">                         <blocks>                             <blockdetail:formblock columnlayout="auto" /> <!-- block -->                         </blocks>                     </objectpagesubsection>                 </subsections>             </objectpagesection>         </sections>     </objectpagelayout> 

formblockcollapsed.view.xml (my block)

<mvc:view xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc"     xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout" xmlns="sap.m"     controllername="namespace.blocks.detailsblockcommon">     <flexbox>         <hbox>             <vbox>                 <f:simpleform >                     <f:content>                         <checkbox class="sapuismallmarginbegin sapuismallmargintop" id="mycheckbox" />                     </f:content>                 </f:simpleform>             </vbox>         </hbox>     </flexbox> ... </mvc:view> 

so far, fine. object page looks checkbox shown.

in controller request.controller.js want validate checkbox in formblockcollapsed.view.xml

validateblockform: function(format){     console.log( oview.byid("mycheckbox").checked() ); //oview.byid("mycheckbox") undefined } 

but i've no access checkbox in block.

cannot read property 'checked' of undefined

further infos

formblock.js

sap.ui.define(['sap/uxap/blockbase'], function (blockbase) {     "use strict";      var multiviewblock = blockbase.extend("namespace.blocks.formblock", {         metadata: {             views: {                 collapsed: {                     viewname: "namespace.blocks.formblockcollapsed",                     type: "xml"                 }             }         }     });      return multiviewblock; }, true); 

detailblockcommon.js

sap.ui.define([     "namespace/controller/basecontroller" ], function (basecontroller) {     "use strict";      return basecontroller.extend("namespace.blocks.detailsblockcommon", {       }); }); 

check if oview defined.

you can this.getview()


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -