Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Custom Script Question
drossign
I have a script that gets called from a custom menu item. A user checks off files and directories and then selects the custom menu item. The script recognizes the files that were checked off and adds them to a file list text file that gets used to do a filelist deploy. When the user closes the script window, is it possible to have the files and directories that they had checked be automatically unchecked?
I haven't found an obvious way to do this yet so any help would be appreciated.
Thanks,
Dave
Find more posts tagged with
Comments
Migrateduser
I think if your CGI outputs JavaScript something like this:
parent.top.Ctl.pw_refresh();
before window.close() that may work for 5.5.x; not sure about 6.x.
drossign
I'm using 5.5.2 and I tried that with no success. I get a JavaScript error saying "parent.top.Ctl is null or not an object".
Migrateduser
Is the teamsite browser window that opened the CGI window still open when you get this error? If so you probably just have to play around with the JavaScript syntax to figure out how to reference this function correctly, but it seems like as long as the parent window is open this should be a valid reference.
Adam Stoller
Actually - if you're in WDP - I think the [officially unsupported] command would be:
parent.top.Ctl.pw_msel_clearall();
(found by right-clicking on the "Clear All" button in the GUI and doing a Save Link Target As ...)
You'd probably want to do the parent.top.Ctl.pw_refresh() afterwards though.
For 6.x - (also NOT officially supported) - it looks like you would use something like
list_view.get_instance('filesystem_list').set_all_selected(false);
(View Source on the GUI page)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
For some CMIs (such as a custom unlock that also unlocks the associated output files/DCRs) you would want to use refresh instead of unselect if possible so the lock icons are updated.
Adam Stoller
I'm guessing at the 'parent' part - I took that from the other post. When I did my save link target as - what I saw in the dialog box began with ...top - so I assumed there was something before "top" and based on the earlier post - presumed that it was "parent"
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Adam Stoller
The original query was for showing the files un-selected / un-checked - which is why I pointed out the clearall() function *and* said you'd probably want to do a refresh/redraw afterwards.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Maybe it's window.opener.top instead of parent, I think parent is for JavaScript in a frame as opposed to a new window.
Migrateduser
No offense, just trying to make the reasoning clear. Since I don't expect much performance differential (and anyway files may have been added/removed) I would probably always use refresh.
drossign
The TeamSite window is still open. I've tried:
parent.top.Ctl.pw_refresh();
parent.Ctl.pw_refresh();
parent.top.pw_refresh();
parent.pw_refresh();
all with no luck. Any other ideas?
Migrateduser
sorry, try window.opener.top.Ctl.
drossign
We have a winner!!! window.opener.top.Ctl.pw_refresh() worked. Thank you for all the help.
Adam Stoller
Out of curiosity - does calling the refresh un-select the previously selected files?
Or do you have to do the clearall() too?
NOTE: All of this is unsupported - and will likely NOT work if/when you migrate to 6.x - so make careful notes about where you're depending on these kinds of things so you'll have some idea of what you'll have to spend a bunch of time on again later on.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
drossign
Calling the refresh does indeed unselect all the selected files so I don't have to do the clearall().
This will be yet another note in the documentation. (-:
Adam Stoller
Hmm - interesting - I guess that explains why when you have multiple files selected and choose an OOTB menu item that expects only one file to be selected, that the selections are lost after the window refreshes... (I always found that annoying - but then I also found the limitation of some of those menu items annoying too ;-)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com