Well, I only overwrite one single method of the DataDialog class (which I used
as base):
public String getJsExecutedAfterSaving() {
if (StringUtils.isBlank(getTreeName())) {
// try getting the treeName from the config node
if (this.getConfigNode().getNodeData("treeName").isExist()) {
setTreeName(this.getConfigNode().getNodeData("treeName").getString());
}
}
if (StringUtils.isBlank(getTreeName())) {
log.debug("need to take super.js (" +
super.getJsExecutedAfterSaving() + ")");
return super.getJsExecutedAfterSaving();
} else {
String js = "opener.mgnl.data.DataTree.reloadAfterEdit('" +
getTreeName() + "', '" + this.path + "/" + this.nodeName + "')";
log.debug("my js: " + js);
return js;
}
}
Does this help in any way?
Regards,
-will
On 13.01.2011, at 14:14, Unger, Richard wrote:
> Hi Will!
>
> Thanks for your quick response!
> Thanks also for the pointer to your ConfigurableTree – that looks useful!
>
> You mention:
> I was able to change that behavior by extending the dialog class and
> explicitly providing the name of the tree in the dialog configuration.
>
> As it happens, ZipUpload is a page, that creates the Dialog in code.
>
> It seems to me that the tree I created is working ok – if I call
> document.location.reload() or mgnlTreeControl.refresh(), the behavior is
> correct.
> So currently, my assumption is that the problem is in the Dialog, or the
> admin-js called after the dialog closes.
>
> May I ask, what did you do in the Dialog class to make it work? Do you
> remember the name of the configuration you set, or the nature of the code
> added to make it work?
>
> Thanks a lot!
>
> Regards from Vienna,
>
> Richard
>
>
>
>
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Will Scheidegger
> Gesendet: Donnerstag, 13. Jänner 2011 12:52
> An: Magnolia User-List
> Betreff: Re: [magnolia-user] ZipUpload Dialog Refresh ??
>
> Hi Richard
>
> This sounds unpleasantly familiar somehow... I think I hit the same problem
> when developing our "configurable tree" extension
> (http://www.fastforward.ch/web/ff/dokumentation/entwickler/magnolia_configurable_tree.html).
> IIRC the tree called after a dialog is closed heavily depends on the name of
> the repository used instead of the tree that was actually used. I was able to
> change that behavior by extending the dialog class and explicitly providing
> the name of the tree in the dialog configuration. Of course this is a dirty
> hack, but it did the job for me and I don't think the whole dialog/tree
> mechanism will be refreshed anymore since Magnolia 5 will be changing
> everything anyways.
>
> Our custom dialog class:
> ch.fastforward.magnolia.module.utils.dialogs.ConfigurableTreeDialog
> Then add a "treeName" nodeData to the dialog definition and set the value to
> the name of the tree which should be used.
>
> You can download this class from our website (see link above) and have a look
> at it. Maybe it will be useful for you.
>
> Cheers,
> -will
>
>
>
> On 13.01.2011, at 12:33, Unger, Richard wrote:
>
>
> Hi Magnolians!
>
> Ok, my Metadata-Import for images is working nicely, with one little problem
> remaining:
>
> I’m using a custom tree (image-catalogue), which is based on the DMS tree,
> and uses the DMS repo.
>
> After uploading a new zip file, there is a refresh of the underlying window.
> My Problem is that after refresh the tree shown is the standard DMS tree,
> rather than my custom tree.
>
> I’ve spent hours, and I can’t figure this one out (the admin-js and
> TemplateMVCHandler stuff is so confusing!!).
>
> Some pointers:
> n If I use the “refresh” command from the right-click menu in my tree,
> everything is refreshed correctly.
> n If I call “document.location.reload()” on my tree (eg. using firebug),
> everything is refreshed correctly.
> n I see that the ZipUpload form contains a hidden field:
> <input type="hidden"
> value="opener.document.location.reload();window.close();" id="mgnlJsCallback"
> name="mgnlJsCallback">
> -- where is this field coming from?? I can’t find it in ZipUpload or any
> of its parent classes? Is this field being used?
> n After submitting the ZipUpload Dialog, how is the underlying window
> refreshed? If the above mgnlJsCallback is used, then why is the tree not
> refreshed correctly? Is there some additional logic in the DMS ZipUpload that
> I haven’t been able to find?
>
> Thanks a lot for any pointers on this, it’s driving me crazy!!
>
> Regards from Vienna,
>
> Richard
>
>
> ----------------------------------------------------------------
> 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]>
> ----------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> 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]>
----------------------------------------------------------------