I believe the code that causes the problem is

#
        @Override
#
        protected CharSequence getURL()
#
        {
#
                return super.getURL() +
String.format("&TB_iframe=true&height=%d&width=%d&modal=false", getHeight(),
getWidth());
#
        }

IFAIK wicket encodes URL parameters in a special form. And the last part is
the number of "../" required for prepending the resource urls. In your app
it might be zero so wicket do not generate appropriate "../../.." for your
"app/shop/rozkovec" mount string.


Vit Rozkovec wrote:
> 
> Hallo,
> I came across strange problem I do not know whether it is mine fault or
> wicket's problem.
> 
> On a page, there is a widget, which list news records.
> Each record has an edit and delete link. Edit link opens new dialog in
> jquery's thickbox window, which is practically IFrame.
> 
> The code for page, which holds form and which is displayed in the thickbox
> window:
> http://pastebin.com/m5ca60e78
> 
> The code for a link, which shows the thickbox window with a page in it:
> http://pastebin.com/m6339b3a
> 
> En example usage:
> http://pastebin.com/m768350aa
> here on line 72 when I do:
> target.addComponent(ShopNewsWidgetPanel.this.get("news-container"));
> 
> after ajax refresh of the component, which contains news records, each
> record containing edit link, there is 404 error found in the Ajax debug
> window.
> From firebug console I can find out that if I add a some component (here
> it is edit link, which is held by news-container), which also contains
> AbstractDefaultAjaxBehavior, then upon rendering head of the response,
> there is wrong path to wicket ajax resources:
> 
> Correct path:
> http://localhost:8080/cz.madewithlove/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
> 
> Wrong path after ajax call:
> http://localhost:8080/cz.madewithlove/app/shop/rozkovec/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
> 
> The page is mounted like so:
> mount(new IndexedHybridUrlCodingStrategy("shop", ShopModulePage.class));
> 
> An ajax function, which is called in the page's ajax button onSubmit()
> method:
> 
> function thickbox_window_close(url)
> {
>    tb_remove(); //removes thickbox window
> 
>    // call url of the behavior, this behavior is attached to the link,
> which opens the page in thickbox window
>    var wcall=wicketAjaxGet(url, null, null, function() {return true;});
> 
>    return !wcall;
> }
> 
> I could solve it by visiting all components of the parent container except
> behaviors and add them to the ajax request target, but it would be better
> to not bother about it and just add the parent container. Any pointers?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wrong-path-to-wicket-event.js-resulting-in-404-after-calling-wicket-from-javascript-tp25678997p25681934.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to