visibility:-oxy-collapse-text; Element Insert Side-effect?

Oxygen general issues.
drLocke97
Posts: 6
Joined: Mon Aug 12, 2013 9:25 pm

visibility:-oxy-collapse-text; Element Insert Side-effect?

Post by drLocke97 »

I'm building a CSS style sheet for editing that uses form controls in the CSS (Oxy version 15.1 64bit).

As suggested by Oxygen Help, I'm using the visibility property to prevent editing of the elements content outside of the form control using "visibility:-oxy-collapse-text;". This works as expected.

However, it appears there's a side-effect of using this property: it prevents insertion of new elements. The reason appears to be as follows: Oxygen Help says regarding the visibility:-oxy-collapse-text; property

"If an element is marked as -oxy-collapse-text you are not able to position the caret inside it and edit it." (http://www.oxygenxml.com/doc/ug-editor/ ... nsion.html)

It seems that a side-effect of this is that you also cannot locate the caret in an element with a form control and insert a new element. For example, if I have elements "a", "b", and "c" in my Schema defined as consecutive siblings, and in my document I have "a" and "c" and use form controls to edit them, I have no way to enter "b" between them.

Is this expected behavior? Am I missing some way to

(1) use form controls for a series of elements
(2) hide the text content from appearing outside the form control
(3) while still allowing me to select an element and insert a new element after it
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: visibility:-oxy-collapse-text; Element Insert Side-effec

Post by alex_jitianu »

Hello,

If you mark an element as -oxy-collapse-text you will not be able to position the caret inside it. Referring to your example, if you mark just a,b,c as -oxy-collapse-text then you will still be able to position between them and insert elements. If you are not able to do that it means that you've marked their parent element as being -oxy-collapse-text. Is that correct? If marking the parent was not the desired behavior then you can just remove -oxy-collapse-text from the parent and you will be able to position between a,b,c and insert elements. If you require the parent element to be -oxy-collapse-text then you could let the user insert elements through inline actions (oxy_button) as they can execute in -oxy-collapse-text contexts too.

Have I understood your situation correctly?

Best regards,
Alex
drLocke97
Posts: 6
Joined: Mon Aug 12, 2013 9:25 pm

Re: visibility:-oxy-collapse-text; Element Insert Side-effec

Post by drLocke97 »

Hi Alex,

Yes, you are exactly correct. I had mistakenly assigned the "-oxy-collapse-text" property to the parent element. I discovered this shortly after my question was submitted, but before it was approved.

It would be a good idea to add a note about this on the Help page for the "-oxy-collapse-text" property.

Thanks
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: visibility:-oxy-collapse-text; Element Insert Side-effec

Post by alex_jitianu »

Hi,

I'm glad to hear that's all it was. I'll take a look again at our documentation and perhaps we will also add an example to help avoid confusion in the future.

Best regards,
Alex
kumarmanish
Posts: 1
Joined: Wed May 27, 2015 8:16 pm

Re: visibility:-oxy-collapse-text; Element Insert Side-effec

Post by kumarmanish »

Hi Alex,

What is the alternate solution of visibility:-oxy-collapse-text?

Could you please help me because i am facing the issue.

Thanks,
Manish
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: visibility:-oxy-collapse-text; Element Insert Side-effec

Post by alex_jitianu »

Hi Manish,

You can use button form controls to insert elements in areas marked as -oxy-text-collapse. I've given a more detailed answer on this thread: http://www.oxygenxml.com/forum/post34341.html#p34341 . Hope it helps.

Best regards,
Alex
Post Reply