hi there,

my effort to port ASP.NET event-driven web forms to webware
is proceeding pretty nicely. here a small anticipation of how
the system will work:

# ------------------------------------------------
from formfx.widgets import * #all form widgets
from WebForm import WebForm

class echoForm(WebForm):
    """WebForm demo: the 'echo' form"""

    # 1. define form contents by returning a list of widgets
    def body(self):
        return [Literal('echo'),
                TextBox('quoteBox', size=50, label='Write something'),
                Button('send', 'Send memorable quote')]

    # 2. attach button's onClick event to this form's onSendQuote method
    def onLoad(self):
        self.widgets.send.onClick = self.onSendQuote

    # 3. do whatever you want when onSubmit handler is called...
    def onSendQuote(self, event):
        w = self.widgets #shortcut

        # ...here we set literal's text to textbox's typed text
        w.echo.text = 'You typed "%s"' % w.quoteBox.text

# ------------------------------------------------

screenshot for this prototype is here:
http://www.deelan.com/temp/formfx1.png

wheen you don't specify a cheetah template for the form (like in the above example) a default totally unstyled HTML form will be used.

i hope to have enough time to finalize a stable release in
the next weeks.

later,
deelan









-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to