Dialog Box | Adobe Higher Education
Skip to main content
Level 2
October 16, 2015
Risolto

Dialog Box

  • October 16, 2015
  • 1 risposta
  • 1125 visualizzazioni

I want to save some data in the page property(hidden) on click of OK button of dialog. Please let me know how this can be done?

Questo argomento è stato chiuso alle risposte.
Migliore risposta di Mshaji

What you can do is create hidden field in dialog and retrieve in jsp as

String hiddenValue = properties.get("./hiddenfield", "some default value"));

Node node = currentPage.getContentResource("jcr:content").adaptTo(Node.class);

node.setProperty("hiddenPropName", hiddenValue);

Session session = node.getSession();
 session.save();

Above is the sample code you can use, but I suggest you to create a jstl method in your tag library and perform the above logic in a class method.

In jsp you just need to call the taglib method with hiddenValue and currentPage

1 risposta

MshajiCommunity AdvisorRisposta
Community Advisor
October 16, 2015

What you can do is create hidden field in dialog and retrieve in jsp as

String hiddenValue = properties.get("./hiddenfield", "some default value"));

Node node = currentPage.getContentResource("jcr:content").adaptTo(Node.class);

node.setProperty("hiddenPropName", hiddenValue);

Session session = node.getSession();
 session.save();

Above is the sample code you can use, but I suggest you to create a jstl method in your tag library and perform the above logic in a class method.

In jsp you just need to call the taglib method with hiddenValue and currentPage