RE: Need Form Help

"Orr, Steve" <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <E418CEC8B5FB3E48B30FA22F092886E7F3AEB9@RNT-BOZ-0201.corp.rightnow.com>
Regarding...
>>  In the base quixote.form.Form class there's an annoying line in the 
>> _render_finish() method...
>>      r += htmltext('</form><br class="quixoteform" />')
>>
>>  This creates an HTML break. So I subclassed Form and overwrote the 
>> method. I shouldn't have to do that for mere formatting should I? 

> You can just add a css rule to not show this element. Or you can just 
> call not call _render_finish()

How would one "add a css rule to not show this element?" 
I did the following but it creates formatting problems within an HTML table. 
br.quixoteform { clear: both; line-height 0; display: none; }

I want to use the _render_finish() method in the base quixote.form.Form class. It's my contention that I shouldn't have to over-ride a base class to merely avoid <BR /> tags. To me the <BR /> tags should NOT be there in the first place as this is an unnecessary inter-mixing of presentation HTML code and logic code. What do you think?
 


-----Original Message-----
From: Mario Ruggier [mailto:[email protected]] 
Sent: Thursday, July 21, 2005 4:51 PM
To: Orr, Steve
Cc: [email protected]
Subject: Re: [Quixote-users] Need Form Help

On Jul 21, 2005, at 10:22 PM, Orr, Steve wrote:

> THANKS!!! This was very helpful. After a little work I was able to get 
> something working.
>
>  In the base quixote.form.Form class there's an annoying line in the 
> _render_finish() method...
>      r += htmltext('</form><br class="quixoteform" />')
>
>  This creates an HTML break. So I subclassed Form and overwrote the 
> method. I shouldn't have to do that for mere formatting should I? I 
> found no such "quixoteform" class in the css.py. Is this a bug?

You can just add a css rule to not show this element. Or you can just 
call not call _render_finish(), but just write it out in your render 
func. There is this wiki entry that may be of interest:
http://www.quixote.ca/qx/CustomFormRendering


>  This brings up another question... Are there some quixote classes 
> which are commonly subclassed to add custom functionality or 
> formatting? Are there any classes which developers routinely subclass? 
> And what's the impact of then having to code against your subclasses 
> versus the base classes?

I typically write my own renderer, as i did in your sample. You may 
need to specify your own _parse().

One thing I find doing at times, because of the way pasre works 
(setting value of widget automatically) is to simply force the value 
directly on the request set request.form['name']. Ugly... any better 
ways to do this simply?

mario
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.