Format value in oxy_textfield

Post here questions and problems related to oXygen frameworks/document types.
Isabelle
Posts: 70
Joined: Fri Jan 20, 2017 1:11 pm

Format value in oxy_textfield

Post by Isabelle » Mon Jun 29, 2020 3:48 pm

Hello,

We work with the 22.0 version of Oxygen and I would like to know if it is possible to format value of an oxy_textfield.
I tried this :

Code: Select all

oxy_textfield(edit, "@oidate", values, oxy_xpath("concat(substring(@oidate, 7, 2), '-', substring(@oidate, 5, 2), '-',substring(@oidate, 1, 4))", evaluate, dynamic-once), columns, 10)
But it displays the value of the attribut and not the result of the oxy_xpath.

Is there any way to format this value ?
Thanks.

Regards,
Isabelle

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Format value in oxy_textfield

Post by Radu » Tue Jun 30, 2020 1:10 pm

Hi Isabelle,

As far as I know the oxy_textfield is what you see is what you get, you cannot see one thing but insert another in the document, so you always see the current attribute value.
That "values" property specifies the list of insertion proposals which appear when pressing Ctrl-Space in the text field:
https://www.oxygenxml.com/doc/versions/ ... ditor.html

Maybe you can try to display the processed attribute value as static content on a ":before" or ":after" selector. And use an oxy_button form control to call your own action in which the end user chooses another value.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Isabelle
Posts: 70
Joined: Fri Jan 20, 2017 1:11 pm

Re: Format value in oxy_textfield

Post by Isabelle » Tue Jun 30, 2020 1:16 pm

Hello Radu,

Thank you for your answer.
I understand, and I was curious about the rendererClassName and swingEditorClassName.
Found here https://www.oxygenxml.com/doc/versions/ ... trols.html.

Can they solve my issue or not ?

Regards,
Isabelle

Radu
Posts: 7024
Joined: Fri Jul 09, 2004 5:18 pm

Re: Format value in oxy_textfield

Post by Radu » Tue Jun 30, 2020 3:55 pm

Hi Isabelle,

That specific feature would give you full control over the form control contents, you would create the Swing component which would get shown there.
I'm not sure if we've ever had somebody implement a custom form control but I think the extensions should work, if you want you can try this approach, see where it takes you and we can help with advice along the way.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply