Page 1 of 1

Multiple fields in an author query dialog

Posted: Mon Sep 23, 2024 3:58 pm
by afuchs
Hello,
While creating frameworks I often need to provide users with a way of adding an element with a number of children, such as:

Code: Select all

<fragment>
   <author>Aristoteles</author>
   <work>Nicomachean Ethics</work>
   <date>354 BC</date>
</fragment>
The texts ('Aristoteles', 'Nicomachean Ethics', '354 BC') are provided by the users through a series of dialogs that rely on separate instances of the generic ${ask()} (or other types of input).
If the user skips a dialog, or enters data in the wrong order etc., the whole process must be aborted and started anew. This is especially regrettable if there is a long series of text chunks.

Is there a way to configure a multiple field dialog, so that the user can view all the fields and the data they are about to feed into the XML before the insertion takes place?

Thank you in advance!

Re: Multiple fields in an author query dialog

Posted: Tue Sep 24, 2024 8:51 am
by Radu
Hi,

The $ask editor variable has limited functionality., we never intended it to become a way of creating more complex dialogs.
For more complex Author operations you can use for example Javascript to call our Java based APIs:
https://github.com/oxygenxml/javascript ... operations
You can also create dialogs using Java Swing and show them:
https://github.com/oxygenxml/javascript ... XMLFrag.js

Regards,
Radu

Re: Multiple fields in an author query dialog

Posted: Tue Sep 24, 2024 12:43 pm
by afuchs
Thank you Radu!
Seems to be no way around JS at a certain point.