0 Replies Latest reply on Mar 7, 2009 9:48 AM by ice9_us

    checkbox question

    ice9_us Level 1
      I am stuck..
      I have a mxml comp... that i call to make a check box for everything returned in my cgi script in xml format..

      http request -> some data..

      data returns data1 data2 data3 data4..

      below is the hbox xml and here is a snip of the actionscript.

      public function mget_usrdata(event:ResultEvent):void {
      dbHlding=event.result.usr_data;
      for ( var a:int=0; dbHlding[a]; a++ ) {
      /*
      dbEnv[a] = dbHlding[a].@env;
      dbApp[a] = dbHlding[a].@app;
      dbAst[a] = dbHlding[a].@ast;
      dbDpt[a] = dbHlding[a].@dpt;
      */
      DisplayBox = new HBoxCreate();
      DisplayBox.callme = dbHlding[a].@env;
      vBoxEnv.addChild(DisplayBox);
      DisplayBox = new HBoxCreate();
      DisplayBox.callme = dbHlding[a].@app;
      vBoxAppl.addChild(DisplayBox);
      DisplayBox = new HBoxCreate();
      DisplayBox.callme = dbHlding[a].@asset;
      vBoxAsset.addChild(DisplayBox);
      DisplayBox = new HBoxCreate();
      DisplayBox.callme = dbHlding[a].@dpt;
      vBoxDpt.addChild(DisplayBox);
      }
      }


      I get the checkbox created. when a user clicks on the submit button how to i send that vbox data in the httpservice request?
      <mx:HTTPService id="get_usr_data" url=" http://{_root.domain}/cgi-bin/get_usr_data.cgi" method="POST" result="mget_usrdata(event)"
      fault="_root.faultHandler(event)" resultFormat="e4x" >
      <mx:request xmlns="">
      <add_usr_name>{add_usr_name.text}</add_usr_name>
      <checkbox data here> </checkbox data here>
      </mx:request>
      </mx:HTTPService>

      --
      The check box data will be a random number of selections... I may have to put it in an array then send it...
      Anyone have any ideas how i get that info after it is selected? I can't find anything on the web.

      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="init()" width="100%" borderColor="{color}" paddingTop="1" paddingLeft="0" paddingRight="0" paddingBottom="0"
      backgroundColor="{color}" borderStyle="inset" >
      <mx:Script>
      <![CDATA[
      import mx.controls.*
      import comp.*;


      [Bindable]
      public var color:uint = 0xFFFFFF;
      [Bindable]
      public var callme:String = new String();
      [Bindable]
      public var HboxName:String = new String();

      public function init():void {
      //TicketDisplayBoxt.text = ticketName;
      //trace(ticketName + " " + "in ticket display");
      /*switch (ticketSeverity) {
      case "sev_1":
      color = 0xFF0000;
      break;
      case "sev_2":
      color = 0xFFFF00;
      break;
      case "sev_3":
      color = 0x00FF00;
      break;
      default:
      color = 0xFFFFFF;
      break;
      }
      this.setStyle("backgroundAlpha","0.2");
      */
      }

      public function setAlphaMax():void {
      this.setStyle("backgroundAlpha","0.8");
      }

      public function setAlphaHigher(event:MouseEvent):void {
      this.setStyle("backgroundAlpha","0.5");
      }

      public function setAlphaLower(event:MouseEvent):void {
      this.setStyle("backgroundAlpha","0.2");
      }

      public function addListeners():void {

      //if (!this.hasEventListener(MouseEvent.MOUSE_OVER)) {
      this.addEventListener(MouseEvent.MOUSE_OVER,setAlphaHigher, false, 0 , true);
      this.addEventListener(MouseEvent.MOUSE_OUT,setAlphaLower, false, 0, true);
      //}
      }

      public function removeListeners():void {
      if (this.hasEventListener(MouseEvent.MOUSE_OVER)) {
      this.removeEventListener(MouseEvent.MOUSE_OVER,setAlphaHigher);
      this.removeEventListener(MouseEvent.MOUSE_OUT,setAlphaLower);
      }
      }

      ]]>
      </mx:Script>
      <mx:CheckBox label="{callme}" id="{HboxName}" />
      </mx:HBox>



      Thank you for any help in advanced