Expand my Community achievements bar.

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

Avatar

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