1 Reply Latest reply on Aug 11, 2008 6:54 AM by Newsgroup_User

    using XMLDate as datasource

    amthekkel Level 1
      HI all,
      I am having trouble displaying date field from XML data. here is what i am doing:
      I have a data grid that displays columns based on XML data containing SQl-server database items. here is a sample dataset i retrieve.

      this displays fine on the data grid. Next i have a summary pannel beneath the datagrid that allows for update and delete functionality. When a row in the data grid is selected, the fields in the summary panel should display the values in that row.
      I can get the likes of integer and string data displayed in the summary panel by creating individual text fields and binding the text attribute to the selected datagrid item. eg.
      <mx: TextInput id="recurrencePattern" text="{datagrid.selectedItem.RecurrencePattern}"/>


      the problem i am having is with the recurrencestartdate field. I have a date field in the summary panel. how do i set it to the date in the datagrid. i tried doing selectedDate="{datagrid.selected.RecurrencePattern}" and it came up with an error faultstring XML@asasdas to date

      Any suggestions how i can overcome that.

      The other issue is how to bind an already binded data. The recurrencePattern i am getting from the datagrid is in the form of a string "1100110", this is a 7 digit string, that represents a boolean for each day of the week. What i would like is instead of displaying "1100110" as a string i would like to display it as 7 checkboxes for sun,mon,tue,wed,thur,fri,sat and sun and with mon,tue,fri and sat as checked.


      many thanks,


      regards
      abhi
        • 1. Re: using XMLDate as datasource
          Level 7

          "amthekkel" <webforumsuser@macromedia.com> wrote in message
          news:g7p42e$12v$1@forums.macromedia.com...
          > HI all,
          > I am having trouble displaying date field from XML data. here is what i am
          > doing:
          > I have a data grid that displays columns based on XML data containing
          > SQl-server database items. here is a sample dataset i retrieve.
          >
          > this displays fine on the data grid. Next i have a summary pannel beneath
          > the
          > datagrid that allows for update and delete functionality. When a row in
          > the
          > data grid is selected, the fields in the summary panel should display the
          > values in that row.
          > I can get the likes of integer and string data displayed in the summary
          > panel
          > by creating individual text fields and binding the text attribute to the
          > selected datagrid item. eg.
          > <mx: TextInput id="recurrencePattern"
          > text="{datagrid.selectedItem.RecurrencePattern}"/>
          >
          >
          > the problem i am having is with the recurrencestartdate field. I have a
          > date
          > field in the summary panel. how do i set it to the date in the datagrid. i
          > tried doing selectedDate="{datagrid.selected.RecurrencePattern}" and it
          > came up
          > with an error faultstring XML@asasdas to date

          You'll have to use the Date() function and break up your existing date info
          into chunks that correspond to the arguments that the Date Constructor
          takes.

          With the problems you're having, you're probably better off parsing your XML
          into an array of strongly typed objects.

          HTH;

          Amy