Hi Lutz,
why do not use context.getConfigNode() instead of a dummy content?
because context.getConfigNode() return null?
I'm using this working code in blossom method annotated by
@DialogFactory("page-extra-properties") :
DialogSelectMedia dialogSelectMedia = (DialogSelectMedia)
info.magnolia.cms.gui.dialog.DialogFactory
.getDialogControlInstanceByName(
context.getRequest(),
context.getResponse(),
context.getWebsiteNode(),
context.getConfigNode(),
"mediaSelection");
dialogSelectMedia.setName("image");
dialogSelectMedia.setLabel("image label");
dialogSelectMedia.setDescription("image description");
settings.getTab().addSub(dialogSelectMedia);
where settings is a TabBuilder.
ciao
luca
2011/1/26 Lutz Hühnken <[email protected]>
>
> Hi all,
>
> sorry for answering my own question...
>
> One can pass a "dummy" configuration node, like this:
>
> // Dummy config for openutils media, since TabBuilder doesn't know
> custom controls
> private static final String DUMMY_IMAGE_CONFIG =
> "/modules/yourModule/dialogs/path/to/some/node";
> [...]
> Content configNode = ContentUtil.getContent("config",
> DUMMY_IMAGE_CONFIG);
>
>
> Regards,
> Lutz
>
>
> 2011/1/26 Lutz Hühnken <[email protected]>:
> > Hi list,
> >
> > is there a way to include a "mediaSelection" (Type
> > net.sourceforge.openutils.mgnlmedia.media.dialog.DialogSelectMedia)
> > from the openmindlab simplemedia module in a dialog that is generated
> > programmatically with blossom?
> >
> > If I try to create an instance with the DialogFactory, the way other
> > controls are created in the TabBuilder class, this way:
> >
> > final DialogSelectMedia selectMedia =
> >
> (DialogSelectMedia)info.magnolia.cms.gui.dialog.DialogFactory.getDialogControlInstanceByName(context.getRequest(),
> > context.getResponse(), context.getWebsiteNode(), null,
> > "mediaSelection");
> >
> > it turns out it needs a non-null "config" node:
> >
> > java.lang.NullPointerException
> >
>
> net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog.getSubNodes(ConfigurableFreemarkerDialog.java:147)
> >
>
> net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog.init(ConfigurableFreemarkerDialog.java:191)
> >
>
> net.sourceforge.openutils.mgnlmedia.media.dialog.DialogSelectMedia.init(DialogSelectMedia.java:110)
> >
>
> info.magnolia.cms.gui.dialog.DialogFactory.getDialogControlInstanceByName(DialogFactory.java:188)
> >
> >
> > Has anyone succeeded in doing this and can help me out with a code
> snippet?
> >
> > Thanks,
> >
> > Lutz
> >
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
>
>
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------