Nobody can explain me how to develop a custom Dialog and use a DialogHandler
for the initialisation?
We developed this one :
public class WSTDownloadLinkListDialog extends ParagraphEditDialog{
public WSTDownloadLinkListDialog(String name, HttpServletRequest
request, HttpServletResponse response, Content configNode) {
super(name, request, response, configNode);
log.info("WSTDownloadLinkListDialog instanciated");
}
...
In Magnolia Configuration, we defined the following dialog:
- modules
- myModule
- dialogs
- paragraphs
- wstDownloadLinkList
+ tabDownloadLink
class=be.uniway.magnolia.WSTDownloadLinkListDialog
i18nBasename=...
label=...
I see the dialog with my contols but nothing appear in the logs!
What is wrong in my configuration?
Can you help me?
Benoît
From: [email protected]
[mailto:[email protected]] On Behalf Of Ana Osman
Sent: jeudi 24 septembre 2009 15:58
To: [email protected]
Subject: [magnolia-user] Custom class for dialog
Hello,
Is there some trick to use in order to create a custom dialog? Here:
http://documentation.magnolia-cms.com/cookbook/creating-a-custom-dialog.html it
is said that "Every dialog can have a class property which defines class to
instantiate."
I have created a class like this:
public class WSTDownloadLinkListDialog extends ConfiguredDialog{
public WSTDownloadLinkListDialog(String name, HttpServletRequest
request, HttpServletResponse response, Content configNode) {
super(name, request, response, configNode);
}
protected Dialog createDialog(Content configNode, Content storageNode)
throws RepositoryException {
Dialog dialog = super.createDialog(configNode, storageNode);
dialog.setJavascriptSources(request.getContextPath() +
"/.resources/mgnl-resources/worldsteelmodule/javascript/wstDialogs.js");
//$NON-NLS-1$
dialog.addTab("MyTag");
return dialog;
}
protected Dialog getDialog() {
Dialog dialog = super.getDialog();
return dialog;
}
/**
* do not reload the tree
*/
public void renderHtml(String view) throws IOException {
PrintWriter out = response.getWriter();
//after saving
if (view == VIEW_CLOSE_WINDOW) {
// .. do some thing special (perhaps make an alert)
}
// show the created dialog
else {
super.renderHtml(view);
}
}
}
The Javascript is not inserted into my dialog window. If I use this class for
adminInterface/dialogs/useredit (so I replace
info.magnolia.module.admininterface.dialogs.UserEditDialog with my class), I
can see that my javascript is inserted into the dialog window...
Is there something else I should do?
The dialog I'm trying to create is placed into a custom module. Maybe I should
specify some configuration in that module?
Thanks a lot in advance,
Ana Osman
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------