You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jeroen Houtevelts <je...@mail.be> on 2004/09/16 15:48:57 UTC

my Address.jwc (2) : BindingException during ValidField.updateValue()

Hello,

(I have allready posted a question regarding to this test component, the answer 
has get me further but it's still not working.)

Trying out the 'everything is a reusable component' mantra of Tapestry, I'm  
making a component Address.jwc . 

Purpose : display street, number, box, zip, city, country fields with the 
necessary validation so i can reuse it everywhere I need an address in a page. 
(This would be, from my point of view, the mayor advantage of Tapestry over 
other web app frameworks)

Setup : the component takes one parameter, Address (domain object) with 
direction="form", the template lay out the fields in a HTML table, the 
controller extends BaseComponent & implements IFormComponent

Problem : I get a BindingException during ValidField.updateValue()

org.apache.tapestry.BindingException 
Unable to update expression 'address.street' for 
be.alliage.cater.webgui.component.JwcAddress$Enhance_13@1b27882[TestAddress2/
$JwcAddress] to street1. 
binding: ExpressionBinding[TestAddress2/$JwcAddress address.street] 
location: context:/WEB-INF/JwcAddress.jwc, line 34, column 60 
   
ognl.OgnlException 
target is null for setProperty(null, "street", street1) 
Stack Trace: 
ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1451) 
ognl.ASTProperty.setValueBody(ASTProperty.java:105) 
ognl.SimpleNode.setValue(SimpleNode.java:239) 
ognl.ASTChain.setValueBody(ASTChain.java:172) 
ognl.SimpleNode.setValue(SimpleNode.java:239) 
ognl.Ognl.setValue(Ognl.java:478) 
org.apache.tapestry.binding.ExpressionBinding.setObject
(ExpressionBinding.java:553) 
org.apache.tapestry.valid.ValidField$Enhance_1.setValue
(ValidField$Enhance_1.java) 
org.apache.tapestry.valid.ValidField.updateValue(ValidField.java:193) 
org.apache.tapestry.form.AbstractTextField.renderComponent
(AbstractTextField.java:68) 
 

Do you know what the problem is and how I can fix it ?

Again, thanks in advance!



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


Re: IE Specific Script

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Richard Hensley's use of getStyleSheetRender() is better if there's just
one. We've got some other special stuff that required us to put it in
getDelegate().



----- Original Message ----- 
From: "Jamie Orchard-Hays" <ja...@dang.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, September 16, 2004 4:26 PM
Subject: Re: IE Specific Script


> In your Border.java file, do something like this. Make sure you have Shell
> in your Border.html and when it renders, this method will be called.
>
>
>  public IRender getDelegate(){
>         String baseUrl =
> ApplicationProperties.getStringProperty("externalWebResources");
>
>         String cssPropertyName =
>
getPage().getEngine().getPropertySource().getPropertyValue("cssPropertyName"
> );
>         if (cssPropertyName == null) {
>             cssPropertyName = "cssFilePath";
>         }
>
>         /**********
>          * put in some browser testing and conditional code here
>          */
>
>         String screenCssFilePath =
> ApplicationProperties.getStringProperty(cssPropertyName);
>         StringBuffer screenCssStrbuf = new StringBuffer();
>         screenCssStrbuf.append("<link rel=\"stylesheet\" type=\"text/css\"
> ");
>         screenCssStrbuf.append("href=\"");
>         screenCssStrbuf.append(baseUrl + screenCssFilePath + "\" />");
>
>         IRender delegate = new RenderString(screenCssStrbuf.toString(),
> true);
>         return delegate;
>     }
> ----- Original Message -----
> From: <ta...@rickaustin.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Thursday, September 16, 2004 2:15 PM
> Subject: IE Specific Script
>
>
> > I have a border component that I use to add a header, footer and a drop
> > down menu. I'm using a CSS based menu from
> > http://www.aplus.co.yu/ADxMenu/. The menu works well and there are no
> > issues with Firefox (my normal browser). For this to work correctly the
> > following IE style has to be inserted prior to the body:
> >
> > <!--[if lte IE 6]>
> > <style type="text/css">
> > body { behavior:url("../scripts/iehover.htc"); }
> > </style>
> > <![endif]-->
> >
> > I've tried a number of things, none of which work:
> >
> > 1. Moving the this snippet to the style sheet.
> > 2. Placing the snippet after the <body> tag.
> > 3. Using @Script but this places it in the body.
> >
> > It only works if it is inserted either inside the head block or between
> > the head and body blocks. So... at this point I'm at a loss as to how I
> > can cause this to be placed in the correct location. I'm moving on with
> > development but I'll eventually need to get this worked out since IE
> > must be supported.
> >
> > Thanks.
> >
> > BTW, I'm a newbie with Tapestry (been a developer for over 16 years) and
> > I have to say Tapestry is awesome. Purchased the book about 6 weeks ago
> > and everything finally clicked for me about halfway through the book.
> > Good stuff!
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: IE Specific Script

Posted by Jamie Orchard-Hays <ja...@dang.com>.
In your Border.java file, do something like this. Make sure you have Shell
in your Border.html and when it renders, this method will be called.


 public IRender getDelegate(){
        String baseUrl =
ApplicationProperties.getStringProperty("externalWebResources");

        String cssPropertyName =
getPage().getEngine().getPropertySource().getPropertyValue("cssPropertyName"
);
        if (cssPropertyName == null) {
            cssPropertyName = "cssFilePath";
        }

        /**********
         * put in some browser testing and conditional code here
         */

        String screenCssFilePath =
ApplicationProperties.getStringProperty(cssPropertyName);
        StringBuffer screenCssStrbuf = new StringBuffer();
        screenCssStrbuf.append("<link rel=\"stylesheet\" type=\"text/css\"
");
        screenCssStrbuf.append("href=\"");
        screenCssStrbuf.append(baseUrl + screenCssFilePath + "\" />");

        IRender delegate = new RenderString(screenCssStrbuf.toString(),
true);
        return delegate;
    }
----- Original Message ----- 
From: <ta...@rickaustin.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, September 16, 2004 2:15 PM
Subject: IE Specific Script


> I have a border component that I use to add a header, footer and a drop
> down menu. I'm using a CSS based menu from
> http://www.aplus.co.yu/ADxMenu/. The menu works well and there are no
> issues with Firefox (my normal browser). For this to work correctly the
> following IE style has to be inserted prior to the body:
>
> <!--[if lte IE 6]>
> <style type="text/css">
> body { behavior:url("../scripts/iehover.htc"); }
> </style>
> <![endif]-->
>
> I've tried a number of things, none of which work:
>
> 1. Moving the this snippet to the style sheet.
> 2. Placing the snippet after the <body> tag.
> 3. Using @Script but this places it in the body.
>
> It only works if it is inserted either inside the head block or between
> the head and body blocks. So... at this point I'm at a loss as to how I
> can cause this to be placed in the correct location. I'm moving on with
> development but I'll eventually need to get this worked out since IE
> must be supported.
>
> Thanks.
>
> BTW, I'm a newbie with Tapestry (been a developer for over 16 years) and
> I have to say Tapestry is awesome. Purchased the book about 6 weeks ago
> and everything finally clicked for me about halfway through the book.
> Good stuff!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


IE Specific Script

Posted by ta...@rickaustin.net.
I have a border component that I use to add a header, footer and a drop
down menu. I'm using a CSS based menu from
http://www.aplus.co.yu/ADxMenu/. The menu works well and there are no
issues with Firefox (my normal browser). For this to work correctly the
following IE style has to be inserted prior to the body:

<!--[if lte IE 6]>
<style type="text/css">
	body { behavior:url("../scripts/iehover.htc"); }
</style>
<![endif]-->

I've tried a number of things, none of which work:

1. Moving the this snippet to the style sheet.
2. Placing the snippet after the <body> tag.
3. Using @Script but this places it in the body.

It only works if it is inserted either inside the head block or between
the head and body blocks. So... at this point I'm at a loss as to how I
can cause this to be placed in the correct location. I'm moving on with
development but I'll eventually need to get this worked out since IE
must be supported.

Thanks.

BTW, I'm a newbie with Tapestry (been a developer for over 16 years) and
I have to say Tapestry is awesome. Purchased the book about 6 weeks ago
and everything finally clicked for me about halfway through the book.
Good stuff!



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


Re: my Address.jwc (2) : BindingException during ValidField.updateValue()

Posted by Paul Ferraro <pm...@columbia.edu>.
You need to make sure that your Address bean is not null during the 
rewind cycle.  You can do this a number of ways.  Here are 2 that come 
to mind:
1.) Make it the Address component's responsibility to set a default value.
e.g.
<parameter name="address" direction="form" type="Address" required="no" 
default-value="new Address()"></parameter>

2.) Make it the containing component's responsibility to set an initial 
value.
e.g.
<property-specification name="myAddress" type="Address" persistent="no" 
initial-value="new Address()"></property-specification>

Paul

Jeroen Houtevelts wrote:

>Hello,
>
>(I have allready posted a question regarding to this test component, the answer 
>has get me further but it's still not working.)
>
>Trying out the 'everything is a reusable component' mantra of Tapestry, I'm  
>making a component Address.jwc . 
>
>Purpose : display street, number, box, zip, city, country fields with the 
>necessary validation so i can reuse it everywhere I need an address in a page. 
>(This would be, from my point of view, the mayor advantage of Tapestry over 
>other web app frameworks)
>
>Setup : the component takes one parameter, Address (domain object) with 
>direction="form", the template lay out the fields in a HTML table, the 
>controller extends BaseComponent & implements IFormComponent
>
>Problem : I get a BindingException during ValidField.updateValue()
>
>org.apache.tapestry.BindingException 
>Unable to update expression 'address.street' for 
>be.alliage.cater.webgui.component.JwcAddress$Enhance_13@1b27882[TestAddress2/
>$JwcAddress] to street1. 
>binding: ExpressionBinding[TestAddress2/$JwcAddress address.street] 
>location: context:/WEB-INF/JwcAddress.jwc, line 34, column 60 
>   
>ognl.OgnlException 
>target is null for setProperty(null, "street", street1) 
>Stack Trace: 
>ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1451) 
>ognl.ASTProperty.setValueBody(ASTProperty.java:105) 
>ognl.SimpleNode.setValue(SimpleNode.java:239) 
>ognl.ASTChain.setValueBody(ASTChain.java:172) 
>ognl.SimpleNode.setValue(SimpleNode.java:239) 
>ognl.Ognl.setValue(Ognl.java:478) 
>org.apache.tapestry.binding.ExpressionBinding.setObject
>(ExpressionBinding.java:553) 
>org.apache.tapestry.valid.ValidField$Enhance_1.setValue
>(ValidField$Enhance_1.java) 
>org.apache.tapestry.valid.ValidField.updateValue(ValidField.java:193) 
>org.apache.tapestry.form.AbstractTextField.renderComponent
>(AbstractTextField.java:68) 
> 
>
>Do you know what the problem is and how I can fix it ?
>
>Again, thanks in advance!
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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