Hi, my application updated some of the framework as well as jquery and now doesn't work. I'm not sure what to do since I'm not getting useful information back to debug. Here's what I am looking for:
GIVEN: I am on the selected page with a text field and submit button WHEN: I type a few letters in the textbox THEN: I want Autocomplete with available accounts matching values from the database.
GIVEN: I see a value that I want to add to my list WHEN: I click "Add" THEN: I want to see the selected value displayed in the panel via Ajax (no need to refresh the page):
Here is the code for the Autocompletion:
$this->btnAddOffer = new QButton($this->pnlAddOffer,"btnAddOffer");
$this->btnAddOffer->CssClass = "button";
$this->btnAddOffer->Text = "Add";
$this->txtNewOffer->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnAddOffer_Click'));
$this->txtNewOffer->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnAddOffer->AddAction(new QClickEvent(), new QAjaxAction('btnAddOffer_Click'));
and:
protected function btnAddOffer_Click($strFormId, $strControlId, $strParameter) {
if($this->txtNewOffer->Text == ''){
$this->txtNewOffer->Warning = "You must be enter a offer company name!";
return false;
}
$objUser = unserialize($_SESSION['User']);
$objAccount = Account::LoadByName($this->txtNewOffer->Text);
if($objAccount){
$objUser->AccountId = $objAccount->Id;
$objOffer = Offer::LoadByUserOwnerIdAccountId($objUser->Id,$objAccount->Id);
if($objOffer){
QApplication::DisplayAlert("This account already exists!!");
} else {
$objOffer = new Offer();
$objOffer->UserOwnerId = $objUser->Id;
$objOffer->AccountId = $objAccount->Id;
$objOffer->Save();
#QApplication::DisplayAlert("New account was added successfully");
}
}
The current outcomes that I get:
- When I type in the textbox, I see an empty form with the following Firebug:
I'm not sure what to do since I have no information to debug what is going on.
Here is a screenshot using Firebug of the code-generated around the input box and the submit button:
The related code in the controller:
More details can be found here:
http://github.com/allyforce/AF-upload/blob/master/Library/Offer.class.php