1 Reply Latest reply on Nov 15, 2008 5:19 PM by Newsgroup_User

    Setting Booleans from XML?

    zakel
      I am trying to turn formItem validation "on" or "off " via e4xml. It seems if flex is not allowing me to set "true" or "false" booleans. The loop is correct, I can write "true" or "false" to a alert box. Is it syntax? I am new at this still learning.

      Thanks for any help!

      This is what my flex code looks like:

      var dfformItems3:FormItem = new FormItem;
      dfformItems3.required = x[j].@validate;

      this is my xml node:

      <element position="5." questionlabel="This is a Dual Date Field">
      <item id="5" inputtype="DateField2" validate="false" here="10/12/2009" here2="10/19/2009" tooltip="true" tip="Dual Date Field. If you place your tip over field you should type text into container." ></item>
      </element>
        • 1. Re: Setting Booleans from XML?
          Level 7

          "zakel" <webforumsuser@macromedia.com> wrote in message
          news:gfne9d$f7k$1@forums.macromedia.com...
          >I am trying to turn formItem validation "on" or "off " via e4xml. It
          >seems if
          > flex is not allowing me to set "true" or "false" booleans. The loop is
          > correct, I can write "true" or "false" to a alert box. Is it syntax? I am
          > new
          > at this still learning.
          >
          > Thanks for any help!
          >
          > This is what my flex code looks like:
          >
          > var dfformItems3:FormItem = new FormItem;
          > dfformItems3.required = x[j].@validate;
          >
          > this is my xml node:
          >
          > <element position="5." questionlabel="This is a Dual Date Field">
          > <item id="5" inputtype="DateField2" validate="false" here="10/12/2009"
          > here2="10/19/2009" tooltip="true" tip="Dual Date Field. If you place your
          > tip
          > over field you should type text into container." ></item>
          > </element>
          >

          The string "true" is not the same as true. Try

          var isRequired:Boolean=x.child(j).attribute('validate')=='true'?true:false;

          dfformItems3.required = isRequired

          HTH;

          Amy