trouble rendering widgets
Lukas Renggli
renggli at gmail.com
Fri Aug 19 07:23:16 MEST 2011
Are you correctly implementing #children?
Also you make sure to use #continue:in:on: instead of #visit: (that's
why you get the messed up HTML, your code writes to the wrong
renderer).
Have a look at PRDocument widget to see an example of how to render
other structures within your widgets.
Lukas
On 19 August 2011 00:49, Tudor Girba <tudor at tudorgirba.com> wrote:
> Hi,
>
> 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') greaseString;
> 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" src="/pier?_s=Zp6phh68i9hRHhnB"></div>
> <div class="cyclerItem"><img alt="Two" src="/pier?_s=z2r2BcgQuxMPw_cc"></div>
> </div>
> <img alt="Three" src="/pier?_s=LFE6L8UkDNIyzAdN"></div>
>
>
> What am I doing wrong?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "Some battles are better lost than fought."
>
>
>
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
--
Lukas Renggli
www.lukas-renggli.ch
More information about the smallwiki
mailing list