You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Sotil Bertanzetti, Matteo" <ms...@gencat.cat> on 2011/09/02 10:27:21 UTC

Reference to css outside classpath on wicket 1.5RC7

Hello.
 
I'm tying to migrate a project from wicket 1.4.18 to 1.5rc7.
I have a problem trying to add css and javascript links to my html code;
css and javascript files are located outside classpath (outside
WEB-INF). 
 
 
In wicket 1.4.18 I do:
 
add(CSSPackageResource.getHeaderContribution("css/main.css"));
 
and in html appears a relative css link like this:
 
        <link rel="stylesheet" type="text/css" href="../../css/main.css
<view-source:http://10.128.28.213:8000/plash/css/main.css> " />
 
wich is correct.
 
 
I want to do the same in wicket 1.5. I try
 
    @Override
    public void renderHead(final IHeaderResponse aResponse) {
        super.renderHead(aResponse);
 
aResponse.renderCSSReference(RequestCycle.get().getUrlRenderer().renderC
ontextRelativeUrl("css/main.css"));
    }
 
It works in some url, but in others it puts too much .. to the url; in
the same example I wrote before, now writes:
 
        <link rel="stylesheet" type="text/css"
href="../../../css/main.css <view-source:http://localhost/css/main.css>
" />
 
Debugging I see that
RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("css/main.c
ss")returns the correct url, but function renderCSSReference adds more
.. to the url. More precisely, it's in line 231 of
org.apache.wicket.request.UrlRenderer, called from renderCSSReference,
where extra .. are added.
 
I'm using:
 
Wicket 1.5RC7
Windows xp
Jdk 1.5
Weblogic 9.2
 
Please help.
 
Matteo Sotil

Ultra strange behaviour AjaxButton - Form

Posted by ma...@mail.bg.
 


Hello, guys, 


I'm experiencing some very strange problem - an AjaxButton's onSubmit never
gets called. 


Here are snippets of what I have: 


HTML: 


... some fields...


in code: 


Form form = new Form("form"); 


AjaxButton submitButton = new AjaxButton("submit") { 


public void onSubmit(ART target, Form form) { 


System.out.println("clicked"); // never printed


... some logic ...  


} 


}; 


form.add(submitButton); 


add(form); 


The above statement and logic are never reached.
The Ajax debugger prints nothing. 


Any help is appreciated. 


Thanks,
Martin  

-------------------------------------
Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други.

Re: Javascript does not detect components loaded upon panel replacement

Posted by ma...@mail.bg.


Thanks, fixed it. 


----- Цитат от Igor Vaynberg (igor.vaynberg@gmail.com), на
02.09.2011 в 18:20 -----   google "jquery live"


-igor


On Fri, Sep 2, 2011 at 2:02 AM,  wrote:


Hello guys,


I've got the following issue. I have a main page that declares in its
markup . Once I replace an existing panel with another one, some JQuery
within the file scripts.js cannot detect markup that come with the new
panel and therefore does not call them. It acts just like that markup is
not present in DOM.


Would you please assist?


Thanks,
Martin


-------------------------------------
Mail.bg: Безплатен e-mail адрес. Най-добрите
характеристики на българския пазар - 10 GB
пощенска кутия, 20 MB прикрепен файл,
безплатен POP3, мобилна версия, SMS
известяване и други.   
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


 

-------------------------------------
Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други.

Re: Javascript does not detect components loaded upon panel replacement

Posted by Igor Vaynberg <ig...@gmail.com>.
google "jquery live"

-igor

On Fri, Sep 2, 2011 at 2:02 AM,  <ma...@mail.bg> wrote:
>
>
>
> Hello guys,
>
>
> I've got the following issue. I have a main page that declares in its
> markup . Once I replace an existing panel with another one, some JQuery
> within the file scripts.js cannot detect markup that come with the new
> panel and therefore does not call them. It acts just like that markup is
> not present in DOM.
>
>
> Would you please assist?
>
>
> Thanks,
> Martin
>
> -------------------------------------
> Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други.

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


Javascript does not detect components loaded upon panel replacement

Posted by ma...@mail.bg.


Hello guys, 


I've got the following issue. I have a main page that declares in its
markup . Once I replace an existing panel with another one, some JQuery
within the file scripts.js cannot detect markup that come with the new
panel and therefore does not call them. It acts just like that markup is
not present in DOM. 


Would you please assist? 


Thanks,
Martin 

-------------------------------------
Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други.

RE: Reference to css outside classpath on wicket 1.5RC7

Posted by "Sotil Bertanzetti, Matteo" <ms...@gencat.cat>.
Thank you, it worked.

I'll try to create a quickstart...

Matteo Sotil

-----Mensaje original-----
De: Martin Grigorov [mailto:mgrigorov@apache.org] 
Enviado el: viernes, 02 de septiembre de 2011 10:37
Para: users@wicket.apache.org
Asunto: Re: Reference to css outside classpath on wicket 1.5RC7

Quick solution for your case:
Implement a new ResourceReference which returns
org.apache.wicket.request.resource.ContextRelativeResource in its
#getResource().
I think we should add such ResourceReference in wicket-core.

I am not sure at the moment what's the problem with the wrongly
produced Url with your approach.
Please create a quickstart and attach it to a ticket.

On Fri, Sep 2, 2011 at 10:27 AM, Sotil Bertanzetti, Matteo
<ms...@gencat.cat> wrote:
> Hello.
>
> I'm tying to migrate a project from wicket 1.4.18 to 1.5rc7.
> I have a problem trying to add css and javascript links to my html code;
> css and javascript files are located outside classpath (outside
> WEB-INF).
>
>
> In wicket 1.4.18 I do:
>
> add(CSSPackageResource.getHeaderContribution("css/main.css"));
>
> and in html appears a relative css link like this:
>
>        <link rel="stylesheet" type="text/css" href="../../css/main.css
> <view-source:http://10.128.28.213:8000/plash/css/main.css> " />
>
> wich is correct.
>
>
> I want to do the same in wicket 1.5. I try
>
>    @Override
>    public void renderHead(final IHeaderResponse aResponse) {
>        super.renderHead(aResponse);
>
> aResponse.renderCSSReference(RequestCycle.get().getUrlRenderer().renderC
> ontextRelativeUrl("css/main.css"));
>    }
>
> It works in some url, but in others it puts too much .. to the url; in
> the same example I wrote before, now writes:
>
>        <link rel="stylesheet" type="text/css"
> href="../../../css/main.css <view-source:http://localhost/css/main.css>
> " />
>
> Debugging I see that
> RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("css/main.c
> ss")returns the correct url, but function renderCSSReference adds more
> .. to the url. More precisely, it's in line 231 of
> org.apache.wicket.request.UrlRenderer, called from renderCSSReference,
> where extra .. are added.
>
> I'm using:
>
> Wicket 1.5RC7
> Windows xp
> Jdk 1.5
> Weblogic 9.2
>
> Please help.
>
> Matteo Sotil
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Reference to css outside classpath on wicket 1.5RC7

Posted by Martin Grigorov <mg...@apache.org>.
Quick solution for your case:
Implement a new ResourceReference which returns
org.apache.wicket.request.resource.ContextRelativeResource in its
#getResource().
I think we should add such ResourceReference in wicket-core.

I am not sure at the moment what's the problem with the wrongly
produced Url with your approach.
Please create a quickstart and attach it to a ticket.

On Fri, Sep 2, 2011 at 10:27 AM, Sotil Bertanzetti, Matteo
<ms...@gencat.cat> wrote:
> Hello.
>
> I'm tying to migrate a project from wicket 1.4.18 to 1.5rc7.
> I have a problem trying to add css and javascript links to my html code;
> css and javascript files are located outside classpath (outside
> WEB-INF).
>
>
> In wicket 1.4.18 I do:
>
> add(CSSPackageResource.getHeaderContribution("css/main.css"));
>
> and in html appears a relative css link like this:
>
>        <link rel="stylesheet" type="text/css" href="../../css/main.css
> <view-source:http://10.128.28.213:8000/plash/css/main.css> " />
>
> wich is correct.
>
>
> I want to do the same in wicket 1.5. I try
>
>    @Override
>    public void renderHead(final IHeaderResponse aResponse) {
>        super.renderHead(aResponse);
>
> aResponse.renderCSSReference(RequestCycle.get().getUrlRenderer().renderC
> ontextRelativeUrl("css/main.css"));
>    }
>
> It works in some url, but in others it puts too much .. to the url; in
> the same example I wrote before, now writes:
>
>        <link rel="stylesheet" type="text/css"
> href="../../../css/main.css <view-source:http://localhost/css/main.css>
> " />
>
> Debugging I see that
> RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("css/main.c
> ss")returns the correct url, but function renderCSSReference adds more
> .. to the url. More precisely, it's in line 231 of
> org.apache.wicket.request.UrlRenderer, called from renderCSSReference,
> where extra .. are added.
>
> I'm using:
>
> Wicket 1.5RC7
> Windows xp
> Jdk 1.5
> Weblogic 9.2
>
> Please help.
>
> Matteo Sotil
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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