$anchorInsertRow->setEvent('onclick', $aRequests['insertrow']); $anchorRemoveColumn = new clsAnchor(array('children' => array(new clsLiteral('Remove Column')))); $anchorRemoveColumn->setEvent('onclick', $aRequests['removecolumn']); $anchorReplaceColumn = new clsAnchor(array('children' => array(new clsLiteral('Replace Column')))); $anchorReplaceColumn->setEvent('onclick', $aRequests['replacecolumn']); $anchorInsertColumn = new clsAnchor(array('children' => array(new clsLiteral('Insert Column Before')))); $anchorInsertColumn->setEvent('onclick', $aRequests['insertcolumn']); $anchorSetCellValue = new clsAnchor(array('children' => array(new clsLiteral('Set Value')))); $anchorSetCellValue->setEvent('onclick', $aRequests['setcellvalue']); $aPropertyOptions = array(new clsOption(array('attributes' => array('value' => 'style.backgroundColor'), 'children' => array(new clsLiteral('Background Color')))), new clsOption(array('attributes' => array('value' => 'style.padding'), 'children' => array(new clsLiteral('Padding')))), new clsOption(array('attributes' => array('value' => 'style.border'), 'children' => array(new clsLiteral('Border'))))); $anchorSetCellProperty = new clsAnchor(array('children' => array(new clsLiteral('Set Property')))); $anchorSetCellProperty->setEvent('onclick', $aRequests['setcellproperty']); $anchorSetRowProperty = new clsAnchor(array('children' => array(new clsLiteral('Set Property')))); $anchorSetRowProperty->setEvent('onclick', $aRequests['setrowproperty']); $anchorSetColumnProperty = new clsAnchor(array('children' => array(new clsLiteral('Set Property')))); $anchorSetColumnProperty->setEvent('onclick', $aRequests['setcolumnproperty']); $table = new clsTable(array('children' => array(new clsThead(array('children' => array(new clsTr(array('children' => array(new clsTd(array('children' => array(new clsLiteral('Click or type a row'), new clsBr(), new clsLiteral('that is in the table')))), new clsTd(array('children' => array(new clsLiteral('Click or type a column'), new clsBr(), new clsLiteral('that is in the table')))), new clsTd(array('children' => array(new clsLiteral('Select a row and column'), new clsBr(), new clsLiteral('then enter a value')))), new clsTd(array('children' => array(new clsLiteral('Select a row and column'), new clsBr(), new clsLiteral('then select a property and value')))), new clsTd(array('children' => array(new clsLiteral('Select a row'), new clsBr(), new clsLiteral('then select a property and value')))), new clsTd(array('children' => array(new clsLiteral('Select a column'), new clsBr(), new clsLiteral('then select a property and value')))))))))), new clsTbody(array('children' => array(new clsTr(array('children' => array(new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsInput(array('attributes' => array('id' => 'RowNumber', 'name' => 'RowNumber', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorRemoveRow, new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorReplaceRow, new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorInsertRow, new clsBr(), new clsBr()))), new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsInput(array('attributes' => array('id' => 'ColumnNumber', 'name' => 'ColumnNumber', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorRemoveColumn, new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorReplaceColumn, new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorInsertColumn, new clsBr(), new clsBr()))), new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsInput(array('attributes' => array('id' => 'Value', 'name' => 'Value', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorSetCellValue, new clsBr(), new clsBr()))), new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsSelect(array('attributes' => array('id' => 'Property', 'name' => 'Property'), 'children' => array(new clsOption(array('attributes' => array('value' => 'style.backgroundColor'), 'children' => array(new clsLiteral('Background Color')))), new clsOption(array('attributes' => array('value' => 'style.padding'), 'children' => array(new clsLiteral('Padding')))), new clsOption(array('attributes' => array('value' => 'style.border'), 'children' => array(new clsLiteral('Border'))))))), new clsBr(), new clsInput(array('attributes' => array('id' => 'PropertyValue', 'name' => 'PropertyValue', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorSetCellProperty, new clsBr(), new clsBr()))), new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsSelect(array('attributes' => array('id' => 'RowProperty', 'name' => 'RowProperty'), 'children' => $aPropertyOptions)), new clsBr(), new clsInput(array('attributes' => array('id' => 'RowPropertyValue', 'name' => 'RowPropertyValue', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorSetRowProperty, new clsBr(), new clsBr()))), new clsTd(array('attributes' => array('valign' => 'top'), 'children' => array(new clsSelect(array('attributes' => array('id' => 'ColumnProperty', 'name' => 'ColumnProperty'), 'children' => $aPropertyOptions)), new clsBr(), new clsInput(array('attributes' => array('id' => 'ColumnPropertyValue', 'name' => 'ColumnPropertyValue', 'type' => 'text'))), new clsBr(), $litSpaceBar, new clsBr(), $litPlusSpace, $anchorSetColumnProperty, new clsBr(), new clsBr()))))))))), new clsTfoot(array('children' => array(new clsTr(array('children' => array(new clsTd(array('attributes' => array('colspan' => 6), 'children' => array(new clsLiteral('The table will appear below...'))))))))))))); ob_start(); ?> <style> table { border: 1px solid #8888aa; } thead { background: #EDF3FF; } tbody { } tbody td { font-size:11px; }
$mediumDelay_Async = new clsAnchor(); $mediumDelay_Async->setAttribute('href', '#log'); $mediumDelay_Async->addChild(new clsLiteral("Medium Delay (Async)")); $mediumDelay_Async->setEvent('onclick', $aRequests['mediumdelay'], array(array(0, XAJAX_JS_VALUE, '[1,2,3,3]'))); $longDelay_Async = new clsAnchor(); $longDelay_Async->addChild(new clsLiteral("Long Delay (Async)")); $longDelay_Async->setEvent('onclick', $aRequests['longdelay']); $shortDelay_Sync = new clsAnchor(); $shortDelay_Sync->addChild(new clsLiteral("Short Delay (Sync)")); $shortDelay_Sync->setEvent('onclick', $aRequests['shortdelays'], array(), 'var oRet = ', '; xajax.$("log").innerHTML += "Function returned: " + oRet + "<br />"; return false;'); $mediumDelay_Sync = new clsAnchor(); $mediumDelay_Sync->addChild(new clsLiteral("Medium Delay (Sync)")); $mediumDelay_Sync->setEvent('onclick', $aRequests['mediumdelays'], array(), 'var oRet = ', '; xajax.$("log").innerHTML += "Function returned: " + oRet + "<br />"; return false;'); $longDelay_Sync = new clsAnchor(); $longDelay_Sync->addChild(new clsLiteral("Long Delay (Sync)")); $longDelay_Sync->setEvent('onclick', $aRequests['longdelays'], array(), 'var oRet = ', '; xajax.$("log").innerHTML += "Function returned: " + oRet + "<br />"; return false;'); echo '<' . '?' . 'xml encoding=' . $xajax->getConfiguration('characterEncoding') . ' ?' . '>'; ob_start(); ?> <script type='text/javascript' defer charset='UTF-8'> /* <![CDATA[ */ clearCheckboxes = function() { var checkboxes = document.getElementsByTagName('INPUT'); var cLen = checkboxes.length; for (var c = 0; c < cLen; ++c) if ('checkbox' == checkboxes[c].type) checkboxes[c].checked = ''; } clearLog = function() { xajax.$('log').innerHTML = '';
$divColor->addChild($aSASB_Blue); $divColor->addChild($litNonBreakSpace); $aSASB_White = new clsAnchor(); $aSASB_White->setEvent('onclick', $aRequests['sendassignstylebackground'], array(array(0, XAJAX_QUOTED_VALUE, '#ffffff'))); $aSASB_White->addChild(new clsLiteral('White')); $divColor->addChild($aSASB_White); $divColor->addChild($litNonBreakSpace); $divStyle->addChild($divColor); $divPage->addChild($divStyle); $divOuterHTML = new clsDiv(); $aSAOH = new clsAnchor(); $aSAOH->setEvent('onclick', $aRequests['sendassignouterhtml']); $aSAOH->addChild(new clsLiteral('Test an update using the outerHTML property.')); $divOuterHTML->addChild($aSAOH); $divPage->addChild($divOuterHTML); $divInnerHTML = new clsDiv(); $aSPIH = new clsAnchor(); $aSPIH->setEvent('onclick', $aRequests['sendappendinnerhtml']); $aSPIH->addChild(new clsLiteral('Test an append using the innerHTML property.')); $divInnerHTML->addChild($aSPIH); $divPage->addChild($divInnerHTML); $divContent = new clsDiv(array('attributes' => array('id' => 'content'), 'children' => array(new clsLiteral('This content has not been modified, click an option above to execute a test.')))); $divPage->addChild($divContent); $objTestScriptPlugin->printHeader($xajax, "xajax Test Suite - Assign / Append", ob_get_clean()); ob_start(); $divPage->printHTML(); $objTestScriptPlugin->printControlPanel(ob_get_clean()); $objTestScriptPlugin->printStatusPanel(); $objTestScriptPlugin->printLogPanel(); $objTestScriptPlugin->printDescriptionPanel(''); $objTestScriptPlugin->printFooter();