On 19 Aug 2011, at 07:23, Lukas Renggli wrote:
Are you correctly implementing #children?
Yes. But, in this case, there are no children.
Also you make sure to use #continue:in:on: instead of #visit:
why you get the messed up HTML, your code writes to the wrong
Thanks. That seems to solve the problem. I am using:
html rendererInstance withinContentDo: [ html rendererInstance continue: each document in:
self on: html ]
Have a look at PRDocument widget to see an example of how to render
other structures within your widgets.
On 19 August 2011 00:49, Tudor Girba <tudor(a)tudorgirba.com> wrote:
> I have a bit of trouble rendering a widget that aims to embed some other structures.
> Here is the current code:
> renderContentOn: html
> html div
> id: #cycler;
> script: ((html jQuery: #cycler) cycle fx: 'fade'; timeout:
self timeout; delay: self delay; speed: self speed; pager: '#cyclerNav')
> with: [
> self sourceChildren do: [:each |
> html div class: 'cyclerItem'; with: [html
rendererInstance visit: each document] ] ].
> It seems to work fine when sourceChildren contains only PRPages, but when there is a
PRFile inside, it goes strange. For example, if I have three PRFiles in the collection,
the rendering looks like:
> <div id="cycler">
> <div class="cyclerItem"></div>
> <div class="cyclerItem"><img alt="One"
> <div class="cyclerItem"><img alt="Two"
> <img alt="Three"
> What am I doing wrong?
> "Some battles are better lost than fought."
> Magritte, Pier and Related Tools ...
Magritte, Pier and Related Tools ...
"Yesterday is a fact.
Tomorrow is a possibility.
Today is a challenge."