> Is there a way to use urlFor() or the like to create links 
> that updates the breadcrumb model with our BreadCrumbPanel 
> subclass for the linked id, i.e. 
> IBreadCrumbModel.setActive(new ArticlePanel(...))?

*crickets*

Anyway, I finally found the likely answer in the form of an extended
PageRequestTarget.

However, it seems the call to urlFor() returns a link that does not
invoke the code as expected; it just re-renders the same page and panel
instead of invoking my object. Am I doing something wrong regarding the
urlFor call? Does the request target object need to be registered
somewhere?

        // ...

                CharSequence urlFor = RequestCycle.get().urlFor(new
ChangeArticleRequestTarget(getPage(), token.getLinkData()));


        public static class ChangeArticleRequestTarget extends
PageRequestTarget {

                private String articleId;
                
                public ChangeArticleRequestTarget(Page page, String
articleId) {
                        super(page);
                        this.articleId = articleId;
                }

                @Override
                public void respond(RequestCycle requestCycle) {
                        Page page = getPage();
                        BreadCrumbBar bar = (BreadCrumbBar)
page.get("breadCrumbBar");
                        try {
                                ArticlePanel newPanel = new
ArticlePanel("articlePanel", bar, new
Model<Integer>(Integer.valueOf(articleId)));
                                page.replace(newPanel);
                                bar.setActive(newPanel);
                                page.dirty();
                        }
                        catch (NumberFormatException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                        catch (Exception e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                        
                        super.respond(requestCycle);
                }
                
                
                
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to