- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FS_BUTTON Executable URL öffnen im ContentCreator
Hallo Community,
habe einen FS_BUTTON im Formular, der ein Executable startet, das einen URL berechnet und den direkt im Browser öffnen soll.
So sieht der Button aus:
<FS_BUTTON name="ptOpenPreview" onClick="class:OpenPreviewExecutable" useLanguages="no">
<LANGINFOS>
<LANGINFO lang="*" label="Vorschau öffnen"/>
</LANGINFOS>
</FS_BUTTON>
So bisher das OpenPreviewExecutable:
String url = calcUrlSomehow();
if (context.is(Env.WEBEDIT)) {
// we are in ContentCreator
if (context.is(Env.PREVIEW)) {
// we are in the preview, not in the form: return the URL and the calling template has to open it via JS included in the HTML channel
return url;
}
// how to open the URL in the form in CC: Can I execute JS? Can I use an operation to get the URL opened in a new tab?
return "";
}
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException | URISyntaxException e) {
// ignore
}
}
return "";
Besten Dank für die Hilfe.
Gruß Heiko
- Labels:
-
Developers
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo Heiko,
das was Du suchst ist die ClientScriptOperation. Hier einfach ein entsprechendes JS in den .perform()-Aufruf reinwerfen - z.B. "window.open(....)".
Das sollte übrigens auch für den „Nicht im Formular”-Fall gehen, so dass die Fallunterscheidung (und das JS im Ausgabekanal) auch wegfallen könnte.
Viele Grüße
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo Heiko,
das was Du suchst ist die ClientScriptOperation. Hier einfach ein entsprechendes JS in den .perform()-Aufruf reinwerfen - z.B. "window.open(....)".
Das sollte übrigens auch für den „Nicht im Formular”-Fall gehen, so dass die Fallunterscheidung (und das JS im Ausgabekanal) auch wegfallen könnte.
Viele Grüße
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vielen Dank Michael,
funktioniert auch für den „Nicht im Formular”-Fall.
Viele Grüße
Heiko

