Pasting pre-formatted text to formatted text control

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Pasting pre-formatted text to formatted text control

bwallis42
Our customers need to copy/paste various things into formatted text controls
and this often causes problems.

This is working a lot better in the new TinyMCE based version of the rich
text area that version 4 and later is using. In version 3.9 the results of
pasting text were often nasty, particularly when copied from Word documents.

But we do have a problem with one common scenario in the latest orbeon
version.

Our users are medical clinicians  and often need to copy text from a
pathology or radiology report into an eform. These, when presented on the
source web page, are usually presented as pre-formatted text (inside <pre>
</pre> tags) as they often use fixed with column tables with spaces for
alignment.

When this is copied and pasted into a formatted text control it does not
display correctly, as the preformatted text extends outside of the displayed
text area. Similarly when the form is printed (pdf). This is a serious
problem as the text can overwrite the values of any controls to the right,
obscuring their contents, or disappear off the right hand side of the page
for a PDF. In both cases the causes a loss of information and is a clinical
risk.

Better behaviour for viewing the form with this text in it would be to
provide a horizontal scroll bar for the displayed text. For printing the
text should wrap to keep it within the boundaries of its control, which is
not ideal but at least all the text will be there and it won't obscure other
values in the form.

We are experimenting with some CSS overrides to achieve the above behaviour
but I think this is something that should probably work out of the box.

I've setup an example of the problem at
https://demo.orbeon.com/demo/fr/cpf/bwtest/edit/6cb5e296f4ffe4264076ce4efdc060ed59cca110


thanks,
brian...


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Pasting pre-formatted text to formatted text control

Alessandro  Vernet
Administrator
Hi Brian,

I agree: we want the text show in the best possible way out-of-the-box. Now,
I'm just trying to make sure I understand the problem correctly:

1. On the edit page, the text is wrapped: https://i.imgur.com/gU9LdaK.png.
Are you saying that you'd prefer to have an horizontal scrollbar?

2. On the view page, the text is wrapped as well, but here no vertical
scrolling is needed: https://i.imgur.com/NAvQ8GR.png. Are you saying that
here to you'd prefer to have no wrapping and an horizontal scrollbar?

3. In the PDF the text isn't wrapped, shown over other content:
https://i.imgur.com/0DfeQ6z.png. Here I imagine that wrapping would make
more sense; i.e. as is the case right now on the view page?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Pasting pre-formatted text to formatted text control

bwallis42
In reply to this post by bwallis42
The developer looking at this has come up with a bit of CSS that quite nicely
resolves the issue.

in view mode this will render a scrollbar and preserve the content. The
white-space setting accommodates IE11 & Edge so this works for the major
browsers we use  (Chrome, Firefox, IE11 and Edge)

.xforms-mediatype-text-html pre {
    overflow: auto;
    line-height: normal;
    white-space: nowrap;
}

Of course scrollbars don't work so well in a PDF.

For printing we want to wrap the content inside the pre tag when rendering
the pdf. The text will now be more difficult to read as the original "pre"
format is mucked up with the line wrapping, but all the text is visible in
the PDF so that is about as good as it can get for PDF.


@media print{

.xforms-mediatype-text-html pre
        {
            line-height: normal;
            white-space: pre-wrap;
        }
}


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Pasting pre-formatted text to formatted text control

bwallis42
In reply to this post by Alessandro Vernet
Hi Alex,

Case 1 - yes, for <pre> text there should be no wrapping and a horizontal
scrollbar should be used.

Case 2 - no wrapping and a horizontal scrollbar when necessary

Case 3 - Wrapping when required since we can't have a scrollbar in a PDF :-)

The underlying reasoning is that when the text is copied/pasted from a
pre-formatted source the author wants that formatting to be preserved where
ever possible. It is possible on a screen using scrollbars or by making the
window wider but when generating a PDF/printing a compromise has to be made.

If there is an issue because the area alloted to the form field is to narrow
(in a column of fields) then I see that as a form design issue. If the form
is likely to be used for this sort of copied text then the design should
allow for it by making that fields full form width.

Above all, regardless of how the data is viewed, never loose or obscure the
text.


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Pasting pre-formatted text to formatted text control

Alessandro  Vernet
Administrator
Hi Brian,

For now I've created the RFE linked below. I'll test this out, and since
this is simple enough, we'll shoot to have this in 2019.1. Thank you for
sharing this with us!

https://github.com/orbeon/orbeon-forms/issues/3974

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Pasting pre-formatted text to formatted text control

Erik Bruchez
Administrator
For reference, this is now implemented.

-Erik

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].