cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog header title when adding or editing data list items

bimsimala
Champ in-the-making
Champ in-the-making
Hi,

is there a way to display some configurable title in the heading of the dialog that opens for editing the data of a custom data list item?

Thanks
3 REPLIES 3

shahsnehal
Champ in-the-making
Champ in-the-making
Chnage "label.new-row.title" from "tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\data-lists\toolbar.get.properties" file.

bimsimala
Champ in-the-making
Champ in-the-making
Yeah, that's what should work. But in my case the header is empty. While debugging server and client side i figured out that my form gets rendered differently.

The id of the header div, where the title should be rendered to, is "template_x002e_toolbar_x002e_data-lists-createRow-form-container_h". In a different predefined data list it is "template_x002e_toolbar_x002e_data-lists-createRow-dialogTitle", and the title is placed here correctly.

The form templates i'm using are those from Alfresco FDK:

<edit-form template="/fdk/templates/tab-edit-form.ftl" />
<create-form template="/fdk/templates/tab-edit-form.ftl" />

The templates shouldn't influence the creation of the header. However… strange behaviour.

How ever i'm trying to investigate a little more and keep this thread up2date.

bimsimala
Champ in-the-making
Champ in-the-making
Ok. I got it managed. I realized that as defined in share's default datalist from config (webapps\share\WEB-INF\classes\alfresco\share-datalist-form-config.xml), all forms are rendered using the template "../data-lists/forms/dataitem.ftl".

So i merged FDKs tabbed-edit-view.ftl and dataitem.ftl to tabbed-dataitem.ftl:
<#assign id=args.htmlid>
<#if formUI == "true">
   <@formLib.renderFormsRuntime formId=formId />
</#if>

<div id="${id}-dialog">
   <div id="${id}-dialogTitle" class="hd">${msg("title")}</div>
   <div class="bd">

      <div id="${formId}-container" class="form-container">

         <#if form.showCaption?exists && form.showCaption>
            <div id="${formId}-caption" class="caption"><span class="mandatory-indicator">*</span>${msg("form.required.fields")}</div>
         </#if>
     
         <form id="${formId}" method="${form.method}" accept-charset="utf-8" enctype="${form.enctype}" action="${form.submissionUrl}">
            <#if form.destination??>
               <input id="${formId}-destination" name="alf_destination" type="hidden" value="${form.destination}" />
            </#if>
            <div id="${formId}-fields" class="form-fields">
                  <div id="${formId}-tabview" class="yui-navset">
                  <ul class="yui-nav">
                     <#list form.structure as item>
                        <#if item.kind == "set">
                           <li<#if item_index == 0> class="selected"</#if>><a href="#tab_${item_index}"><em>${item.label}</em></a></li>
                        </#if>
                     </#list>
                  </ul>               
                  <div class="yui-content">
                     <#list form.structure as item>
                        <#if item.kind == "set">
                           <div id="tab_${item_index}">
                              <@formLib.renderSet set=item />
                           </div>     
                        </#if>
                     </#list>
                  </div>
                 </div>
               </div>
               <div class="bdft">
                  <input id="${formId}-submit" type="submit" value="${msg("form.button.submit.label")}" />
                   <input id="${formId}-cancel" type="button" value="${msg("form.button.cancel.label")}" />
            </div>
         </form>
      </div>
   </div>
</div>

Now the header title can be placed correctly.