AnsweredAssumed Answered

[solved]use DialogManager bean properties with taglibs

Question asked by ethan on Oct 1, 2010
Latest reply on Oct 11, 2010 by ethan
Hi :)

I created an action with a dialog which is supposed to load a graphic timeline component (from the ZK framework). the component must load xml files which are named according to the Space the action is triggered on. I wanted to use the #{DialogManager.bean.name} as I already did for other dialogs but the taglib of the ZK framework doesn't read the value from it.

Here is the code of my jsp page :


<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ taglib prefix="z" uri="http://www.zkoss.org/jsp/zul'%>

<f:verbatim>
<div id="width:100%; margin-bottom: 20px;"></f:verbatim>
   <h:outputText value="Timeline for the folder : #{DialogManager.bean.name}"/>
<f:verbatim>
</div>
<div></f:verbatim>
   <h:outputLink value="/alfresco/charts/timeline/#{DialogManager.bean.zulFile}" target="_blank"><h:outputText value="Click here to load the timeline."/></h:outputLink>
<f:verbatim>
</div>
</f:verbatim>

<z:page>
   <z:window>
      <z:timeline id="tl1" height="600px" width="850px">
         <z:bandinfo width="7%" id="b2" intervalUnit="year" intervalPixels="50"
            syncWith="b1">
            <z:attribute name="eventSourceUrl">
               /alfresco/charts/timeline/${DialogManager.bean.spacexmlfile}
            </z:attribute>
         </z:bandinfo>         
      </z:timeline>
   </z:window>
</z:page>

the #{DialogManager.bean.name} works fine with the <h:outputText> tag but the #{DialogManager.bean.spacexmlfile} is displayed as it (and not its value) inside the <z:attribute> tag.

So I wanted to know if there was a way to convert the #{DialogManager.bean.spacexmlfile} into a jsp variable or if there was a way to use java code inside my jsp page to get the value of the spacexmlfile variable ? Is there a class that could allow me to access the bean properties inside the jsp page?

Thank you :)

Outcomes