Skip to Content
0
Jan 18, 2018 at 04:17 PM

create custom control by using existing sapui5 control

88 Views Last edit Jan 18, 2018 at 04:18 PM 2 rev

Hi All,

I would like to create a custom control in sapui5 by using existing control.

For example instead of writing this in my view:

            <Bar>
                <contentLeft>
                    <Button icon="sap-icon://nav-back" press="onNavBack"></Button>
                </contentLeft>
                <contentMiddle>
                    <OverflowToolbar id="otb2">
                        <Input liveChange="onSearchInBoard" placeholder="Search...">
                            <layoutData>
                                <OverflowToolbarLayoutData minWidth="400px" shrinkable="false" priority="NeverOverflow" />
                            </layoutData>
                        </Input>
                    </OverflowToolbar>
                </contentMiddle>
            </Bar>

I would like to write something like :

<custom:Bar contentLeftButtonPress="onNavBack" contentLeftInputLiveChange="onSearchInBoard" ></custom:Bar>

Can we write the code in an xml document and call it from my custom declaration of my control? Or how to ?
Thanks and regards