I thought it would work too :-)

I actually copied the code from the Palette component initially to start
my development. My date selector uses 8 <select>s, each one specified as a
Delegator (as per the Palette), and rendered in the exact same way: i just
modeled my bufferSelects() method on Palette's. I had no visible
difference in my code or spec - that's why the problem was hard to find.
However - the ONE difference was that I included a checkbox, specified as
a Checkbox. When I changed this to a Delegator, I didn't have a problem.
Here's my hypothesis: Tapestry sees my composite component as counting as
1 component (at first), since I call form.getElementId(this) in my
render() method. However, in rendering the sub-components
(super.render()), it comes across the Checkbox, which also receives an
element id (presumably), and is also counted as a form component. (You
know, the <input type="hidden" name="Form0" value="4">).
Well, when the rewind occurs, my component immediately jumps to
handleSubmission(cycle), just like Palette, skipping over the
rendering/handling of the Checkbox! Thus, the component count is now off,
and I get a stinkin' StaleLinkException :-]
Sounds easy to repeat it now - but it didn't make much sense when I was
looking for it! Still - what would be the proper modification to prevent
this behavior? Render all the components before doing the
handleSubmission()?
Let me know what you think. BTW - now that I understand it, I know how to
fix the other component I sent to you - it was using a Hidden, and causing
the same StaleLinkException.
-Jason

P.S. Note that Palette *doesn't* use any of the pre-built components
(Select, Checkbox, ImageSubmit) - they are all rendered 'by hand'. I
didn't make that distinction clear in my first mail (and if I had actually
noticed that sooner...)
> This should work and I'm not aware of any problems that would keep it
> from working.
>
> For example, the Palette component is a custom component that is a form
> component.
>
> The dynamic select boxes ... were they PropertySelection components, or
> something home-brewed?  Can we see the code?
>
> If you are having problems, don't forget to add bugs!
>
> ----- Original Message -----
> From: "Jason Owens" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 05, 2002 7:25 PM
> Subject: [Tapestry-developer] Custom form components...
>
>
>> Hello,
>>
>> I don't know if this is fixed in newer versions (I'm using 2.0.0) -
>> but there seems to be a bug when creating custom form components.
>> Basically, if you create a composite form component using existing
>> form components, then actually try to use it, you'll get a
>> StaleLinkException.
>>
>> I was building a component with 8 dynamic select boxes, but had a
>> normal Checkbox stuck in there as well. Wouldn't work. Finally took a
>> wild guess (after hours and hours of trying to discover this stupid
>> thing), and took out the checkbox. That remedied the symptom, but
>> hasn't solved the problem...
>>
>> No one's ever run into this before?
>>
>> Argh.
>>
>> -Jason
>>
>>
>> _______________________________________________________________
>>
>> Don't miss the 2002 Sprint PCS Application Developer's Conference
>> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>>
>> _______________________________________________
>> Tapestry-developer mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>>
>
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer




_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to