so now that ive looked at ipagefactory what you want should be pretty easy
if you still want to use pages
mount a MyFactoryPage onto the /mountpointurl using indexedurlcodingstrategy
then in ipagefactory do this:
Page newPage(final Class<? extends Page> pageClass, final PageParameters
parameters) {
if (pageClass.equals(MyFactoryPage.class)) {
// we hit our marker factory page
String url=buildurlfromparameters(params);
String resolvedpageclass=resolveclassfromurl(url);
PageParameters resolvedparams=resolveparamsfromurl(url);
return super.newPage(resolvedpageclass, resolvedparams);
} else { return super.newPage(pageClass, parameters); }
}
MyFactoryPage is just an empty page, it really only serves as a marker for
when you hit that mount point.
makes sense?
-igor
On 3/1/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
the niceset woiuld be to use panels instead of pages. that way you mount a
page onto /mountpoint, when its hit you read the rest of the parameters,
query the db for the panel class, instantiate it and add it to the page.
nice and clean. there is really very little difference between page and
panel functionality-wise.
i dont have the code infront of me, but i would think this should be
doable within the pagemap factory
-igor
On 3/1/07, Mats Norén < [EMAIL PROTECTED]> wrote:
>
> Hi,
> I'm looking for a pattern to create page instances from a configuration
> in db.
> I sounds really weird but the scenario is this:
>
> - A request comes in for /mountpoint/dynamicpart1/part2/part3
> - A lookup is made to db for a PageConfig with urlPart =
> dynamicpart1/part2/part3
> PageConfig contains a className and 1 or more params where the
> mandatory param is the id for the modelObject for the page.
>
> - Use reflection to find a corresponding page in the class hierarchy.
> - Instantiate.
> - Let wicket render it...
>
> I've looked at the IPageFactory but that seems to late in the
> processing because the page class is already determined.
>
> I guess some kind of urldecoding strategy is needed but I don't know
> the internals of wickets processing parts that well.
>
> Would appreciate any pointers to where to look!
>
> /Mats
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user