cancel
Showing results for 
Search instead for 
Did you mean: 

Pop up dialog does not close?

Former Member
0 Kudos

Hi all,

I am calling the popup the pop dialog is triggered but i am not able to close the method is not triggered.what might be the issue?

view3.controller


//call the pop up to display the line items

if (!this._Popdelitems) {

this._Popdelitems = sap.ui.xmlfragment("d2","app.POP_Delitems",this);

sap.ui.getCore().byId("idUI_view3").addDependent(this._Popdelitems);

}

this._Popdelitems.open();

popup close method in view3.controller is not triggered.


onCloseDialog:function(){

this._Popdelitems.close();

         

}

Thanks

Deepan Ignaatious

View Entire Topic
former_member91307
Contributor
0 Kudos

Hi Deepan,

What is the context of 'this' in method onCloseDialog:function ?

1.try this.close()  in case the this refers to the _Popdelitems

if 1 does not work

2. try console.log to check the context

onCloseDialog:function(){

     console.log('this'+this);

     console.log('popup'+this._Popdelitems);

     this._Popdelitems.close();        

}

Thanks and Regards, Venkatesh

Former Member
0 Kudos

I have placed debugger inside onCloseDialog function still the same function is not hit when close button in the popup is clicked

former_member182862
Active Contributor
0 Kudos

Hi Thivi

First, we have to understand what is in the fragment, sap.ui.xmlfragment("d2","app.POP_Delitems",this);

you are calling the return control of this fragment to close.

-D

Former Member
0 Kudos

The fragment


<core:FragmentDefinition

  xmlns="sap.m"

  xmlns:core="sap.ui.core"

  xmlns:mvc="sap.ui.core.mvc"

  xmlns:l="sap.ui.layout"

  xmlns:f="sap.ui.layout.form">

<Dialog

    title="items"

    class="sapUiPopupWithPadding" >

      <content>

      <Table id="iditemTable"

   title="Delivery header details"   

    inset="false"

    items="{oitems>/results}"

   

     modeAnimationOn="true">

       

        <columns>

        <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="Item" />

      </Column>

      <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="number" />

      </Column>

        <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="text" />

      </Column>

       <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="Quantity" />

      </Column>

            <Column

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="UOM" />

      </Column>

              

    </columns>

      <items>

      <ColumnListItem>

        <cells>

        <Text text="{oitems>POSNR}" />

        <Text text="{oitems>MATNR}" />

        <Text text="{oitems>ARKTX}" />

        <Text text="{oitems>LFIMG}" />

        <Text text="{oitems>MEINS}" />

         </cells>

      </ColumnListItem>

    </items>

       

         </Table>

 

   </content>

    <beginButton>

      <Button text="Close" press="onCloseDialog" />

    </beginButton>

  </Dialog>

</core:FragmentDefinition>

former_member182862
Active Contributor
0 Kudos

can you add an ID to your dialog and do

sap.ui.getCore().byId('YourDialogId').close();

Former Member
0 Kudos

hi

yes when i try the following in console it closes but the the function onCloseDialog is not triggered inside which i have written this._Popdelitems.close();

sap.ui.getCore().byId('YourDialogId').close();

this._Popdelitems.close();

is it some issue  related to setting the controller of the dialog?