how to add a proceed dialog before executing an action

31 views
Skip to first unread message

tom wible

unread,
Aug 5, 2025, 9:18:18 AMAug 5
to Xataface
i have several actions defined in /actions and actions.ini that work perfectly, but as the title says i would like to add a simple
         'onclick' => "return confirm('Are you sure you want to proceed?');"
to the action link...
chatgpt suggests:
        'Custom Action Button in template'
or
         'In your templates/ or delegate class, you can hook into rendering and inject the onclick. '
but i'm not sure exactly where these are...can i buy a clue?-}

Patrick Reinhard

unread,
Aug 5, 2025, 12:58:54 PMAug 5
to Xataface
Something like the following in your actions.ini should work:

[Stampa_Informative_Interessato_pdf]
url_condition="$record"
onclick="return confirm('QUESTA FUNZIONE E\' SPERIMENTALE! Prima di utilizzarla per favore leggete le note al riguardo nelle \'News\'.');"
url="{$this->url('-action=StampaInformativaInteressato')}&KAzienda={$record->val('KAzienda')}&format=pdf"
label=" pdf"
description="Genera Informativa unificata di tutti i Trattamenti di questo Interessato in formato pdf"
category=informativainc
order=21

Unfortunately I could not yet figure out how to split the message on two or more lines, i.e. how to insert a line feed in the message of the js confirm box, as '\n' does not work, at least in my configuration.

HTH

tom wible

unread,
Aug 5, 2025, 1:33:20 PMAug 5
to Xataface
that woprked! thanx-)

tom wible

unread,
Aug 5, 2025, 1:35:11 PMAug 5
to Xataface
worked-}

and no, confirm dialogs can't have linebreaks-\

On Tuesday, August 5, 2025 at 12:58:54 PM UTC-4 pat...@gmail.com wrote:

John R Blakely

unread,
Aug 5, 2025, 1:43:15 PMAug 5
to Xataface
Just curious, have you tried inserting an HTML break ("<br>") or paragraph ("<p>") element embedded in the text?
Message has been deleted

tom wible

unread,
Aug 5, 2025, 1:50:51 PMAug 5
to Xataface
yes...javascript dialogs simply pass any html literally

tom wible

unread,
Aug 5, 2025, 2:07:53 PMAug 5
to Xataface

Patrick Reinhard

unread,
Aug 6, 2025, 4:52:33 AMAug 6
to Xataface
Onclick is referenced under javascript actions at https://shannah.github.io/xataface-manual/#javascript-action

tom wible

unread,
Aug 6, 2025, 9:21:44 AMAug 6
to Xataface
the github manual is more up-to-date than the wiki
Reply all
Reply to author
Forward
0 new messages