Yeah I think a misleaded you on this one. I'll try to give you a more complete answer here.
In the first place when you create your textboxes, you should have an array of textboxes so that you can access them later out of the scope of your function. Instead of
$TextField = new QTextBox( $this, $strControlIdTextField );
you would first declare a variable (in the form itself, not in a function), something like
protected $TextFieldArray;
and then when you create your textbox (note that the datagrid is the parent, not the form):
$this->TextFieldArray[$strControlIdTextField ] = new QTextBox($this->dtgItem, $strControlIdTextField );
Same thing when you create your button, but then you will add an ActionParameter to your button :
if ( !$Button ) {
// Create the button.
$this->ButtonArray[strControlIdButton] = new QButton($this->dtgItem, $strControlIdButton );
$this->ButtonArray[strControlIdButton]->ActionParameter = $strControlIdButton;
$this->ButtonArray[strControlIdButton]->Text = 'Enter amount?';
$this->ButtonArray[strControlIdButton]->Visible = true;
$this->ButtonArray[strControlIdButton]->AddAction(new QClickEvent(), new QConfirmAction('Your message here'));
$this->ButtonArray[strControlIdButton]->AddAction( new QClickEvent(), new QServerAction( 'Button_Click' ) );
$this->ButtonArray[strControlIdButton]->CausesValidation = true;
}
Next, when you want to get the value of one of your TextFieldArray item, your function has to receive the parameters that are automatically send when your button is clicked and that you can optionally use.
protected function TextField_Save ($strFormId, $strControlId, $strParameter) {
$strValueEntered = $this->TextFieldArray[$strParameter]->Text;
$objItem = Item::LoadByItemId($strParameter);
$objItem->YourDBfield = $strValueEntered;
$objItem->Save();
}
Just a precision on $_ITEM : you can only access it within the scope of your Datagrid. Meaning if you want to use it outside of this scope, you need to pass it to the function you are calling from your datagrid column declaration, like this : $_FORM->SaveButton_Render($_ITEM). Then, your function SaveButton_Render ( Item $objItem ) can receive the the object and you can use $objItem->YourobjDBfield.
Hope this helps. Sorry for rounding corners in my previous posts.
-patrick