You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Russ Brown <rb...@infinityhealthcare.com> on 2005/01/01 16:42:11 UTC

Re: Problem with ognl parameter binding

Looks like your TestBean property "Oggetto" is null.  Your Oggetto in
the componenet is specified as a property, when it looks like you meant
to use it as a parameter.  Try changing the <property-specification...>
entry to a <parameter...>.

You're page is passing in an "Oggetto" parameter to the component, but
since there is no such parameter defined, it's being treated as an
informal parameter.

Hope this helps.
Russ

Luca Jannace wrote:
> 
> Hi, I have a proble using tapestry framework, can u help me??
> 
> Thanks.
> 
> My state is:
> 
> ********************************************************************************
> **
> 
> -----------------------------------------------------------------------
> - Home.page
> <page-specification class="com.provacomponente.Home">
> <description><![CDATA[ add a description ]]></description>
> 
> <component id="Componente" type="TestComponent">
> <binding name="Oggetto" expression="OggettoDaPassare"/>
> </component>
> 
> </page-specification>
> 
> -----------------------------------------------------------------------
> - TestComponent.jwc
> <component-specification class="org.apache.tapestry.BaseComponent" allow-
> body="yes" allow-informal-parameters="yes">
> 
> <property-specification name="Oggetto" type="com.provacomponente.TestBean"/>
> 
> <component id="e" type="Foreach">
> <binding name="source" expression="Oggetto.Elenco"/>
> </component>
> <component id="Testo" type="TextField">
> <binding name="value" expression="components.e.value"/>
> </component>
> </component-specification>
> 
> -----------------------------------------------------------------------
> - Home.java
> package com.provacomponente;
> import org.apache.tapestry.html.BasePage;
> 
> public class Home extends BasePage {
> private TestBean OggettoDaPassare;
> 
> public Home() {
> super();
> OggettoDaPassare = new TestBean();
> }
> 
> public TestBean getOggettoDaPassare() {
> return OggettoDaPassare;
> }
> 
> public void setOggettoDaPassare(TestBean oggettoDaPassare) {
> OggettoDaPassare = oggettoDaPassare;
> }
> 
> }
> 
> -----------------------------------------------------------------------
> - TestBean.java
> package com.provacomponente;
> import java.util.ArrayList;
> 
> public class TestBean {
> private ArrayList Elenco;
> 
> public ArrayList getElenco() {
> return Elenco;
> }
> 
> public void setElenco(ArrayList elenco) {
> Elenco = elenco;
> }
> 
> public TestBean() {
> Elenco = new ArrayList();
> 
> Elenco.add("Testo1");
> Elenco.add("Testo2");
> Elenco.add("Testo3");
> Elenco.add("Testo4");
> Elenco.add("Testo5");
> }
> 
> }
> 
> ********************************************************************************
> **
> 
> Now,
> 
> My server (jetty) gets a:
> 
> ________________________________________________________________________________
> _
> - org.apache.tapestry.BindingException:
> Unable to resolve expression 'Oggetto.Elenco' for
> com.provacomponente.TestComponent$Enhance_0@107f45d[Home/Componente].
> 
> AND
> 
> - ognl.OgnlException:
> source is null for getProperty(null, "Elenco")
> ________________________________________________________________________________
> _
> 
> I think the problem is in the binding of Oggetto.Elenco...
> Indeed if I call directly the property Oggetto it works and puts another kind
> of error.
> 
> Is an ongl parser problem?
> 
> Why it happend?
> How can I resolve it?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


----------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,is for the sole use of the intended recipient(s), even if addressed incorrectly, and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy or delete all copies of the original message and all attachments, including deletion from the trash or equivalent folder.  Thank you.