Hello People,

I'm learning how to use tg.widgets and I have a question.
I've follow the AutoCompleteField Howto but I couldn't find any way to "put" this AutoCompleteField inside one widgets.TableForm.

All I want is to have a form with some fields, and one of them of AutoCompleteField type.

Thanks a lot.

Mario h.c.t.


On 8/17/06, Ed Singleton <[EMAIL PROTECTED]> wrote:

Unless I'm very, very mistaken, with widgets, you can pass in any
parameters you want, do things with those values, then render them as
html.  What more could you want?

I can't think of anything of the top of my head that you couldn't do
with a widget if you pass in the right parameters.

If you want a widget that has longdescs on a form or such it's very
easy to create your own widget.  I'd be glad to send you some examples
but I've already posted a few to this list (I needed to put
subheadings in at various positions in the form).

As a basic example (untested):

class RatingsPortlet(Widget):
    params = ["item"]

    _javascript_ = [mochikit, JSLink("/static/_javascript_/ratings.js")]

    template = """
    <div class="rating" xmlns:py="http://purl.org/kid/ns#">
        <a href="" item.pageid), 'yes')"><img
src="" class="thumbup"/></a>
        <a href="" 'no')"><img
src="" class="thumbdown"/></a>
    </div>
    """

ratings_portlet = RatingsPortlet()


If you're using TextMate on a Mac I've even written a snippet that
does this for you.

If you have more specific questions about widgets or there is anything
in particular you are struggling with, post them to the list, and
there are loads of people here who can help.

Ed


On 8/17/06, mindlace <[EMAIL PROTECTED]> wrote:
>
> Gentlebeings,
>
> I was excited about the notion of widgets; indeed it was one of the
> primary things that induced me to start developing against the alpha
> release rather than the production release.
>
> Unfortunately, as implemented they're completely useless to me, because
> of accessability issues and the, pages-as-python-code idea that seems
> to be at the center of them.
>
> Accessibility means I have to guarantee that all of the pages I
> generate are accessable. This means that either the widget framework
> has to completely adopt accessability - something that's likely
> impossible - or it has to make it so that I can accessable-ify the
> widgets easily.
>
> To be fair, the widgets go a reasonable length towards being
> accessable, by having label elements and the like. Unfortunately they
> don't include all the accessability niceties, like longdesc attributes,
> the myriad of attributes that make tables accessible, or much in the
> way of ensuring that the JS provides meaningful results to screen
> readers.
>
> I was prepared to deal with this; I figured I'd just modify the widget
> templates appropriately. This is where I started to run into the second
> part of the problem.
>
> The problem, basically stated, is that it is a mistake to generate
> templates in code. The conceit of tg.widgets is that a form or widget
> should be created by some python code that 'fills in' the templates.
> Examples include setting titles, label values and the like via keyword
> arguments to constructor methods.
>
> This makes things difficult for i18n, painful for collaborating with
> designers, and difficult to make accessibility modifications. As a
> simple example, if I need to include a longdesc attribute, I need to
> override the constructor *and* the template, or I need to override the
> template only and provide some other method for filling the attribute,
> which makes it even harder to understand where a bit of generated
> markup is coming from.
>
> In my little world, it seems like widgets should be templates (and yes,
> the *template* should contain js, css, error messages, alternate
> versions, etc) with python helper code, rather than code that generates
> templates. I admit that I won't be able to help much on this end for a
> while, but I wanted to get the idea out there while widgets were not
> quite frozen in their approach.
>
> Thanks for hearing my kvetch,
>
> ~ethan fremen
>
>
> >
>





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to