cancel
Showing results for 
Search instead for 
Did you mean: 

LIST property aspect

sandile
Champ in-the-making
Champ in-the-making
Hi

I have a problem, i want to list properties of an aspect as a dropdown. I  want the propertis of that aspect to appear when you select the dropdown.
The aspect i want its properties to show is attached to a file. at the moment it does not return the aspect properties but the default propertis of the file.



JAVA SCRIPT FILE

var defFile = userhome.childByNamePath("defaults.txt");

model.yrsearch = defFile;



FTL FILE

Hello ${person.properties.userName } welcome to  ${companyhome.name}

<table>
   <tr>
    <td>
       <#assign props = yrsearch.properties?keys>
   
   <select name="idRequest" id="idRequest">
      <option value="NOT SELECTED" selected="selected">[–SELECT YEAR–]</option>
      
      
   <#list props as t>
   
   <option value="${t}}">${t}</option>
   
   </#list>

   </select>
     </td>
    </tr>
</table>  


DESCRIPTOR FILE

<webscript>
  <shortname>Hello</shortname>
  <description>Polite greeting</description>
  <url>/sample/dropdown</url>
  <authentication>user</authentication>
</webscript>


Your help will is kindly appreciated
1 REPLY 1

zladuric
Champ on-the-rise
Champ on-the-rise
#list props as t
will, by default, list all of the file properties. Does your <strong>defaults.txt</strong> file has this custom aspect attached?

Did you try first creating this manually? Something like:

<select name="idRequest" id="idRequest">
<option value="NOT SELECTED" selected="selected">[–SELECT YEAR–]</option>
<#– Now instead of your: <#list props as t> 
     List all aspects' props manually. –>
<option value="${myCustomProp1}}">${myCustomProp1}</option>
<option value="${myCustomProp2}}">${myCustomProp3}</option>
<option value="${myCustomProp3}}">${myCustomProp3}</option>
</select>


Also, you only list keys, both as options and as values. Maybe you can just put all the keys in an array and loop over them?

I don't know if that helps.