4 Replies Latest reply on Jan 16, 2007 9:23 AM by AI_Michael

    Dynamic Identifiers

      I'm working on a custom app that displays dynamic form elements based on how many elements were set in the admin tool. Where I'm having an issue is when the mx:Repeater is displaying each form element. Here's an example:

      <mx:Repeater id="lblRepeater" count="{getAdmin.lastResult.rules.rule.numLines - 1}">
      <mx:FormItem label="Line {lblRepeater.currentIndex + 1} Text" styleName="lblStyleReq">
      <mx:TextInput x="{getAdmin.lastResult.rules.rule.ln1X}" y="{getAdmin.lastResult.rules.rule.ln1Y}" id="txtLine{lblRepeater.currentIndex + 1}" width="180" height="24" fontSize="11" fontFamily="Arial" fontWeight="normal" color="#000000" change="updateImg()"/>

      Ok, so what I get when I save this is: "'txtLine{lblRepeater.currentIndex + 1}' is not a valid identifier"

      I need dynamic identifiers so that I know which elements have what values. The other issue I can already see is going to be an issue is the x/y stuff. These are being set in the admin tool as well so I'm going to need something like:

      x="{getAdmin.lastResult.rules.rule.ln{lblRepeater.currentIndex + 1}X}" - (I know this won't work but this is how I'm envisioning it so that I can explain it properly.

      Any help with either one of these things would be greatly appreciated!