Skip to Content

file not found - Fragment.xml

Hi,

I would like to open a fragment.xml when pressing a button. This is the code of the button in the "worklist.viem.xml".

<Button press="onTableSettings" id="Button_Filter" text="Filtro" activeIcon="sap-icon://filter" icon="sap-icon://filter"/>

So when I press this code should be execute; (in the worklist.controller.js)

onTableSettings: function(oEvent) {

// Open the Table Setting dialog

this._oDialog = sap.ui.xmlfragment("view.SettingsDialog", this);

this._oDialog.open();

},

The code of the fragment: (SettingsDialog.fragment.xml)

And finally this is the folder where is located:

So when I press the button I have this error in the concole. I Have seen samples with the same code working. I don't know what is the problem:

Uncaught Error: resource view/SettingsDialog.fragment.xml could not be loaded from ../resources/view/SettingsDialog.fragment.xml. Check for 'file not found' or parse errors. Reason: Not Found

If more code is requiered let me know.

Thanks in Advanced.

Marcos

button.PNG (32.5 kB)
view.PNG (10.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2016 at 10:10 AM

    Hi Marcos,

    you are missing the name space of the of the project , actually if you doesn't provide the namespace than sapui5 core will find the file/folder in the resources (sapui5 initial loaded resources) , so you need to mention the namespace to make them understand that view folder is in your project ...

    this._oDialog = sap.ui.xmlfragment("<namespace>.view.SettingsDialog", this);



    thanks

    Viplove

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.