I have successfully deployed and verified that the behavior still seems to be
in error. I have not actually run the phonebook application but was using it
as a pattern.

Following code shows how link to the edit page is being created.

                        protected void populateItem(final Item item)
                        {
                                User user = (User)item.getModelObject();
                                Link link = new Link("editLink",item.getModel())
                                {
                                        /**
                                         * Go to the Edit page, passing this 
page and the id of the
                                         * Contact involved.
                                         */
                                        public void onClick() {
                                                setResponsePage(new 
EditUserPage(getPage(), getModel()));
                                                //setResponsePage(new 
EditUserPage(new Index(null), getModel()));
                                                
                                        }

                                };      
                                
                                item.add(link); 
                                link.add(new Label("name", user.getName()));  
                                item.add(new Label("role", user.getRole()));
                                item.add(new Label("email", user.getEmail()));
                                
                                item.add(new AttributeModifier("class", true, 
new
AbstractReadOnlyModel()
                                {
                                        public Object getObject() 
                                        {
                                                return (item.getIndex() % 2 == 
1) ? "even" : "odd";
                                        }
                                }));
                                
                        }
                };

Here is the Edit User Page constructor signature:

        public EditUserPage(Page backPage, IModel userModel) {
                this.backPage = backPage;

Here is where the where the links back are generated.

                form.add(new Button("cancel") {
                        public void onSubmit() {
                                String msg = 
getLocalizer().getString("status.cancel", this);
                                getSession().info(msg);
                                setResponsePage(EditUserPage.this.backPage);
                        }
                }.setDefaultFormProcessing(false));

                form.add(new Button("save") {
                        public void onSubmit() {
                                User user = (User) getForm().getModelObject();
                                dao.save(user);

                                String msg = 
MapVariableInterpolator.interpolate(getLocalizer()
                                                .getString("status.save", 
this), new MicroMap("name",
                                                user.getName()));

                                getSession().info(msg);

                                //setResponsePage(EditUserPage.this.backPage);
                                
redirectToInterceptPage(EditUserPage.this.backPage);
                        }
                });
                
                form.add(new Button("delete") {
                        public void onSubmit() {
                                User user = (User) getForm().getModelObject();
                                dao.delete(user.getId());

                                String msg = 
MapVariableInterpolator.interpolate(getLocalizer()
                                                .getString("status.delete", 
this), new MicroMap("name",
                                                user.getName()));

                                getSession().info(msg);

                                //setResponsePage(EditUserPage.this.backPage);
                                
redirectToInterceptPage(EditUserPage.this.backPage);
                        }



                form.add(new Button("cancel") {
                        public void onSubmit() {
                                String msg = 
getLocalizer().getString("status.cancel", this);
                                getSession().info(msg);
                                setResponsePage(EditUserPage.this.backPage);
                        }
                }.setDefaultFormProcessing(false));

                form.add(new Button("save") {
                        public void onSubmit() {
                                User user = (User) getForm().getModelObject();
                                dao.save(user);

                                String msg = 
MapVariableInterpolator.interpolate(getLocalizer()
                                                .getString("status.save", 
this), new MicroMap("name",
                                                user.getName()));

                                getSession().info(msg);

                                //setResponsePage(EditUserPage.this.backPage);
                                
redirectToInterceptPage(EditUserPage.this.backPage);
                        }
                });
                
                form.add(new Button("delete") {
                        public void onSubmit() {
                                User user = (User) getForm().getModelObject();
                                dao.delete(user.getId());

                                String msg = 
MapVariableInterpolator.interpolate(getLocalizer()
                                                .getString("status.delete", 
this), new MicroMap("name",
                                                user.getName()));

                                getSession().info(msg);

                                //setResponsePage(EditUserPage.this.backPage);
                                
redirectToInterceptPage(EditUserPage.this.backPage);
                        }
I tried both redirectToInterceptPage as well as setResponsePage with the
same results.

Hope this info is helpful.


Eelco Hillenius wrote:
> 
> Can you show us some code fragments? How to you set the feedback
> messages and how do you redirect to that other page? Etc. Have you
> been seeing the same thing with the phonebook example?
> 
> Eelco
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Odd-Refresh-Page-Behavior-tf3986136.html#a11336871
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to