The order of _otherOutput and _formsOutput sould be reversed in function printJSONOuput() and printOutput() OPENBIZ_BIN/ClientProxy.php.
// output JSON
foreach ($this->_formsOutput as $output)
$outs[] = $output;
foreach ($this->_otherOutput as $output)
$outs[] = $output;
With this setup one form can switchForm() to another form and set some elements in the *NEW* form. For example given a form method that allows to set hidden field fld_StatusNum that the user cannot edit. The method also sets the visual output field fld_status (a LabelText field) for the user to see. Then is switches to the ReportEditForm.
public function SubmitReport($editform='exprep.form.ReportEditForm', $id=null)
{
$updArr['fld_StatusNum']=SUBMIT;
BizSystem::clientProxy()->updateFormElements($this->m_Name, $updArr);
BizSystem::clientProxy()->updateClientElement('fld_status', 'Submitted');
$this->switchForm($editform, $id);
} // function SubmitReport()
In the current setup this will not work (well, it does something!) as the updateClientElement() will update the old form, THEN it switches to the new form, undoing all changes. Therefore replace the order so we first replace forms, then run te scripts on the *NEW* form.