Ok , I have handled the problem I was facing by figuring which button was clicked [Save] OR [Add Rows] and by tweaking here and there. I clean up the stale entries from the list when somebody (USER1) does a [Save]. Now even though USER2 might be adding new ones, tapestry anyways creates the new objects while deserializing , and i add it to the List if an entry is not found. I'm also synchronizing the deserialized list with the actual. and yes I'm using the For component.
Now I have read about the stale link issue somewhere. I have never tried tapestry 3. Can we safely conclude that it will *never* occur when using For component in tapestry4? simply because For was created to address exactly that - it has its own copy of the list and hence does not rely on the underlying model being in sync when rewinding. Can someone please confirm this. thanks! karthik On 12/8/05, karthik G <[EMAIL PROTECTED]> wrote: > > Thanks, it will be great if you could suggest something really cool when > you find time. > > Meanwhile, I did try your suggestion (adding blank rows to the *model*, i > mean the list ) and it works like a charm. But I'm not sure if I'm doing it > the right way. If the user changes his mind later and does not commit, the > list is ending up with dummy entries that I dont want. > OR > when i open another browser and access the page, its displaying 3 > additional rows now (the ones that i added earlier) as expected. User1 has > not commited yet so User2 is seeing 3 blank rows even though User2 did'nt > press [Add Rows] button. > So the model needs to be cleaned up in case the user just closes the page/ > simply forgets to do anything. Could you please tell me a good way to handle > this. > > thanks > karthik > > > On 12/8/05, adasal <[EMAIL PROTECTED]> wrote: > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > >
