Hi,
QQueries are the same don't matter that you use QServerAction or QAjaxAction.
The query is performed, and the QControl changes are applied.
And a working example is right here in the SampleForm posted by you, the commented part.
here is another example, which counts the persons having 'John' as FirstName, following your example.
<?php
..........
protected $lblPersonCount;
..........
protected function Form_Create()
{
$this->name = new QLabel($this);
$this->name->Text = 'John';
$this->lblPersonCount = new QLabel($this);
$this->lblPersonCount->Text = '0';
...........
protected function btnButton_Click ($strFormId, $strControlId, $strParameter)
{
$cntPersons = Person::QueryCount(
QQ::Like(QQN::Person()->FirstName, $objPerson->FirstName)
);
$this->lblPersonCount->Text = $cntPersons;
/*
$objPerson = new Person();
$objPerson->FirstName = $this->name->Text;
$objPerson->Save();
$objPersonArray1 = Person::QueryArray
(
QQ::Like(QQN::Person()->FirstName, $objPerson->FirstName) //
);
*/
} // End of btnButton_Click
?>
hope this helps,
regards,
Arpi.