struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Givler, Eric" <>
Subject RE: Struts 1.x Edit Button Dispatching
Date Fri, 02 Feb 2007 17:57:31 GMT
MJ>If you don't use Javascript, how do you supply id of an item to edit?

Right now, it's a hyperlink.  

The previous Model 1 based version of the application used a button, and then it cycled through
all the rows (it had a rowcount as a hidden var).  So, if the request.getParameter("event_edit#")
was != null, the # was the index into a list of items, and it would pull off that items id#

ML>Do you have one button for the whole grid, or does each row has a button? I

Right now, each row would have a button.

MJ>If you use one button, please explain how do you employ one
MJ>button without using Javascript, how do you select item to edit.

I was assuming I'd do something similar to what was done before.  I'd map the default action
to something like eventHandler.
Then I'd just step through the request parameters using the same code as before.  If I found
an event_Edit# parameter, I knew the user clicked a button, and the item they wanted to edit
was item# (a hidden field).

MJ>Without Javascript your task can be easily resolved with one
MJ>button/link per row in grid. Links look nicer in grid rows than
MJ>buttons ;-) If you use buttons, the simplest way is to define each row
MJ>as an HTML form. If you use links, you need to build these links so an
MJ>item id is added as parameter.

I've done the link for now - I'm unsure what the user's preference might be if I change this.
 The screen allows the user to edit any row that has a specific status code (say X).  If the
status code is "Y", they can "flag the row" with multiple checkboxes (maybe several records,
each with differing sets of checkboxes) for further proecssing, and proceed to another step.
 So, there's really only ONE FORM since the status can change per row, and I needed to track
this "include this row" checkbox on a row-by-row basis as well.

MJ>You may find this sample useful:

I'll have to look at that link.  

Thanks a lot!

I hope my update provides enough detail to get a feel for what the form does.  

It looks something like this:

   Action  Inc   1/2off Details                        Amount
1  [Edit]               Eric's Data   My address PA    $100.00
2          [x]   [x]    Mike's DAta   Mike's Address   $100.00
3          [ ]   [ ]    Jim's Data    Jim's Address    $100.00
4          [x]   [ ]    Srini's Data  Srini's Addres   $100.00
                                                Total  $300.00  (items that can be included)
                                              Included $200.00
                                              w/Reduct $150.00  (any 1/2 off's factored in)
                                              Unselect $100.00  Row #3

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message