Thank you for your answer Igor.
I did not manage to append the id to the url. I tried something like this:
tabbedPanel = new AjaxTabbedPanel("mytabpanel", tabs) {
@Override
protected WebMarkupContainer newLink(String linkId,
final int index) {
final WebMarkupContainer c = new
IndicatingAjaxLink(linkId) {
@Override
public void onClick(AjaxRequestTarget
target) {
setSelectedTab(index);
if (target != null) {
target.addComponent(MyTabbedPanel.this);
}
onAjaxUpdate(target);
}
};
c.add(new SimpleAttributeModifier("href",
"&itemId=xxx"));
return c;
}
I also tried:
final IModel<String> model = new
AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return "&itemId=xxx";
}
};
add(new AttributeModifier("href", model) {
@Override
protected String newValue(String currentValue,
String
replacementValue) {
return currentValue + replacementValue;
}
});
but in WebRequestCycle, the URL is always without "&itemId=xxx" at the end.
Can you please tell me what am I missing here? Or what should I do to modify
the url generated by ajaxtabpanel?
Thank you,
Marius Anton
igor.vaynberg wrote:
>
> your request cycle has access to the url that caused the page expired
> exception. at that point you cannot know anything else because there
> is no longer a session either.
>
> what you might want to do is append itemid to the urls generated by
> the ajaxtabbedpanel.
>
> -igor
>
> On Wed, Aug 5, 2009 at 1:52 AM, Marius Anton<[email protected]> wrote:
>> Hello everybody,
>>
>> I hope that someone can help me on this.
>>
>> I have a page that displays information about a particular item. On that
>> page there is also an ajax tab panel (from wicket.extensions).
>> For every item, the url looks like this:
>> http://mysite?itemId=xxxx-xxxxx. After the page expires I want the
>> current page to be refreshed.
>>
>> After the page expires, and the user clicks on one of the tabs, a page
>> expired exception is thrown. I have a custom request cycle, witch extends
>> WebRequestCycle, that caches that exception,
>> but the problem is that I can not redirect the user to the same page
>> because there in my request cycle I am not able to see the parameter
>> "itemId". Inside RequstCycle, if I try request.getUrl, I get something
>> like this: mypage?wicket:interface=:5:10:::0:&random=0.8618006417527795.
>>
>> My question is: can I somehow send a parameter(itemId) to the request
>> cycle when a page expired exception is thrown?
>> Or how can I refresh the current page(witch has the itemId as parameter)
>> when the user clicks on an ajax link(in this case a tab)
>> after the page expired?
>>
>> Any sugestion will be apreciated.
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Can-I-send-a-parameter-value-to-RequestCycle--tp24823173p24846158.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]