Location: PHPKode > projects > PHPfaces - User Interface Framework > demo/article_browser/BrowserEvents.class.php
<?php

class ButAddEvent extends PActionEvent {

	function actionPerformed($ui, $form, $component) {
		$tblArticles = $form->getComponent('tblArticles');
		$txtArticle = $form->getComponent('txtArticle');
		$txtDescr = $form->getComponent('txtDescr');
		$txtPrice = $form->getComponent('txtPrice');
		$cbColor = $form->getComponent('cbColor');
		
		$tblArticles->addRow(array($txtArticle->getText(), $txtDescr->getText(), $txtPrice->getText(), $cbColor->getValue($cbColor->getSelectionIndex())));

        $explorer = $form->getComponent('explorer');
        $node1 = $explorer->getChildNode('node1');

        $n1 = new PTreeNode($txtArticle->getText(), $txtArticle->getText());

        $n1->addNode(new PTreeNode('node_'.$txtDescr->getText(), 'Descr: '.$txtDescr->getText()));
        $n1->addNode(new PTreeNode('node_'.$txtPrice->getText(), 'Price: '.$txtPrice->getText()));
        $n1->addNode(new PTreeNode('node_'.$cbColor->getValue($cbColor->getSelectionIndex()), 'Color: '.$cbColor->getValue($cbColor->getSelectionIndex())));

        $node1->addNode($n1);
	}

	function getFile() {
		return __FILE__;
	}

}

?>
Return current item: PHPfaces - User Interface Framework