Skip to Content

create custom control by using existing sapui5 control

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 18 at 04:39 PM

    fragment

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 18 at 04:49 PM

    Thanks Jun, But I need to embbed some native functionnality and in a fragment I'm not able to call a controller that can do it for me this is why I want to create a custome control to keep the native functionnality...

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 18 at 05:07 PM
    Add comment
    10|10000 characters needed characters exceeded