AnsweredAssumed Answered

Custom Dialog problem

Question asked by jbarrett on Mar 25, 2007
Latest reply on Mar 26, 2007 by jbarrett
I am having a problem with my custom dialog and need some help.  I have a ContactDialogBean that extends BaseDialogBean where I have default values set for each of the beans properties.  The problem I am having is with my JSP.  For some reason the only property value that gets populated is the name property.  When I submit the page I get a bunch of conversion errors.

If I only display the name property in the jsp when I submit the page I get no errors and everything executes as I expected.  Below is the code for the bean and the jsp. 

package com.microstrat.ecm.alfresco.bean;

import java.util.HashMap;
import java.util.Map;

import javax.faces.context.FacesContext;

import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.bean.repository.Repository;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.microstrat.ecm.alfresco.bean.repository.MSIModel;

public class ContactDialogBean extends BaseDialogBean {
   private static Log logger = LogFactory.getLog(ContactDialogBean.class);
   protected String name = "Josh";
   protected String company = "TEST CO";
   protected String jobTitle = "CEO";
   protected String office = "444444444";
   protected String cell = "3333333333";
   protected String fax = "32232232111";
   protected String email ="";
   protected String web = "blablabla";
   protected String icon = "contact";
   protected String finishImpl(FacesContext context, String outcome)
         throws Exception {
      System.out.println(ContentModel.PROP_TITLE.getNamespaceURI()+ "-"+ContentModel.PROP_TITLE.getLocalName());
      NodeRef parentNodeRef;
        String nodeId = this.navigator.getCurrentNodeId();
        if (nodeId == null)
           parentNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
           parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId);
        FileInfo fileInfo = fileFolderService.create(
    , MSIModel.CONTACT);
        NodeRef nodeRef = fileInfo.getNodeRef();
        if (logger.isDebugEnabled())
           logger.debug("Created Contact node with name: " +;
        Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(5);
        uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon);
        uiFacetsProps.put(ContentModel.PROP_DESCRIPTION," description");
        this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps);
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_CELL, this.cell);
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_COMPANY,;
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_EMAIL,;
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_FAX, this.fax);
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_JOB_TITLE, this.jobTitle);
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_OFFICE,;
        this.nodeService.setProperty(nodeRef, MSIModel.CONTACT_WEB, this.web);

        if (logger.isDebugEnabled())
           logger.debug("Added uifacets aspect with properties: " + uiFacetsProps);

      return outcome;
      public boolean getFinishButtonDisabled()
         return false;
   public String getCell() {
      return cell;
   public void setCell(String cell) {
      this.cell = cell;
   public String getCompany() {
      return company;
   public void setCompany(String company) { = company;
   public String getEmail() {
      return email;
   public void setEmail(String email) { = email;
   public String getFax() {
      return fax;
   public void setFax(String fax) {
      this.fax = fax;
   public String getJobTitle() {
      return jobTitle;
   public void setJobTitle(String jobTitle) {
      this.jobTitle = jobTitle;
   public String getName() {
      return name;
   public void setName(String name) { = name;
   public String getOffice() {
      return office;
   public void setOffice(String office) { = office;
   public String getWeb() {
      return web;
   public void setWeb(String web) {
      this.web = web;


<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<h:panelGrid id="addContactGrid" columns="2">
   <h:outputText value="Name:"/>
   <h:inputText id="name" value="#{}"/>
   <h:outputText value="Company:"/>
   <h:inputText id="company" value="#{}"/>
   <h:outputText value="Job Title:"/>
   <h:inputText id="jobtitle" value="#{DialogManger.bean.jobTitle}"/>
   <h:outputText value="Office:"/>
   <h:inputText id="office" value="#{}"/>
   <h:outputText value="Cell:"/>
   <h:inputText id="cell" value="#{DialogManger.bean.cell}"/>
   <h:outputText value="Fax:"/>
   <h:inputText id="fax" value="#{DialogManger.bean.fax}"/>
   <h:outputText value="Email:"/>
   <h:inputText id="email" value="#{}"/>
   <h:outputText value="Web Site:"/>
   <h:inputText id="web" value="#{DialogManger.bean.web}"/>    

Please help.