I'm trying to write the Dreamweaver TBB and I am stuck at one point where I need to get the field value at a different template level.
Below is my XML where I need to get the inputType field present at formField level to the input Templating level.
<formField>
<divClassName>fieldClassName</divClassName>
<label>Please enter your Name</label>
<labelId>labelNameId</labelId>
<inputType>text</inputType>
<input>
<inputName>sam</inputName>
<inputId>ssss</inputId>
<inputSize>40</inputSize>
<inputLabel>xxx</inputLabel>
<inputValue>zzz</inputValue>
</input>
<input>
<inputName>gf</inputName>
<inputId>g</inputId>
<inputSize>fdg</inputSize>
<inputLabel>sg</inputLabel>
<inputValue>gsdfg</inputValue>
</input>
<param1>ssss</param1>
<param2>ssss</param2>
</formField>
To get the value in the same level we can use
<!-- TemplateBeginRepeat name="Component.Fields.formField" -->
@@inputType@@
<!-- TemplateEndRepeat -->
But my requirement is to get the inputValue at input templating level
<!-- TemplateBeginRepeat name="input" -->
@@inputType@@
<!-- TemplateEndRepeat -->
This code fails to return as there is no inputType present at input templating level. So i tried to use:
<!-- TemplateBeginRepeat name="input" -->
@@RenderComponentField("formField[0].inputType",0)@@
<!-- TemplateEndRepeat -->
Here there are two issues when i use RenderComponentField the output looks like:
<tcdl:ComponentField name="formField[0].inputType" index="0">
text
</tcdl:ComponentField>
its returning the value along with tcdl tags which I don't require.
Secondly, instead of the index directly giving 0 , I need to use TemplateRepeatIndex
, but its giving an error if i use @@RenderComponentField("formField[TemplateRepeatIndex].inputType",0)@@
So how can we achieve this if we want to get the field value at a different templating level.