0 Replies Latest reply on Aug 20, 2010 4:57 AM by welcomecan

    data bind problem in txtbox?

    welcomecan Level 1

      hai friends,

       

      below my code

       

      in resdata2 inclde data

        dname->document name,

      dnum->document number

       

       

       

       

       

       

      xmlns:fx="http://ns.adobe.com/mxml/2009"

       

      library://ns.adobe.com/flex/spark"

       

      library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

       

       

      <fx:Script>

       

       

      import mx.collections.ArrayCollection;

       

      import mx.containers.FormItem;

       

      import mx.controls.Alert;

       

      import mx.controls.Text;

       

      import spark.components.ComboBox;

       

      public function txtchange():void

       

       

      var a:String=txtarea.text;

       

      public function search_click()

       

      //var date:Date = new Date();

       

       

      //Alert.show("Date: "+date.toLocaleString());

       

       

      //Logon.fnatt("view","4563","0");

       

       

      //Logon.viewf("1","4436","","file_view","Open");

       

       

      //Logon.fneditatt("Edit","4080");

       

       

      //Logon.editattr("do_edit","B59BAA32CD9C28E5825FC281109E6228","4563"," New Text Document_20100323003136805.txt", " ","{ts '2010-07-27 00:41:20'}","New Text Document","New Text Document","txt","Testing file","TEsting file","this is test file.. asa dhan");

       

       

      //Logon.editattrfirst("Edit","4387");

       

       

      "Edit","3986");

       

      private function handlelogonResult(event):void

       

       

      if(event.result)

       

      var resdata:ArrayCollection=event.result.RES2;

       

      var profileid:int;

       

      var i:int;

       

      if(resdata[0].storage_profile_id==null)

       

      /* for(i=0;i<resdata.length;i++)

       

      Alert.show(

       

       

      "single","alert");

       

      else

       

       

      var resdata2:ArrayCollection=event.result.RES2;

       

      var resdata1:ArrayCollection=event.result.RES1;

       

      for(i=0;i<resdata1.length;i++)

       

      /* var tmpLbl:Label = new Label();

       

       

       

       

      /* var k:int = 30;

       

       

      for(i=0;i<resdata1.length;i++)

       

      /* var newlabel:Label=new Label();

       

       

      false;

       

      //var lbl : Label = new Label();

       

       

      var lbl:FormItem=new FormItem();

       

      /* lbl.width = 130;

       

       

      "horizontal";

       

      //lblContainer.addChild(lbl);

       

       

      var lblform:Label=new Label();

       

      if(resdata1[i].hasOptionsList==null)

       

      var newtxtbox:TextInput=new TextInput();

       

      "txt_"+ resdata1[i].keyvariablename;

       

      newtxtbox.text=resdata2  // first txtbox i need document name.second txtbo i need documentnumber

       

       

      if(resdata1[i].hasOptionsList!==null)

       

      var newcb:ComboBox=new ComboBox();

       

      /* newcb.height=27; */

       

       

      //var bindata:ArrayCollection=resdata1[i].ruleName;

       

       

      /* var n:int; */

       

       

      /* for(n=0;n<resdata1[i].ruleName.length;n++)

       

       

       

       

      /* tem=resdata1[i].ruleName.spko_value.concat(); */

       

       

      var tempdata:ArrayCollection=resdata1[i].ruleName;

       

      //newcb.dataProvider=bindata;

       

       

      "spko_value";

       

      true;

       

      true;

       

      /* var m:int=40;

       

       

      //Alert.show("Double","alert");

       

       

      //pn.visible=true;

       

       

      private function handlelogonFault(event):void

       

      //Alert.show("Incorrect","Alert");

       

       

      </fx:Script>

       

       

      <s:Button id="btn_search" x="220" y="20" label="Search" click="search_click();"/>

       

       

      <s:TextArea id="txtarea" change="txtchange()" />

       

       

      <!--<s:VGroup id="lblContainer" width="180" height="150" verticalAlign="middle" verticalScrollPosition="2" />-->

       

       

      <s:Panel title="Form Container Example" id="pn1"

       

      0" verticalCenter="0" visible="false">

       

       

      <!--<s:VGroup left="10" right="10" top="10" bottom="10">-->

       

       

      <mx:HBox>

       

       

      <mx:Form

       

       

      lblContainer" verticalGap="2" indicatorGap="14" paddingBottom="10"

       

      16"

       

      />

       

       

      </mx:HBox>

       

       

      <!--</s:VGroup>-->

       

       

      </s:Panel>

       

       

      <!--<mx:VBox id="lblContainer" width="180" height="150" verticalGap="2" visible="false"/>-->

       

       

      <s:Panel id="pn" width="100%" visible="false">

       

      <s:Label id="newlabel" x="200" y="300"/>

       

      <s:TextInput id="newtxtbox" />

       

      </s:Panel>

       

       

       

      <fx:Declarations>

       

      <s:RemoteObject destination="ColdFusion" id="Logon" source="IST_Business_Applications.IST_Docstor.file_access.editattrfirst" >

       

      <s:method name="fneditatt" fault="handlelogonFault(event)" result="handlelogonResult(event)" />

       

      </s:RemoteObject>

       

      <!-- Place non-visual elements (e.g., services, value objects) here -->

       

      </fx:Declarations>

      </s:Application>

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      paddingTop="

      id="

       

       

       

       

       

       

       

      horizontalCenter="

       

       

       

       

       

      }

       

      ]]>

       

      {

       

      Alert.show(event.fault.message);

       

       

      }

       

      }

       

      }

       

       

       

      pn1.title=resdata1[0].ProfileName;

      }

       

      for(i=0;i<resdata1.length;i++)

      {

      if(resdata1[i].hasOptionsList==null)

      {

      var newtxtbox:TextInput=new TextInput();

      newtxtbox.text="1";

      pn.addElement(newtxtbox);

      k=250;

      m+=30;

      if (counter >=resdata1.length)

      { counter = 0; k=10; m+=30;}

      newtxtbox.x= k ;

      newtxtbox.y = m;

      counter++;

       

      }

       

      }

      */

       

       

      lblContainer.visible=

      lbl.addElement(newcb);

      }

       

      lblContainer.addElement(lbl);

      }

      pn1.visible=

      newcb.dataProvider=tempdata;

      newcb.labelField=

       

       

       

      {

      tem[n]=resdata1[i].ruleName[n].spko_value.concat();

       

      } */

       

       

       

       

       

       

      newcb.width=300;

       

      {

       

                                                       //i am used to take length of resdata.but it shows 1

      lbl.addElement(newtxtbox);

      }

       

       

      newtxtbox.width=300;

      newtxtbox.id=

      {

       

       

      lblform.text=resdata1[i].spk_name;

      lblform.width=100;

      lbl.addElement(lblform);

       

       

       

       

       

      lbl.direction=

      lbl.height = 27;

       

      lbl.label = resdata1[i].spk_name; */

       

       

       

      pn.visible=

      newlabel.text=resdata1[i].spk_name;

      //pn.addChild(newlabel);

      pn.addElement(newlabel);

      k =125;

      j+=20;

      if (counter >=resdata1.length)

      { counter = 0; k=10; j+=30;}

      newlabel.x= k ;

      newlabel.y = j;

      counter++; */

      {

       

       

       

      var j: int = 40;

      var counter:int = 0; */

      tmpLbl.x = 10;

      tmpLbl.y = 5;

      tmpLbl.text = "Label Text"; */

      {

       

       

       

       

      {

       

      }

       

      {

      Alert.show("welcome","alert");

      } */

      {

       

       

       

       

       

      {

       

      {

       

      }

       

      Logon.fneditatt(

       

       

       

       

       

       

      {

       

       

       

      }

       

      {

       

       

       

       

       

       

       

       

      <![CDATA[

       

       

      xmlns:mx="

      xmlns:s="

      <s:Application

      <?xml version="1.0" encoding="utf-8"?>