Lukket

Flex/JAVA/Actionscript Need function written that loops through nested formItems within Flex then send id and values to a .jsp file. *Simple Job!

Flex/JAVA/Actionscript Need function written that loops through nested formItems within Flex then send id and values to a .jsp file. *Simple Job

I need someone to write a function for a Flex application. All work is done except for collecting

FormItem elements then sending id and values to a .jsp file. *IMPORTANT: This needs to be completed

before 10 a.m. eastern time U.S.A.

When user clicks submit button it calls a function that loops thru form then sends data. I have one

within the application that worked very well when all elements were a child of the form, without a grid. With the new grid layout, formItems are no longer children of the form.

Form elements are within a [url removed, login to view] other form elements.

(this is not exact, just a general idea)

YOu can view the application here:

[url removed, login to view]

I will only choose someone who can give me indication of knowledge of flex and a solid feedback history.

Examine Flex source code posted below so you can understand what is needed before you bid.

Flex/MXML-------------------------------------------

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientColors="white" backgroundDisabledColor="white" backgroundColor="white" horizontalAlign="center" verticalAlign="middle" creationComplete="handleCreationComplete()" verticalScrollPolicy="auto" cachePolicy="off">

<mx:Script>

<![CDATA[

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import flash.utils.*;

[Bindable]

public var dynurl:String;

[Bindable]

public var comboelements:ArrayCollection;

public function collectFormValues():Object

{

var vals:Array = new Array();

var items:Object = [url removed, login to view]();

for (var i:int = 0; i < [url removed, login to view]; i++) // looping around formitem elements

{

var item:Array = items[i].getChildren(); // get the children of the formitem

for (var j:int = 0; j < [url removed, login to view]; j++) // looping around the controls contained in the formitem

{

if(item[j].toLocaleString().indexOf("TextInput") > -1 || item[j].toLocaleString().indexOf("TextArea") > -1 ||

item[j].toLocaleString().indexOf("DateField") > -1)

{

[url removed, login to view](item[j].id + "=" + item[j].text);

}

else if(item[j].toLocaleString().indexOf("CheckBox") > -1 || item[j].toLocaleString().indexOf("RadioButton") > -1)

{

[url removed, login to view](item[j].id + "=" + item[j].selected);

}

else if(item[j].toLocaleString().indexOf("ComboBox") > -1)

{

[url removed, login to view](item[j].id + "=" + item[j].selectedLabel);

}

}

}

service = new HTTPService();

[url removed, login to view] = "receive.jsp";

[url removed, login to view] = "POST";

[url removed, login to view]("result", httpResult);

[url removed, login to view]("fault", httpFault);

[url removed, login to view](vals);

[url removed, login to view]("Returning " + vals + " values Submitted to .jsp");

trace("Returning " + [url removed, login to view] + " values");

return vals;

}

private var service:HTTPService

public function useHttpService(vals:Object):void {

service = new HTTPService();

[url removed, login to view] = "receive.jsp";

[url removed, login to view] = "POST";

[url removed, login to view]("result", httpResult);

[url removed, login to view]("fault", httpFault);

[url removed, login to view](vals);

}

public function httpResult(event:ResultEvent):void {

var result:Object = [url removed, login to view];

//Do something with the result.

vs1.selectedIndex=1;

}

public function httpFault(event:FaultEvent):void {

var faultstring:String = [url removed, login to view];

[url removed, login to view](faultstring);

}

private function handleCreationComplete():void

{

dynurl = [url removed, login to view];

[url removed, login to view]();

}

private function errorHandler(evt:FaultEvent):void

{

[url removed, login to view]("Error: " + [url removed, login to view]);

}

private function resultHandler(evt:ResultEvent):void

{

buildForm(new XML([url removed, login to view]));

}

private function buildForm(xml:XML):void

{

var lst:XMLList = [url removed, login to view]();

var lsta:XMLList = [url removed, login to view]();

var uid:XMLList = [url removed, login to view]("userid");

var fname:XMLList = [url removed, login to view]("fname");

var lname:XMLList = [url removed, login to view]("lname");

var qname:XMLList = [url removed, login to view]("questionlabel");

[url removed, login to view] = uid;

[url removed, login to view] = fname;

[url removed, login to view] = lname;

//[url removed, login to view] = qname;

for(var i:int = 0; i < [url removed, login to view](); i++)

{

var x:XMLList = lst[i].children();

var w:XMLList = lst[i].@questionlabel;

var z:XMLList = lst[i].@position;

var pos:XMLList = lst.@position;

for(var j:int = 0; j < [url removed, login to view](); j++)

{

if(x[j].@inputtype == 'TextInput')

{

var frmItem:FormItem = new FormItem();

[url removed, login to view] = "horizontal";

//[url removed, login to view] = "left";

[url removed, login to view] = z + '. ' + w;

var tb:TextInput = new TextInput();

[url removed, login to view] = x[j];

//[url removed, login to view] = "30%";

[url removed, login to view] = x[j].@id;

[url removed, login to view] = 'Enter your Answer here';

[url removed, login to view](tb);

[url removed, login to view](frmItem);

}

else

if(x[j].@inputtype == 'radText')

{

var radtxt:FormItem = new FormItem();

[url removed, login to view] = "horizontal";

[url removed, login to view] = true;

//[url removed, login to view] = z + '. ' + w;

var trad:RadioButton = new RadioButton();

[url removed, login to view] = x[j].@radiolabel;

//[url removed, login to view] = "30%";

[url removed, login to view] = x[j].@id;

[url removed, login to view] = x[j].@group;

[url removed, login to view] = 'Enter your Answer here';

[url removed, login to view](trad);

var tradtxt:TextInput = new TextInput();

[url removed, login to view] = x[j];

//[url removed, login to view] = "30%";

[url removed, login to view] = x[j].@id;

[url removed, login to view] = 'Enter your Answer here';

[url removed, login to view](tradtxt);

[url removed, login to view](radtxt);

}

else

{

// Support other form field types

if(x[j].@inputtype == 'RadioButton')

{

var frmItem2:FormItem = new FormItem();

[url removed, login to view] = "vertical";

[url removed, login to view] = z + ' ' + w;

var tc:RadioButton = new RadioButton();

[url removed, login to view] = x[j].@radiolabel;

[url removed, login to view] = x[j].@placement;

[url removed, login to view] = x[j].@group;

[url removed, login to view] = x[j].@id;

[url removed, login to view](tc);

[url removed, login to view](frmItem2);

}

else

{

// Support other form field types

if(x[j].@inputtype == 'TextArea')

{

var tarea:FormItem = new FormItem();

[url removed, login to view] = "horizontal";

//[url removed, login to view] = x[j].@questionlabel;

[url removed, login to view] = z + '. ' + w;

var tf:TextArea = new TextArea();

[url removed, login to view] = x[j].@id;

[url removed, login to view] = 500;

[url removed, login to view] = 70;

[url removed, login to view] = x[j];

// check [url removed, login to view] changed from label to id

[url removed, login to view](tf);

[url removed, login to view](tarea);

}

else

{

// Support other form field types

if(x[j].@inputtype == 'CheckBox')

{

var frmItem3:FormItem = new FormItem();

[url removed, login to view] = "horizontal";

//[url removed, login to view] = true;

[url removed, login to view] = z + ' ' + w;

var te:CheckBox = new CheckBox();

[url removed, login to view] = 'Click Here! To select Your Answers';

[url removed, login to view] = x[j].@checklabel;

[url removed, login to view] = x[j].@id;

[url removed, login to view] = x[j].@selected;

[url removed, login to view](te);

[url removed, login to view](frmItem3);

}

else

{

// Support other form field types

if(x[j].@inputtype == 'DateField')

{

var dateItem:FormItem = new FormItem();

[url removed, login to view] = "horizontal";

//[url removed, login to view] = true;

[url removed, login to view] = z + '. ' + w;

var tedate:DateField = new DateField();

//[url removed, login to view] = x[j];

[url removed, login to view] = 'Click here to activate Pre-formatted date.';

[url removed, login to view](tedate);

[url removed, login to view] = 2012;

[url removed, login to view] = 2008;

[url removed, login to view] = true;

[url removed, login to view] = x[j].@id;

[url removed, login to view] = x[j].@here;

//[url removed, login to view] = lst;

//[url removed, login to view] = x[j].@here;

[url removed, login to view](dateItem);

}

else

{

if(x[j].@inputtype == 'Text1')

{

var gridRow1:GridRow = new GridRow();

[url removed, login to view] = 100;

[url removed, login to view] = 100;

[url removed, login to view]("paddingTop", 10);

[url removed, login to view]("paddingBottom", 10);

var gridItems1:GridItem = new GridItem();

[url removed, login to view] = 20;

var formItems1:Text = new Text();

[url removed, login to view] = z + '.';

[url removed, login to view]("fontWeight", "bold");

var gridItems2:GridItem = new GridItem();

[url removed, login to view] = 450;

var formItems2:Text = new Text();

[url removed, login to view] = w;

[url removed, login to view] = 440;

[url removed, login to view]("fontWeight", "bold");

var gridItems3:GridItem = new GridItem();

[url removed, login to view] = 380;

var formItems3:FormItem = new FormItem;

[url removed, login to view] = true;

var txtinput1:TextInput = new TextInput;

[url removed, login to view] = 360;

[url removed, login to view] = x[j].@id;

[url removed, login to view](gridRow1);

[url removed, login to view](gridItems1);

[url removed, login to view](gridItems2);

[url removed, login to view](gridItems3);

[url removed, login to view](formItems1);

[url removed, login to view](formItems2);

[url removed, login to view](formItems3);

[url removed, login to view](txtinput1);

}

else

{

if(x[j].@inputtype == 'Text2')

{

var t2gridRow1:GridRow = new GridRow();

//[url removed, login to view] = 100;

[url removed, login to view] = 100;

[url removed, login to view]("paddingTop", 10);

[url removed, login to view]("paddingBottom", 10);

var t2gridItems1:GridItem = new GridItem();

[url removed, login to view] = 20;

var t2formItems1:Text = new Text();

[url removed, login to view] = z + '.';

[url removed, login to view]("fontWeight", "bold");

var t2gridItems2:GridItem = new GridItem();

[url removed, login to view] = 450;

var t2formItems2:Text = new Text();

[url removed, login to view] = w;

[url removed, login to view] = 440;

[url removed, login to view]("fontWeight", "bold");

var t2gridItems3:GridItem = new GridItem();

//[url removed, login to view] = 180;

var t2formItems3:FormItem = new FormItem;

[url removed, login to view] = true;

[url removed, login to view] = x[j].@label1;

var t2txtinput1:TextInput = new TextInput;

//[url removed, login to view] = 170;

[url removed, login to view] = x[j].@id;

var t2gridItems4:GridItem = new GridItem();

//[url removed, login to view] = 280;

var t2formItems4:FormItem = new FormItem;

[url removed, login to view] = true;

[url removed, login to view] = x[j].@label2;

var t2txtinput2:TextInput = new TextInput;

//[url removed, login to view] = 170;

[url removed, login to view] = x[j].@id;

[url removed, login to view](t2gridRow1);

[url removed, login to view](t2gridItems1);

[url removed, login to view](t2gridItems2);

[url removed, login to view](t2gridItems3);

[url removed, login to view](t2gridItems4);

[url removed, login to view](t2formItems1);

[url removed, login to view](t2formItems2);

[url removed, login to view](t2formItems3);

[url removed, login to view](t2formItems4);

[url removed, login to view](t2txtinput1);

[url removed, login to view](t2txtinput2);

}

else

{

// Support other form field types

if(x[j].@inputtype == 'ComboBox')

{

var frmItemCombo:FormItem = new FormItem();

var tg:ComboBox = new ComboBox();

[url removed, login to view] = z + '. ' + w;

[url removed, login to view] = .9;

[url removed, login to view] = [url removed, login to view]('drop');

//[url removed, login to view] = 'droplabel';

[url removed, login to view] = "Please Select Answer ---";

[url removed, login to view] = "@dropvalue";

[url removed, login to view] = "@droplabel";

[url removed, login to view] = "@dropvalue";

[url removed, login to view] = 230;

[url removed, login to view] = "@dropvalue";

[url removed, login to view] = true;

[url removed, login to view](tg);

[url removed, login to view](frmItemCombo);

//[url removed, login to view] = [url removed, login to view]('drop');

}

}

}

}

}

}

}

}

}

}

}

]]>

</mx:Script>

<mx:HTTPService fault="errorHandler(event)" id="XMLService" resultFormat="e4x" url="test/formdata_final.xml" result="resultHandler(event)" method="POST" />

<!--mx:HTTPService fault="errorHandler(event)" id="XMLService" resultFormat="e4x" url="send.jsp" result="resultHandler(event)" method="POST" /-->

<!-- <mx:HTTPService id="XMLServiceSend" url="receive.jsp" method="POST" /> -->

<!-- <mx:HTTPService fault="errorHandler(event)" id="XMLService" resultFormat="e4x" url="{dynurl}" result="resultHandler(event)" method="POST" /> -->

<mx:Panel title="XML Driven Form -- Send Receive Data from SOA _JSP" height="98%" width="98%"

paddingTop="20" paddingLeft="20" paddingBottom="20" paddingRight="20" horizontalAlign="center" backgroundColor="#EEEFFD" borderColor="#E2E2E2">

<!--mx:TextArea width="90%" id="varlabelx" text=" " fontSize="9"/-->

<!-- <mx:Label id="tree" text="XML Tree:" fontWeight="bold"/>

<mx:TextArea width="90%" id="varlabel" text=" " fontSize="9"/>

<mx:Label id="urldat" text="Dynamic URL:" fontWeight="bold"/>

<mx:TextArea width="90%" id="dynlabel" text="{dynurl}" fontSize="9"/> -->

<mx:Canvas width="100%" height="50" autoLayout="true" textAlign="left">

<mx:Label id="usertitle" text="User ID: " fontWeight="bold"/>

<mx:Label id="userlabel" text=" " x="54"/>

<mx:Label id="nametitle" text="Name: " fontWeight="bold" y="14"/>

<mx:Label id="fnamelabel" text=" " x="42" y="14"/>

<mx:Label id="lnamelabel" text=" " x="82" y="14"/>

</mx:Canvas>

<mx:ViewStack id="vs1" width="100%" height="100%" textAlign="center">

<mx:Form id="userInfoForm" borderThickness="1" borderColor="#FCFAFA" borderStyle="solid" textAlign="left">

<mx:Grid id="grid1" width="98%">

</mx:Grid>

</mx:Form>

<mx:VBox>

<mx:Label text="Thank You for submittng your data!"/>

</mx:VBox>

</mx:ViewStack>

<mx:Canvas width="90%" autoLayout="true" textAlign="center">

<mx:Button label="Submit" enabled="true" toolTip="Submit Your Data" click="collectFormValues()" ></mx:Button>

<!--mx:Button label="Clear" enabled="true" toolTip="Clear answers / Start over" click="submitForm()" x="74"></mx:Button-->

</mx:Canvas>

</mx:Panel>

</mx:Application>

xml:----------------------------------------------------

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

<formdata userid="lgeige" fname="David" lname="washingon" auth="1">

<element position="1." questionlabel="Text area with no text limit. Text limit values can be added if needed.">

<item id="4" inputtype="TextArea"></item>

</element>

<element position="2." questionlabel="Radio Button Treated as Single Elements. SelectedItem = True for element selection.">

<item id="5a" group="5" placement="right" inputtype="RadioButton" radiolabel="What is this" selectedItem=""></item>

</element>

<element position="" questionlabel="">

<item id="5b" group="5" placement="right" inputtype="RadioButton" radiolabel="What is that" selectedItem=""></item>

</element>

<element position="" questionlabel="">

<item id="5c" group="5" placement="right" inputtype="RadioButton" radiolabel="What is on" selectedItem=""></item>

</element>

<element position="" questionlabel=" ">

<item id="8" group="5" placement="right" inputtype="radText" radiolabel="Other" selectedItem="true">This is the Text for Input.</item>

</element>

<element position="3." questionlabel="Single ComboBox. For singel Option. Multi-Item selection Bug found. ">

<item id="6" inputtype="ComboBox">

<drop droplabel="What is this" dropvalue="1" selectedItem="What is this"></drop>

<drop droplabel="What is that" dropvalue="2" selectedItem=""></drop>

<drop droplabel="What is in" dropvalue="3" selectedItem=""></drop>

</item>

</element>

<element position="4." questionlabel="This is a single Date Field No additional formatting passed except Date at this tme.">

<item id="7" inputtype="DateField1" here="10/12/2009"></item>

</element>

<element position="5." questionlabel="This is a Dual Date Field">

<item id="7" inputtype="DateField2" here="10/12/2009" here2="10/15/2009"></item>

</element>

<element position="6." questionlabel="Check Box Treated as a single element. Not as a group.">

<item id="5a" placement="right" inputtype="CheckBox" checklabel="Check Box 1" selectedItem=""></item>

</element>

<element position="" questionlabel="">

<item id="5b" placement="right" inputtype="CheckBox" checklabel="Check Box 2" selectedItem="true"></item>

</element>

<element position="" questionlabel="">

<item id="5c" placement="right" inputtype="CheckBox" checklabel="Check Box 3" selectedItem=""></item>

</element>

<element position="7." questionlabel="Single Text field. It would be nice if I could wrap this text. Well if you build a custom comp. from scratch, this can happen.">

<item id="2" inputtype="Text1"></item>

</element>

<element position="8." questionlabel="Two Text fields. It would be nice if I could send this text. Well if you build a custom comp. from scratch, this does happen.">

<item id="2" label1="label 1" label2="label 2" inputtype="Text2"></item>

</element>

<element position="9." questionlabel="Dual-Radio Buttons. It would be nice if I could send this text. Well if you build a custom comp. from scratch, this does happen.">

<item id="2" label1="label 1" labe1selected="" label2="label 2" labe2selected="true" inputtype="Rad2"></item>

</element>

<element position="10." questionlabel="Dual-Check Boxes. It would be nice if I could send this text. Well if you build a custom comp. from scratch, this does happen.">

<item id="2" placement="left" checklabel1="label 1" labe1selected="" checklabel2="label 2" labe2selected="true" inputtype="Check2" group="2"></item>

</element>

<element position="11." questionlabel="Tripple-Text Inputs. It would be nice if I could send this text. I built a custom comp. from scratch, this does happen.">

<item id="2" label1=" label 1" label2="label 2" label3="label 3" inputtype="Text3"></item>

</element>

<element position="12." questionlabel="Tripple-Radio Buttons. It would be nice if I could send this text. I built a custom comp. from scratch, this does happen.">

<item id="2" label1=" label 1" labe1selected="" label2="label 2" labe2selected="" label3="label 3" labe3selected="true" inputtype="Rad3" group="3"></item>

</element>

<element position="13." questionlabel="Dual-Check Boxes. It would be nice if I could send this text. Well if you build a custom comp. from scratch, this does happen.">

<item id="2" placement="left" checklabel1="label 1" labe1selected="" checklabel2="label 2" labe2selected="true" checklabel3="label 3" labe3selected="true" inputtype="Check3" group="2"></item>

</element>

<element position="14." questionlabel="Quadruple- Text fields. It is be nice if I could send this text. I built a custom comp. from scratch.">

<item id="2" label1="label 1" label2="label 2" label3="label 3" label4="label 4" inputtype="Text4"></item>

</element>

<element position="15." questionlabel="Quadruple-Radio Buttons. It would be nice if I could send this text. I built a custom comp. from scratch, this does happen.">

<item id="2" label1="label 1" labe1selected="" label2="label 2" labe2selected="" label3="label 3" labe3selected="" label4="label 4" labe4selected="true" inputtype="Rad4" group="4"></item>

</element>

<element position="16." questionlabel="Quad-Check Boxes. It would be nice if I could send this text. Well if you build a custom comp. from scratch, this does happen.">

<item id="2" placement="left" checklabel1="label 1" labe1selected="" checklabel2="label 2" labe2selected="true" checklabel3="label 3" labe3selected="true" checklabel4="label 4" labe4selected="true" inputtype="Check4" group="2"></item>

</element>

</formdata>

Færdigheder: Adobe Flash, J2EE, Java, JSP, XML

Se mere: flex checkbox label position, java actionscript, flex formitem wrap text, java formitems array, java checklabel, placement new, work values, java collections, tree box, tooltip html, text string, tc support, tc java, tc data, tc 2008, string source code java, string j, source formatting, single view application, s controls, one job, m string, jsp service, job values, job event

Om arbejdsgiveren:
( 0 bedømmelser ) clinton, United States

Projekt-ID: #316989

2 freelancere byder i gennemsnit $175 for dette job

prashantch

I can do it, I have 1.5 yrs of exp in flex and 4+ in J2EE. Please let me know if you are interested.

$200 USD på 1 dag
(1 bedømmelse)
4.7
sam1511

hi please check PM, thanks

$150 USD på 1 dag
(0 bedømmelser)
0.0