AnsweredAssumed Answered

How to get form fields values from share-config-custom.xml

Question asked by croc on Oct 22, 2010
Latest reply on Feb 28, 2014 by alhol
Hi,

I need to get fields from share-config-custom.xml.
Below is what did:

[b]File name: rmsearch.get.js[/b]
[b]Created a method called getFormFields()[/b]

function  getFormFields(){
var  scopedRoot = config.scoped["cm:content"]["forms"]["form"];
var configs = scopedRoot.getChildren("appearance");

………
}

share-config-custom.xml

   <!– cm:content type (existing nodes) –>
   <config  evaluator="node-type" condition="cm:content">
      <forms>
         <!– Default form configuration used on the document details and edit metadata pages –>
         <form>
            <field-visibility>
               <!– Indicators aspect–>
               <show id="simm:PAIA" />
               <show id="simm:Evidence" />
               <show id="simm:Config" />
               <show id="simm:AutoAssignReference" />
               <show id="simm:MRIPNB" />
            </field-visibility>
            <appearance>
               <field id="simm:PAIA" label-id="label.simm_PAIA" />
               <field id="simm:Evidence" label-id="label.simm_Evidence" />
               <field id="simm:Config" label-id="label.simm_Config" />
               <field id="simm:AutoAssignReference" label-id="label.simm_AutoAssignReference" />
               <field id="simm:MRIPNB" label-id="label.simm_MRIPNB" />
            </appearance>
         </form>
      </forms>
   </config>

And I get an error, "Cannot call method "getChildren""

Thanks,
Croc

Outcomes