As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public void ethod(ActionEvent actionEvent) { UIActionLink link = (UIActionLink) actionEvent.getComponent(); Map<String, String> params = link.getParameterMap(); String ref = params.get("ref"); NodeRef nodeRef = new NodeRef(ref); }
<action id="someid"> <label-id>domelabel</label-id> <image>/images/icons/someimg.gif </image> <action-listener>#{TetsBean.ethod} </action-listener> <action>dialog:yourdialog</action> <params> <param name="ref">#{actionContext.nodeRef}</param> </params> </action>
I do not understand you too well
, but you should add parameter to pass to dialog. if you have action to initiate dialog you should add<params> <param name="ref">#{actionContext.nodeRef}</param> </params>
public void ethod(ActionEvent actionEvent) { UIActionLink link = (UIActionLink) actionEvent.getComponent(); Map<String, String> params = link.getParameterMap(); String ref = params.get("ref"); NodeRef nodeRef = new NodeRef(ref); } <action id="someid"> <label-id>domelabel</label-id> <image>/images/icons/someimg.gif </image> <action-listener>#{TetsBean.ethod} </action-listener> <action>dialog:yourdialog</action> <params> <param name="ref">#{actionContext.nodeRef}</param> </params> </action>So how this works: on click dialog opens, but before action listeer is called and you set values up.then add in your bean:String namegetNamesetnameand in your jsp put <hutput…. value =#{ DialogManager.bean.name}….
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <h:panelGrid> <h:outputText value="Name: " /> <h:outputText value="#{DialogManager.bean.node_name}"/> <h:outputText value="Creator: " /> <h:outputText value="#{DialogManager.bean.node_creator}"/> </h:panelGrid>
<!– sushi view –> <action id="sushi_view"> <label>Open Sushi View Dialog</label> <image>/images/icons/sushi_view_image.gif</image> <action-listener>#{SushiViewDialog.nodeMethod}</action-listener> <action>dialog:sushiView</action> <params> <param name="ref">#{actionContext.nodeRef}</param> </params> </action> <config> <dialogs> <dialog name="sushiView" page="/jsp/extension/dialogs/sushi-view.jsp" managed-bean="sushiViewDialog" icon="/images/icons/Sushi_1.gif" title="Sushi View" description="Displays sushi info" /> </dialogs> </config>
<managed-bean> <description> The bean that backs up the Sushi View Dialog </description> <managed-bean-name>SushiViewDialog</managed-bean-name> <managed-bean-class>com.sushi.web.bean.SushiViewDialog</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>nodeService</property-name> <value>#{NodeService}</value> </managed-property> <managed-property> <property-name>browseBean</property-name> <value>#{BrowseBean}</value> </managed-property> <managed-property> <property-name>actionService</property-name> <value>#{ActionService}</value> </managed-property> </managed-bean>
package com.sushi.web.bean; import java.util.Map; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import org.alfresco.model.ContentModel; import org.alfresco.repo.action.executer.ScriptActionExecuter; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.web.app.servlet.FacesHelper; import org.alfresco.web.bean.BrowseBean; import org.alfresco.web.bean.dialog.BaseDialogBean; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.ui.common.component.UIActionLink; /** * Bean implementation for "Sushi Overview Dialog" * */ public class SushiViewDialog extends BaseDialogBean { protected String node_name; protected String node_creator; private ActionService actionService; private NodeService nodeService; private BrowseBean browseBean; public void nodeMethod(ActionEvent event) { UIActionLink link = (UIActionLink)event.getComponent(); Map<String, String> params = link.getParameterMap(); String ref = params.get("ref"); NodeRef nodeRef = new NodeRef(ref); String node_name = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); String node_creator = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_CREATOR); } @Override protected String finishImpl(FacesContext context, String outcome) throws Exception { // return the default outcome return outcome; } public void setActionService(ActionService actionService) { this.actionService = actionService; } public String getNode_name() { return node_name; } public void setNode_name(String node_name) { this.node_name = node_name; } public BrowseBean getBrowseBean() { return browseBean; } public void setBrowseBean(BrowseBean browseBean) { this.browseBean = browseBean; } public String getNode_creator() { return node_creator; } public void setNode_creator(String node_creator) { this.node_creator = node_creator; } public NodeService getNodeService() { return nodeService; } public void setNodeService(NodeService nodeService) { this.nodeService = nodeService; } public ActionService getActionService() { return actionService; } }
String node_name = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); Node node=new Node(nodeRef); node.getName();
String node_name = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); Node node=new Node(nodeRef); node.getName();try this. and check what ref value is. this should work fine.
String node_name = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); String node_creator = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_CREATOR);
node_name = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); node_creator = (String)this.getNodeService().getProperty(nodeRef, ContentModel.PROP_CREATOR);