Re: THEMES AND TEMPLATES

2007-04-11 Thread Laurie Harper

Juan Espinosa wrote:

Hi is there any theme repository ??? I want to change my theme, like putting
the field errors in red, in the right of the component (field) who cause the
error...


I'm not sure what you mean by a theme repository, but documentation on 
customizing Struts 2 themes and templates is here:


http://struts.apache.org/2.x/docs/themes-and-templates.html

For simple tweaks like changing colours, you can use plain ol' CSS. For 
more extensive changes, you'll want a customized theme.


L.


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



THEMES AND TEMPLATES

2007-04-10 Thread Juan Espinosa

Hi is there any theme repository ??? I want to change my theme, like putting
the field errors in red, in the right of the component (field) who cause the
error...

Regards

Juan Espinosa

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.26/754 - Release Date: 09/04/2007
22:59
 


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



RE: Themes and templates

2006-11-29 Thread Juan Espinosa
Thanks mark for your help, i will give a try to your advices

Regards Juan

-Mensaje original-
De: Mark Shifman [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 28 de Noviembre de 2006 05:20 p.m.
Para: Struts Users Mailing List
Asunto: Re: Themes and templates

If you set
struts.ui.theme=simple in the struts.properties file you won't fight with
the templates and it will be sort of like good old struts 1.

However, there are other gotchas in store.  You have to get validation
errors on the screen yourself using s:fielderror/ since the theme cleverly
puts the validation errors next to the invalid fields but not with simple.
This is how I have done it but there is probably a better way:
s:if test=hasErrors()
h3span style=color:red; font-weight:boldValidation
Error/span/h3
s:actionerror/
s:fielderror/
/s:if
The hasErrors() comes from the value stack from you action that extended
ActionSupport.

But this didn't really answer your question of how to make themes and
templates work for you :(.


Juan Espinosa wrote:
 Hi to all, im building an struts2 based application and i dont understan
the
 concept of themes an templates. In the past i used struts 1, and in the
view
 i used jsp tags and struts tags like iterate and others.
  
 Now in the application that im buildin i use tags provided by struts like
 s:action s:include s:iterator,  s:form etc. the problem started when i was
 using the radio button tag that renders radio buttons based on a list. The
 buttons are put side by side... and i want to put one below the other
  
 label radio1 label radio2 (now)
  
 label radio1
 label radio2 (mi needs)
  
 I want to know if render of buttons tables forms and other tags are based
on
 this templates..and how i could change it
  
 Regards
  
 Juan
  
  
  
  
  

   


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [EMAIL PROTECTED]


-
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]



Themes and templates

2006-11-28 Thread Juan Espinosa
Hi to all, im building an struts2 based application and i dont understan the
concept of themes an templates. In the past i used struts 1, and in the view
i used jsp tags and struts tags like iterate and others.
 
Now in the application that im buildin i use tags provided by struts like
s:action s:include s:iterator,  s:form etc. the problem started when i was
using the radio button tag that renders radio buttons based on a list. The
buttons are put side by side... and i want to put one below the other
 
label radio1 label radio2 (now)
 
label radio1
label radio2 (mi needs)
 
I want to know if render of buttons tables forms and other tags are based on
this templates..and how i could change it
 
Regards
 
Juan
 
 
 
 
 


Re: Themes and templates

2006-11-28 Thread Mark Shifman

If you set
struts.ui.theme=simple in the struts.properties file
you won't fight with the templates and it will be sort of like good old 
struts 1.


However, there are other gotchas in store.  You have to get validation 
errors on the screen yourself
using s:fielderror/ since the theme cleverly puts the validation 
errors next to the invalid fields but
not with simple.  This is how I have done it but there is probably a 
better way:

s:if test=hasErrors()
   h3span style=color:red; font-weight:boldValidation 
Error/span/h3

   s:actionerror/
   s:fielderror/
/s:if
The hasErrors() comes from the value stack from you action that extended 
ActionSupport.


But this didn't really answer your question of how to make themes and 
templates work for you :(.



Juan Espinosa wrote:

Hi to all, im building an struts2 based application and i dont understan the
concept of themes an templates. In the past i used struts 1, and in the view
i used jsp tags and struts tags like iterate and others.
 
Now in the application that im buildin i use tags provided by struts like

s:action s:include s:iterator,  s:form etc. the problem started when i was
using the radio button tag that renders radio buttons based on a list. The
buttons are put side by side... and i want to put one below the other
 
label radio1 label radio2 (now)
 
label radio1

label radio2 (mi needs)
 
I want to know if render of buttons tables forms and other tags are based on

this templates..and how i could change it
 
Regards
 
Juan
 
 
 
 
 

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Themes and templates

2006-11-28 Thread Mark Menard
On 11/28/06 4:04 PM, Juan Espinosa [EMAIL PROTECTED] wrote:

 I want to know if render of buttons tables forms and other tags are based on
 this templates..and how i could change it

Hi Juan,

The rendering of the buttons is based on the theme template. The templates
can be found in the Struts source in:

/core/src/main/resources/template

There are a few directories there. I believe S2 defaults to the xhtml theme.

I have extended the xhtml theme extensively to do variable multi-column
layouts. It took some work, and at the time I thought it was hard, but in
retrospect it wasn't that bad.

Take a look at the template that backs s:textfield first. It's text.ftl in
the xhtml directory. It's real short:

#include /${parameters.templateDir}/${parameters.theme}/controlheader.ftl
/
#include /${parameters.templateDir}/simple/text.ftl /
#include /${parameters.templateDir}/xhtml/controlfooter.ftl /


It includes a controlheader, the simple text.ftl template, then a
controlfooter.

The control header and footer is where the table wrapping happens and the
simple/text.ftl is where the actual input element is generated from.

Just go through it a piece at a time.

I have yet to use a radio button group, but I think the template to start
with is radiomap.ftl.

When going through this just remember to follow the includes.

Good luck,

Mark

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



Re: Themes and templates

2006-11-28 Thread Mark Menard
On 11/28/06 4:06 PM, Mark Menard [EMAIL PROTECTED] wrote:

 On 11/28/06 4:04 PM, Juan Espinosa [EMAIL PROTECTED] wrote:
 
 I want to know if render of buttons tables forms and other tags are based on
 this templates..and how i could change it
 
 Hi Juan,
 
 The rendering of the buttons is based on the theme template. The templates
 can be found in the Struts source in:
 
   /core/src/main/resources/template

Forgot to mention if you want to hack on these do the following:

1. In WEB-INF/classes/ make a template directory.

2. Copy the xhtml, and simple directories from the Struts distribution to
that directory.

3. in WEB-INF/classes/template make a directory for your own theme, such as
WEB-INF/class/template/mytheme/. You'll put any template you want to
override in this directory.

4. Optionally, although I'd highly recommend it, copy the contents of the
xhtml theme to your theme directory so you have something to hack on.

5. Hack away and see how it works.

Later,

Mark

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