• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting previous value when using display:table

 
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using display:table to display a table in my jsp. It includes a radio button for the user to select that particular record. The record includes the date field.

So now I want to edit the record. So the user clicks the radio button and click edit. In the next page the user enters the date. But now I want to validate the date so that it is greater than the previous one. How can I do this.

One way I was thinking is using a hidden variable (previousDate, NextDate in the form) and get those values in the edit page. But how can I set the values for the hidden variables.

Any help is appreciated.

Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well you can use a hidden form element and reference it

<input type="hidden" name="prevDate" value="10/20/2006" />

you can reference that with:

var dPrev = new Date(document.formName.prevDate.value);
var newDate = new Date(document.formName.newDate.value);

if(dPrev>newDate)alert("wrong");

Eric
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply and apologises for the late response.

Actually I was also thinking of using the hidden parameter. But how can I set the value for them.

So I have 2 hidden parameters. The user selects a value using the radio button. I need to populate the hidden parameter with the previous and next values of the selected radio button. I am not able to figure out how to set the values for the hidden parameter.

Hope I made myself clear.

Thanks again.
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still struggling to find a solution for this. Any help would be greatly appreciated.

Thanks.
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

Finally I solved it. It seems that the should be in between the <display:column> tag.

This is what I did



I had a property previousDate in the bean and I populated it when getting the table values itself. Now I am able to get the values.

Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic