Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

fetching dialog field values using WCM POJO class and display on a page.

Tejaswini_S
Level 1
Level 1

Hello community,

 

I'm trying to fetch dialog box values using WCM POJO class(Use class and Bean class). I'm providing my bean class and use class code here to fetch "title" value. Could you help me out!

 

MyBean.java:

public class MyBean

{

private String title='' ";

public String getTitle(){

return title;

}

public void setTitle(String title){

this.title=title;

}

}

 

MyUse.java:

public class MyUse extends WCMUsePojo{

private static final Logger Logger = LoggerFactory

            .getLogger(MyUse.class);

private MyBean myBean=null;

private MyBean getMyBean(){

return myBean;

}

@ Override

public void activate() throws Exception{

 

maintenancetabBean = new MaintenancetabBean();

 

  Node node= getResourceResolver()

                      .getResource("content/...(path of my page)").adaptTo(Node.class);

if(node.hasProperty("title")){

myBean.setTitle(node.getProperty("title").getString());

}

}

 

}

 

myhtml code:

<sly data-sly-use.content="com.fedex.irc.use.MyUse"">

<h3>${content.MyBean.title}</h3>

</sly>

This is my code. It is not throwing any errors but not displaying output in my page. I'm not getting what's the wrong! could anyone of you help me with this?

2 Replies