Hi I'm trying to pass data from my customGraphService to my ZUL Page through a customGraphController. But it won't display it.
customGraphService
public class customGraphService {
public String test(){
return "this is a test";
}
}
customGraphController
import com.hybris.cockpitng.core.model.WidgetModel;
import org.training.services.customGraphService;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import com.hybris.cockpitng.util.DefaultWidgetController;
public class customGraphController extends DefaultWidgetController
{
@WireVariable
private transient customGraphService customGraphService;
@Override
public void preInitialize(Component comp) {
super.preInitialize(comp);
// get the model
WidgetModel model = getModel();
model.put("test", customGraphService.test());
}
}
ZUL PAGE CODE
<h:body>
<h:div>
<h:canvas id="myChart"></h:canvas>
</h:div>
<h:div>
<h:div value="${widgetModel.test}"></h:div>
</h:div>
</h:body>