1

I have a JSF form of view *.jspx page. The form has around 20 fields. I have a print preview button, that would open a new browser window and show print preview of this form, making all the form content as read only.

I have done a bit of workaround like setting a boolean flag in Managed bean as showprintPreview. This approach has almost done the job by showing all the fields in readonly and buttons as disabled mode. But, I don't want to change the backing bean object.

I'd like to show the print preview with css or javascript for a jsf form.

UPDATE:

I have tried another way by using onclick on print preview button that would call predefined, window.print() js function. But its displaying all the buttons as well. I would like to hide buttons like submit, back etc in print preview and show all the input fields like text, textarea etc.

srk
  • 4,857
  • 12
  • 65
  • 109

1 Answers1

1

I would reuse part of page wich you want to print. Create new page only with this reusable part. then on button action open this new page in new window (target="_blank") in print preview you mentioned.

Peter Šály
  • 2,848
  • 2
  • 12
  • 26