You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniela Valero <da...@gmail.com> on 2010/04/07 00:41:09 UTC

Javascript from panel does not work

Hi everybody

I'm having a problem with my call to javascript from a panel. The problem is
tah javascript does not work (if i call it from a page it works fine)

I'm doing this:

<wicket:head>
    <script language="JavaScript1.2"
src="views/js/jquery-1.3.2.min.js"></script>
    <script language="JavaScript1.2"
src="views/js/ToggleHighLigh.js"></script>
</wicket:head>

<p class="row">Click to toggle</p>
  <p class="row highLightedRow">highlight</p>
  <p class="row">on these</p>
  <p class="row">paragraphs</p


When I click the <p> element it should call ToggleHighLigh.js, and add a css
background.

I tried calling the javascript from Page parent, but it isn't work

What I'm missing?


-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
I tried adding

public void renderHead(IHeaderResponse response) {
        response.renderJavascriptReference("views/js/ToggleHighLigh.js");
        response.renderJavascriptReference("views/js/jquery-1.3.2.min.js");
        }

from IHeaderResponse, but it isn't work

2010/4/6 Daniela Valero <da...@gmail.com>

> Hi everybody
>
> I'm having a problem with my call to javascript from a panel. The problem
> is tah javascript does not work (if i call it from a page it works fine)
>
> I'm doing this:
>
> <wicket:head>
>     <script language="JavaScript1.2"
> src="views/js/jquery-1.3.2.min.js"></script>
>     <script language="JavaScript1.2"
> src="views/js/ToggleHighLigh.js"></script>
> </wicket:head>
>
> <p class="row">Click to toggle</p>
>   <p class="row highLightedRow">highlight</p>
>   <p class="row">on these</p>
>   <p class="row">paragraphs</p
>
>
> When I click the <p> element it should call ToggleHighLigh.js, and add a
> css background.
>
> I tried calling the javascript from Page parent, but it isn't work
>
> What I'm missing?
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
I found the solution

In my  class, I declare this attr:

ResourceReference SHORTCUTS_CSS = new
CompressedResourceReference(New_Policy.class,"/css/style.css");

ResourceReference SHORTCUTS_JAVASCRIPT = new
CompressedResourceReference(New_Policy.class,"/js/jquery-1.3.2.min.js");

ResourceReference SHORTCUTS_JAVASCRIPT2 = new
CompressedResourceReference(New_Policy.class,"/js/ToggleHighLigh.js");


Implement the interfaz: IHeaderConstributor

In its method I ask to render my JS and CSS:

    @Override
    public void renderHead(IHeaderResponse response) {
        response.renderCSSReference(SHORTCUTS_CSS);
        response.renderJavascriptReference(SHORTCUTS_JAVASCRIPT);
        response.renderJavascriptReference(SHORTCUTS_JAVASCRIPT2);
        response.renderOnLoadJavascript("alert('page loaded!');");
    }

And, that's it!!!


The last problem that I have, is, on my DataView, the items are declared
"final", that is the reason because on RunTime, the row does not get
highlighted.

Now I avanced on my app

Thanks for the help every body !!!!



Con eso ya puedo hacer referencia a mis clases felizmente, me funciona el JS
perfectamente, y todo.

Ahora, me di cuenta, que, dentro de mi DataView, no es añadida la clase que
necesito (la que sombrea la fila), porque el item (la fila), en su
populateItem, es trabajado como final (es decir, no modificable).... Total
que ahora me toca inventarme una para hacer funcionar esto en mi tabla (es
por ello que cuando apago el servidor si me funciona la cosa en la tabla)

Se hizo la luz!

-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
Well, i tried everithing-


Finally y do it almost work with

<wicket:link> and JavascriptPackageResource, but now, it works only a few
seconds when the panel is loaded, then it doest not work any more

Here I post one way:

String p1 = "/views/js/ToggleHighLigh.js";
            String p2 =  "/views/js/jquery-1.3.2.min.js";
            String contextPath =
((WebRequest)getRequest()).getHttpServletRequest().getContextPath();
            final String pathToggle = contextPath + p1;
            final String pathJquery = contextPath + p2;

dataView.add(JavascriptPackageResource.getHeaderContribution(pathJquery));

dataView.add(JavascriptPackageResource.getHeaderContribution(pathToggle));

And here the other way

<wicket:head>
 <wicket:link>
 <link href="views/css/style.css" rel="stylesheet" type="text/css" />
<script  type="text/javascript" src="views/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript"" src="views/js/ToggleHighLigh.js"></script>


    <script>
$(function() {
         $('.fieldRow input').focus(function(){
                $(this).parents('.fieldRow').toggleClass("text_field");
         });
});
</script>


     </wicket:link>
</wicket:head>

This is my function

$(document).ready(function(){


    $('.row').click(function(event) {



 $(this).parents('.row').toggleClass("highLightedRow",$(this).hasClass("highLightedRow"));

        alert("welcome to 2");
        if ($(event.target).is('.row')) {
            $(event.target).toggleClass('highlighted');
          }
    });
        });



I check and the JS are being loaded. I put a JS message and it works, but my
JQuery does not work on panels
2010/4/7 Daniela Valero <da...@gmail.com>

> Thanks!!!  Very much !!!
>
>
> I going to check this out now
>
> 2010/4/7 Jeremy Thomerson <je...@wickettraining.com>
>
>> Again, do NOT generate hard-coded URL references.  Please see the very
>> first
>> code line from:
>>
>> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/
>>
>> <
>> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/
>> >Specifically,
>> this line: c.add(HeaderContributor.forJavaScript(MyComponent.class,
>> "myscript.js");
>>
>> NOTE: if you are on 1.4, this class will be deprecated, but the javadoc
>> will
>> point you to the newer class.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Wed, Apr 7, 2010 at 9:07 AM, Daniela Valero
>> <da...@gmail.com>wrote:
>>
>> > I wrote the header constributor, and nothing
>> >
>> >
>> > public void renderHead(IHeaderResponse response) {
>> >        response.renderJavascriptReference("
>> > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js");
>> >        response.renderJavascriptReference("
>> > http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js");
>> >
>> >    }
>> >
>> > 2010/4/7 Daniela Valero <da...@gmail.com>
>> >
>> > > I wrapped my JS on wicket:link, and I wrote the absolute url, like
>> this
>> > >
>> > > <script  language="JavaScript1.2" src="
>> > > http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js
>> "></script>
>> > >
>> > > Now, the files are loaded, I can see it from firebug, but still not
>> > workin
>> > > :
>> > >
>> > >
>> > > 2010/4/7 Jeremy Thomerson <je...@wickettraining.com>
>> > >
>> > > This is what I was trying to tell you.  Please load your resources
>> > >> correctly.  Either use a ResourceReference with a class to create the
>> > URL
>> > >> correctly, or wrap your script tags in <wicket:link> tags.
>> > >>
>> > >> --
>> > >> Jeremy Thomerson
>> > >> http://www.wickettraining.com
>> > >>
>> > >>
>> > >>
>> > >> On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
>> > >> <da...@gmail.com>wrote:
>> > >>
>> > >> > I got on firebug the same message from css file, but it is working
>> > fine.
>> > >> > (it
>> > >> > is being called from Page parent)
>> > >> >
>> > >> > 2010/4/7 Daniela Valero <da...@gmail.com>
>> > >> >
>> > >> > > You are right stefan, the JS file is not being loaded, on firebug
>> i
>> > >> got
>> > >> > >
>> > >> > > Failed to load source for:
>> > >> > > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
>> > >> > >
>> > >> > > but, I tryed to acces directly to that url and I get the js
>> > >> > >
>> > >> > > 2010/4/7 Stefan Lindner <li...@visionet.de>
>> > >> > >
>> > >> > > To make it sure (it's better than just belive it): Take e.g.
>> firefox
>> > >> with
>> > >> > >> fiurebug-plugin. Inspect the head scetion of the page. There go
>> to
>> > >> the
>> > >> > >> <script src=...> tag and expand the tag. IF the js-file is
>> > referenced
>> > >> > >> correctly and if it is loaded then the content should be visible
>> in
>> > >> > firebug.
>> > >> > >> Or place a simple
>> > >> > >>
>> > >> > >>        alert('I am loaded');
>> > >> > >>
>> > >> > >> in your js files.
>> > >> > >>
>> > >> > >> If you need the jQuery date picker try wicketsruff/jwicket.
>> There
>> > you
>> > >> > will
>> > >> > >> find a ready to use implementation of jQuery's DatePicker. And
>> it
>> > >> works
>> > >> > in
>> > >> > >> Panels.
>> > >> > >>
>> > >> > >> Stefan
>> > >> > >>
>> > >> > >> -----Ursprüngliche Nachricht-----
>> > >> > >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
>> > >> > >> Gesendet: Mittwoch, 7. April 2010 15:28
>> > >> > >> An: users@wicket.apache.org
>> > >> > >> Betreff: Re: Javascript from panel does not work
>> > >> > >>
>> > >> > >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
>> > >> > >>
>> > >> > >> > Please make sure that your JS files are loading.  I suspect
>> you
>> > may
>> > >> be
>> > >> > >> > getting a 404 when loading the JS because you are not
>> referencing
>> > >> them
>> > >> > >> > correctly (you're using a relative URL, which may not work
>> > >> depending
>> > >> > on
>> > >> > >> > where your panel is placed).
>> > >> > >> >
>> > >> > >>
>> > >> > >>
>> > >> > >> I belive that de url is fine, becouse my panel is placed in the
>> > same
>> > >> > place
>> > >> > >> than the Page parent, and it works fine on Page parent. I will
>> > check
>> > >> > this
>> > >> > >> out again.
>> > >> > >>
>> > >> > >> Few days ago, a friend was trying to make work JS on panel, he
>> was
>> > >> doing
>> > >> > >>  a
>> > >> > >> JQuery datePicker, but he can't do it work on panels. Then he
>> left
>> > >> the
>> > >> > >> project. He comment me that wicket's YUI datePicker desapeared
>> > fastly
>> > >> on
>> > >> > >> panels, it doesnt wait the click on the date of the user.
>> > >> > >>
>> > >> > >> I believe those things are related, if my ToggleHighLigh.js
>> works,
>> > >> the
>> > >> > >> datepicker by transitivity will works too
>> > >> > >>
>> > >> > >>
>> > >> > >> >
>> > >> > >> > Also, where is the JS that adds the onclick handler that
>> > highlights
>> > >> a
>> > >> > >> row
>> > >> > >> > when it is clicked?  I'm assuming it much be
>> "ToggleHighLigh.js"?
>> > >> > >> >
>> > >> > >>
>> > >> > >>
>> > >> > >> It is in that file, it contains a onClick JQuery function ->
>> > >> > >> ${this}.toggleClass("myClass").
>> > >> > >>
>> > >> > >>
>> > >> > >> >
>> > >> > >> > --
>> > >> > >> > Jeremy Thomerson
>> > >> > >> > http://www.wickettraining.com
>> > >> > >> >
>> > >> > >> >
>> > >> > >> >
>> > >> > >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
>> > >> > >> > <da...@gmail.com>wrote:
>> > >> > >> >
>> > >> > >> > > Hi everybody
>> > >> > >> > >
>> > >> > >> > > I'm having a problem with my call to javascript from a
>> panel.
>> > The
>> > >> > >> problem
>> > >> > >> > > is
>> > >> > >> > > tah javascript does not work (if i call it from a page it
>> works
>> > >> > fine)
>> > >> > >> > >
>> > >> > >> > > I'm doing this:
>> > >> > >> > >
>> > >> > >> > > <wicket:head>
>> > >> > >> > >    <script language="JavaScript1.2"
>> > >> > >> > > src="views/js/jquery-1.3.2.min.js"></script>
>> > >> > >> > >    <script language="JavaScript1.2"
>> > >> > >> > > src="views/js/ToggleHighLigh.js"></script>
>> > >> > >> > > </wicket:head>
>> > >> > >> > >
>> > >> > >> > > <p class="row">Click to toggle</p>
>> > >> > >> > >  <p class="row highLightedRow">highlight</p>
>> > >> > >> > >  <p class="row">on these</p>
>> > >> > >> > >  <p class="row">paragraphs</p
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > When I click the <p> element it should call
>> ToggleHighLigh.js,
>> > >> and
>> > >> > add
>> > >> > >> a
>> > >> > >> > > css
>> > >> > >> > > background.
>> > >> > >> > >
>> > >> > >> > > I tried calling the javascript from Page parent, but it
>> isn't
>> > >> work
>> > >> > >> > >
>> > >> > >> > > What I'm missing?
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > --
>> > >> > >> > > | Daniela Valero
>> > >> > >> > >
>> > >> > >> > > "No hay vientos favorables para quien no sabe a donde quiere
>> > ir!
>> > >> > >> > >
>> > >> > >> >
>> > >> > >>
>> > >> > >>
>> > >> > >>
>> > >> > >> --
>> > >> > >> | Daniela Valero
>> > >> > >>
>> > >> > >> "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >> > >>
>> > >> > >>
>> > ---------------------------------------------------------------------
>> > >> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > >> > >> For additional commands, e-mail: users-help@wicket.apache.org
>> > >> > >>
>> > >> > >>
>> > >> > >
>> > >> > >
>> > >> > > --
>> > >> > > | Daniela Valero
>> > >> > >
>> > >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >> > >
>> > >> >
>> > >> >
>> > >> >
>> > >> > --
>> > >> > | Daniela Valero
>> > >> >
>> > >> > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >> >
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > | Daniela Valero
>> > >
>> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >
>> >
>> >
>> >
>> > --
>> > | Daniela Valero
>> >
>> > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> >
>>
>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
Thanks!!!  Very much !!!


I going to check this out now

2010/4/7 Jeremy Thomerson <je...@wickettraining.com>

> Again, do NOT generate hard-coded URL references.  Please see the very
> first
> code line from:
>
> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/
>
> <
> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/
> >Specifically,
> this line: c.add(HeaderContributor.forJavaScript(MyComponent.class,
> "myscript.js");
>
> NOTE: if you are on 1.4, this class will be deprecated, but the javadoc
> will
> point you to the newer class.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Apr 7, 2010 at 9:07 AM, Daniela Valero
> <da...@gmail.com>wrote:
>
> > I wrote the header constributor, and nothing
> >
> >
> > public void renderHead(IHeaderResponse response) {
> >        response.renderJavascriptReference("
> > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js");
> >        response.renderJavascriptReference("
> > http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js");
> >
> >    }
> >
> > 2010/4/7 Daniela Valero <da...@gmail.com>
> >
> > > I wrapped my JS on wicket:link, and I wrote the absolute url, like this
> > >
> > > <script  language="JavaScript1.2" src="
> > > http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js"></script>
> > >
> > > Now, the files are loaded, I can see it from firebug, but still not
> > workin
> > > :
> > >
> > >
> > > 2010/4/7 Jeremy Thomerson <je...@wickettraining.com>
> > >
> > > This is what I was trying to tell you.  Please load your resources
> > >> correctly.  Either use a ResourceReference with a class to create the
> > URL
> > >> correctly, or wrap your script tags in <wicket:link> tags.
> > >>
> > >> --
> > >> Jeremy Thomerson
> > >> http://www.wickettraining.com
> > >>
> > >>
> > >>
> > >> On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
> > >> <da...@gmail.com>wrote:
> > >>
> > >> > I got on firebug the same message from css file, but it is working
> > fine.
> > >> > (it
> > >> > is being called from Page parent)
> > >> >
> > >> > 2010/4/7 Daniela Valero <da...@gmail.com>
> > >> >
> > >> > > You are right stefan, the JS file is not being loaded, on firebug
> i
> > >> got
> > >> > >
> > >> > > Failed to load source for:
> > >> > > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
> > >> > >
> > >> > > but, I tryed to acces directly to that url and I get the js
> > >> > >
> > >> > > 2010/4/7 Stefan Lindner <li...@visionet.de>
> > >> > >
> > >> > > To make it sure (it's better than just belive it): Take e.g.
> firefox
> > >> with
> > >> > >> fiurebug-plugin. Inspect the head scetion of the page. There go
> to
> > >> the
> > >> > >> <script src=...> tag and expand the tag. IF the js-file is
> > referenced
> > >> > >> correctly and if it is loaded then the content should be visible
> in
> > >> > firebug.
> > >> > >> Or place a simple
> > >> > >>
> > >> > >>        alert('I am loaded');
> > >> > >>
> > >> > >> in your js files.
> > >> > >>
> > >> > >> If you need the jQuery date picker try wicketsruff/jwicket. There
> > you
> > >> > will
> > >> > >> find a ready to use implementation of jQuery's DatePicker. And it
> > >> works
> > >> > in
> > >> > >> Panels.
> > >> > >>
> > >> > >> Stefan
> > >> > >>
> > >> > >> -----Ursprüngliche Nachricht-----
> > >> > >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
> > >> > >> Gesendet: Mittwoch, 7. April 2010 15:28
> > >> > >> An: users@wicket.apache.org
> > >> > >> Betreff: Re: Javascript from panel does not work
> > >> > >>
> > >> > >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
> > >> > >>
> > >> > >> > Please make sure that your JS files are loading.  I suspect you
> > may
> > >> be
> > >> > >> > getting a 404 when loading the JS because you are not
> referencing
> > >> them
> > >> > >> > correctly (you're using a relative URL, which may not work
> > >> depending
> > >> > on
> > >> > >> > where your panel is placed).
> > >> > >> >
> > >> > >>
> > >> > >>
> > >> > >> I belive that de url is fine, becouse my panel is placed in the
> > same
> > >> > place
> > >> > >> than the Page parent, and it works fine on Page parent. I will
> > check
> > >> > this
> > >> > >> out again.
> > >> > >>
> > >> > >> Few days ago, a friend was trying to make work JS on panel, he
> was
> > >> doing
> > >> > >>  a
> > >> > >> JQuery datePicker, but he can't do it work on panels. Then he
> left
> > >> the
> > >> > >> project. He comment me that wicket's YUI datePicker desapeared
> > fastly
> > >> on
> > >> > >> panels, it doesnt wait the click on the date of the user.
> > >> > >>
> > >> > >> I believe those things are related, if my ToggleHighLigh.js
> works,
> > >> the
> > >> > >> datepicker by transitivity will works too
> > >> > >>
> > >> > >>
> > >> > >> >
> > >> > >> > Also, where is the JS that adds the onclick handler that
> > highlights
> > >> a
> > >> > >> row
> > >> > >> > when it is clicked?  I'm assuming it much be
> "ToggleHighLigh.js"?
> > >> > >> >
> > >> > >>
> > >> > >>
> > >> > >> It is in that file, it contains a onClick JQuery function ->
> > >> > >> ${this}.toggleClass("myClass").
> > >> > >>
> > >> > >>
> > >> > >> >
> > >> > >> > --
> > >> > >> > Jeremy Thomerson
> > >> > >> > http://www.wickettraining.com
> > >> > >> >
> > >> > >> >
> > >> > >> >
> > >> > >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> > >> > >> > <da...@gmail.com>wrote:
> > >> > >> >
> > >> > >> > > Hi everybody
> > >> > >> > >
> > >> > >> > > I'm having a problem with my call to javascript from a panel.
> > The
> > >> > >> problem
> > >> > >> > > is
> > >> > >> > > tah javascript does not work (if i call it from a page it
> works
> > >> > fine)
> > >> > >> > >
> > >> > >> > > I'm doing this:
> > >> > >> > >
> > >> > >> > > <wicket:head>
> > >> > >> > >    <script language="JavaScript1.2"
> > >> > >> > > src="views/js/jquery-1.3.2.min.js"></script>
> > >> > >> > >    <script language="JavaScript1.2"
> > >> > >> > > src="views/js/ToggleHighLigh.js"></script>
> > >> > >> > > </wicket:head>
> > >> > >> > >
> > >> > >> > > <p class="row">Click to toggle</p>
> > >> > >> > >  <p class="row highLightedRow">highlight</p>
> > >> > >> > >  <p class="row">on these</p>
> > >> > >> > >  <p class="row">paragraphs</p
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > When I click the <p> element it should call
> ToggleHighLigh.js,
> > >> and
> > >> > add
> > >> > >> a
> > >> > >> > > css
> > >> > >> > > background.
> > >> > >> > >
> > >> > >> > > I tried calling the javascript from Page parent, but it isn't
> > >> work
> > >> > >> > >
> > >> > >> > > What I'm missing?
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > --
> > >> > >> > > | Daniela Valero
> > >> > >> > >
> > >> > >> > > "No hay vientos favorables para quien no sabe a donde quiere
> > ir!
> > >> > >> > >
> > >> > >> >
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >> --
> > >> > >> | Daniela Valero
> > >> > >>
> > >> > >> "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >> > >>
> > >> > >>
> > ---------------------------------------------------------------------
> > >> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >> > >>
> > >> > >>
> > >> > >
> > >> > >
> > >> > > --
> > >> > > | Daniela Valero
> > >> > >
> > >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > | Daniela Valero
> > >> >
> > >> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > | Daniela Valero
> > >
> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >
> >
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Again, do NOT generate hard-coded URL references.  Please see the very first
code line from:
http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/

<http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/>Specifically,
this line: c.add(HeaderContributor.forJavaScript(MyComponent.class,
"myscript.js");

NOTE: if you are on 1.4, this class will be deprecated, but the javadoc will
point you to the newer class.

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



On Wed, Apr 7, 2010 at 9:07 AM, Daniela Valero
<da...@gmail.com>wrote:

> I wrote the header constributor, and nothing
>
>
> public void renderHead(IHeaderResponse response) {
>        response.renderJavascriptReference("
> http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js");
>        response.renderJavascriptReference("
> http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js");
>
>    }
>
> 2010/4/7 Daniela Valero <da...@gmail.com>
>
> > I wrapped my JS on wicket:link, and I wrote the absolute url, like this
> >
> > <script  language="JavaScript1.2" src="
> > http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js"></script>
> >
> > Now, the files are loaded, I can see it from firebug, but still not
> workin
> > :
> >
> >
> > 2010/4/7 Jeremy Thomerson <je...@wickettraining.com>
> >
> > This is what I was trying to tell you.  Please load your resources
> >> correctly.  Either use a ResourceReference with a class to create the
> URL
> >> correctly, or wrap your script tags in <wicket:link> tags.
> >>
> >> --
> >> Jeremy Thomerson
> >> http://www.wickettraining.com
> >>
> >>
> >>
> >> On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
> >> <da...@gmail.com>wrote:
> >>
> >> > I got on firebug the same message from css file, but it is working
> fine.
> >> > (it
> >> > is being called from Page parent)
> >> >
> >> > 2010/4/7 Daniela Valero <da...@gmail.com>
> >> >
> >> > > You are right stefan, the JS file is not being loaded, on firebug i
> >> got
> >> > >
> >> > > Failed to load source for:
> >> > > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
> >> > >
> >> > > but, I tryed to acces directly to that url and I get the js
> >> > >
> >> > > 2010/4/7 Stefan Lindner <li...@visionet.de>
> >> > >
> >> > > To make it sure (it's better than just belive it): Take e.g. firefox
> >> with
> >> > >> fiurebug-plugin. Inspect the head scetion of the page. There go to
> >> the
> >> > >> <script src=...> tag and expand the tag. IF the js-file is
> referenced
> >> > >> correctly and if it is loaded then the content should be visible in
> >> > firebug.
> >> > >> Or place a simple
> >> > >>
> >> > >>        alert('I am loaded');
> >> > >>
> >> > >> in your js files.
> >> > >>
> >> > >> If you need the jQuery date picker try wicketsruff/jwicket. There
> you
> >> > will
> >> > >> find a ready to use implementation of jQuery's DatePicker. And it
> >> works
> >> > in
> >> > >> Panels.
> >> > >>
> >> > >> Stefan
> >> > >>
> >> > >> -----Ursprüngliche Nachricht-----
> >> > >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
> >> > >> Gesendet: Mittwoch, 7. April 2010 15:28
> >> > >> An: users@wicket.apache.org
> >> > >> Betreff: Re: Javascript from panel does not work
> >> > >>
> >> > >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
> >> > >>
> >> > >> > Please make sure that your JS files are loading.  I suspect you
> may
> >> be
> >> > >> > getting a 404 when loading the JS because you are not referencing
> >> them
> >> > >> > correctly (you're using a relative URL, which may not work
> >> depending
> >> > on
> >> > >> > where your panel is placed).
> >> > >> >
> >> > >>
> >> > >>
> >> > >> I belive that de url is fine, becouse my panel is placed in the
> same
> >> > place
> >> > >> than the Page parent, and it works fine on Page parent. I will
> check
> >> > this
> >> > >> out again.
> >> > >>
> >> > >> Few days ago, a friend was trying to make work JS on panel, he was
> >> doing
> >> > >>  a
> >> > >> JQuery datePicker, but he can't do it work on panels. Then he left
> >> the
> >> > >> project. He comment me that wicket's YUI datePicker desapeared
> fastly
> >> on
> >> > >> panels, it doesnt wait the click on the date of the user.
> >> > >>
> >> > >> I believe those things are related, if my ToggleHighLigh.js works,
> >> the
> >> > >> datepicker by transitivity will works too
> >> > >>
> >> > >>
> >> > >> >
> >> > >> > Also, where is the JS that adds the onclick handler that
> highlights
> >> a
> >> > >> row
> >> > >> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
> >> > >> >
> >> > >>
> >> > >>
> >> > >> It is in that file, it contains a onClick JQuery function ->
> >> > >> ${this}.toggleClass("myClass").
> >> > >>
> >> > >>
> >> > >> >
> >> > >> > --
> >> > >> > Jeremy Thomerson
> >> > >> > http://www.wickettraining.com
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> >> > >> > <da...@gmail.com>wrote:
> >> > >> >
> >> > >> > > Hi everybody
> >> > >> > >
> >> > >> > > I'm having a problem with my call to javascript from a panel.
> The
> >> > >> problem
> >> > >> > > is
> >> > >> > > tah javascript does not work (if i call it from a page it works
> >> > fine)
> >> > >> > >
> >> > >> > > I'm doing this:
> >> > >> > >
> >> > >> > > <wicket:head>
> >> > >> > >    <script language="JavaScript1.2"
> >> > >> > > src="views/js/jquery-1.3.2.min.js"></script>
> >> > >> > >    <script language="JavaScript1.2"
> >> > >> > > src="views/js/ToggleHighLigh.js"></script>
> >> > >> > > </wicket:head>
> >> > >> > >
> >> > >> > > <p class="row">Click to toggle</p>
> >> > >> > >  <p class="row highLightedRow">highlight</p>
> >> > >> > >  <p class="row">on these</p>
> >> > >> > >  <p class="row">paragraphs</p
> >> > >> > >
> >> > >> > >
> >> > >> > > When I click the <p> element it should call ToggleHighLigh.js,
> >> and
> >> > add
> >> > >> a
> >> > >> > > css
> >> > >> > > background.
> >> > >> > >
> >> > >> > > I tried calling the javascript from Page parent, but it isn't
> >> work
> >> > >> > >
> >> > >> > > What I'm missing?
> >> > >> > >
> >> > >> > >
> >> > >> > > --
> >> > >> > > | Daniela Valero
> >> > >> > >
> >> > >> > > "No hay vientos favorables para quien no sabe a donde quiere
> ir!
> >> > >> > >
> >> > >> >
> >> > >>
> >> > >>
> >> > >>
> >> > >> --
> >> > >> | Daniela Valero
> >> > >>
> >> > >> "No hay vientos favorables para quien no sabe a donde quiere ir!
> >> > >>
> >> > >>
> ---------------------------------------------------------------------
> >> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > >> For additional commands, e-mail: users-help@wicket.apache.org
> >> > >>
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > > | Daniela Valero
> >> > >
> >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > | Daniela Valero
> >> >
> >> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >> >
> >>
> >
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
I wrote the header constributor, and nothing


public void renderHead(IHeaderResponse response) {
        response.renderJavascriptReference("
http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js");
        response.renderJavascriptReference("
http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js");

    }

2010/4/7 Daniela Valero <da...@gmail.com>

> I wrapped my JS on wicket:link, and I wrote the absolute url, like this
>
> <script  language="JavaScript1.2" src="
> http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js"></script>
>
> Now, the files are loaded, I can see it from firebug, but still not workin
> :
>
>
> 2010/4/7 Jeremy Thomerson <je...@wickettraining.com>
>
> This is what I was trying to tell you.  Please load your resources
>> correctly.  Either use a ResourceReference with a class to create the URL
>> correctly, or wrap your script tags in <wicket:link> tags.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
>> <da...@gmail.com>wrote:
>>
>> > I got on firebug the same message from css file, but it is working fine.
>> > (it
>> > is being called from Page parent)
>> >
>> > 2010/4/7 Daniela Valero <da...@gmail.com>
>> >
>> > > You are right stefan, the JS file is not being loaded, on firebug i
>> got
>> > >
>> > > Failed to load source for:
>> > > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
>> > >
>> > > but, I tryed to acces directly to that url and I get the js
>> > >
>> > > 2010/4/7 Stefan Lindner <li...@visionet.de>
>> > >
>> > > To make it sure (it's better than just belive it): Take e.g. firefox
>> with
>> > >> fiurebug-plugin. Inspect the head scetion of the page. There go to
>> the
>> > >> <script src=...> tag and expand the tag. IF the js-file is referenced
>> > >> correctly and if it is loaded then the content should be visible in
>> > firebug.
>> > >> Or place a simple
>> > >>
>> > >>        alert('I am loaded');
>> > >>
>> > >> in your js files.
>> > >>
>> > >> If you need the jQuery date picker try wicketsruff/jwicket. There you
>> > will
>> > >> find a ready to use implementation of jQuery's DatePicker. And it
>> works
>> > in
>> > >> Panels.
>> > >>
>> > >> Stefan
>> > >>
>> > >> -----Ursprüngliche Nachricht-----
>> > >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
>> > >> Gesendet: Mittwoch, 7. April 2010 15:28
>> > >> An: users@wicket.apache.org
>> > >> Betreff: Re: Javascript from panel does not work
>> > >>
>> > >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
>> > >>
>> > >> > Please make sure that your JS files are loading.  I suspect you may
>> be
>> > >> > getting a 404 when loading the JS because you are not referencing
>> them
>> > >> > correctly (you're using a relative URL, which may not work
>> depending
>> > on
>> > >> > where your panel is placed).
>> > >> >
>> > >>
>> > >>
>> > >> I belive that de url is fine, becouse my panel is placed in the same
>> > place
>> > >> than the Page parent, and it works fine on Page parent. I will check
>> > this
>> > >> out again.
>> > >>
>> > >> Few days ago, a friend was trying to make work JS on panel, he was
>> doing
>> > >>  a
>> > >> JQuery datePicker, but he can't do it work on panels. Then he left
>> the
>> > >> project. He comment me that wicket's YUI datePicker desapeared fastly
>> on
>> > >> panels, it doesnt wait the click on the date of the user.
>> > >>
>> > >> I believe those things are related, if my ToggleHighLigh.js works,
>> the
>> > >> datepicker by transitivity will works too
>> > >>
>> > >>
>> > >> >
>> > >> > Also, where is the JS that adds the onclick handler that highlights
>> a
>> > >> row
>> > >> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
>> > >> >
>> > >>
>> > >>
>> > >> It is in that file, it contains a onClick JQuery function ->
>> > >> ${this}.toggleClass("myClass").
>> > >>
>> > >>
>> > >> >
>> > >> > --
>> > >> > Jeremy Thomerson
>> > >> > http://www.wickettraining.com
>> > >> >
>> > >> >
>> > >> >
>> > >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
>> > >> > <da...@gmail.com>wrote:
>> > >> >
>> > >> > > Hi everybody
>> > >> > >
>> > >> > > I'm having a problem with my call to javascript from a panel. The
>> > >> problem
>> > >> > > is
>> > >> > > tah javascript does not work (if i call it from a page it works
>> > fine)
>> > >> > >
>> > >> > > I'm doing this:
>> > >> > >
>> > >> > > <wicket:head>
>> > >> > >    <script language="JavaScript1.2"
>> > >> > > src="views/js/jquery-1.3.2.min.js"></script>
>> > >> > >    <script language="JavaScript1.2"
>> > >> > > src="views/js/ToggleHighLigh.js"></script>
>> > >> > > </wicket:head>
>> > >> > >
>> > >> > > <p class="row">Click to toggle</p>
>> > >> > >  <p class="row highLightedRow">highlight</p>
>> > >> > >  <p class="row">on these</p>
>> > >> > >  <p class="row">paragraphs</p
>> > >> > >
>> > >> > >
>> > >> > > When I click the <p> element it should call ToggleHighLigh.js,
>> and
>> > add
>> > >> a
>> > >> > > css
>> > >> > > background.
>> > >> > >
>> > >> > > I tried calling the javascript from Page parent, but it isn't
>> work
>> > >> > >
>> > >> > > What I'm missing?
>> > >> > >
>> > >> > >
>> > >> > > --
>> > >> > > | Daniela Valero
>> > >> > >
>> > >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >> > >
>> > >> >
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> | Daniela Valero
>> > >>
>> > >> "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >>
>> > >> ---------------------------------------------------------------------
>> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > >> For additional commands, e-mail: users-help@wicket.apache.org
>> > >>
>> > >>
>> > >
>> > >
>> > > --
>> > > | Daniela Valero
>> > >
>> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >
>> >
>> >
>> >
>> > --
>> > | Daniela Valero
>> >
>> > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> >
>>
>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
I wrapped my JS on wicket:link, and I wrote the absolute url, like this

<script  language="JavaScript1.2" src="
http://localhost:8080/FrontEnd/views/js/jquery-1.3.2.min.js"></script>

Now, the files are loaded, I can see it from firebug, but still not workin :


2010/4/7 Jeremy Thomerson <je...@wickettraining.com>

> This is what I was trying to tell you.  Please load your resources
> correctly.  Either use a ResourceReference with a class to create the URL
> correctly, or wrap your script tags in <wicket:link> tags.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
> <da...@gmail.com>wrote:
>
> > I got on firebug the same message from css file, but it is working fine.
> > (it
> > is being called from Page parent)
> >
> > 2010/4/7 Daniela Valero <da...@gmail.com>
> >
> > > You are right stefan, the JS file is not being loaded, on firebug i got
> > >
> > > Failed to load source for:
> > > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
> > >
> > > but, I tryed to acces directly to that url and I get the js
> > >
> > > 2010/4/7 Stefan Lindner <li...@visionet.de>
> > >
> > > To make it sure (it's better than just belive it): Take e.g. firefox
> with
> > >> fiurebug-plugin. Inspect the head scetion of the page. There go to the
> > >> <script src=...> tag and expand the tag. IF the js-file is referenced
> > >> correctly and if it is loaded then the content should be visible in
> > firebug.
> > >> Or place a simple
> > >>
> > >>        alert('I am loaded');
> > >>
> > >> in your js files.
> > >>
> > >> If you need the jQuery date picker try wicketsruff/jwicket. There you
> > will
> > >> find a ready to use implementation of jQuery's DatePicker. And it
> works
> > in
> > >> Panels.
> > >>
> > >> Stefan
> > >>
> > >> -----Ursprüngliche Nachricht-----
> > >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
> > >> Gesendet: Mittwoch, 7. April 2010 15:28
> > >> An: users@wicket.apache.org
> > >> Betreff: Re: Javascript from panel does not work
> > >>
> > >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
> > >>
> > >> > Please make sure that your JS files are loading.  I suspect you may
> be
> > >> > getting a 404 when loading the JS because you are not referencing
> them
> > >> > correctly (you're using a relative URL, which may not work depending
> > on
> > >> > where your panel is placed).
> > >> >
> > >>
> > >>
> > >> I belive that de url is fine, becouse my panel is placed in the same
> > place
> > >> than the Page parent, and it works fine on Page parent. I will check
> > this
> > >> out again.
> > >>
> > >> Few days ago, a friend was trying to make work JS on panel, he was
> doing
> > >>  a
> > >> JQuery datePicker, but he can't do it work on panels. Then he left the
> > >> project. He comment me that wicket's YUI datePicker desapeared fastly
> on
> > >> panels, it doesnt wait the click on the date of the user.
> > >>
> > >> I believe those things are related, if my ToggleHighLigh.js works, the
> > >> datepicker by transitivity will works too
> > >>
> > >>
> > >> >
> > >> > Also, where is the JS that adds the onclick handler that highlights
> a
> > >> row
> > >> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
> > >> >
> > >>
> > >>
> > >> It is in that file, it contains a onClick JQuery function ->
> > >> ${this}.toggleClass("myClass").
> > >>
> > >>
> > >> >
> > >> > --
> > >> > Jeremy Thomerson
> > >> > http://www.wickettraining.com
> > >> >
> > >> >
> > >> >
> > >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> > >> > <da...@gmail.com>wrote:
> > >> >
> > >> > > Hi everybody
> > >> > >
> > >> > > I'm having a problem with my call to javascript from a panel. The
> > >> problem
> > >> > > is
> > >> > > tah javascript does not work (if i call it from a page it works
> > fine)
> > >> > >
> > >> > > I'm doing this:
> > >> > >
> > >> > > <wicket:head>
> > >> > >    <script language="JavaScript1.2"
> > >> > > src="views/js/jquery-1.3.2.min.js"></script>
> > >> > >    <script language="JavaScript1.2"
> > >> > > src="views/js/ToggleHighLigh.js"></script>
> > >> > > </wicket:head>
> > >> > >
> > >> > > <p class="row">Click to toggle</p>
> > >> > >  <p class="row highLightedRow">highlight</p>
> > >> > >  <p class="row">on these</p>
> > >> > >  <p class="row">paragraphs</p
> > >> > >
> > >> > >
> > >> > > When I click the <p> element it should call ToggleHighLigh.js, and
> > add
> > >> a
> > >> > > css
> > >> > > background.
> > >> > >
> > >> > > I tried calling the javascript from Page parent, but it isn't work
> > >> > >
> > >> > > What I'm missing?
> > >> > >
> > >> > >
> > >> > > --
> > >> > > | Daniela Valero
> > >> > >
> > >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> | Daniela Valero
> > >>
> > >> "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > | Daniela Valero
> > >
> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >
> >
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Jeremy Thomerson <je...@wickettraining.com>.
This is what I was trying to tell you.  Please load your resources
correctly.  Either use a ResourceReference with a class to create the URL
correctly, or wrap your script tags in <wicket:link> tags.

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



On Wed, Apr 7, 2010 at 8:42 AM, Daniela Valero
<da...@gmail.com>wrote:

> I got on firebug the same message from css file, but it is working fine.
> (it
> is being called from Page parent)
>
> 2010/4/7 Daniela Valero <da...@gmail.com>
>
> > You are right stefan, the JS file is not being loaded, on firebug i got
> >
> > Failed to load source for:
> > http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
> >
> > but, I tryed to acces directly to that url and I get the js
> >
> > 2010/4/7 Stefan Lindner <li...@visionet.de>
> >
> > To make it sure (it's better than just belive it): Take e.g. firefox with
> >> fiurebug-plugin. Inspect the head scetion of the page. There go to the
> >> <script src=...> tag and expand the tag. IF the js-file is referenced
> >> correctly and if it is loaded then the content should be visible in
> firebug.
> >> Or place a simple
> >>
> >>        alert('I am loaded');
> >>
> >> in your js files.
> >>
> >> If you need the jQuery date picker try wicketsruff/jwicket. There you
> will
> >> find a ready to use implementation of jQuery's DatePicker. And it works
> in
> >> Panels.
> >>
> >> Stefan
> >>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
> >> Gesendet: Mittwoch, 7. April 2010 15:28
> >> An: users@wicket.apache.org
> >> Betreff: Re: Javascript from panel does not work
> >>
> >> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
> >>
> >> > Please make sure that your JS files are loading.  I suspect you may be
> >> > getting a 404 when loading the JS because you are not referencing them
> >> > correctly (you're using a relative URL, which may not work depending
> on
> >> > where your panel is placed).
> >> >
> >>
> >>
> >> I belive that de url is fine, becouse my panel is placed in the same
> place
> >> than the Page parent, and it works fine on Page parent. I will check
> this
> >> out again.
> >>
> >> Few days ago, a friend was trying to make work JS on panel, he was doing
> >>  a
> >> JQuery datePicker, but he can't do it work on panels. Then he left the
> >> project. He comment me that wicket's YUI datePicker desapeared fastly on
> >> panels, it doesnt wait the click on the date of the user.
> >>
> >> I believe those things are related, if my ToggleHighLigh.js works, the
> >> datepicker by transitivity will works too
> >>
> >>
> >> >
> >> > Also, where is the JS that adds the onclick handler that highlights a
> >> row
> >> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
> >> >
> >>
> >>
> >> It is in that file, it contains a onClick JQuery function ->
> >> ${this}.toggleClass("myClass").
> >>
> >>
> >> >
> >> > --
> >> > Jeremy Thomerson
> >> > http://www.wickettraining.com
> >> >
> >> >
> >> >
> >> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> >> > <da...@gmail.com>wrote:
> >> >
> >> > > Hi everybody
> >> > >
> >> > > I'm having a problem with my call to javascript from a panel. The
> >> problem
> >> > > is
> >> > > tah javascript does not work (if i call it from a page it works
> fine)
> >> > >
> >> > > I'm doing this:
> >> > >
> >> > > <wicket:head>
> >> > >    <script language="JavaScript1.2"
> >> > > src="views/js/jquery-1.3.2.min.js"></script>
> >> > >    <script language="JavaScript1.2"
> >> > > src="views/js/ToggleHighLigh.js"></script>
> >> > > </wicket:head>
> >> > >
> >> > > <p class="row">Click to toggle</p>
> >> > >  <p class="row highLightedRow">highlight</p>
> >> > >  <p class="row">on these</p>
> >> > >  <p class="row">paragraphs</p
> >> > >
> >> > >
> >> > > When I click the <p> element it should call ToggleHighLigh.js, and
> add
> >> a
> >> > > css
> >> > > background.
> >> > >
> >> > > I tried calling the javascript from Page parent, but it isn't work
> >> > >
> >> > > What I'm missing?
> >> > >
> >> > >
> >> > > --
> >> > > | Daniela Valero
> >> > >
> >> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> | Daniela Valero
> >>
> >> "No hay vientos favorables para quien no sabe a donde quiere ir!
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
I got on firebug the same message from css file, but it is working fine. (it
is being called from Page parent)

2010/4/7 Daniela Valero <da...@gmail.com>

> You are right stefan, the JS file is not being loaded, on firebug i got
>
> Failed to load source for:
> http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js
>
> but, I tryed to acces directly to that url and I get the js
>
> 2010/4/7 Stefan Lindner <li...@visionet.de>
>
> To make it sure (it's better than just belive it): Take e.g. firefox with
>> fiurebug-plugin. Inspect the head scetion of the page. There go to the
>> <script src=...> tag and expand the tag. IF the js-file is referenced
>> correctly and if it is loaded then the content should be visible in firebug.
>> Or place a simple
>>
>>        alert('I am loaded');
>>
>> in your js files.
>>
>> If you need the jQuery date picker try wicketsruff/jwicket. There you will
>> find a ready to use implementation of jQuery's DatePicker. And it works in
>> Panels.
>>
>> Stefan
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
>> Gesendet: Mittwoch, 7. April 2010 15:28
>> An: users@wicket.apache.org
>> Betreff: Re: Javascript from panel does not work
>>
>> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
>>
>> > Please make sure that your JS files are loading.  I suspect you may be
>> > getting a 404 when loading the JS because you are not referencing them
>> > correctly (you're using a relative URL, which may not work depending on
>> > where your panel is placed).
>> >
>>
>>
>> I belive that de url is fine, becouse my panel is placed in the same place
>> than the Page parent, and it works fine on Page parent. I will check this
>> out again.
>>
>> Few days ago, a friend was trying to make work JS on panel, he was doing
>>  a
>> JQuery datePicker, but he can't do it work on panels. Then he left the
>> project. He comment me that wicket's YUI datePicker desapeared fastly on
>> panels, it doesnt wait the click on the date of the user.
>>
>> I believe those things are related, if my ToggleHighLigh.js works, the
>> datepicker by transitivity will works too
>>
>>
>> >
>> > Also, where is the JS that adds the onclick handler that highlights a
>> row
>> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
>> >
>>
>>
>> It is in that file, it contains a onClick JQuery function ->
>> ${this}.toggleClass("myClass").
>>
>>
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> >
>> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
>> > <da...@gmail.com>wrote:
>> >
>> > > Hi everybody
>> > >
>> > > I'm having a problem with my call to javascript from a panel. The
>> problem
>> > > is
>> > > tah javascript does not work (if i call it from a page it works fine)
>> > >
>> > > I'm doing this:
>> > >
>> > > <wicket:head>
>> > >    <script language="JavaScript1.2"
>> > > src="views/js/jquery-1.3.2.min.js"></script>
>> > >    <script language="JavaScript1.2"
>> > > src="views/js/ToggleHighLigh.js"></script>
>> > > </wicket:head>
>> > >
>> > > <p class="row">Click to toggle</p>
>> > >  <p class="row highLightedRow">highlight</p>
>> > >  <p class="row">on these</p>
>> > >  <p class="row">paragraphs</p
>> > >
>> > >
>> > > When I click the <p> element it should call ToggleHighLigh.js, and add
>> a
>> > > css
>> > > background.
>> > >
>> > > I tried calling the javascript from Page parent, but it isn't work
>> > >
>> > > What I'm missing?
>> > >
>> > >
>> > > --
>> > > | Daniela Valero
>> > >
>> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
>> > >
>> >
>>
>>
>>
>> --
>> | Daniela Valero
>>
>> "No hay vientos favorables para quien no sabe a donde quiere ir!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
You are right stefan, the JS file is not being loaded, on firebug i got

Failed to load source for:
http://localhost:8080/FrontEnd/views/js/ToggleHighLigh.js

but, I tryed to acces directly to that url and I get the js

2010/4/7 Stefan Lindner <li...@visionet.de>

> To make it sure (it's better than just belive it): Take e.g. firefox with
> fiurebug-plugin. Inspect the head scetion of the page. There go to the
> <script src=...> tag and expand the tag. IF the js-file is referenced
> correctly and if it is loaded then the content should be visible in firebug.
> Or place a simple
>
>        alert('I am loaded');
>
> in your js files.
>
> If you need the jQuery date picker try wicketsruff/jwicket. There you will
> find a ready to use implementation of jQuery's DatePicker. And it works in
> Panels.
>
> Stefan
>
> -----Ursprüngliche Nachricht-----
> Von: Daniela Valero [mailto:danielavalero255@gmail.com]
> Gesendet: Mittwoch, 7. April 2010 15:28
> An: users@wicket.apache.org
> Betreff: Re: Javascript from panel does not work
>
> 2010/4/6 Jeremy Thomerson <je...@wickettraining.com>
>
> > Please make sure that your JS files are loading.  I suspect you may be
> > getting a 404 when loading the JS because you are not referencing them
> > correctly (you're using a relative URL, which may not work depending on
> > where your panel is placed).
> >
>
>
> I belive that de url is fine, becouse my panel is placed in the same place
> than the Page parent, and it works fine on Page parent. I will check this
> out again.
>
> Few days ago, a friend was trying to make work JS on panel, he was doing  a
> JQuery datePicker, but he can't do it work on panels. Then he left the
> project. He comment me that wicket's YUI datePicker desapeared fastly on
> panels, it doesnt wait the click on the date of the user.
>
> I believe those things are related, if my ToggleHighLigh.js works, the
> datepicker by transitivity will works too
>
>
> >
> > Also, where is the JS that adds the onclick handler that highlights a row
> > when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
> >
>
>
> It is in that file, it contains a onClick JQuery function ->
> ${this}.toggleClass("myClass").
>
>
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> > <da...@gmail.com>wrote:
> >
> > > Hi everybody
> > >
> > > I'm having a problem with my call to javascript from a panel. The
> problem
> > > is
> > > tah javascript does not work (if i call it from a page it works fine)
> > >
> > > I'm doing this:
> > >
> > > <wicket:head>
> > >    <script language="JavaScript1.2"
> > > src="views/js/jquery-1.3.2.min.js"></script>
> > >    <script language="JavaScript1.2"
> > > src="views/js/ToggleHighLigh.js"></script>
> > > </wicket:head>
> > >
> > > <p class="row">Click to toggle</p>
> > >  <p class="row highLightedRow">highlight</p>
> > >  <p class="row">on these</p>
> > >  <p class="row">paragraphs</p
> > >
> > >
> > > When I click the <p> element it should call ToggleHighLigh.js, and add
> a
> > > css
> > > background.
> > >
> > > I tried calling the javascript from Page parent, but it isn't work
> > >
> > > What I'm missing?
> > >
> > >
> > > --
> > > | Daniela Valero
> > >
> > > "No hay vientos favorables para quien no sabe a donde quiere ir!
> > >
> >
>
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

AW: Javascript from panel does not work

Posted by Stefan Lindner <li...@visionet.de>.
To make it sure (it's better than just belive it): Take e.g. firefox with fiurebug-plugin. Inspect the head scetion of the page. There go to the <script src=...> tag and expand the tag. IF the js-file is referenced correctly and if it is loaded then the content should be visible in firebug.
Or place a simple

	alert('I am loaded');

in your js files.

If you need the jQuery date picker try wicketsruff/jwicket. There you will find a ready to use implementation of jQuery's DatePicker. And it works in Panels.

Stefan

-----Ursprüngliche Nachricht-----
Von: Daniela Valero [mailto:danielavalero255@gmail.com] 
Gesendet: Mittwoch, 7. April 2010 15:28
An: users@wicket.apache.org
Betreff: Re: Javascript from panel does not work

2010/4/6 Jeremy Thomerson <je...@wickettraining.com>

> Please make sure that your JS files are loading.  I suspect you may be
> getting a 404 when loading the JS because you are not referencing them
> correctly (you're using a relative URL, which may not work depending on
> where your panel is placed).
>


I belive that de url is fine, becouse my panel is placed in the same place
than the Page parent, and it works fine on Page parent. I will check this
out again.

Few days ago, a friend was trying to make work JS on panel, he was doing  a
JQuery datePicker, but he can't do it work on panels. Then he left the
project. He comment me that wicket's YUI datePicker desapeared fastly on
panels, it doesnt wait the click on the date of the user.

I believe those things are related, if my ToggleHighLigh.js works, the
datepicker by transitivity will works too


>
> Also, where is the JS that adds the onclick handler that highlights a row
> when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
>


It is in that file, it contains a onClick JQuery function ->
${this}.toggleClass("myClass").


>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> <da...@gmail.com>wrote:
>
> > Hi everybody
> >
> > I'm having a problem with my call to javascript from a panel. The problem
> > is
> > tah javascript does not work (if i call it from a page it works fine)
> >
> > I'm doing this:
> >
> > <wicket:head>
> >    <script language="JavaScript1.2"
> > src="views/js/jquery-1.3.2.min.js"></script>
> >    <script language="JavaScript1.2"
> > src="views/js/ToggleHighLigh.js"></script>
> > </wicket:head>
> >
> > <p class="row">Click to toggle</p>
> >  <p class="row highLightedRow">highlight</p>
> >  <p class="row">on these</p>
> >  <p class="row">paragraphs</p
> >
> >
> > When I click the <p> element it should call ToggleHighLigh.js, and add a
> > css
> > background.
> >
> > I tried calling the javascript from Page parent, but it isn't work
> >
> > What I'm missing?
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

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


Re: Javascript from panel does not work

Posted by Daniela Valero <da...@gmail.com>.
2010/4/6 Jeremy Thomerson <je...@wickettraining.com>

> Please make sure that your JS files are loading.  I suspect you may be
> getting a 404 when loading the JS because you are not referencing them
> correctly (you're using a relative URL, which may not work depending on
> where your panel is placed).
>


I belive that de url is fine, becouse my panel is placed in the same place
than the Page parent, and it works fine on Page parent. I will check this
out again.

Few days ago, a friend was trying to make work JS on panel, he was doing  a
JQuery datePicker, but he can't do it work on panels. Then he left the
project. He comment me that wicket's YUI datePicker desapeared fastly on
panels, it doesnt wait the click on the date of the user.

I believe those things are related, if my ToggleHighLigh.js works, the
datepicker by transitivity will works too


>
> Also, where is the JS that adds the onclick handler that highlights a row
> when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?
>


It is in that file, it contains a onClick JQuery function ->
${this}.toggleClass("myClass").


>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
> <da...@gmail.com>wrote:
>
> > Hi everybody
> >
> > I'm having a problem with my call to javascript from a panel. The problem
> > is
> > tah javascript does not work (if i call it from a page it works fine)
> >
> > I'm doing this:
> >
> > <wicket:head>
> >    <script language="JavaScript1.2"
> > src="views/js/jquery-1.3.2.min.js"></script>
> >    <script language="JavaScript1.2"
> > src="views/js/ToggleHighLigh.js"></script>
> > </wicket:head>
> >
> > <p class="row">Click to toggle</p>
> >  <p class="row highLightedRow">highlight</p>
> >  <p class="row">on these</p>
> >  <p class="row">paragraphs</p
> >
> >
> > When I click the <p> element it should call ToggleHighLigh.js, and add a
> > css
> > background.
> >
> > I tried calling the javascript from Page parent, but it isn't work
> >
> > What I'm missing?
> >
> >
> > --
> > | Daniela Valero
> >
> > "No hay vientos favorables para quien no sabe a donde quiere ir!
> >
>



-- 
| Daniela Valero

"No hay vientos favorables para quien no sabe a donde quiere ir!

Re: Javascript from panel does not work

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Please make sure that your JS files are loading.  I suspect you may be
getting a 404 when loading the JS because you are not referencing them
correctly (you're using a relative URL, which may not work depending on
where your panel is placed).

Also, where is the JS that adds the onclick handler that highlights a row
when it is clicked?  I'm assuming it much be "ToggleHighLigh.js"?

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



On Tue, Apr 6, 2010 at 5:41 PM, Daniela Valero
<da...@gmail.com>wrote:

> Hi everybody
>
> I'm having a problem with my call to javascript from a panel. The problem
> is
> tah javascript does not work (if i call it from a page it works fine)
>
> I'm doing this:
>
> <wicket:head>
>    <script language="JavaScript1.2"
> src="views/js/jquery-1.3.2.min.js"></script>
>    <script language="JavaScript1.2"
> src="views/js/ToggleHighLigh.js"></script>
> </wicket:head>
>
> <p class="row">Click to toggle</p>
>  <p class="row highLightedRow">highlight</p>
>  <p class="row">on these</p>
>  <p class="row">paragraphs</p
>
>
> When I click the <p> element it should call ToggleHighLigh.js, and add a
> css
> background.
>
> I tried calling the javascript from Page parent, but it isn't work
>
> What I'm missing?
>
>
> --
> | Daniela Valero
>
> "No hay vientos favorables para quien no sabe a donde quiere ir!
>