Page 1 of 1

Combobox from XSLT (author mode XSLTOperation)

Posted: Fri Jan 01, 2016 9:38 pm
by hlapin
Does anyone have experience invoking a jOptionPane combobox from XSLT in an XSLTOperation in author mode??
[Context, this is for a global (i.e., context-element wide) operation that changes a dummy value for all instances of an attribute in child nodes to a valid one.]

I can get something like the following to work:
[Codebox=]<xsl:variable name="testStr" select="jop:showInputDialog(null,
'Edit the following string: ',
'string')"/>[/Codebox]

However I would like, if possible, to have a user select from a list of possible valid values. I have looked at the specs for the java swing object, but I can't seem to get the parameters right (and I have almost no Java). Any advice would be appreciated!

Also, as long as I am asking but less essential, are there any ways to specify linebreaks in the message or the size of the dialog box?

Many thanks, and a happy new year to all.

Hayim Lapin

Re: Combobox from XSLT (author mode XSLTOperation)

Posted: Mon Jan 04, 2016 3:38 pm
by alex_jitianu
Dear Hayim,

New lines can be added in the message by using character entities: &#xA; Here's an example on how to use this entity and how to specify a list of possible values:

Code: Select all

<xsl:value-of select="jop:showInputDialog(
null,
'Message on&#xA; two lines',
'The title',
3,
null,
('apple','orange'),
'orange')"/>

Beste regards,
Alex

Re: Combobox from XSLT (author mode XSLTOperation)

Posted: Mon Jan 04, 2016 4:13 pm
by hlapin
Brilliant, thanks!