You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Greene <ag...@romulin.com> on 2004/01/09 19:30:30 UTC

Problem with Components and Bindings

I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
figure out. I have a page that displays conferences, there are X number
associations that can have Y number of conferences each, so I have the X
ForEach and inside it I have the Y ForEach. As a part of printing the
Conference data I created a component called InsertAddress that takes an
Address object (each event has an Address object, and an event is the
Conference). The problem I'm facing is that when the page is loaded the
IBinding (I use custom on the components "address" parameter) is set, then
the page goes through its ForEach loops, but the addressBinding is empty,
the address is never assigned to it. Did I do something wrong are or is
there a problem somewheres else. I've attached as much of the source as
possible.


Adam Greene
Director of Software Development
RGI
885 Main St, Suite 16
Moncton, NB, E1C 1G5
Canada

Phone: (506) 863-1014 x4
Fax  : (506) 854-6886
http://www.romulin.com 


RE: [FIXED] Problem with Components and Bindings

Posted by Adam Greene <ag...@romulin.com>.
In Tapestry 2.2, I don't think I had to make the getAddress and setAddress,
it would simply use the binding and get it for me.  Whatever.  As long as I
know how to do it now.

-----Original Message-----
From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
Sent: Friday, January 09, 2004 2:59 PM
To: Tapestry users
Subject: Re: [FIXED] Problem with Components and Bindings


Yes, the "auto" parameter will be enhanced and the getAddress() and
setAddress() methods will be
created automatically in the component class for you. The implmentation of
these methods will access
the binding and do the needful automatically. While a component with a
"custom" parameter, say
"address", will be enhanced to have only the getAddressBinding() and
setAddressBinding() methods.
The getAddress() and setAddress() methods will have to be implemented
manually.

So in your case when you used a cutom parameter you probably did not
implement the getAddress() and
setAddress() methods and hence the exception.

Hope this makes sense.

-Harish

Adam Greene wrote:

> So why doesn't custom work when I have the IBinding object?  It comes back
> and gives an error message about the source being null on a getProperty
> (null, location) -- location is part of the address object.  When I set it
> to auto, it still uses my IBinding methods to get and set the binding, but
> the component works, is it creating "getAddress()" and "setAddress()"??
>
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Friday, January 09, 2004 2:42 PM
> To: Tapestry users
> Subject: Re: [FIXED] Problem with Components and Bindings
>
>
> With "auto" parameters, Tapestry creates both the parameter property and
the
> binding property for
> you. With "custom" Tapestry only created the binding property; it is your
> responsibility to retrieve
> the value from the binding and update the binding.
>
> -Harish
>
> Adam Greene wrote:
>
>
>>Ok, fixed my own problem, just changed "custom" to "auto" on direction and
>>"everyone plays nice" now.  What is the difference?
>>  -----Original Message-----
>>  From: Adam Greene [mailto:agreene@romulin.com]
>>  Sent: Friday, January 09, 2004 2:31 PM
>>  To: Tapestry
>>  Subject: Problem with Components and Bindings
>>
>>
>>  I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
>>  figure out. I have a page that displays conferences, there are X number
>>  associations that can have Y number of conferences each, so I have the X
>>  ForEach and inside it I have the Y ForEach. As a part of printing the
>>  Conference data I created a component called InsertAddress that takes an
>>  Address object (each event has an Address object, and an event is the
>>  Conference). The problem I'm facing is that when the page is loaded the
>>  IBinding (I use custom on the components "address" parameter) is set,
>
> then
>
>>  the page goes through its ForEach loops, but the addressBinding is
>
> empty,
>
>>  the address is never assigned to it. Did I do something wrong are or is
>>  there a problem somewheres else. I've attached as much of the source as
>>  possible.
>>
>>
>>  Adam Greene
>>  Director of Software Development
>>  RGI
>>  885 Main St, Suite 16
>>  Moncton, NB, E1C 1G5
>>  Canada
>>
>>  Phone: (506) 863-1014 x4
>>  Fax  : (506) 854-6886
>>  http://www.romulin.com
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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



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


Re: [FIXED] Problem with Components and Bindings

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Yes, the "auto" parameter will be enhanced and the getAddress() and setAddress() methods will be 
created automatically in the component class for you. The implmentation of these methods will access 
the binding and do the needful automatically. While a component with a "custom" parameter, say 
"address", will be enhanced to have only the getAddressBinding() and setAddressBinding() methods. 
The getAddress() and setAddress() methods will have to be implemented manually.

So in your case when you used a cutom parameter you probably did not implement the getAddress() and 
setAddress() methods and hence the exception.

Hope this makes sense.

-Harish

Adam Greene wrote:

> So why doesn't custom work when I have the IBinding object?  It comes back
> and gives an error message about the source being null on a getProperty
> (null, location) -- location is part of the address object.  When I set it
> to auto, it still uses my IBinding methods to get and set the binding, but
> the component works, is it creating "getAddress()" and "setAddress()"??
> 
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Friday, January 09, 2004 2:42 PM
> To: Tapestry users
> Subject: Re: [FIXED] Problem with Components and Bindings
> 
> 
> With "auto" parameters, Tapestry creates both the parameter property and the
> binding property for
> you. With "custom" Tapestry only created the binding property; it is your
> responsibility to retrieve
> the value from the binding and update the binding.
> 
> -Harish
> 
> Adam Greene wrote:
> 
> 
>>Ok, fixed my own problem, just changed "custom" to "auto" on direction and
>>"everyone plays nice" now.  What is the difference?
>>  -----Original Message-----
>>  From: Adam Greene [mailto:agreene@romulin.com]
>>  Sent: Friday, January 09, 2004 2:31 PM
>>  To: Tapestry
>>  Subject: Problem with Components and Bindings
>>
>>
>>  I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
>>  figure out. I have a page that displays conferences, there are X number
>>  associations that can have Y number of conferences each, so I have the X
>>  ForEach and inside it I have the Y ForEach. As a part of printing the
>>  Conference data I created a component called InsertAddress that takes an
>>  Address object (each event has an Address object, and an event is the
>>  Conference). The problem I'm facing is that when the page is loaded the
>>  IBinding (I use custom on the components "address" parameter) is set,
> 
> then
> 
>>  the page goes through its ForEach loops, but the addressBinding is
> 
> empty,
> 
>>  the address is never assigned to it. Did I do something wrong are or is
>>  there a problem somewheres else. I've attached as much of the source as
>>  possible.
>>
>>
>>  Adam Greene
>>  Director of Software Development
>>  RGI
>>  885 Main St, Suite 16
>>  Moncton, NB, E1C 1G5
>>  Canada
>>
>>  Phone: (506) 863-1014 x4
>>  Fax  : (506) 854-6886
>>  http://www.romulin.com
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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: [FIXED] Problem with Components and Bindings

Posted by Adam Greene <ag...@romulin.com>.
So why doesn't custom work when I have the IBinding object?  It comes back
and gives an error message about the source being null on a getProperty
(null, location) -- location is part of the address object.  When I set it
to auto, it still uses my IBinding methods to get and set the binding, but
the component works, is it creating "getAddress()" and "setAddress()"??

-----Original Message-----
From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
Sent: Friday, January 09, 2004 2:42 PM
To: Tapestry users
Subject: Re: [FIXED] Problem with Components and Bindings


With "auto" parameters, Tapestry creates both the parameter property and the
binding property for
you. With "custom" Tapestry only created the binding property; it is your
responsibility to retrieve
the value from the binding and update the binding.

-Harish

Adam Greene wrote:

> Ok, fixed my own problem, just changed "custom" to "auto" on direction and
> "everyone plays nice" now.  What is the difference?
>   -----Original Message-----
>   From: Adam Greene [mailto:agreene@romulin.com]
>   Sent: Friday, January 09, 2004 2:31 PM
>   To: Tapestry
>   Subject: Problem with Components and Bindings
>
>
>   I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
>   figure out. I have a page that displays conferences, there are X number
>   associations that can have Y number of conferences each, so I have the X
>   ForEach and inside it I have the Y ForEach. As a part of printing the
>   Conference data I created a component called InsertAddress that takes an
>   Address object (each event has an Address object, and an event is the
>   Conference). The problem I'm facing is that when the page is loaded the
>   IBinding (I use custom on the components "address" parameter) is set,
then
>   the page goes through its ForEach loops, but the addressBinding is
empty,
>   the address is never assigned to it. Did I do something wrong are or is
>   there a problem somewheres else. I've attached as much of the source as
>   possible.
>
>
>   Adam Greene
>   Director of Software Development
>   RGI
>   885 Main St, Suite 16
>   Moncton, NB, E1C 1G5
>   Canada
>
>   Phone: (506) 863-1014 x4
>   Fax  : (506) 854-6886
>   http://www.romulin.com
>
>


---------------------------------------------------------------------
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: [FIXED] Problem with Components and Bindings

Posted by Harish Krishnaswamy <hk...@comcast.net>.
With "auto" parameters, Tapestry creates both the parameter property and the binding property for 
you. With "custom" Tapestry only created the binding property; it is your responsibility to retrieve 
the value from the binding and update the binding.

-Harish

Adam Greene wrote:

> Ok, fixed my own problem, just changed "custom" to "auto" on direction and
> "everyone plays nice" now.  What is the difference?
>   -----Original Message-----
>   From: Adam Greene [mailto:agreene@romulin.com]
>   Sent: Friday, January 09, 2004 2:31 PM
>   To: Tapestry
>   Subject: Problem with Components and Bindings
> 
> 
>   I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
>   figure out. I have a page that displays conferences, there are X number
>   associations that can have Y number of conferences each, so I have the X
>   ForEach and inside it I have the Y ForEach. As a part of printing the
>   Conference data I created a component called InsertAddress that takes an
>   Address object (each event has an Address object, and an event is the
>   Conference). The problem I'm facing is that when the page is loaded the
>   IBinding (I use custom on the components "address" parameter) is set, then
>   the page goes through its ForEach loops, but the addressBinding is empty,
>   the address is never assigned to it. Did I do something wrong are or is
>   there a problem somewheres else. I've attached as much of the source as
>   possible.
> 
> 
>   Adam Greene
>   Director of Software Development
>   RGI
>   885 Main St, Suite 16
>   Moncton, NB, E1C 1G5
>   Canada
> 
>   Phone: (506) 863-1014 x4
>   Fax  : (506) 854-6886
>   http://www.romulin.com
> 
> 


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


[FIXED] Problem with Components and Bindings

Posted by Adam Greene <ag...@romulin.com>.
Ok, fixed my own problem, just changed "custom" to "auto" on direction and
"everyone plays nice" now.  What is the difference?
  -----Original Message-----
  From: Adam Greene [mailto:agreene@romulin.com]
  Sent: Friday, January 09, 2004 2:31 PM
  To: Tapestry
  Subject: Problem with Components and Bindings


  I am having a really annoying problem with Tapestry-3.0-b3 that I cannot
  figure out. I have a page that displays conferences, there are X number
  associations that can have Y number of conferences each, so I have the X
  ForEach and inside it I have the Y ForEach. As a part of printing the
  Conference data I created a component called InsertAddress that takes an
  Address object (each event has an Address object, and an event is the
  Conference). The problem I'm facing is that when the page is loaded the
  IBinding (I use custom on the components "address" parameter) is set, then
  the page goes through its ForEach loops, but the addressBinding is empty,
  the address is never assigned to it. Did I do something wrong are or is
  there a problem somewheres else. I've attached as much of the source as
  possible.


  Adam Greene
  Director of Software Development
  RGI
  885 Main St, Suite 16
  Moncton, NB, E1C 1G5
  Canada

  Phone: (506) 863-1014 x4
  Fax  : (506) 854-6886
  http://www.romulin.com