OK. I can't give you anything definitive.
I will rumage our code base and give you an example in a while, but, so far
as I know, we have done all of this server side.
It is an interesting question, because we have a button that reveals
additional fields in some circumstances and is a submit request in other
circumstances, depends on the server.
We have migrated from T3 to T4 (em, perhaps I should do a synch before I
rumage at all:)) and in T3 we had the problem of ids available to use as
handles in js. This has been resolved in T4, though I doubt we have migrated
our scripts to reflect this.
So my understanding is that you will get some very complex js if you attempt
this from the client, but others should comment. Afterall there is much
thought about AJAX and that is also about making such things more
encapsulated and immiediate?
In our case we had a couple of other reasons (aside from js complexity) not
to use the client.
1). Legal. We couldn't be in the position where the client could
(maliciously or inadvertantly) manipulate the code.
2). We are working up from our persistance model and it makes sense to
create additional objects server side which we have a persistance mechanism
for. As I see it, if you have a restricted number of types, e.g. you are
just adding rows to a table represented by one type, client side might be
OK, but if, as in our case, there is a wide variety of types, any one of
which might have additional elements created and stored, it makes more sense
to control all of this server side.
3). Our comprehensive error checking mechanism used js, the Tapestry
framework and our own additions. It might be an error to create extra
elements in some circumstances in our implementation, and this might only be
available for checking in the business logic server side. So, if none of the
other reasons were enough not to use client script this one definitely is :)
I will go fishing for an example when I get a chance later today.
Adam

On 07/12/05, karthik G <[EMAIL PROTECTED]> wrote:
>
> Hi Adam,
>
> So do you want me to submit the form when user clicks [Add Rows] ? I can
> try
> that. But right now am adding new rows to the table (of users) on the
> client
> side using javascript. Now I dont know how to get For component to
> recongnize the existance of new users during the final submit. I can see
> tapestry generating hidden fields to store ids. But having that logic in
> my
> custom javascript method does'nt look neat.
> Do you think i can stick to client side addition of new rows and still
> handle things during final submit?.
>
> thanks
> karthik
>
> On 12/6/05, adasal <[EMAIL PROTECTED]> wrote:
> >
> > In the listener have it check the status of Add Rows. If true have it
> > create
> > further elements in an iteration that are added into the ListMap as a
> > series
> > of empty strings.
> > Adam
> >
> > On 06/12/05, karthik G <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi All,
> > >
> > > I'm a tapestry beginner and I have a requirement similar to the
> original
> > > post.
> > >
> > > My requirement is almost similar too except that I plan to add blank
> > rows
> > > when user clicks the button [Add Rows]..say 5 rows by default.
> Initially
> > > get
> > > all users and display them. Later allow user to add / edit.
> > >
> > >
> > > (text)   (text Input) (PropertySelection)
> > > UserId   UserName     Group
> > >
> > > xxx01    Peter        Admin
> > > xxx02    Bob          Guess
> > > xxx04    Mark         Beginner
> > >
> > > [Save] [Cancel] [Add Rows]
> > >
> > >
> > >   (text)   (text Input) (PropertySelection)
> > > UserId   UserName     Group
> > >
> > > xxx01    Peter        Admin
> > > xxx02    Bob          Guess
> > > xxx04    Mark         Beginner
> > > --------     --------        --------
> > > --------     --------        --------
> > > --------     --------        --------
> > > --------     --------        --------
> > > --------     --------        --------
> > > [Save] [Cancel] [Add Rows]
> > >
> > > Now if the use adds new entries, modifies some of the existing ones, i
> > > need
> > > to be able to add /update to the database on clicking [Save]. How s' d
> I
> > > handle this?.
> > >
> > > Thanks ,
> > > karthik
> > >
> > >
> >
>
>

Reply via email to