Tomasz Mazan wrote:
at least following are missing

mgnlPath
mgnlNodeCollection
mgnlNode


Michael, there is no problem with those parameters.
JS funcrtion mgnlOpenDialog fullfill them. Even those listed by you I can find in form in my onSave method.

All of them :
mgnlRichE = true
mgnlRichEPaste = textarea
mgnlSaveInfo = params.failed.Dispatcher,String,0,0,0
mgnlPath = /bankSample
mgnlRepository = website
mgnlDialog = pl-touk-pageIncludeParagraph
mgnlParagraph = //here's problem, it's empty but not lost during saving, but while creating dialog
mgnlNode = 0
mgnlNodeCollection = leftColInclude__
selectTemplatePath = /templates/jsp/bank-sample/balances
params.failed.Dispatcher =
mgnlJsCallback = opener.document.location.reload();window.close();

I had a look at my own custom paragraphs and found the additional member 'paragraph'. Here's the class:

public class ParagraphEditDialog extends ConfiguredDialog {

    private static Logger log = Logger.getLogger(ParagraphEditDialog.class);

    private String paragraph = StringUtils.EMPTY;

public ParagraphEditDialog(String name, HttpServletRequest request, HttpServletResponse response, Content configNode) {
        super(name, request, response, configNode);
        paragraph = params.getParameter("mgnlParagraph"); //$NON-NLS-1$
    }

    /*
     * (non-Javadoc)
* @see info.magnolia.module.admininterface.DialogMVCHandler#createDialog(info.magnolia.cms.core.Content,
     * info.magnolia.cms.core.Content)
     */
protected DialogDialog createDialog(Content configNode, Content websiteNode) throws RepositoryException {
        DialogDialog dialog = super.createDialog(configNode, websiteNode);
        dialog.setConfig("paragraph", getParagraph()); //$NON-NLS-1$
        return dialog;
    }

    /**
     * Get the configuration of the dialog from the paragraph
     */
public static Content getConfigNode(HttpServletRequest request, String paragraph) {
        Paragraph para = Paragraph.getInfo(paragraph);

        if (para == null) {
// out.println(msgs.get("dialog.paragraph.paragraphNotAvailable", new String[]{paragraph}));
            log.error("paragraph not found: " + paragraph); //$NON-NLS-1$
            return null;
        }

        return para.getDialogContent();
    }

    /**
     * @return Returns the paragraph.
     */
    public String getParagraph() {
        return paragraph;
    }
}



Not sure anymore why this was needed and if it will help you. But you could give it a try.


--
Cheers
Michael

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to