You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Sachmann <a....@profiit.de> on 2005/04/12 22:11:16 UTC
c:forEach tag and indexed properties problem
Hi Guys,
i have a problem with the forEach Tag and an indexed propertie!
Please have a look at this peace of code.
<c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
<TR>
<TD> <c:out value="${artikel.kategorie}"/> - <c:out
value="${artikel.setbezeichnungkurz}"/>
<c:out value="${artikel.preisnetto}"/> <c:out
value="${artikel.preiseinheit}"/>
</TD>
<TD>
<c:out value="${artikel.warengruppe}"/>
</TD>
<TD>
<c:out value="${artikel.angebotsdatumbis}"/>
<html:text name="artikel" indexed="true" property="menge"/>
</TD>
</TR>
</c:forEach>
Everthing goes okay - but the html:text element throws an error -
Cannot find bean artikel in any scope
Why it doesn't work?
Thanks for Help
Axel Sachmann
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
c:forEach tag not working properly
Posted by Axel Sachmann <a....@profiit.de>.
Hi,
i have still a problem with the c:forEach tag in a Jsp.
In a DynaValidatorForm i set an array of Objects as an element of
form-property "artikel" with the action
"de.zakps.action.generiereArtikelform". That works fine.
The Iteration of the array with the c:forEach tag works very good.
But the problem is the <html:text element to get the property "menge" in
the html:form.
The error message is:Cannot find bean artikel in any scope
What must i do to access the bean artikel??? How can i use the artikel
in the form??
Thanks for Help
Axel Sachmann
----------------------Struts-Config-------------------------
<struts-config>
<data-sources />
<form-beans>
<form-bean name="dynamicArrayForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="artikel"
type="de.zakps.global.dao.Verkaufsartikel[]"/>
</form-bean>
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action path="/generiereArtikelform"
type="de.zakps.action.generiereArtikelform" name="dynamicArrayForm"
scope="session"
validate="false">
<forward name="success" path="/module/anzeigenKategorie.jsp" />
</action>
-------------JSP Page anzeigenKategorie.Jsp----------------
<%@ page language="java" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template"
prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested"
prefix="nested" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix='c'%>
<table border="0" width="100%">
<tbody><tr >
<td class="text" colspan="2"><b>
<html:form action="/kalkulierePositionen.do">
<TABLE WIDTH="80%" BORDER="1">
<c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
<TR>
<TD> <c:out value="${artikel.kategorie}"/> - <c:out
value="${artikel.setbezeichnungkurz}"/>
<c:out value="${artikel.preisnetto}"/> <c:out
value="${artikel.preiseinheit}"/>
</TD>
<TD><c:out value="${artikel.warengruppe}"/></TD>
<TD><c:out value="${artikel.angebotsdatumbis}"/>
<html:text name="artikel" indexed="true"
property="menge"/>
<<<<<<<<<<<<<<<<<<<------------------Problem is here
</TD>
</TR>
</c:forEach>
</table>
<html:submit/>
</html:form>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: c:forEach tag and indexed properties problem
Posted by gd...@cmhc-schl.gc.ca.
Ah yes... you do not have the <html:form> tag?
According to the Developer Guide (
http://struts.apache.org/userGuide/struts-html.html#text)
Render an input button of type text. This tag is only valid when nested
inside a form tag body.
Try wrapping it in the <html:form> tag.
Axel Sachmann <a....@profiit.de>
13/04/2005 07:55 AM
Please respond to "Struts Users Mailing List"
To: Struts Users Mailing List <us...@struts.apache.org>
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
Subject: Re: c:forEach tag and indexed properties problem
Classification:
gdeschen@cmhc-schl.gc.ca wrote:
>Have you included the taglb in the JSP ?
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
>
Yes but the bean is not in any scope! How can i access the Form-property?
>
>
>
>
>Axel Sachmann <a....@profiit.de>
>12/04/2005 05:49 PM
>Please respond to "Struts Users Mailing List"
>
>
>
>
>
> To: Struts Users Mailing List <us...@struts.apache.org>
> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>
> Subject: Re: c:forEach tag and indexed properties problem
> Classification:
>
>
>
>gdeschen@cmhc-schl.gc.ca wrote:
>
>
>
>>Any data in the dynamicArrayForm.map.artikel ?
>>
>>
>>
>>
>yes it's work fine without the html:text tag.
>here is an example output.
>
><TR>
> <TD> bad - Ausstattung PS-Exklusiv
> 2000.0 Euro
> </TD>
> <TD>Typ 1</TD>
> <TD>30.05.2005
>
> </TD>
>
> </TR>
>
>But it doesn't work with the html:text tag!
>
>
>
>
>
>>
>>
>>Axel Sachmann <a....@profiit.de>
>>12/04/2005 04:11 PM
>>Please respond to "Struts Users Mailing List"
>>
>>
>>
>>
>>
>> To: user@struts.apache.org
>> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>>
>> Subject: c:forEach tag and indexed properties problem
>>Classification:
>>
>>
>>
>>Hi Guys,
>>
>>i have a problem with the forEach Tag and an indexed propertie!
>>Please have a look at this peace of code.
>>
>><c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
>> <TR>
>> <TD> <c:out value="${artikel.kategorie}"/> - <c:out
>>value="${artikel.setbezeichnungkurz}"/>
>> <c:out value="${artikel.preisnetto}"/> <c:out
>>value="${artikel.preiseinheit}"/>
>> </TD>
>> <TD>
>> <c:out value="${artikel.warengruppe}"/>
>> </TD>
>> <TD>
>> <c:out value="${artikel.angebotsdatumbis}"/>
>><html:text name="artikel" indexed="true" property="menge"/>
>> </TD>
>> </TR>
>> </c:forEach>
>>
>>Everthing goes okay - but the html:text element throws an error -
>>
>>Cannot find bean artikel in any scope
>>
>>Why it doesn't work?
>>
>>Thanks for Help
>>
>>Axel Sachmann
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
--
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln
Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12
Internet: http://www.profiIT.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: c:forEach tag and indexed properties problem
Posted by Axel Sachmann <a....@profiit.de>.
gdeschen@cmhc-schl.gc.ca wrote:
>Have you included the taglb in the JSP ?
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
>
Yes but the bean is not in any scope! How can i access the Form-property?
>
>
>
>
>Axel Sachmann <a....@profiit.de>
>12/04/2005 05:49 PM
>Please respond to "Struts Users Mailing List"
>
>
>
>
>
> To: Struts Users Mailing List <us...@struts.apache.org>
> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>
> Subject: Re: c:forEach tag and indexed properties problem
> Classification:
>
>
>
>gdeschen@cmhc-schl.gc.ca wrote:
>
>
>
>>Any data in the dynamicArrayForm.map.artikel ?
>>
>>
>>
>>
>yes it's work fine without the html:text tag.
>here is an example output.
>
><TR>
> <TD> bad - Ausstattung PS-Exklusiv
> 2000.0 Euro
> </TD>
> <TD>Typ 1</TD>
> <TD>30.05.2005
>
> </TD>
>
> </TR>
>
>But it doesn't work with the html:text tag!
>
>
>
>
>
>>
>>
>>Axel Sachmann <a....@profiit.de>
>>12/04/2005 04:11 PM
>>Please respond to "Struts Users Mailing List"
>>
>>
>>
>>
>>
>> To: user@struts.apache.org
>> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>>
>> Subject: c:forEach tag and indexed properties problem
>>Classification:
>>
>>
>>
>>Hi Guys,
>>
>>i have a problem with the forEach Tag and an indexed propertie!
>>Please have a look at this peace of code.
>>
>><c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
>> <TR>
>> <TD> <c:out value="${artikel.kategorie}"/> - <c:out
>>value="${artikel.setbezeichnungkurz}"/>
>> <c:out value="${artikel.preisnetto}"/> <c:out
>>value="${artikel.preiseinheit}"/>
>> </TD>
>> <TD>
>> <c:out value="${artikel.warengruppe}"/>
>> </TD>
>> <TD>
>> <c:out value="${artikel.angebotsdatumbis}"/>
>><html:text name="artikel" indexed="true" property="menge"/>
>> </TD>
>> </TR>
>> </c:forEach>
>>
>>Everthing goes okay - but the html:text element throws an error -
>>
>>Cannot find bean artikel in any scope
>>
>>Why it doesn't work?
>>
>>Thanks for Help
>>
>>Axel Sachmann
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
--
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln
Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12
Internet: http://www.profiIT.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: c:forEach tag and indexed properties problem
Posted by gd...@cmhc-schl.gc.ca.
Have you included the taglb in the JSP ?
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
Axel Sachmann <a....@profiit.de>
12/04/2005 05:49 PM
Please respond to "Struts Users Mailing List"
To: Struts Users Mailing List <us...@struts.apache.org>
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
Subject: Re: c:forEach tag and indexed properties problem
Classification:
gdeschen@cmhc-schl.gc.ca wrote:
>Any data in the dynamicArrayForm.map.artikel ?
>
>
yes it's work fine without the html:text tag.
here is an example output.
<TR>
<TD> bad - Ausstattung PS-Exklusiv
2000.0 Euro
</TD>
<TD>Typ 1</TD>
<TD>30.05.2005
</TD>
</TR>
But it doesn't work with the html:text tag!
>
>
>
>
>Axel Sachmann <a....@profiit.de>
>12/04/2005 04:11 PM
>Please respond to "Struts Users Mailing List"
>
>
>
>
>
> To: user@struts.apache.org
> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>
> Subject: c:forEach tag and indexed properties problem
> Classification:
>
>
>
>Hi Guys,
>
>i have a problem with the forEach Tag and an indexed propertie!
>Please have a look at this peace of code.
>
><c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
> <TR>
> <TD> <c:out value="${artikel.kategorie}"/> - <c:out
>value="${artikel.setbezeichnungkurz}"/>
> <c:out value="${artikel.preisnetto}"/> <c:out
>value="${artikel.preiseinheit}"/>
> </TD>
> <TD>
> <c:out value="${artikel.warengruppe}"/>
> </TD>
> <TD>
> <c:out value="${artikel.angebotsdatumbis}"/>
><html:text name="artikel" indexed="true" property="menge"/>
> </TD>
> </TR>
> </c:forEach>
>
>Everthing goes okay - but the html:text element throws an error -
>
>Cannot find bean artikel in any scope
>
>Why it doesn't work?
>
>Thanks for Help
>
>Axel Sachmann
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
--
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln
Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12
Internet: http://www.profiIT.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: c:forEach tag and indexed properties problem
Posted by Axel Sachmann <a....@profiit.de>.
gdeschen@cmhc-schl.gc.ca wrote:
>Any data in the dynamicArrayForm.map.artikel ?
>
>
yes it's work fine without the html:text tag.
here is an example output.
<TR>
<TD> bad - Ausstattung PS-Exklusiv
2000.0 Euro
</TD>
<TD>Typ 1</TD>
<TD>30.05.2005
</TD>
</TR>
But it doesn't work with the html:text tag!
>
>
>
>
>Axel Sachmann <a....@profiit.de>
>12/04/2005 04:11 PM
>Please respond to "Struts Users Mailing List"
>
>
>
>
>
> To: user@struts.apache.org
> cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
>
> Subject: c:forEach tag and indexed properties problem
> Classification:
>
>
>
>Hi Guys,
>
>i have a problem with the forEach Tag and an indexed propertie!
>Please have a look at this peace of code.
>
><c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
> <TR>
> <TD> <c:out value="${artikel.kategorie}"/> - <c:out
>value="${artikel.setbezeichnungkurz}"/>
> <c:out value="${artikel.preisnetto}"/> <c:out
>value="${artikel.preiseinheit}"/>
> </TD>
> <TD>
> <c:out value="${artikel.warengruppe}"/>
> </TD>
> <TD>
> <c:out value="${artikel.angebotsdatumbis}"/>
><html:text name="artikel" indexed="true" property="menge"/>
> </TD>
> </TR>
> </c:forEach>
>
>Everthing goes okay - but the html:text element throws an error -
>
>Cannot find bean artikel in any scope
>
>Why it doesn't work?
>
>Thanks for Help
>
>Axel Sachmann
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
--
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln
Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12
Internet: http://www.profiIT.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: c:forEach tag and indexed properties problem
Posted by gd...@cmhc-schl.gc.ca.
Any data in the dynamicArrayForm.map.artikel ?
Axel Sachmann <a....@profiit.de>
12/04/2005 04:11 PM
Please respond to "Struts Users Mailing List"
To: user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
Subject: c:forEach tag and indexed properties problem
Classification:
Hi Guys,
i have a problem with the forEach Tag and an indexed propertie!
Please have a look at this peace of code.
<c:forEach var="artikel" items="${dynamicArrayForm.map.artikel}" >
<TR>
<TD> <c:out value="${artikel.kategorie}"/> - <c:out
value="${artikel.setbezeichnungkurz}"/>
<c:out value="${artikel.preisnetto}"/> <c:out
value="${artikel.preiseinheit}"/>
</TD>
<TD>
<c:out value="${artikel.warengruppe}"/>
</TD>
<TD>
<c:out value="${artikel.angebotsdatumbis}"/>
<html:text name="artikel" indexed="true" property="menge"/>
</TD>
</TR>
</c:forEach>
Everthing goes okay - but the html:text element throws an error -
Cannot find bean artikel in any scope
Why it doesn't work?
Thanks for Help
Axel Sachmann
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org