I have no answer to your problem but you might try the
following if have not done so already.


> <span jwcid="repeatingAddressSection">
> 
>     <span jwcid="@PostcodeSearch"
> postalAddress="ognl:postalAddress[counter]"/>
> 
> </span>

Set up the postalAddresses  in 
<binding name="source" expression="postalAddresses"/>
to be a list of distinct elements. 

In the above Foreach loop, print out postalAddress
This is to make sure the component PostcodeSearch
is fed with the correct postalAddress at each round
of the loop.

Shing 



--- "Offiah Raymond, Slough"
<[EMAIL PROTECTED]> wrote:
> Hi there.
> 
>  
> 
> Wonder if someone could help me out with a small
> code problem.
> 
>  
> 
> I'm trying to build a dynamic form using Tapestry.
> Nothing to difficult; the
> page can have any number of address blocks, that the
> user can add to, by
> clicking on a 'more' button.
> 
>  
> 
> This submits the form, and adds a new entry to the
> list of entries, which
> the user can then fill in.
> 
>  
> 
> When the page is rendered, the new address fields
> should appear on the page.
> 
>  
> 
> The code looks something like this:
> 
>  
> 
> --page-
> 
>  
> 
>     <component id="repeatingAddressSection"
> type="Foreach">
> 
>         <binding name="source"
> expression="postalAddresses"/>
> 
>         <binding name="index" expression="counter"/>
> 
>     </component>
> 
>  
> 
> As I said, after a submission, I add an empty
> element to the list of postal
> addresses, then render it again
> 
>  
> 
> The HTML template section, looks like this ... :-)
> 
>  
> 
> <span jwcid="repeatingAddressSection">
> 
>     <span jwcid="@PostcodeSearch"
> postalAddress="ognl:postalAddress[counter]"/>
> 
> </span>
> 
> <span jwcid="more"/>
> 
>  
> 
> The PostcodeSearch component, is just a series of
> fields for the address,
> with a button for doing search lookups based on
> Postcode.
> 
>  
> 
>  
> 
> Now, what I've found is that if I have two
> PostcodeSearch components mounted
> on a page, then they work OK. Pressing the postcode
> button will create a
> list under the correct postcode field, from which I
> can select an address.
> 
>  
> 
> But if I add the components to the page using the
> @Foreach component; then
> clicking on one postcode button, displays a list for
> every PostcodeSearch
> component generated in the loop.
> 
>  
> 
> I had a look around the mailing list, and it looks
> like the problem is
> caused by the way the @Foreach component works. I
> was expecting a separate
> instance of Postcode object for each iteration of
> the loop. But apparently,
> @Foreach generates ONE instance and just adds the
> same one three times.
> 
>  
> 
> It seems that the way I'm trying to do this,
> disagrees with the Tapestry
> way; so could someone point me in the right
> direction? How should I go about
> generating a dynamic form, where the number of
> elements cannot be fixed?
> 
>  
> 
> Thanks in advance.
> 
>  
> 
>  
> 
> Ray
> 
>  
> 
>  
> 
> 
> 
> Scanned for viruses by MessageLabs. The integrity
> and security of this message cannot be guaranteed.
> This email is intended for the named recipient only,
> and may contain confidential information and
> proprietary material. Any unauthorised use or
> disclosure is prohibited.

Home page :
  http://uk.geocities.com/matmsh/index.html


                
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to