Hmm.. I wouldn't use string constants like that... use Class.getName() instead.

**
Martin

2010/5/28 msalman <[email protected]>:
>
> Martin,
>
> Thanks for your response.
>
> I did try ((CastToYourSession) Session.get()) and that part works.  I wanted
> to do something as following:
>
>
> public class MyOwnStreamLocator extends ResourceStreamLocator
> {
>
>        //protected
>
>        protected App app;
>
>
>
>        public MyOwnStreamLocator(App app)
>        {
>                this.app = app;
>        }
>
>
>        public IResourceStream locate(final Class clazz, final String path)
>        {
>                if
> (clazz.getName().compareTo("com.michni.wicket.request.search.specificsupplier.PageSpcificSupplierSearchRequest")==0
> )
>                {
>                        UserSession session = (UserSession)Session.get();
>
>                        Supplier supplier = session.getSpecificSupplier();
>
>                        if (supplier.getId() == 2)
>                        {
>                                String path2 = 
> "PageSpcificSupplierSearchRequest_custom.html";
>
>                                IResourceStream located = super.locate(clazz, 
> trimFolders(path2));
>
>                                if (located != null)
>                                {
>                                        return located;
>                                }
>                        }
>                }
>
>        IResourceStream located = super.locate(clazz, trimFolders(path));
>
>        if (located != null)
>        {
>            return located;
>        }
>        located = super.locate(clazz, path);
>
>        return located;
>    }
>
>
>
> But I have found that the locate method for each Page class is called only
> once and so what ever html file is set for a Page once is used all the time.
>
> Is there a way to set the html file location in the Page class?  So when
> ever that page is constructed the right custom html file is picked.  I have
> a feeling that the key lies in the MarkupStream but I don't know how to use
> it.
>
>
> Thanks.
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/custom-html-page-tp2234086p2234882.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

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

Reply via email to