cancel
Showing results for 
Search instead for 
Did you mean: 

create custom control by using existing sapui5 control

collinjona
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

junwu
Active Contributor
0 Kudos
collinjona
Explorer
0 Kudos

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...

junwu
Active Contributor
0 Kudos

fragment