could you check youre case with 1.1beta (when it comes out this weekend?)

I love to know if this could be a problem that is fixed in the current head stream.

You can hold a instance of a page so that you can reuse that and keep the state of that page. it shouldn't matter when you do new Page1() or reuse it. I would love to see and example that
shows this behaviour.

johan

josh lim wrote:
Hi Johan

added the RenderStrategy as :
getApplicationSettings().setRenderStrategy(ApplicationSettings.REDIRECT_TO_RENDER);
and it worked ! makes sense?

Josh

On 7/17/05, josh lim <[EMAIL PROTECTED]> wrote:
Hi Johan,

I took out all checks and always redirectTo(new page1()) and the first
time it renders ok but not the second... just thinking should I
instantiate a new Page1 everytime I reredirectTo?

thanks
Josh

On 7/17/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
are you sure the second time this piece of code works:

 Page nextPage = getNextPage(parameters.getString(SURVEY_PARAM_NAME));

            if ((nextPage != null) && (nextPage.isDMCQ())) {
                log.info("next");
                redirectTo(new Page1(parameters));
            }



Do you really have then also the right parameters?
Do you have the same request parameters as you have when you where at
the first page?
What happens if you just always do:

                redirectTo(new Page1());


No checks (and page1 should be able to work without params then ofcourse)

Where does that request param come from? Is that set to the same thing
as it did the first time?

johan





josh lim wrote:
Hi johan

thanks for the suggestion, I have tried to implement it as your explanation....
However, I face another (related?) problem...

In my Start.checkAccess, I redirect to Page1, Page1 goes to Page3 - so
far so good....

at Page3, onSubmit, I want to go back to Start. where
Start.checkAccess will decide where to go next.... it goes to Page1
again (due to the database information as you have guessed)
BUT Page1 does not render. ... it rendered ok before...

Thanks
Josh

here's the code....

Start.java

public Start(final PageParameters parameters)
    {
          log.info(parameters);
          setPageParameters(parameters); // keep parameters in var, used to
decide where to go , sort of ...
      }

      /* 
--------------------------------------------------------------------------------
     *  Methods
     * 
--------------------------------------------------------------------------------
*/

      protected boolean checkAccess()
      {
          log.info("checkAccess");

          PageParameters parameters = getPageParameters();
          Page nextPage = getNextPage(parameters.getString(SURVEY_PARAM_NAME));

          if ((nextPage != null) && (nextPage.isDMCQ())) {
              log.info("next");
              redirectTo(new Page1(parameters));
          }
            ....// if some other condition, go to Page2 or PageEnd


              return ACCESS_DENIED;
      }



On 7/16/05, Johan Compagner <[EMAIL PROTECTED]> wrote:

I think i have the solution

youre homepage can do redirectTo()
but don't do it in the constructor
do it in checkAccess()
and let checkAccess() return false.

johan


josh lim wrote:

Hi I am new to wicket and have been trying to prototype a simple
application together ...

Here's my problem.

I've basically have 4 WebPage currently. The HomePage is set to
Start.java. This page basically "redirects" or acts as a "branch"
based on some database information.

an example flow would be to:

1) Start -> Page1  -> Page3 -> Start

2) Start -> Page2 -> Start

3) Start -> EndPage

So In the constructor of Start.java, I had used
"redirectToInterceptPage" successfully, but when I return to Start, I
get an error

"Already redirecting to
'/idea/survey?component=4&version=0&interface=IRedirectListener'.
Cannot redirect more than once...." - But the page _does_ load ...

1. Is there a way out of this?
2. should I be doing "redirectToInter..." in the constructor?
3. in Page1 - 3 I use setResponsePage(new nextPage()) - should I reuse
the page rather than instantiate new pages?

any advise?
Thanks
Josh


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to