Refresh document after "Replace All"

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

Refresh document after "Replace All"

Post by Isabelle »

Hello,

We used the version 25.0.0.0 of oxygen sdk.

After modification in an element, we add a blue horizontal bar next to the element thanks to css.
But when user made modifications in elements thanks to "Replace All" action, document is updated but css is not refresh and we don't see the blue bar.
Is it possible to force refresh css after a "Replace All" action ?
Thanks,

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Refresh document after "Replace All"

Post by Radu »

Hi Isabelle,

I will need more details.
we add a blue horizontal bar next to the element thanks to css.
How does the CSS selector look like?
document is updated but css is not refresh and we don't see the blue bar.
I'm not sure what you mean by that. Do you dynamically modify on disk the CSS used for visual editing?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Refresh document after "Replace All"

Post by Isabelle »

Hello,

When user modify an element (add new element'child, change text or attribute value),
a specific attribut (changeMark) is set on the element like this :

Before modification :

Code: Select all

<element>
   <para>First para</para>
</element>
After modification :

Code: Select all

<element>
   <para>First para</para>
   <para changeMark="1">New para</para>
</element>
A blue vertical line is displayed when changeMark is set to 1.

When we use "Replace All" button on search box, the changeMark attribut is well set but the css vertical line is not displayed.

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Refresh document after "Replace All"

Post by Radu »

Hi Isabelle,
I assume that "Replace All" button you are discussing is from your own find/replace functionality as Oxygen's Find/Replace dialog does not allow chancing attributes.
When you change attributes in the Author visual editor you must always use this method:
https://www.oxygenxml.com/InstData/Edit ... orElement-
so do not set the attribute directly on the AuthorElement, use the AuthorDocumentController to set the attribute, this should properly update the document and make undo/redo properly work.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Refresh document after "Replace All"

Post by Isabelle »

Hi Radu,
Radu wrote: Fri Jul 21, 2023 8:30 am I assume that "Replace All" button you are discussing is from your own find/replace functionality as Oxygen's Find/Replace dialog does not allow chancing attributes.
No, it is from Oxygen's Find/Replace dialog.
We add changeMark attribute thanks to our own AuthorDocumentFilter, and we already use AuthorDocumentController.setAttribute function.

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Refresh document after "Replace All"

Post by Radu »

Hi Isabelle,
I'm not sure why this does not work, I would need to see some sample Java code from where in the AuthorDocumentFilter you are setting the attribute plus the CSS selector which matches the attribute and adds a border.
So after the replace all, if you save the XML and re-open it the border is shown right?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Refresh document after "Replace All"

Post by Isabelle »

Radu,
Radu wrote: Fri Jul 21, 2023 11:22 am Hi Isabelle,
I'm not sure why this does not work, I would need to see some sample Java code from where in the AuthorDocumentFilter you are setting the attribute plus the CSS selector which matches the attribute and adds a border.
I understand and I will try to provide you an exemple asap.
Radu wrote: Fri Jul 21, 2023 11:22 am So after the replace all, if you save the XML and re-open it the border is shown right?
Yes, as the changeMarker are set, when re-open the document, the border are displayed.

Regards,
Isabelle
Post Reply