public function renderView($webpageName, $form = "", $rule = "", $params = null, $hist = "")
    {
        /* @var $webpage \Openbizx\Easy\WebPage */
        if ($webpageName == "__DynPopup") {
            $webpage = Openbizx::getWebpageObject($webpageName);
            return $webpage->render();
        }        
        $this->setCurrentViewName($webpageName);
        $webpage = Openbizx::getWebpageObject($webpageName);
        if (!$webpage) {
            return '';
        }
        
        $viewSet = $webpage->getViewSet();
        $this->setCurrentViewSet($viewSet);        
        $this->getSessionContext()->clearSessionObjects(true);

        if ($hist == "N") { // clean view history
            $webpage->cleanViewHistory();
        }
        if ($form != "" && $rule != "") {
            $webpage->processRule($form, $rule, TRUE);
        }
        if ($params) {
            $webpage->setParameters($params);
        }
        if (isset($_GET['mode'])) {   // can specify mode of form
            $webpage->setFormMode($form, $_GET['mode']);
        }
        return $webpage->render();
    }