Quantcast
Channel: SCN : Unanswered Discussions - SAP for Mobile
Viewing all articles
Browse latest Browse all 5512

Problem when using fragments

$
0
0

Hi I'm trying to use two fragments in my application.
The first will be displayed when I press on "send mail" button and the other one must be displayed when I press on "Start new discussion". The problem is that I get the same fragment each time although I have defined two different fragments Here the code in the Controller : 
/*********/

onMail: function (evt) {

        if (! this._oPopover) {

              this._oPopover = sap.ui.xmlfragment("sap.ui.demo.myFiori.view.Mail", this);

            }

            this._oPopover.setModel(this.getView().getModel());

            this._oPopover.open();

          },

    onAdd : function (evt) {

              this._oPopover = sap.ui.xmlfragment("sap.ui.demo.myFiori.view.start_discussion", this);

            this._oPopover.setModel(this.getView().getModel());

            this._oPopover.open();

            },

 

/********/

I always get the same fragment like the picture below although I clicked on the mail :

Selection_034.png

 

Here also the code in the Fragments :
/***** 1st Fragment start_discussion.fragment.xml ******/

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">

  <Dialog title="New Discussion" type="Message" >

    <VBox class="marginBoxContent" >

    <items>

      <Label text="Subject" />

      <Input id="SubjectInput" type="Text" placeholder="Enter Subject ..." />

      <Label text="Message" />

      <Input id="TextInput" type="Text" placeholder="Enter Message ..."/>

      <Button text="Publish" press="handlePublish" />

    </items>

  </VBox>

  </Dialog>

</core:FragmentDefinition>
/***************************************/


Viewing all articles
Browse latest Browse all 5512

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>