click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <sab...@gmail.com>
Subject Re: Creating Pages during Postbacks
Date Thu, 01 Nov 2012 05:42:56 GMT
Hi Dennis,

In the postback he form and fields should be created in order to process
and validate the values and persist data. I would assume that if the values
were incorrect you would render the page again to show the error messages.
Only when everything is correct would you redirect to another page.

But to answer your question you could put conditional code around
constructing your controls with either:
http://click.apache.org/docs/click-api/org/apache/click/Context.html#isPost()

or if you want to know if a specific form was submitted you could create
just that form and check:
http://click.apache.org/docs/click-api/org/apache/click/control/Form.html#isFormSubmission()

Hope this helps.

Kind regards

Bob


On Wed, Oct 31, 2012 at 9:31 PM, Dennis M. J. Yerger <
dennisyerger84@hotmail.com> wrote:

>  Those of you who are familiar with Web applications know that a page is
> first requested with a HTTP GET request. If this page contains a form, the
> form is normally submitted back to the same address with a POST request.
> This type of request is called a postback. Postbacks usually result in
> redirects to a new page. But here's the problem. When a Click page is
> requested, it must construct its controls before processing the request.
> But if the request is a postback that results in a redirect, the controls
> on the original page are never rendered, which means they are created for
> nothing. So my question is this: is there a way to get around constructing
> controls during a postback since they will never be rendered?
>

Mime
View raw message