RE: [Webwork-user] Form - appending formnames based on row-number
Brought to you by:
baldree,
rickardoberg
From: <ma...@sm...> - 2002-08-16 12:43:34
|
WebWork has moved over to opensymphony and its new mailing list opensymphony-webwork. But, in short, yes you can use the iterator tag and use its status to see what index you are on. You can also use the generator to create an index. So, there are many ways to solve your problem. If you need a more complete response, then I suggest you post to the new list. On Fri, 16 August 2002, "Torsten Terp" wrote: >=20 >=20 > I believe something like this was supported in Struts > by using the attribute > indexed=3Dtrue for the data being iterated over. That way > it was possible to > get the row number... >=20 > I dont know if webwork has a feature like this... > anybody?? >=20 > ^torsten >=20 >=20 > > -----Original Message----- > > From: web...@li... > > [mailto:web...@li...]On > Behalf Of Ren=E9 > > Rolander Nygaard > > Sent: 16. august 2002 10:49 > > To: web...@li... > > Subject: [Webwork-user] Form - appending formnames > based on row-number > > > > > > To Webwork-users. > > > > We have a form with a number of data. We save changed > whenever the user > > changes the data in a form-field (onChange event) > > We need to make some calculations based on other > values on the > > same row. In > > order to handle this this want to append the row > number on each > > field-name. > > Example: > > Item Actual count Min. count Wanted count=20=20 > Ordercount > > 1 5 5 10=20 =20=20=20=20 > 5 > > 5 10 5 10=20 =20=20=20=20 > 0 > > 9 6 5 10=20 =20=20=20=20 > 0 > > 15 12 5 10=20 =20=20=20=20 > 0 > > Each formfield is named based on their column name eg: > > itemId currCount minValue wantedValue=20=20=20 > orderCount > > There exist getxxx for each column. There exist and > iterator to traverse > > through the list of items. > > > > Changing the field for item 9, min. count to 7 should > change ordercount to > > 4. > > We need in the client javascript to be able to get > each field and > > its value. > > > > Furthermore we would like the user to be able to press > > key-down/up and jump > > from field to field. (future option) > > > > So from my point of view we have two options. > > One is naming each formfield with the item-id. So the > formfieldnames would > > be > > itemId1 currCount1 minValue1 wantedValue1=20 > orderCount1 > > itemId5 currCount5 minValue5 wantedValue5=20 > orderCount5 > > itemId9 currCount9 minValue9 wantedValue9=20 > orderCount9 > > itemId15 currCount15 minValue15 wantedValue15 > orderCount15 > > Calling the onChange script should then send the > itemId as an parameter. > > How could we name the field based on the itemId ? And > how should this look > > like for webwork ? > > > > The second option (and our prefered) - using a > rowcounter eg: > > itemId1 currCount1 minValue1 wantedValue1=20 > orderCount1 > > itemId2 currCount2 minValue2 wantedValue2=20 > orderCount2 > > itemId3 currCount3 minValue3 wantedValue3=20 > orderCount3 > > itemId4 currCount4 minValue4 wantedValue4=20 > orderCount4 > > This will help us move up and down, and would be > easier when we are not > > using a simple primary-key like itemId. > > How can we setup WebWork to handle a rowcounter in an > iterator, > > and how can > > we append it to the name-field ?? > > > > And inputs would be really appreciated > > thank in advance > > - Ren=E9 Nygaard > > Net-Mill > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: OSDN - Tired of > that same old > > cell phone? Get a new here for FREE! > > > <a href=3D"http://mail.smallleap.com//jump/https://www.inphonic.com/r.asp?r=3D= urceforge1&refcode1=3D3390">https://www.inphonic.com/r.asp?r=3Durceforg= e1&refcode1=3D3390</a> > > _______________________________________________ > > Webwork-user mailing list > > Web...@li... > > > <a href=3D"http://mail.smallleap.com//jump/https://lists.sourceforge.net/lists= /listinfo/webwork-user">https://lists.sourceforge.net/lists/listinfo/webwor= k-user</a> >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that > same old > cell phone? Get a new here for FREE! > <a href=3D"http://mail.smallleap.com//jump/https://www.inphonic.com/r.asp?r=3D= sourceforge1&refcode1=3Dvs3390">https://www.inphonic.com/r.asp?r=3Dsour= ceforge1&refcode1=3Dvs3390</a> > _______________________________________________ > Webwork-user mailing list > Web...@li... > <a href=3D"http://mail.smallleap.com//jump/https://lists.sourceforge.net/lists= /listinfo/webwork-user">https://lists.sourceforge.net/lists/listinfo/webwor= k-user</a> |