Skip to content

Commit

Permalink
panels are correctly rendered on pages
Browse files Browse the repository at this point in the history
  • Loading branch information
git-trainee committed Oct 18, 2012
1 parent 56ab855 commit bce75ee
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 18 deletions.
11 changes: 0 additions & 11 deletions impl/render/MarkupContainerTagRenderer.php
Expand Up @@ -12,17 +12,6 @@ public function MarkupContainerTagRenderer(ComponentStub $component){
$this->TagRenderer($component);
}

public function renderOpenTag()
{
return "";
}

public function renderCloseTag()
{
return "";
}


public function renderBody(MarkupParser $markupParser)
{
$this->log->debug("rendering body ".$this->component->getId());
Expand Down
1 change: 0 additions & 1 deletion impl/render/TagRenderer.php
Expand Up @@ -65,7 +65,6 @@ public function render(MarkupParser $markupParser){
$content = $this->renderOpenTag();
$content.=$this->renderBody($markupParser);
$content.=$this->renderCloseTag();
$this->log->debug("rendered tag for ".$this->component->getId()." ".$content);
$this->streamWriter->renderToStream($markupParser,$content);

return $markupParser->getTagForComponent($this->component)->htmlOuter();
Expand Down
8 changes: 4 additions & 4 deletions log4pconfig.xml
Expand Up @@ -3,10 +3,10 @@

<appender name="myConsoleAppender" class="LoggerAppenderConsole" />

<appender name="myFileAppender" class="LoggerAppenderFile">
<layout class="LoggerLayoutTTCC" />
<param name="file" value="logs/myLog.out" />
</appender>
<!--<appender name="myFileAppender" class="LoggerAppenderFile">-->
<!--<layout class="LoggerLayoutTTCC" />-->
<!--<param name="file" value="/logs/myLog.out" />-->
<!--</appender>-->


<root>
Expand Down
3 changes: 3 additions & 0 deletions tests/component/page/PageTestPanel.html
@@ -0,0 +1,3 @@
<div>
<span pid="panel-test-id"/>
</div>
15 changes: 15 additions & 0 deletions tests/component/page/PageTestPanel.php
@@ -0,0 +1,15 @@
<?php
/**
* Created by IntelliJ IDEA.
* User: martindilger
* Date: 18.10.12
* Time: 14:55
* To change this template use File | Settings | File Templates.
*/
class PageTestPanel extends Panel
{
public function PageTestPanel($id,$model){
$this->Panel($id,$model);
$this->add(new Label("panel-test-id",new SimpleModel("Panel gets rendered")));
}
}
2 changes: 1 addition & 1 deletion tests/component/page/WebPageTest.html
Expand Up @@ -5,7 +5,7 @@
<body>
<div pid="webpage">
<!--body-->
<div id="test-id" pid="test-id"/>
<span id="test-id" pid="test-id"></span>
<span pid="test-id-2">hallo welt</span>
</div>
</body>
Expand Down
12 changes: 11 additions & 1 deletion tests/component/page/WebPageTest.php
Expand Up @@ -2,6 +2,7 @@
include_once __DIR__ . '/../../BaseTestCase.php';
require_once __DIR__ . '/../../container/SimpleTestPanel.php';
require_once __DIR__ . '/../../util/MarkupTester.php';
require_once __DIR__."/PageTestPanel.php";
/**
* Created by IntelliJ IDEA.
* User: dilgerma
Expand Down Expand Up @@ -62,9 +63,18 @@ public function testRenderWebPageWithDoubleContributions(){
$markupTester->assertTagCount("script",1);
}

public function testRenderPageWithPanel(){
$testWebPage = new TestWebPage("webpage", new SimpleModel(""));
$testWebPage->add(new PageTestPanel("test-id",new SimpleModel("")));

$markupParser = new MarkupParser(MarkupParser::getMarkupNameFromScript(__FILE__));
$testWebPage->render($markupParser);

}

}

class TestWebPage extends WebPage
{

}
}

0 comments on commit bce75ee

Please sign in to comment.