Monday, March 23, 2009

The render mechanism in Weblocks

Now I'm working on a simple wiki application for weblocks.I create a wiki widget, it show pages in a single place,(Maybe pages should be linked from each other, but it is a simplewiki now, :)). User can click the page, modify its content and submitit.

I used a widget which inherit dataform to reflect page,because dataform has two state, one show content, one is a form which you can modifycontent and submit. I tried it and met a problem, when user click "Modify" link of dataform widget, its state is changed but not its appearance. I think it is beacuse thewiki widget is not rendered. The page widget is stored in the slot of wiki widget,the wiki widget does not konw whether it need be render. so if I put page widgetinto the children of wiki widget?

I keey trying, but it does not work :(. I just got a advantage that parent widgetcan render children widget automatically.

I know I must mark-dirty a widget to let it being render. It is a pity thereis not a hook function in the modify link of dataform widget. I have to modifythe render function of page widget in order to use a accustomed link to replacethe modify link.

It is my surface impression of The render mechanism in Weblocks, :). oh, anotherthing, It seems children widget's render-widget does not call its parents functionautomatically, I need use call-next-method mannully.

1 comment:

  1. I'm having trouble understanding your problem.

    Perhaps it would help to post this to the Weblocks group with some code that shows the issue.

    ReplyDelete