It may not be the prettiest, but you could come up with a utility method
that encodes all of those parameters into one string so that you ultimately
have one parameter that represents them all.  Then you could even create a
subclass of PageParameters that knows to look up the parameter in that
string if the parameter isn't there by the default lookup.  Sorr y- I don't
think that description was very good - let me give a pseudo-code example of
what I'm thinking....

Where ever you currently create your page parameters:
PageParameters params = new PageParameters();
params.add( "category", "12" );
params.add( "brand", "11" );

Change it to something like:
StringBuffer sb = new StringBuffer();
sb.append("category").append(":").append("12").append("|");
sb.append("brand").append(":").append("11").append("|");
PageParameters params = new PageParameters();
params.add("data", sb.toString());

Okay, just looked - you can't subclass PageParameters - it's final.  So, I
suppose you could use a utility method like:

String brand = MyUtility.getParameter(params, "brand");
    MyUtility {

        String getParameter(PageParameters params, String key) {
            String val = params.get(key);
            if (val == null) {
                String data = params.get("data");
                val = getFromEncodedString(data, key);
            }
        }

        String getFromEncodedString(String data, String key) {
            String[] pieces = data.split("|");
            for (String piece : pieces) {
                if (piece.beginsWith(key)) {
                    String[] keyVal = piece.split(":");
                    return keyVal[1];
                }
            }
        }
    }


DISCLAIMER - obviously this code does a lot of unsafe things.  It is just to
show one idea that I had for handling your situation.  You could take it and
modify it to work for you, or it may give you another idea.  The primary
piece of this idea is that you encode all of your parameters into one
parameter that stores the data in the order that you need it since order
matters to you.

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Fri, Aug 15, 2008 at 3:12 PM, Mathias P.W Nilsson
<[EMAIL PROTECTED]>wrote:

>
> I have already solved this using wicket ultimate stateful WebFramework.
>
> Customer requires that the site must be google friendly.
> --
> View this message in context:
> http://www.nabble.com/PageParameter-question-tp18999929p19004831.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]
>
>

Reply via email to