Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

💾 Custom "Save as Draft Without Validation" Button with Auto-Redirect in Joget Forms

🧩 Overview In many Joget applications, users want the flexibility to save their form progress as a draft and return later to complete it. This guide shows how to create a custom "Save as Draft" button in Joget using a BeanShell script th…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




🧩 Overview



In many Joget applications, users want the flexibility to save their form progress as a draft and return later to complete it.



This guide shows how to create a custom "Save as Draft" button in Joget using a BeanShell script that:




  • Adds a Save as Draft button dynamically.

  • Automatically updates workflow status fields (status and wf_status).

  • Redirects users to the Inbox (or another page) after saving.









⚙️ How It Works



✅ The script dynamically inserts a SaveAsDraftButton inside a section’s layout.


✅ It then injects a small JavaScript snippet using a CustomHTML element to handle:




  • Status updates to "Draft"

  • Conditional redirection to a custom Userview page (your_menu_id)









💻 Full Code



Paste this BeanShell script into your Form → Section → Data → Load Binder:








import org.joget.apps.form.lib.SaveAsDraftButton;
import org.joget.apps.form.lib.SubmitButton;
import org.joget.apps.form.lib.CustomHTML;
import org.joget.apps.form.model.Column;
import org.joget.apps.form.model.Element;
import org.joget.apps.form.model.FormAction;
import org.joget.apps.form.model.FormData;
import org.joget.apps.form.model.Section;
import org.joget.apps.form.service.FormUtil;
import java.util.ArrayList;
import java.util.Collection;

// Create a collection for form actions
Collection formActions = new ArrayList();
String saveButtonLabel = "Save As Draft";
Element saveButton = new SaveAsDraftButton();
saveButton.setProperty(FormUtil.PROPERTY_ID, "customSaveAsDraft");
saveButton.setProperty("label", saveButtonLabel);
formActions.add(saveButton);

// Get the form section and its first column
Section section = element;
ArrayList columns = (ArrayList) section.getChildren();
Column column = columns.get(0);
column.setProperty("horizontal", "true");
column.setChildren(formActions);

// Add layout fix and script logic
Element html = new CustomHTML();
String script = "<script>$(document).ready(function(){ ";

// Move the button layout into section-actions
script += "$('#" + section.getPropertyString("id") + "').find('.form-cell').prependTo('#section-actions .form-column');";
script += "$('#" + section.getPropertyString("id") + "').remove();";

// Set workflow status to Draft
script += "$('#status').val('Draft').trigger('change');";
script += "$('#wf_status').val('Draft').trigger('change');";

// Check if Save As Draft button was clicked and redirect
FormData fd = formData;
if (fd.getRequestParameter("customSaveAsDraft") != null) {
script += "window.location.href='your_menu_id_to_redirect';"; // Redirect to Inbox or another page
}

script += "});</script>";

// Apply the custom HTML script
html.setProperty("id", "button_layout_fixes");
html.setProperty("label", "");
html.setProperty("value", script);
formActions.add(html);

return null;


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten 💾 Custom "Save as Draft Without Validation" Button with Auto-Redirect in Joget Forms

Thematisch verwandte Begriffe: Custom, Save, Draft, Without · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-17636 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick