Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do we update without refreshing  RSS feed

 
Kerry Shannon
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are developing a payroll time entry solution. We use JSPs and servlets, and are sending out the page dynamically based on saved data from the database.
We would like to know how to add steps that would do the following. I think we have an idea how you could do it, but are not sure, and I feel we really don't understand how to display some of this without refreshing the entire page.
1. Copy the time entered from the matching field one day earlier to the current day ( copy the start time from yesterday to today ).
2. Copy all of the values entered from the previous day to the current day (copy start, break, end, and regular time values from yesterday's row to today's ).
3. Format the value entered in a field when the employee leaves the field (change 7A to 7:00 AM for them ).
4. Compute the net time after they enter the end time for the day (probably onBlur, but how do you write the function and then update the page.
Any suggestions would help.
Thanks.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are copying a certain row into a different row, or from certain boxes into other boxes, then perhaps you could set up buttons for this function, and use javascript (client side). So the textbox which has focus would have it's value copied into the box right beside it, when you click the button "Copy Box", or the whole row of values when it's "Copy Row".

Then when you submit, the form contains all the data necessary for server side processing. Formating would be an onBlur javascript.

javascript can be included in jsp's. It's just like any other output.

Another thing to consider is making an applet for time entry, and you get to use GUI components. It can get pretty messy combining applets, javascript and server-side (JSP), but perhaps it's an idea to look at.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!