You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthieu MARC <ma...@angers.ensam.fr> on 2008/06/13 11:08:54 UTC

Form template

Hi,

I am making a form page with jstl tags :

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<s:form>
   
    <s:hidden name="week.username" value="%{week.username}" />
   
    <s:iterator value="week.daysOfWeek">
        <s:label labelposition="top" value="%{getText(displayName)}" 
cssStyle="font-weight: bold;" />
        <s:select name="week.daysOfWeek[%{index}].am" 
onchange="countHour();" id="am%{index}" key="timetable.morning" 
list="heures" value="%{am}" />
        <s:select name="week.daysOfWeek[%{index}].pm" 
onchange="countHour();" id="pm%{index}" key="timetable.afternoon" 
list="heures" value="%{pm}" />
    </s:iterator>
   
    <s:label id="tpsTotal" labelposition="left" 
key="timetable.totalTime" name="tpsTotal" />
    <s:submit name="submitChange" value="Submit" 
action="timetableRecordChange" />
    <s:submit name="submitCancel" value="Cancel" 
action="timetableDisplay" />
   
</s:form>

The code generated used TABLE, TR and TD to put the different element on 
the page. I would prefered to use DIV, P and SPAN but I don't know how 
to do. Looking at the s:form element, I found the parameter template, 
but I didn't manage to find any documentation on how to use the paramater.

Can someone give me some link to documentation on templating a form in 
order to use anything else than a table based formated page ?

Thanks in advance.

Matthieu MARC

-- 
Matthieu MARC
matthieu.marc@angers.ensam.fr


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Form template

Posted by Craftyman <cr...@gmail.com>.
Hi,

You can use theme="simple" in your tag to disable table mode. Ex : <s:form
theme="simple" >

Cédric

2008/6/13 Ralf Fischer <th...@googlemail.com>:

> Hi Matthieu,
>
> On Fri, Jun 13, 2008 at 11:08 AM, Matthieu MARC
> <ma...@angers.ensam.fr> wrote:
> > Hi,
> >
> > I am making a form page with jstl tags :
> >
> > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> >
> > <s:form>
> >     <s:hidden name="week.username" value="%{week.username}" />
> >     <s:iterator value="week.daysOfWeek">
> >       <s:label labelposition="top" value="%{getText(displayName)}"
> > cssStyle="font-weight: bold;" />
> >       <s:select name="week.daysOfWeek[%{index}].am"
> onchange="countHour();"
> > id="am%{index}" key="timetable.morning" list="heures" value="%{am}" />
> >       <s:select name="week.daysOfWeek[%{index}].pm"
> onchange="countHour();"
> > id="pm%{index}" key="timetable.afternoon" list="heures" value="%{pm}" />
> >   </s:iterator>
> >     <s:label id="tpsTotal" labelposition="left" key="timetable.totalTime"
> > name="tpsTotal" />
> >   <s:submit name="submitChange" value="Submit"
> > action="timetableRecordChange" />
> >   <s:submit name="submitCancel" value="Cancel" action="timetableDisplay"
> />
> >  </s:form>
>
> Well, IMO you don't use ANY JSTL tag in the code snipplet  here.
>
> > The code generated used TABLE, TR and TD to put the different element on
> the
> > page. I would prefered to use DIV, P and SPAN but I don't know how to do.
> > Looking at the s:form element, I found the parameter template, but I
> didn't
> > manage to find any documentation on how to use the paramater.
> >
> > Can someone give me some link to documentation on templating a form in
> order
> > to use anything else than a table based formated page ?
>
> That would be here [1].
>
> Bye,
> -Ralf
>
>
> [1] http://struts.apache.org/2.0.11.1/docs/extending-themes.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Form template

Posted by Ralf Fischer <th...@googlemail.com>.
Hi Matthieu,

On Fri, Jun 13, 2008 at 11:08 AM, Matthieu MARC
<ma...@angers.ensam.fr> wrote:
> Hi,
>
> I am making a form page with jstl tags :
>
> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
>
> <s:form>
>     <s:hidden name="week.username" value="%{week.username}" />
>     <s:iterator value="week.daysOfWeek">
>       <s:label labelposition="top" value="%{getText(displayName)}"
> cssStyle="font-weight: bold;" />
>       <s:select name="week.daysOfWeek[%{index}].am" onchange="countHour();"
> id="am%{index}" key="timetable.morning" list="heures" value="%{am}" />
>       <s:select name="week.daysOfWeek[%{index}].pm" onchange="countHour();"
> id="pm%{index}" key="timetable.afternoon" list="heures" value="%{pm}" />
>   </s:iterator>
>     <s:label id="tpsTotal" labelposition="left" key="timetable.totalTime"
> name="tpsTotal" />
>   <s:submit name="submitChange" value="Submit"
> action="timetableRecordChange" />
>   <s:submit name="submitCancel" value="Cancel" action="timetableDisplay" />
>  </s:form>

Well, IMO you don't use ANY JSTL tag in the code snipplet  here.

> The code generated used TABLE, TR and TD to put the different element on the
> page. I would prefered to use DIV, P and SPAN but I don't know how to do.
> Looking at the s:form element, I found the parameter template, but I didn't
> manage to find any documentation on how to use the paramater.
>
> Can someone give me some link to documentation on templating a form in order
> to use anything else than a table based formated page ?

That would be here [1].

Bye,
-Ralf


[1] http://struts.apache.org/2.0.11.1/docs/extending-themes.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org