Re: Printer Friendly Struts Form

2005-09-15 Thread Ed Griebel
I was thinking that one could use javascript if you wanted to have a
button that would do a "print preview", and then swap the css display
attribute for the media types. I guess it's not really that useful,
but still "neat" to modify the style on the fly :-)

-ed

On 9/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Ed,
> 
> I'm not sure why you would need to use javacript to change the the media
> attribute. If you just output the both at the same time, the styles with
> media set to screen get applied only on your monitor and while the
> media=print styles are ignored. The reverse is true when you send the page
> to a printer. no need for javascripting at all.
> 
> Mariano
> 
> 
> [original message below]
> 
> This is a creative idea for presentation, and the attribute can be
> changed by simple javascript. But, there might be an application
> access/security issue with this if this method is used for display of
> read-only data, as you are sending an editable version of the form
> even though it's hidden. Some browsers allow you to change CSS on the
> fly, e.g. firefox with the EditCSS plugin.
> 
> -ed
> 
> On 9/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Here's a solution for you, but I don't know its applicability to
> Firefox,
> > and won't work for inline styling.
> >
> > 1. Start by outputting the information in a text area and in a div/span.
> > 2. Give each different class names/ids, say foo and bar respectivly.
> > 3. Link to your stylesheet or declare your style section defining all
> your
> > styles EXCEPT for foo and bar.
> > 4. Define two more stylesheets or style sections.
> > 5. In one use the attribute media="screen"  and within the section do
> > foo { display: inline;}
> > bar{display: none;}
> > 6. In the second one do the same thing but reverse the display
> properties.
> >
> >
> >
> > Mariano
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-15 Thread Mario_Hernandez
Ed, 

I'm not sure why you would need to use javacript to change the the media 
attribute. If you just output the both at the same time, the styles with 
media set to screen get applied only on your monitor and while the 
media=print styles are ignored. The reverse is true when you send the page 
to a printer. no need for javascripting at all.

Mariano


[original message below]

This is a creative idea for presentation, and the attribute can be
changed by simple javascript. But, there might be an application
access/security issue with this if this method is used for display of
read-only data, as you are sending an editable version of the form
even though it's hidden. Some browsers allow you to change CSS on the
fly, e.g. firefox with the EditCSS plugin.

-ed

On 9/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Here's a solution for you, but I don't know its applicability to 
Firefox,
> and won't work for inline styling.
> 
> 1. Start by outputting the information in a text area and in a div/span.
> 2. Give each different class names/ids, say foo and bar respectivly.
> 3. Link to your stylesheet or declare your style section defining all 
your
> styles EXCEPT for foo and bar.
> 4. Define two more stylesheets or style sections.
> 5. In one use the attribute media="screen"  and within the section do
> foo { display: inline;}
> bar{display: none;}
> 6. In the second one do the same thing but reverse the display 
properties.
> 
> 
> 
> Mariano
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-15 Thread Ed Griebel
This is a creative idea for presentation, and the attribute can be
changed by simple javascript. But, there might be an application
access/security issue with this if this method is used for display of
read-only data, as you are sending an editable version of the form
even though it's hidden. Some browsers allow you to change CSS on the
fly, e.g. firefox with the EditCSS plugin.

-ed

On 9/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Here's a solution for you, but I don't know its applicability to Firefox,
> and won't work for inline styling.
> 
> 1. Start by outputting the information in a text area and in a div/span.
> 2. Give each different class names/ids, say foo and bar respectivly.
> 3. Link to your stylesheet or declare your style section defining all your
> styles EXCEPT for foo and bar.
> 4. Define two more stylesheets or style sections.
> 5. In one use the attribute media="screen"  and within the section do
> foo { display: inline;}
> bar{display: none;}
> 6. In the second one do the same thing but reverse the display properties.
> 
> 
> 
> Mariano
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Mario_Hernandez
Woops, should have read the rest of the thread as Jeff Deskins had already 
brought up the media attribute.

Re: Printer Friendly Struts Form

2005-09-14 Thread Mario_Hernandez
Here's a solution for you, but I don't know its applicability to Firefox, 
and won't work for inline styling. 

1. Start by outputting the information in a text area and in a div/span. 
2. Give each different class names/ids, say foo and bar respectivly. 
3. Link to your stylesheet or declare your style section defining all your 
styles EXCEPT for foo and bar.
4. Define two more stylesheets or style sections. 
5. In one use the attribute media="screen"  and within the section do 
foo { display: inline;}
bar{display: none;}
6. In the second one do the same thing but reverse the display properties. 



Mariano

Re: Printer Friendly Struts Form

2005-09-14 Thread Frank W. Zammetti
The idea of updating the tags was proposed by someone else in the past 
two weeks ironically.  I think there was some interest in it (I seem to 
remember it being part of a larger proposal, but that particular part 
seemed to elicit some support).


Frank

Jeff Deskins wrote:
Thanks for the info on this subject. They have been a big help. 

One of the problems with textareas is in printing the rest of the text 
beyond the scrolled view (when you have more text than is visible in the 
textarea). However, it will work in IE with a print style of 
{overflow:visible} - but will not work in Firefox.


Don't want to dive too much into CSS in this group. Was just hoping there 
was (or in the future?) an attribute for the struts form tag that would 
automatically print the form values as text instead of printing the values 
inside form elements (inputs/textareas) using the existing struts form code.


In the meantime, I can live with handling most of it with stylesheets or 
wrapping an "if" statement around each form element and display according to 
a querystring parameter.


Thanks for all the tips!
Jeff

-- Forwarded message --
From: "Frank W. Zammetti" <[EMAIL PROTECTED]>
To: "Frank W. Zammetti" <[EMAIL PROTECTED]>
Date: Wed, 14 Sep 2005 13:39:02 -0400 (EDT)
Subject: Re: Printer Friendly Struts Form
Even better, use display:none; on the checkboxes and radios so everything
lines up right. Updated:



Test

.cssNoBorder {
border : 0 solid #ff;
overflow : hidden;
background-color : #ff;
}





Button:



Text:



Select:
1


Textarea:
SomeValue


Checkbox:
 SomeValue


Radio:
 SomeValue


File:



Password:



Reset:



Submit:






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Jeff Deskins
Thanks for the info on this subject. They have been a big help. 

One of the problems with textareas is in printing the rest of the text 
beyond the scrolled view (when you have more text than is visible in the 
textarea). However, it will work in IE with a print style of 
{overflow:visible} - but will not work in Firefox.

Don't want to dive too much into CSS in this group. Was just hoping there 
was (or in the future?) an attribute for the struts form tag that would 
automatically print the form values as text instead of printing the values 
inside form elements (inputs/textareas) using the existing struts form code.

In the meantime, I can live with handling most of it with stylesheets or 
wrapping an "if" statement around each form element and display according to 
a querystring parameter.

Thanks for all the tips!
Jeff

-- Forwarded message --
From: "Frank W. Zammetti" <[EMAIL PROTECTED]>
To: "Frank W. Zammetti" <[EMAIL PROTECTED]>
Date: Wed, 14 Sep 2005 13:39:02 -0400 (EDT)
Subject: Re: Printer Friendly Struts Form
Even better, use display:none; on the checkboxes and radios so everything
lines up right. Updated:



Test

.cssNoBorder {
border : 0 solid #ff;
overflow : hidden;
background-color : #ff;
}





Button:



Text:



Select:
1


Textarea:
SomeValue


Checkbox:
 SomeValue


Radio:
 SomeValue


File:



Password:



Reset:



Submit:






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


Re: Printer Friendly Struts Form

2005-09-14 Thread Frank W. Zammetti
Even better, use display:none; on the checkboxes and radios so everything
lines up right.  Updated:



Test

  .cssNoBorder {
border : 0 solid #ff;
overflow : hidden;
background-color : #ff;
  }



  

  Button:
  


  Text:
  


  Select:
  1


  Textarea:
  SomeValue


  Checkbox:
   SomeValue


  Radio:
   SomeValue


  File:
  


  Password:
  


  Reset:
  


  Submit:
  

  



-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, September 14, 2005 1:36 pm, Frank W. Zammetti said:
> Yeah, no good... Below is a quick test you can play with.  I couldn't
> figure out how to get the selects to work like the rest.  Checkboxes and
> radios too it doesn't like you can do much with, but they may be OK.  Here
> you go though, pretty simple stuff...
>
> 
> 
> Test
> 
>   .cssNoBorder {
> border : 0 solid #ff;
> overflow : hidden;
> background-color : #ff;
>   }
> 
> 
> 
>   
> 
>   Button:
>   
> 
> 
>   Text:
>   
> 
> 
>   Select:
>   1
> 
> 
>   Textarea:
>   SomeValue
> 
> 
>   Checkbox:
>class="cssNoBorder"> SomeValue
> 
> 
>   Radio:
>class="cssNoBorder"> SomeValue
> 
> 
>   File:
>   
> 
> 
>   Password:
>value="SomeValue">
> 
> 
>   Reset:
>   
> 
> 
>   Submit:
>   
> 
>   
> 
> 
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> On Wed, September 14, 2005 12:59 pm, Michael Jouravlev said:
>> This is what I was thinking where problem was. I don't know if CSS can
>> control borders (and arrows for comboboxes) of input elements.
>>
>> On 9/14/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>>> Laurie had the right idea... you can disable the border for form
>>> fields,
>>> and that's what you would want your stylesheet to do.  You may run into
>>> some fields that can't be controlled like that, I've never tried to do
>>> them all (specifically I'm thinking of selects, which seem to be a
>>> world
>>> unto themselves many times).
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Frank W. Zammetti
Actually, for the checkboxes and radios you can set visibility:hidden; on
them and it will actually hide the checkbox or radio itself, not the
associated text, so that's pretty good.  Just gotta find a way to deal
with the selects.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, September 14, 2005 1:36 pm, Frank W. Zammetti said:
> Yeah, no good... Below is a quick test you can play with.  I couldn't
> figure out how to get the selects to work like the rest.  Checkboxes and
> radios too it doesn't like you can do much with, but they may be OK.  Here
> you go though, pretty simple stuff...
>
> 
> 
> Test
> 
>   .cssNoBorder {
> border : 0 solid #ff;
> overflow : hidden;
> background-color : #ff;
>   }
> 
> 
> 
>   
> 
>   Button:
>   
> 
> 
>   Text:
>   
> 
> 
>   Select:
>   1
> 
> 
>   Textarea:
>   SomeValue
> 
> 
>   Checkbox:
>class="cssNoBorder"> SomeValue
> 
> 
>   Radio:
>class="cssNoBorder"> SomeValue
> 
> 
>   File:
>   
> 
> 
>   Password:
>value="SomeValue">
> 
> 
>   Reset:
>   
> 
> 
>   Submit:
>   
> 
>   
> 
> 
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> On Wed, September 14, 2005 12:59 pm, Michael Jouravlev said:
>> This is what I was thinking where problem was. I don't know if CSS can
>> control borders (and arrows for comboboxes) of input elements.
>>
>> On 9/14/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>>> Laurie had the right idea... you can disable the border for form
>>> fields,
>>> and that's what you would want your stylesheet to do.  You may run into
>>> some fields that can't be controlled like that, I've never tried to do
>>> them all (specifically I'm thinking of selects, which seem to be a
>>> world
>>> unto themselves many times).
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Frank W. Zammetti
Yeah, no good... Below is a quick test you can play with.  I couldn't
figure out how to get the selects to work like the rest.  Checkboxes and
radios too it doesn't like you can do much with, but they may be OK.  Here
you go though, pretty simple stuff...



Test

  .cssNoBorder {
border : 0 solid #ff;
overflow : hidden;
background-color : #ff;
  }



  

  Button:
  


  Text:
  


  Select:
  1


  Textarea:
  SomeValue


  Checkbox:
   SomeValue


  Radio:
   SomeValue


  File:
  


  Password:
  


  Reset:
  


  Submit:
  

  



-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, September 14, 2005 12:59 pm, Michael Jouravlev said:
> This is what I was thinking where problem was. I don't know if CSS can
> control borders (and arrows for comboboxes) of input elements.
>
> On 9/14/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>> Laurie had the right idea... you can disable the border for form fields,
>> and that's what you would want your stylesheet to do.  You may run into
>> some fields that can't be controlled like that, I've never tried to do
>> them all (specifically I'm thinking of selects, which seem to be a world
>> unto themselves many times).
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Michael Jouravlev
This is what I was thinking where problem was. I don't know if CSS can
control borders (and arrows for comboboxes) of input elements.

On 9/14/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Laurie had the right idea... you can disable the border for form fields,
> and that's what you would want your stylesheet to do.  You may run into
> some fields that can't be controlled like that, I've never tried to do
> them all (specifically I'm thinking of selects, which seem to be a world
> unto themselves many times).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Frank W. Zammetti
Laurie had the right idea... you can disable the border for form fields,
and that's what you would want your stylesheet to do.  You may run into
some fields that can't be controlled like that, I've never tried to do
them all (specifically I'm thinking of selects, which seem to be a world
unto themselves many times).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, September 14, 2005 11:43 am, Michael Jouravlev said:
> On 9/13/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
>> Jeff Deskins wrote:
>> > Is there a way to display all inputs/textareas of a struts form as
>> plain
>> > text for a printer-friendly version of a page?
>> >
>> > This would be similar to how the readonly attribute of a form
>> currently
>> > works in struts, by changing all fields to readonly. However, in this
>> case,
>> > I am looking for something to change all fields to display just the
>> values
>> > instead of the inputs and textareas. This way I can use the same jsp
>> in
>> > combination with css to have a printer-friendly page by passing in a
>> print
>> > parameter to the struts form.
>>
>> You don't need to do anything (Struts specific or otherwise) in your JSP
>> other than provide the appropriate print stylesheet. Add the following
>> to your JSP page:
>>
>>>  media="print"/>
>>
>> (note the 'media' attribute). Then, in print.css you can make whatever
>> formatting changes you want for printed copy, including supressing input
>> lables if you want.
>>
>> This article might help shed more light:
>>
>>http://www.alistapart.com/articles/goingtoprint
>
> He does not want to suppress form elements, he wants to print existing
> input fields and textareas without borders, as labels.
>
> Michael.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-14 Thread Michael Jouravlev
On 9/13/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> Jeff Deskins wrote:
> > Is there a way to display all inputs/textareas of a struts form as plain
> > text for a printer-friendly version of a page?
> >
> > This would be similar to how the readonly attribute of a form currently
> > works in struts, by changing all fields to readonly. However, in this case,
> > I am looking for something to change all fields to display just the values
> > instead of the inputs and textareas. This way I can use the same jsp in
> > combination with css to have a printer-friendly page by passing in a print
> > parameter to the struts form.
> 
> You don't need to do anything (Struts specific or otherwise) in your JSP
> other than provide the appropriate print stylesheet. Add the following
> to your JSP page:
> 
>  media="print"/>
> 
> (note the 'media' attribute). Then, in print.css you can make whatever
> formatting changes you want for printed copy, including supressing input
> lables if you want.
> 
> This article might help shed more light:
> 
>http://www.alistapart.com/articles/goingtoprint

He does not want to suppress form elements, he wants to print existing
input fields and textareas without borders, as labels.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Printer Friendly Struts Form

2005-09-13 Thread Laurie Harper

Jeff Deskins wrote:
Is there a way to display all inputs/textareas of a struts form as plain 
text for a printer-friendly version of a page? 

This would be similar to how the readonly attribute of a form currently 
works in struts, by changing all fields to readonly. However, in this case, 
I am looking for something to change all fields to display just the values 
instead of the inputs and textareas. This way I can use the same jsp in 
combination with css to have a printer-friendly page by passing in a print 
parameter to the struts form.


You don't need to do anything (Struts specific or otherwise) in your JSP 
other than provide the appropriate print stylesheet. Add the following 
to your JSP page:


  

(note the 'media' attribute). Then, in print.css you can make whatever 
formatting changes you want for printed copy, including supressing input 
lables if you want.


This article might help shed more light:

  http://www.alistapart.com/articles/goingtoprint

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Printer Friendly Struts Form

2005-09-13 Thread Johnson, Kaerstin

Im not sure how to do this in struts, although you could use JSTL to
print out only the values for 'print' version and the actual inputs, etc
for the live version... 

Very simple example: 



  ${myValue}


   





-Original Message-
From: Jeff Deskins [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 4:58 PM
To: user@struts.apache.org
Subject: Printer Friendly Struts Form

Is there a way to display all inputs/textareas of a struts form as plain

text for a printer-friendly version of a page? 

This would be similar to how the readonly attribute of a form currently 
works in struts, by changing all fields to readonly. However, in this
case, 
I am looking for something to change all fields to display just the
values 
instead of the inputs and textareas. This way I can use the same jsp in 
combination with css to have a printer-friendly page by passing in a
print 
parameter to the struts form.

Thanks,
Jeff



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Printer Friendly Struts Form

2005-09-13 Thread Jeff Deskins
Is there a way to display all inputs/textareas of a struts form as plain 
text for a printer-friendly version of a page? 

This would be similar to how the readonly attribute of a form currently 
works in struts, by changing all fields to readonly. However, in this case, 
I am looking for something to change all fields to display just the values 
instead of the inputs and textareas. This way I can use the same jsp in 
combination with css to have a printer-friendly page by passing in a print 
parameter to the struts form.

Thanks,
Jeff