Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Printing AbstractHtmlField/AbstractImageField content
Printing AbstractHtmlField/AbstractImageField content [message #1834062] Sat, 31 October 2020 16:22 Go to next message
Eclipse UserFriend
Hi,
In my application built on Scout 9, I would like to add a button that triggers a printout of the field content, that inherits from AbstractHtmlField or AbstractImageField.

Is there any simple method to get something like this?
Re: Printing AbstractHtmlField/AbstractImageField content [message #1834086 is a reply to message #1834062] Mon, 02 November 2020 04:45 Go to previous message
Eclipse UserFriend
Hi Krzysztof

I can't think of a simple method to do that out-of-the-box. Since printing happens in the context of the browser (and not the Java UI server) you need to have some kind of a custom widget (button) which triggers window.print(). You could use a @ModelVariant to create an instance of a PrintButton.js (extends Button.js) in the UI which does that.

In order to print out only a specific field, you could work with CSS classes and media queries. Give that field that must be on the printout a specific CSS class like "myapp-printable", and in your CSS/LESS file make everything invisible for "print" _except_ elements which have that CSS class.

Cheers,
André
Previous Topic:html5 rich text editor
Next Topic:Autocompletion and syntax for JS
Goto Forum:
  


Current Time: Mon Jul 07 01:31:42 EDT 2025

Powered by FUDForum. Page generated in 0.05448 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top