Win a copy of High Performance Python for Data Analytics this week in the Python 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

Passing variable from page one to page two hidden field in AEM

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to Java and Adobe Experience Manager and need to code out a solution that passes a variable from one page (referring page) to a hidden field on another page (receiving page with form). In my old world, one likely solution would be to pass the variable in the URL through a query string and use jQuery or JavaScript to populate the hidden field. But since this is AEM, I'm thinking it would make the most sense to use session variables. I made an attempt to code this out and was hoping to get some feedback. Am I starting in the right direction?

Page 1 (referring page)


Page 2 (receiving page with form)
 
Marshal
Posts: 3355
492
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know anything about the Adobe Experience Manager framework, but I don't see anywhere that your code is setting the input element's value.

You probably want to do something like this:
Edit: updated code example to inlcude the hidden attribute
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic