This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Do we always need form element to invoke action class?

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do we always need form element to invoke action class?

For Eg.

I have a ADD screen . On pressing submit. I generate a ConfirmScreen with data enetered entered by the user in the ADD screen.

The ConfirmScreen has a OK and Cacel button. Only if the user presses ok the data has to be submitted to the database.

In my second screen I don't have any form element. Lots of Bean:write tag and a html submit and reset button. how do I call the Action class in this case?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use an action in an <html:form> tag, it must have an ActionForm associated with it. There is no getting around this rule.

In your specific situation, I see two differnt ways you could go:
  • In your confirmation screen, embed all the data in <html:hidden> fields that correspond to the data being displayed with <bean:write> tags. Then just make the "OK" button a submit button, and the form will be submitted with the data
  • Make the confirm screen just a pop-up screen with no form in it at all. If the user presses cancel, just close the window. If she presses "OK", use JavaScript to submit the form in the parent window (opener.document.forms[0].submit()).

  •  
    shah rah
    Ranch Hand
    Posts: 124
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    thnx. I am planning to take the second way.
     
    Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
    the value of filler advertising in 2020
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic