Hi All,

I have something strange going on with my forms, they seem to
misbehave and i don't know if its my code, or something with forms.

The strange thing is, if i get Turbogears to reload anything by adding
a comment to a file, i can visit the page and the form works again.
but the forms vanish again.

The following is a form rendered correctly:
http://prontoapps.com/images/formItemShowing.png

The following is the form if the page is refreshed, or visited from
another browser tab/machine:
http://prontoapps.com/images/formItemsVanish.png

The application does not have a DB, and is designed to manipulate
files on the filesystem.

Looking forward to someone shedding light on this.

Regards

Charles

======

The following is the root controller:
=================
# -*- coding: utf-8 -*-
"""Main Controller"""

from tg import expose, flash, require, url, request, redirect
from pylons.i18n import ugettext as _, lazy_ugettext as l_
from tg import tmpl_context, redirect, validate

from webdeploy.lib.base import BaseController
from webdeploy.model import DBSession, metadata
from webdeploy.controllers.error import ErrorController
from webdeploy.lib.mylibs import getMywebInstalledVersions as
getVersions
from webdeploy.lib.mylibs import checkIfRunning as checkIfRunning

from webdeploy.lib.applicationControlForm import
create_applicationControlForm

import os

__all__ = ['RootController']


class RootController(BaseController):
    """
    The root controller for the webdeploy application.

    All the other controllers and WSGI applications should be mounted
on this
    controller. For example::

        panel = ControlPanelController()
        another_app = AnotherWSGIApplication()

    Keep in mind that WSGI applications shouldn't be mounted directly:
They
    must be wrapped around
with :class:`tg.controllers.WSGIAppController`.

    """

    error = ErrorController()

    @expose('webdeploy.templates.index')
    def index(self):
        """Handle the front-page."""
        myweb_home = os.getenv("MYWEB_HOME")
        return dict(page='index', versions=getVersions(myweb_home),
appStatus=checkIfRunning())


    @expose('webdeploy.templates.applicationControl')
    def applicationControl(self, **kw):
        """Handle the 'applicationControl' page."""
        tmpl_context.form = create_applicationControlForm
        return dict(page='applicationControl',
control_options='controlApplicationOptions',
control_actions='controlAction')

    @validate(create_applicationControlForm)
    @expose()
    def executeForm(self, **kw):
        """Handle the 'applicationControl' page."""
        tmpl_context.form = create_applicationControlForm
        redirect("index")


The following is my form code:
============
# -*- coding: utf-8 -*-

from tw.api import WidgetsList
from tw.forms import TableForm, SingleSelectField, TextField,
TextArea, Spacer, Label
from tw.forms.validators import Int, NotEmpty, DateConverter
from webdeploy.lib.mylibs import getExecutables as getExecutables


class applicationControlForm(TableForm):

    class fields(WidgetsList):
        installDict = getExecutables()
        applicationList = []
        hover_help = True
        for each in installDict:
            if each == "DMT" :
                pass
            else :
                applicationList.append(each)
        controlApplicationOptions = enumerate((applicationList))
        controlApplication = SingleSelectField('Application',
options=controlApplicationOptions, help_text = 'Please select the
Application to control.')

        controlActionOptions = enumerate(('start', 'stop'))
        controlAction = SingleSelectField
(options=controlActionOptions)

create_applicationControlForm = applicationControlForm
("create_applicationControlForm", action='executeForm')

================
Environment info:
# paster --versionPasteScript 1.7.3 from /home/nowplus/apps/mywebapp/
lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg (python 2.6.2
(r262:71600, Aug 11 2009, 07:00:48))

TurboGears2 Complete Version Information
========================================

TurboGears2 requires:

  * setuptools 0.6c11
  * Paste 1.7.2
  * Pygments 1.0
  * WebError 0.10.1
  * FormEncode 1.2.1
  * repoze.who 1.0.15
  * PasteScript 1.7.3
  * BytecodeAssembler 0.3
  * TurboGears2 2.0.3
  * PasteDeploy 1.3.3
  * Routes 1.10.3
  * nose 0.10.4
  * Tempita 0.2
  * AddOns 0.6
  * WebFlash 0.1a9
  * transaction 1.0a1
  * DecoratorTools 1.7
  * repoze.what 1.0.8
  * prioritized-methods 0.2.1
  * TurboJson 1.2.1
  * SymbolType 1.0
  * PEAK-Rules 0.5a1.dev-r2582
  * WebOb 0.9.6.1
  * repoze.who-testutil 1.0rc1
  * decorator 3.0.0
  * Genshi 0.5.1
  * Extremes 1.1
  * Beaker 1.3
  * WebHelpers 0.6.4
  * Pylons 0.9.7
  * repoze.what-pylons 1.0rc3
  * zope.interface 3.4.1
  * simplejson 2.0.8
  * WebTest 1.1
  * Mako 0.2.4
  * ToscaWidgets 0.9.8
  * repoze.tm2 1.0a4

TurboGears2 Commands

  * migrate (tg.devtools 2.0.2)
  * quickstart (tg.devtools 2.0.2)
  * shell (TurboGears2 2.0.3)
  * serve (TurboGears2 2.0.3)

Widget Packages

  * widgets (ToscaWidgets 0.9.8)
  * resources (ToscaWidgets 0.9.8)
  * widgets (tw.forms 0.9.8)
  * samples (tw.forms 0.9.8)

TurboGears2 Templates

  * turbogears2 (tg.devtools 2.0.2)

Toolbox2 Gadgets


Template Engines

  * json (TurboJson 1.2.1)
  * genshi-markup (Genshi 0.5.1)
  * genshi-text (Genshi 0.5.1)
  * genshi (Genshi 0.5.1)
  * pylonsmyghty (Pylons 0.9.7)
  * mako (Mako 0.2.4)
  * toscawidgets (ToscaWidgets 0.9.8)

Available Widgets:


  * ToscaWidgets 0.9.8:
    - AggregatedCSSLink
    - AggregatedJSLink
    - CSSLink
    - CSSMixin
    - CSSSource
    - Child
    - EngineException
    - EngineManager
    - HostFramework
    - IECSSLink
    - IECSSSource
    - IEJSLink
    - IEJSSource
    - JSFunctionCalls
    - JSLink
    - JSMixin
    - JSSource
    - LRUCache
    - Link
    - OrderedSet
    - Renderable
    - RepeatedWidget
    - RepeatingWidgetBunch
    - RequestLocalDescriptor
    - Resource
    - ServerSideCallbackMixin
    - Source
    - Widget
    - WidgetBunch
    - WidgetException
    - WidgetInitialized
    - WidgetLocked
    - WidgetRepeater
    - WidgetType
    - WidgetUninitialized
    - WidgetUnlocked
    - WidgetsList
    - adapt_value
    - always_allow
    - always_deny
    - asbool
    - base
    - disable_runtime_checks
    - display
    - engine_plugin
    - exceptions
    - inject_resources
    - injector_middleware
    - js
    - js_callback
    - js_function
    - js_symbol
    - lazystring
    - locations
    - make_middleware
    - merge_resources
    - meta
    - middleware
    - registry
    - render
    - resource_injector
    - resources
    - retrieve_resources
    - server
    - serverside_callback
    - util
    - valid_id
    - view

  * ToscaWidgets 0.9.8:
    - AggregatedCSSLink
    - AggregatedJSLink
    - CSSLink
    - CSSMixin
    - CSSSource
    - Child
    - EngineException
    - EngineManager
    - HostFramework
    - IECSSLink
    - IECSSSource
    - IEJSLink
    - IEJSSource
    - JSFunctionCalls
    - JSLink
    - JSMixin
    - JSSource
    - LRUCache
    - Link
    - OrderedSet
    - Renderable
    - RepeatedWidget
    - RepeatingWidgetBunch
    - RequestLocalDescriptor
    - Resource
    - ServerSideCallbackMixin
    - Source
    - Widget
    - WidgetBunch
    - WidgetException
    - WidgetInitialized
    - WidgetLocked
    - WidgetRepeater
    - WidgetType
    - WidgetUninitialized
    - WidgetUnlocked
    - WidgetsList
    - adapt_value
    - always_allow
    - always_deny
    - asbool
    - base
    - disable_runtime_checks
    - display
    - engine_plugin
    - exceptions
    - inject_resources
    - injector_middleware
    - js
    - js_callback
    - js_function
    - js_symbol
    - lazystring
    - locations
    - make_middleware
    - merge_resources
    - meta
    - middleware
    - registry
    - render
    - resource_injector
    - resources
    - retrieve_resources
    - server
    - serverside_callback
    - util
    - valid_id
    - view

  * tw.forms 0.9.8:
    - BooleanRadioButtonList
    - Button
    - CalendarDatePicker
    - CalendarDateTimePicker
    - CheckBox
    - CheckBoxList
    - CheckBoxTable
    - ContainerMixin
    - DataGrid
    - FieldSet
    - FileField
    - Form
    - FormField
    - FormFieldRepeater
    - HiddenField
    - ImageButton
    - InputField
    - InputWidget
    - InputWidgetRepeater
    - Label
    - LabelHiddenField
    - ListFieldSet
    - ListForm
    - ListMixin
    - MultipleSelectField
    - MultipleSelectionMixin
    - PasswordField
    - RadioButton
    - RadioButtonList
    - ResetButton
    - SecureFormMixin
    - SecureTicketField
    - SelectionField
    - SelectionList
    - SingleSelectField
    - SingleSelectionMixin
    - Spacer
    - SubmitButton
    - TableFieldSet
    - TableForm
    - TableMixin
    - TextArea
    - TextField
    - Widget
    - calendar_js
    - calendar_setup
    - calendars
    - core
    - datagrid
    - fields
    - merge_schemas
    - validators

--

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?hl=en.


Reply via email to