AnsweredAssumed Answered

Datalists / data grid in Share

Question asked by tomash on Nov 12, 2012
I want to display muliple properties of my custom content model in a data grid (like the existing standard datalist).

Therefore I edited the  \shared\classes\alfresco\web-extension\share-config-custom.xml:


<config evaluator="model-type" condition="vb:rechnung">
      <forms>
         <form>
            <field-visibility>
            <show id="vb:Sachkonto" />
            <show id="vb:Rechnungsnummer" />
            <show id="vb:Rechnungseingang" />
            <show id="vb:Bruttosumme" />
            <show id="vb:inOrdnung" />
          </field-visibility>
       </form>
      
        <form id="datagrid">
            <field-visibility>
            <show id="vb:Sachkonto" />
            <show id="vb:Rechnungsnummer" />
            <show id="vb:Rechnungseingang" />
            <show id="vb:Bruttosumme" />
            <show id="vb:inOrdnung" />
          </field-visibility>
       </form>      
       </forms>
</config> 


The model type ist defined in file \shared\classes\alfresco\extension\model\vbrechnungModel.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!– xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 modelSchema.xsd" –>
<model name="vb:rechnungmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>Rechnung Model</description>
   <author>xxxx</author>
   <published>2012-10-09</published>
   <version>1.0</version>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
       <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>
      <namespaces>
      <namespace uri="http://www.haasiwork.de/model/content/1.0" prefix="vb"/>
   </namespaces>
   <types>
      <type name="vb:rechnung">
            <title>Rechnungsdokument Haasi</title>
            <parent>cm:content</parent>
            <properties>
                         
                <property name="vb:Rechnungssteller">
                   <title>Rechnungsteller</title>
               <type>d:text</type>
            </property>
            
            <property name="vb:Sachkonto">
               <title>Sachkonto</title>
               <type>d:int</type>
            </property>
            <property name="vb:Rechnungsnummer">
               <title>Rechnungsnummer</title>
               <type>d:text</type>
            </property>
            <property name="vb:Rechnungseingang">
               <title>Rechnungseingang</title>
               <type>d:date</type>
            </property>
            <property name="vb:Bruttosumme">
               <title>Bruttosumme</title>
               <type>d:long</type>
            </property>
            <property name="vb:inOrdnung">
               <title>OK</title>
               <type>d:boolean</type>
            </property>
         </properties>
        </type>
   </types>
</model>

The model works in share. I can change the type of existing documents and edit my defined proteries.

How can I get my data grid now?
Are additional configuration necessary for a new entry in datalists?

Outcomes