First of all, sorry for the late response :)

> Yes, something like that could be more appropriate for Kid. But don't
> you want KidPage to be a subclass of the standard WebKit Page? Then, I
> don't see a need for setup() and teardown() methods since we already
> have awake() and sleep() and you can also use the __init__ method.

I agree, no more setup or teardown :)

> KidPage could provide additional methods similar to Kid, such as
> load_template(), serialize, generate(), write(), with the difference
> that there should be some caching behind and parameters should
> automagically be set appropriately. For instance, write() would
> automatically call load_template, which in turn would automatically load
> the template MyPage.kid, when MyPage is the current servlet class, and
> it would automatically write output to the HTTP response. But you would
> be also able to use serialize() and filter the output before writing.

I think the servlet should get the template serialized and then write
it to the page stream, maybe by a method writeTemplate, so I can
rewrite this method to filter the output...

I didn't think on many situations where I must catch the output, the
only one is maybe the use of formencode (or another form validator). I
had problems with formencode as to write the errors on the page I must
use something like this:

 <input type="text" name="data"> <form:error name="data">

I thinking in a subclass of KidPage called KidFormPage (or something
like this), this servlet should do exactly what KidPage does except it
catches the page generated and validate the form, if there is some
error, the designer will not refer to ir as <form:error ...>, I can
create a servlet attribute called formError then the user should do:

<input type="text" name="data"> <span py:content="formError.data">the
error message</span>

> Another idea: Maybe, instead of providing a KidPage class, we should
> better provide a KidServlet mixin that adds this Kid Tempalte
> functionality to ordinary Webware servlets?

A mixin? I never worked with mixins, I can check it out...

> Also, it should still be possible to have Kid templates without any
> accompanying Webware class. In this case, the class would be
> automatically asumed to be WebKit.Page, with the respond() replace so
> that it writes the serialized Kid template.

Ok, I agree...
I have some code but it's uncommented, I in a middle of a project this
week and it is taking all my time, I think next week I will restart to
work with KidPage.

Thanks for the reply

-- 
Michel Thadeu Sabchuk
Curitiba - Brasil


_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to