Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Printing AbstractHtmlField/AbstractImageField content
Printing AbstractHtmlField/AbstractImageField content [message #1834062] Sat, 31 October 2020 20:22 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
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 09:45 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
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é


Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:html5 rich text editor
Next Topic:Autocompletion and syntax for JS
Goto Forum:
  


Current Time: Sat Apr 27 01:37:57 GMT 2024

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

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

Back to the top