acemcleod
04-26-2011, 06:17 PM
Hello folks, generally I prefer to find my answers via google or use help files but so far can't find anything to help me on this. For reference sake I am heavily modifying the Flex Test Drive App since it pretty much facilitates what I am trying to do, which is build an issue tracking application for my company. Its not software, more like customer calls to complain about something. Anyhow, I have created an InputDate field that I have written a function to populate with the currentDate, however the value of the function is not being passed to the database. How do I get a value generated by a function to post to a mysql database?
//Here is the function that adds issues to the database
protected function button_clickHandler(event:MouseEvent):void
{
issues.iDate = iDateTextInput.text;
issues.customerFname = customerFnameTextInput.text;
issues.customerLname = customerLnameTextInput.text;
issues.phNum = phNumTextInput.text;
issues.customerAddress = customerAddressTextInput.text;
issues.customerCity = customerCityTextInput.text;
issues.customerState = customerStateTextInput.text;
issues.iType = iTypeTextInput.text;
issues.iNote = iNoteTextInput.text;
issues.binQ = binQTextInput.text;
issues.dDate = dDateTextInput.text;
issues.rtNum = rtNumTextInput.text;
issues.rtSupervisor = rtSupervisorTextInput.text;
issues.iClosed = iClosedTextInput.text;
issues.rDate = rDateTextInput.text;
issues.rNote = rNoteTextInput.text;
if(issues.tktNum==0){
createIssuetableResult.token = issuetableService.createIssuetable(Issues);
}
else{
updateIssuetableResult.token = issuetableService.updateIssuetable(Issues);
}
}
//Function to get today's date and return a string
private function currentDateToString():String{
var CurrentDate:Date = new Date();
return dateFormatter.format(CurrentDate);
}
//This is the specific form label that displays the result of the function
<mx:FormItem label="Input Date:">
<s:Label id="iDateTextInput" text="currentDateToString()}"/>
</mx:FormItem>
I appreciate any help. Thanks!
//Here is the function that adds issues to the database
protected function button_clickHandler(event:MouseEvent):void
{
issues.iDate = iDateTextInput.text;
issues.customerFname = customerFnameTextInput.text;
issues.customerLname = customerLnameTextInput.text;
issues.phNum = phNumTextInput.text;
issues.customerAddress = customerAddressTextInput.text;
issues.customerCity = customerCityTextInput.text;
issues.customerState = customerStateTextInput.text;
issues.iType = iTypeTextInput.text;
issues.iNote = iNoteTextInput.text;
issues.binQ = binQTextInput.text;
issues.dDate = dDateTextInput.text;
issues.rtNum = rtNumTextInput.text;
issues.rtSupervisor = rtSupervisorTextInput.text;
issues.iClosed = iClosedTextInput.text;
issues.rDate = rDateTextInput.text;
issues.rNote = rNoteTextInput.text;
if(issues.tktNum==0){
createIssuetableResult.token = issuetableService.createIssuetable(Issues);
}
else{
updateIssuetableResult.token = issuetableService.updateIssuetable(Issues);
}
}
//Function to get today's date and return a string
private function currentDateToString():String{
var CurrentDate:Date = new Date();
return dateFormatter.format(CurrentDate);
}
//This is the specific form label that displays the result of the function
<mx:FormItem label="Input Date:">
<s:Label id="iDateTextInput" text="currentDateToString()}"/>
</mx:FormItem>
I appreciate any help. Thanks!