Hi Daniel,
these are excellent questions! I'm CC'ing engine-devel to reach out to everyone
who might be interested in them.
why dialogToken is mandatory? (wouldn't it be more convenience to
make it optional?)
dialogToken is used to work with the dialog once it's displayed via showDialog API
function.
For example, there are no buttons defined for the dialog by default, so you might want to
define at least a "Close" button:
api.showDialog('My Dialog', 'my-dialog',
'http://www.abc.com/', '800px', '600px', {
buttons: [
{
label: 'Close',
onClick: function() { api.closeDialog('my-dialog'); }
}
]
});
As you can see, you need dialogToken at least to close the dialog :) another example of a
dialog button:
{
label: 'Load different content',
onClick: function() { api.setDialogContentUrl('my-dialog',
'http://www.xyz.com/'); }
}
(The above are just simple examples, you can put whatever code you like into onClick
function.)
what are dialogToken's restrictions (no-spaces?/etc...)
Unlike historyToken in custom tab API (addMainTab/addSubTab/etc.), dialogToken doesn't
have any restrictions. It's recommended to use
"token-string-lowercase-without-spaces" syntax, but it's just a
recommendation.
As for historyToken in custom tab API, the
"token-string-lowercase-without-spaces" syntax is preferred, because
historyToken value will be part of WebAdmin URL (e.g. WebAdmin.html#my-main-tab) when
navigating to the given custom tab.
Regards,
Vojtech
----- Original Message -----
From: "Daniel Erez" <derez(a)redhat.com>
To: "Vojtech Szocs" <vszocs(a)redhat.com>
Sent: Thursday, March 28, 2013 8:14:38 PM
Subject: webadmin: UI plugin dialog API improved
Hi Voj,
Some qqs about showDialog api:
* why dialogToken is mandatory? (wouldn't it be more convenience to make it
optional?)
* what are dialogToken's restrictions (no-spaces?/etc...)
10x,
Daniel