Hi,

A relatively common thing you see in a web application is an automatically
updating total field. For example you have a bunch of line items and you want
the total qty, price, etc. to update automatically whenever the user changes a
number.

Since this is a common pattern in the app I am creating, and this is Tapestry, I
thought I'd make a component. My componenet would look something like this:

<span jwcid="@Totaler" componentToTotal="ognl:components.numericFieldQuantity" 
/>

The Totaler component would create javascript that would find all the form
fields that the componentToTotal form component rendered and total its values.

Sounded easy to me until I realize I can't "get at" all the form element id's
that a particular form component may have generated - at least I don't know how
to! The cheap way to do this is pass the totaler component a string which would
be the prefix of the generated form inputs, and it could just iterate through
all the components of the form and find ones that started with that prefix. But
that is not very tapestry-like and requires that you make sure you don't have
conflicting component names....

The sort of thing I was originally looking for was something like a component
render listener - something I could hook into a form component and have it
trigger every time it was rendered on a page so I could do a getName() and add
it to my list of form id's....

Of course if there is another way to do this I'm open to that too - unless it
involves submitting to the server!

Thanks in advance,

Bobby


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

Reply via email to