On 25 Nov, 11:18, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:

> It is difficult to judge from your code-example as it does not display the
> whole two-stage-process, but are you aware that you need to pass around *all*
> form-fields of the first form, using hidden input fields in the second one?
>
> Alternatively, you can use the session of course.
>
> Diez

Well, when I prepared a simpler example last Friday I managed to get
both the static and dynamic SingleSelectFields losing the previous
value at each form sending.

The problem was that I was using numerical values as keys instead of
strings.

Example:

class TestSSF(widgets.WidgetsList):
    numericKeys = widgets.SingleSelectField(label="Numeric Key",\
        options=[("", "Pick one:"), (1, "First"), (2, "Second"),\
            (3, "Third")],\
        validator=validators.NotEmpty())

    textualKeys = widgets.SingleSelectField(label="Textual Key",\
        options=[("", "Pick one:"), ("1", "First"), ("2", "Second"),\
            ("3", "Third")],\
        validator=validators.NotEmpty())

    textArea = widgets.TextField(label="Additional text field",\
        validator=validators.NotEmpty())

formTestSSF = widgets.TableForm(
    name = "test_ssf",
    fields = TestSSF(),
    action = "test_ssf_action"
)

class Root(controllers.RootController):
    @expose(template=".templates.test_ssf")
    def test_ssf(self, tg_errors=None):
        return dict(form=formTestSSF)

    @expose()
    @validate(form=formTestSSF)
    @error_handler(test_ssf)
    def test_ssf_action(self, **data):
        return "Form OK"

test_ssf.kid is the simple <p py:replace="form.display()">.

This form will keep the values from textualKey and textArea but lose
numericKey selected option each time.

Should this behavior be treated as a bug? I mean, by silently
converting numeric keys to strings at widget construction time would
be enough.
--~--~---------~--~----~------------~-------~--~----~
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