on 12-23-2016 11:31 AM
Hellos, i am doing a app sapui5 and i have a problem because i have done the fragment in which there is a event and this event is defined in the controller, so i did this:
controllerName="sacyr.controller.pendienteContabilizar" in the fragment but this not is working. If i put the fragment in the view directly, it is working goog. can somebody help me?.
Sorry for my english
thanks, but it yet not working, in the fragment i have this:
<core:FragmentDefinition xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core" xmlns:commons="sap.ui.commons" controllerName="jas.controller.pendienteContabilizar"> <HBox > <VBox> </VBox> <VBox > <Label text="postright1"></Label> </VBox> <VBox> <Button icon="sap-icon://decline" press="eliminar" /> </VBox> </HBox> </core:FragmentDefinition>
and in the controller this is;
eliminar: function () { if (!this._oDialog) { this._oDialog = sap.ui.xmlfragment("sacyr.fragmento.selectext", this); this.getView().addDependent(this._oDialog); } return this._oDialog; },
i think the problem is that the fragment adds dinamic content
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Can you paste how you have called the above fragment.
<core:FragmentDefinition xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core"
xmlns:commons="sap.ui.commons" controllerName="jas.controller.pendienteContabilizar">
<HBox > <VBox> </VBox>
<VBox > <Label text="postright1"></Label>
</VBox>
<VBox>
<Button icon="sap-icon://decline" press="eliminar" />
</VBox>
</HBox>
</core:FragmentDefinition>
I think you are missing the 'this' keyword in the original fragment call as well.
https://sapui5.hana.ondemand.com/#docs/guide/354f98ed2b514ba9960556333428d35e.html
you have to use code to assign the controller
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.