Jump to content

Topic on Talk:OOUI/Windows/Message Dialogs

Error when using OOjs UI/Windows/Message Dialogs

5
ShanikaEdiriweera (talkcontribs)

I am working on a phabricator task and I need to use OOjs UI/Windows/Message Dialogs for a user warning. 

But 

TypeError: OO.ui.MessageDialog is not a constructor

error occurs at:

var messageDialog = new OO.ui.MessageDialog();

What might be the problem? 

ShanikaEdiriweera (talkcontribs)

I added `'oojs-ui-core'` and `'oojs-ui-windows'` dependancies in Resources.php

eg:

   'mediawiki.special.movePage' => [
       'scripts' => 'resources/src/mediawiki.special/mediawiki.special.movePage.js',
       'dependencies' => [
           'jquery.byteLimit',
           'mediawiki.widgets',
           'oojs-ui-core',
           'oojs-ui-windows'
       ],
   ],

Now the messeageDialog() is working without an error.

ShanikaEdiriweera (talkcontribs)
Jdforrester (WMF) (talkcontribs)
ShanikaEdiriweera (talkcontribs)

Yeah. I clearly did not notice that since I directly went to the message dialog page.

It is better if every page like this one has s link to the section you mentioned.

Reply to "Error when using OOjs UI/Windows/Message Dialogs"