You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Cristi Toth <cr...@gmail.com> on 2008/04/08 01:50:14 UTC

Re: [Trinidad][Facelets] Best-Practise: Different-Template for HTML-printing

Hi Harald,

Thanks to your observations I resolved issue TRINIDAD-951
check the following link and the subversion commits tab to see what
renderers were fixed

http://issues.apache.org/jira/browse/TRINIDAD-951

the changes will be available in the snapshots and in the next release
(1.*.8)

regards,

On Tue, Feb 19, 2008 at 4:08 PM, Kuhn, Harald <HK...@airplus.com> wrote:

>  Hi to all,
>
> I wonder which is the best way to achieve different output for printing?
> If the output is rendered for printing all buttons should be disabled and
> all form fields (i.e. <tr:input>) should be readonly.
>
> Right now we have a Controller, that could detect (depending on a
> request-Parameter) if the request should be rendered for printing.
>
> All our Facelets get their template from this controller. So I could
> change the template upon outputMode (online or printing).
>
> With this approach, we are able to deliver different boiler plate for each
> mode. Also the print-Template could open the browsers print dialog on load.
>
> Unfortunately, all the buttons, links , etc. in this print-View are fully
> functionally. This should not be the case.
> One solution would be, to set each of them (at component level) to
> readonly (or disabled) depending on the outputMode.
>
> On the otherhand Trinidad has a config parameter <output-mode> which could
> be set to "printable" or "default".
> If this parameter is set input fields are rendered readonly but buttons
> are still functional.
> For Example:
>
> Online-View (output-mode = default):
> <<settings_DefaultMode.png>>
>
> Print-View (output-mode= printable):
> <<settings_PrintMode.png>>
>
> But in this view the button is still functional, which shouldn't be the
> case and there are also some javascript-errors, like:
>
>    - TrPage is not defined
>    - _chain is not defined
>
> With output-mode = printable there seems to be no Trinidad-JS included in
> the rendered HTML. But some components still render JS-code.
>
> What would you recommend, to achieve such a szenario?
>
> 1) Change the (Facelet-)Template, handle readonly/disabled/rendered within
> the content on component level. This might be errror-prone.
>
> 2) Change the (Facelet-)Template and Trinidad Output-Mode. This leads to
> JS-errors.
> 3) Completly different approach. Maybe CSS?
>
> It would be great, if you could share your experiences.
>
> Env:
> tomcat          6.0.14
> myfaces         1.2.2
> Trinidad                1.2.5
> Facelets        1.1.14
>
> Best regards
>
>   Harald
>
> ****************************************
> *Harald Kuhn*
> *AirPlus International*
> *Business Information Services*
> *Phone:   +49 (0) 61 02 204-821*
> *Fax:     +49 (0) 61 02 204-139*
> *E-Mail:   HKuhn@airplus.com*
> *Internet:  **www.airplus.com* <http://www.airplus.com>**
> ****************************************
>
> *AirPlus International - Winner of the Buying Business Travel Diamond
> Award 2008 for Best Corporate Card Provider*
>
> Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263
> Neu-Isenburg · Deutschland · Geschäftsführer: Patrick W. Diemer (Vorsitz),
> Klaus Busch · Vorsitzender des Aufsichtsrates: Stephan Gemkow ·
> Handelsregister: Amtsgericht Offenbach/Main, HRB 8119 ******* *
>
>


-- 
Cristi Toth

-------------
Codebeat
www.codebeat.ro