You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eduardo Nunes <es...@gmail.com> on 2009/04/25 00:47:36 UTC

Announce: new JavaScript Inheritance Implementation

Hello guys,

  I'm not used to develop in Javascript but, as a fan of programming
languages and object-oriented paradigm, my friend Otavio Avila and I
decided to develop a kind of inheritance in JavaScript. He is a very
experienced javascript developer and html coder, with helped me a lot
with my lack of knowledge in these areas. You can check more about it
in http://jsii.googlecode.com. The project is licensed in LGPL that
enables you to use it in your commercial, or not, applications.
  I think it could help to make more complex things with javascript.

Thanks,
Eduardo S. Nunes

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Eduardo Nunes <es...@gmail.com>.
I don't know if you understood what I said, but take a look on this example:

public class Main {
	public static class A {
		public void methodA() {
			System.out.println("A.methodA()");
		}
		public void methodB() {
			methodA();
			System.out.println("A.methodB()");
		}
	}
	public static class B extends A {
		public void methodA() {
			System.out.println("B.methodA()");
		}
		public void methodB() {
			System.out.println("B.methodB()");
			super.methodB();
		}
	}
	public static void main(String[] args) {
		B b = new B();
		b.methodB();
	}
}

The output will be:
B.methodB()
B.methodA()
A.methodB()

The implementation that I did in the javascript library works exactly like this.

On Sat, Apr 25, 2009 at 4:58 AM, Johan Compagner <jc...@gmail.com> wrote:
> Java doesnt work like that
> If you are in X and you call super.Y() then you will skipp the Y of
> that class but really go to a super impl.
>
> You seem to have implemented it in js with _super exactly like we do
> also in our product Servoy, only there the 'classes'  are not js
> things but Forms (UI elements) that has a set of js functions
>
> On 25/04/2009, Eduardo Nunes <es...@gmail.com> wrote:
>> Yes sure, you can call any method with super, but the syntax is
>> "this._super().method()".
>>
>> If you are in the "someFunction()" method and you call
>> "this._super().someFunction()" it will call the next "someFunction"
>> method up in the class hierarchy, but if you are in the
>> "someFunction()" method and call "this._super().anotherFunction()" it
>> will call the latest implementation of "anotherFunction" method. It
>> works exactly as Java.
>>
>> On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
>> <je...@wickettraining.com> wrote:
>>> Does it only apply to attributes then?  Can you still call the super's
>>> functions?  How do I do this?
>>>
>>> function someFunction() {
>>>    addMoreFunctionality();
>>>    super.someFunction();
>>> }
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>>> uhmm, why do you think it is pretty big? I shouldn't use
>>>> super.attribute, you can use this.attribute instead.
>>>> For example:
>>>>
>>>> var Shape = Class.extend({
>>>>    height: 0,
>>>>    width: 0,
>>>>    init: function(height, width) {
>>>>        this.height = height;
>>>>        this.width = width;
>>>>    },
>>>>    info: function() {
>>>>        alert("I have height = " + this.height +
>>>>            " and width = " + this.width);
>>>>    }
>>>> });
>>>>
>>>> var Rectangle = Shape.extend({
>>>>  info: function() {
>>>>    alert("I'm a rectangle and I have height = " + this.height + " and
>>>> width = " + this.width);
>>>>    // you can't do this.super().height, because this makes the method
>>>> accessor counter gets lost.
>>>>  }
>>>> });
>>>>
>>>> All attributes from the super class are copied to the new class.
>>>>
>>>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>>>> <je...@wickettraining.com> wrote:
>>>>> Looks nice, but:
>>>>>
>>>>>> Limitations
>>>>>>
>>>>>> It's not possible to access an attribute through the super function.
>>>>>
>>>>> That seems pretty big.  Do you plan on adding that?
>>>>>
>>>>> --
>>>>> Jeremy Thomerson
>>>>> http://www.wickettraining.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com>
>>>>> wrote:
>>>>>> Hello guys,
>>>>>>
>>>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>>>> experienced javascript developer and html coder, with helped me a lot
>>>>>> with my lack of knowledge in these areas. You can check more about it
>>>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>>>> enables you to use it in your commercial, or not, applications.
>>>>>>  I think it could help to make more complex things with javascript.
>>>>>>
>>>>>> Thanks,
>>>>>> Eduardo S. Nunes
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Johan Compagner <jc...@gmail.com>.
Java doesnt work like that
If you are in X and you call super.Y() then you will skipp the Y of
that class but really go to a super impl.

You seem to have implemented it in js with _super exactly like we do
also in our product Servoy, only there the 'classes'  are not js
things but Forms (UI elements) that has a set of js functions

On 25/04/2009, Eduardo Nunes <es...@gmail.com> wrote:
> Yes sure, you can call any method with super, but the syntax is
> "this._super().method()".
>
> If you are in the "someFunction()" method and you call
> "this._super().someFunction()" it will call the next "someFunction"
> method up in the class hierarchy, but if you are in the
> "someFunction()" method and call "this._super().anotherFunction()" it
> will call the latest implementation of "anotherFunction" method. It
> works exactly as Java.
>
> On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> Does it only apply to attributes then?  Can you still call the super's
>> functions?  How do I do this?
>>
>> function someFunction() {
>>    addMoreFunctionality();
>>    super.someFunction();
>> }
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>> uhmm, why do you think it is pretty big? I shouldn't use
>>> super.attribute, you can use this.attribute instead.
>>> For example:
>>>
>>> var Shape = Class.extend({
>>>    height: 0,
>>>    width: 0,
>>>    init: function(height, width) {
>>>        this.height = height;
>>>        this.width = width;
>>>    },
>>>    info: function() {
>>>        alert("I have height = " + this.height +
>>>            " and width = " + this.width);
>>>    }
>>> });
>>>
>>> var Rectangle = Shape.extend({
>>>  info: function() {
>>>    alert("I'm a rectangle and I have height = " + this.height + " and
>>> width = " + this.width);
>>>    // you can't do this.super().height, because this makes the method
>>> accessor counter gets lost.
>>>  }
>>> });
>>>
>>> All attributes from the super class are copied to the new class.
>>>
>>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>>> <je...@wickettraining.com> wrote:
>>>> Looks nice, but:
>>>>
>>>>> Limitations
>>>>>
>>>>> It's not possible to access an attribute through the super function.
>>>>
>>>> That seems pretty big.  Do you plan on adding that?
>>>>
>>>> --
>>>> Jeremy Thomerson
>>>> http://www.wickettraining.com
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com>
>>>> wrote:
>>>>> Hello guys,
>>>>>
>>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>>> experienced javascript developer and html coder, with helped me a lot
>>>>> with my lack of knowledge in these areas. You can check more about it
>>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>>> enables you to use it in your commercial, or not, applications.
>>>>>  I think it could help to make more complex things with javascript.
>>>>>
>>>>> Thanks,
>>>>> Eduardo S. Nunes
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Johan Compagner <jc...@gmail.com>.
Yes attributs is not a limit but is a logical thing, there are no
multiply implenetations of an attribute so calling super on them isnt
logical in my eyes anyway

Of course java does have multiple implementations of an attribute but
those are private and cant be accessed any way.

I evendont know from the top of my head what happens in java when you
declare a public or protected method twice.. Can you then acces it by
Classname.this.xxx ? Never seen or used that

On 25/04/2009, Eduardo Nunes <es...@gmail.com> wrote:
> Yes, thanks for your feedback. I changed the text a little bit:
>
> Limitations:
> It's not possible to access an attribute through the _super function
> e.g. this._super().attribute, instead you must use this.attribute.
> This limitation only applies to attributes.
>
> Later I will add a list of all features and leave this "Limitations"
> section below it.
>
> Thanks,
> Eduardo S. Nunes
>
> On Fri, Apr 24, 2009 at 8:59 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> Oh - perfect.  I might suggest adding a little clarification to that
>> line on your homepage.  The line is correct, but a little
>> clarification might help avoid simple misunderstandings such as this.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Apr 24, 2009 at 6:50 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>> Yes sure, you can call any method with super, but the syntax is
>>> "this._super().method()".
>>>
>>> If you are in the "someFunction()" method and you call
>>> "this._super().someFunction()" it will call the next "someFunction"
>>> method up in the class hierarchy, but if you are in the
>>> "someFunction()" method and call "this._super().anotherFunction()" it
>>> will call the latest implementation of "anotherFunction" method. It
>>> works exactly as Java.
>>>
>>> On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
>>> <je...@wickettraining.com> wrote:
>>>> Does it only apply to attributes then?  Can you still call the super's
>>>> functions?  How do I do this?
>>>>
>>>> function someFunction() {
>>>>    addMoreFunctionality();
>>>>    super.someFunction();
>>>> }
>>>>
>>>> --
>>>> Jeremy Thomerson
>>>> http://www.wickettraining.com
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com>
>>>> wrote:
>>>>> uhmm, why do you think it is pretty big? I shouldn't use
>>>>> super.attribute, you can use this.attribute instead.
>>>>> For example:
>>>>>
>>>>> var Shape = Class.extend({
>>>>>    height: 0,
>>>>>    width: 0,
>>>>>    init: function(height, width) {
>>>>>        this.height = height;
>>>>>        this.width = width;
>>>>>    },
>>>>>    info: function() {
>>>>>        alert("I have height = " + this.height +
>>>>>            " and width = " + this.width);
>>>>>    }
>>>>> });
>>>>>
>>>>> var Rectangle = Shape.extend({
>>>>>  info: function() {
>>>>>    alert("I'm a rectangle and I have height = " + this.height + " and
>>>>> width = " + this.width);
>>>>>    // you can't do this.super().height, because this makes the method
>>>>> accessor counter gets lost.
>>>>>  }
>>>>> });
>>>>>
>>>>> All attributes from the super class are copied to the new class.
>>>>>
>>>>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>>>>> <je...@wickettraining.com> wrote:
>>>>>> Looks nice, but:
>>>>>>
>>>>>>> Limitations
>>>>>>>
>>>>>>> It's not possible to access an attribute through the super function.
>>>>>>
>>>>>> That seems pretty big.  Do you plan on adding that?
>>>>>>
>>>>>> --
>>>>>> Jeremy Thomerson
>>>>>> http://www.wickettraining.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com>
>>>>>> wrote:
>>>>>>> Hello guys,
>>>>>>>
>>>>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>>>>> experienced javascript developer and html coder, with helped me a lot
>>>>>>> with my lack of knowledge in these areas. You can check more about it
>>>>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>>>>> enables you to use it in your commercial, or not, applications.
>>>>>>>  I think it could help to make more complex things with javascript.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Eduardo S. Nunes
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Eduardo Nunes <es...@gmail.com>.
Yes, thanks for your feedback. I changed the text a little bit:

Limitations:
It's not possible to access an attribute through the _super function
e.g. this._super().attribute, instead you must use this.attribute.
This limitation only applies to attributes.

Later I will add a list of all features and leave this "Limitations"
section below it.

Thanks,
Eduardo S. Nunes

On Fri, Apr 24, 2009 at 8:59 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Oh - perfect.  I might suggest adding a little clarification to that
> line on your homepage.  The line is correct, but a little
> clarification might help avoid simple misunderstandings such as this.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Apr 24, 2009 at 6:50 PM, Eduardo Nunes <es...@gmail.com> wrote:
>> Yes sure, you can call any method with super, but the syntax is
>> "this._super().method()".
>>
>> If you are in the "someFunction()" method and you call
>> "this._super().someFunction()" it will call the next "someFunction"
>> method up in the class hierarchy, but if you are in the
>> "someFunction()" method and call "this._super().anotherFunction()" it
>> will call the latest implementation of "anotherFunction" method. It
>> works exactly as Java.
>>
>> On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
>> <je...@wickettraining.com> wrote:
>>> Does it only apply to attributes then?  Can you still call the super's
>>> functions?  How do I do this?
>>>
>>> function someFunction() {
>>>    addMoreFunctionality();
>>>    super.someFunction();
>>> }
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>>> uhmm, why do you think it is pretty big? I shouldn't use
>>>> super.attribute, you can use this.attribute instead.
>>>> For example:
>>>>
>>>> var Shape = Class.extend({
>>>>    height: 0,
>>>>    width: 0,
>>>>    init: function(height, width) {
>>>>        this.height = height;
>>>>        this.width = width;
>>>>    },
>>>>    info: function() {
>>>>        alert("I have height = " + this.height +
>>>>            " and width = " + this.width);
>>>>    }
>>>> });
>>>>
>>>> var Rectangle = Shape.extend({
>>>>  info: function() {
>>>>    alert("I'm a rectangle and I have height = " + this.height + " and
>>>> width = " + this.width);
>>>>    // you can't do this.super().height, because this makes the method
>>>> accessor counter gets lost.
>>>>  }
>>>> });
>>>>
>>>> All attributes from the super class are copied to the new class.
>>>>
>>>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>>>> <je...@wickettraining.com> wrote:
>>>>> Looks nice, but:
>>>>>
>>>>>> Limitations
>>>>>>
>>>>>> It's not possible to access an attribute through the super function.
>>>>>
>>>>> That seems pretty big.  Do you plan on adding that?
>>>>>
>>>>> --
>>>>> Jeremy Thomerson
>>>>> http://www.wickettraining.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>>>>> Hello guys,
>>>>>>
>>>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>>>> experienced javascript developer and html coder, with helped me a lot
>>>>>> with my lack of knowledge in these areas. You can check more about it
>>>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>>>> enables you to use it in your commercial, or not, applications.
>>>>>>  I think it could help to make more complex things with javascript.
>>>>>>
>>>>>> Thanks,
>>>>>> Eduardo S. Nunes
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Oh - perfect.  I might suggest adding a little clarification to that
line on your homepage.  The line is correct, but a little
clarification might help avoid simple misunderstandings such as this.

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




On Fri, Apr 24, 2009 at 6:50 PM, Eduardo Nunes <es...@gmail.com> wrote:
> Yes sure, you can call any method with super, but the syntax is
> "this._super().method()".
>
> If you are in the "someFunction()" method and you call
> "this._super().someFunction()" it will call the next "someFunction"
> method up in the class hierarchy, but if you are in the
> "someFunction()" method and call "this._super().anotherFunction()" it
> will call the latest implementation of "anotherFunction" method. It
> works exactly as Java.
>
> On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> Does it only apply to attributes then?  Can you still call the super's
>> functions?  How do I do this?
>>
>> function someFunction() {
>>    addMoreFunctionality();
>>    super.someFunction();
>> }
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>> uhmm, why do you think it is pretty big? I shouldn't use
>>> super.attribute, you can use this.attribute instead.
>>> For example:
>>>
>>> var Shape = Class.extend({
>>>    height: 0,
>>>    width: 0,
>>>    init: function(height, width) {
>>>        this.height = height;
>>>        this.width = width;
>>>    },
>>>    info: function() {
>>>        alert("I have height = " + this.height +
>>>            " and width = " + this.width);
>>>    }
>>> });
>>>
>>> var Rectangle = Shape.extend({
>>>  info: function() {
>>>    alert("I'm a rectangle and I have height = " + this.height + " and
>>> width = " + this.width);
>>>    // you can't do this.super().height, because this makes the method
>>> accessor counter gets lost.
>>>  }
>>> });
>>>
>>> All attributes from the super class are copied to the new class.
>>>
>>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>>> <je...@wickettraining.com> wrote:
>>>> Looks nice, but:
>>>>
>>>>> Limitations
>>>>>
>>>>> It's not possible to access an attribute through the super function.
>>>>
>>>> That seems pretty big.  Do you plan on adding that?
>>>>
>>>> --
>>>> Jeremy Thomerson
>>>> http://www.wickettraining.com
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>>>> Hello guys,
>>>>>
>>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>>> experienced javascript developer and html coder, with helped me a lot
>>>>> with my lack of knowledge in these areas. You can check more about it
>>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>>> enables you to use it in your commercial, or not, applications.
>>>>>  I think it could help to make more complex things with javascript.
>>>>>
>>>>> Thanks,
>>>>> Eduardo S. Nunes
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Eduardo Nunes <es...@gmail.com>.
Yes sure, you can call any method with super, but the syntax is
"this._super().method()".

If you are in the "someFunction()" method and you call
"this._super().someFunction()" it will call the next "someFunction"
method up in the class hierarchy, but if you are in the
"someFunction()" method and call "this._super().anotherFunction()" it
will call the latest implementation of "anotherFunction" method. It
works exactly as Java.

On Fri, Apr 24, 2009 at 8:44 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Does it only apply to attributes then?  Can you still call the super's
> functions?  How do I do this?
>
> function someFunction() {
>    addMoreFunctionality();
>    super.someFunction();
> }
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
>> uhmm, why do you think it is pretty big? I shouldn't use
>> super.attribute, you can use this.attribute instead.
>> For example:
>>
>> var Shape = Class.extend({
>>    height: 0,
>>    width: 0,
>>    init: function(height, width) {
>>        this.height = height;
>>        this.width = width;
>>    },
>>    info: function() {
>>        alert("I have height = " + this.height +
>>            " and width = " + this.width);
>>    }
>> });
>>
>> var Rectangle = Shape.extend({
>>  info: function() {
>>    alert("I'm a rectangle and I have height = " + this.height + " and
>> width = " + this.width);
>>    // you can't do this.super().height, because this makes the method
>> accessor counter gets lost.
>>  }
>> });
>>
>> All attributes from the super class are copied to the new class.
>>
>> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
>> <je...@wickettraining.com> wrote:
>>> Looks nice, but:
>>>
>>>> Limitations
>>>>
>>>> It's not possible to access an attribute through the super function.
>>>
>>> That seems pretty big.  Do you plan on adding that?
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>>> Hello guys,
>>>>
>>>>  I'm not used to develop in Javascript but, as a fan of programming
>>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>>> experienced javascript developer and html coder, with helped me a lot
>>>> with my lack of knowledge in these areas. You can check more about it
>>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>>> enables you to use it in your commercial, or not, applications.
>>>>  I think it could help to make more complex things with javascript.
>>>>
>>>> Thanks,
>>>> Eduardo S. Nunes
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Does it only apply to attributes then?  Can you still call the super's
functions?  How do I do this?

function someFunction() {
    addMoreFunctionality();
    super.someFunction();
}

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




On Fri, Apr 24, 2009 at 6:37 PM, Eduardo Nunes <es...@gmail.com> wrote:
> uhmm, why do you think it is pretty big? I shouldn't use
> super.attribute, you can use this.attribute instead.
> For example:
>
> var Shape = Class.extend({
>    height: 0,
>    width: 0,
>    init: function(height, width) {
>        this.height = height;
>        this.width = width;
>    },
>    info: function() {
>        alert("I have height = " + this.height +
>            " and width = " + this.width);
>    }
> });
>
> var Rectangle = Shape.extend({
>  info: function() {
>    alert("I'm a rectangle and I have height = " + this.height + " and
> width = " + this.width);
>    // you can't do this.super().height, because this makes the method
> accessor counter gets lost.
>  }
> });
>
> All attributes from the super class are copied to the new class.
>
> On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> Looks nice, but:
>>
>>> Limitations
>>>
>>> It's not possible to access an attribute through the super function.
>>
>> That seems pretty big.  Do you plan on adding that?
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
>>> Hello guys,
>>>
>>>  I'm not used to develop in Javascript but, as a fan of programming
>>> languages and object-oriented paradigm, my friend Otavio Avila and I
>>> decided to develop a kind of inheritance in JavaScript. He is a very
>>> experienced javascript developer and html coder, with helped me a lot
>>> with my lack of knowledge in these areas. You can check more about it
>>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>>> enables you to use it in your commercial, or not, applications.
>>>  I think it could help to make more complex things with javascript.
>>>
>>> Thanks,
>>> Eduardo S. Nunes
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Eduardo Nunes <es...@gmail.com>.
uhmm, why do you think it is pretty big? I shouldn't use
super.attribute, you can use this.attribute instead.
For example:

var Shape = Class.extend({
    height: 0,
    width: 0,
    init: function(height, width) {
        this.height = height;
        this.width = width;
    },
    info: function() {
        alert("I have height = " + this.height +
            " and width = " + this.width);
    }
});

var Rectangle = Shape.extend({
  info: function() {
    alert("I'm a rectangle and I have height = " + this.height + " and
width = " + this.width);
    // you can't do this.super().height, because this makes the method
accessor counter gets lost.
  }
});

All attributes from the super class are copied to the new class.

On Fri, Apr 24, 2009 at 8:07 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Looks nice, but:
>
>> Limitations
>>
>> It's not possible to access an attribute through the super function.
>
> That seems pretty big.  Do you plan on adding that?
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
>> Hello guys,
>>
>>  I'm not used to develop in Javascript but, as a fan of programming
>> languages and object-oriented paradigm, my friend Otavio Avila and I
>> decided to develop a kind of inheritance in JavaScript. He is a very
>> experienced javascript developer and html coder, with helped me a lot
>> with my lack of knowledge in these areas. You can check more about it
>> in http://jsii.googlecode.com. The project is licensed in LGPL that
>> enables you to use it in your commercial, or not, applications.
>>  I think it could help to make more complex things with javascript.
>>
>> Thanks,
>> Eduardo S. Nunes
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Announce: new JavaScript Inheritance Implementation

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Looks nice, but:

> Limitations
>
> It's not possible to access an attribute through the super function.

That seems pretty big.  Do you plan on adding that?

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




On Fri, Apr 24, 2009 at 5:47 PM, Eduardo Nunes <es...@gmail.com> wrote:
> Hello guys,
>
>  I'm not used to develop in Javascript but, as a fan of programming
> languages and object-oriented paradigm, my friend Otavio Avila and I
> decided to develop a kind of inheritance in JavaScript. He is a very
> experienced javascript developer and html coder, with helped me a lot
> with my lack of knowledge in these areas. You can check more about it
> in http://jsii.googlecode.com. The project is licensed in LGPL that
> enables you to use it in your commercial, or not, applications.
>  I think it could help to make more complex things with javascript.
>
> Thanks,
> Eduardo S. Nunes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Delegate loading of wicket-event.js?

Posted by bh...@actrix.gen.nz.
Thanks Igor.
https://issues.apache.org/jira/browse/WICKET-2999

Regards,

Bernard


On Tue, 17 Aug 2010 18:31:50 -0700, you wrote:

>you should file this as a bug, packagedresourcereference urls should
>not be encoded with the session id
>
>-igor
>
>On Tue, Aug 17, 2010 at 6:30 PM,  <bh...@actrix.gen.nz> wrote:
>> Hi,
>>
>> I get two instances of wicket-event.js and other resources in the
>> browser cache due to the probing for client cookie suport on the first
>> page in the browser session. One with jsessionid in the URl and one
>> without.
>>
>> Can Wicket delegate the loading of these (extracted from the jar file)
>> files to outside the path of the wicket servlet filter eg ../scripts
>> same as static css files, images?
>>
>> Example:
>>
>> <script type="text/javascript"
>> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83"></script>
>>
>> Many thanks,
>>
>> Bernard
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Delegate loading of wicket-event.js?

Posted by Igor Vaynberg <ig...@gmail.com>.
you should file this as a bug, packagedresourcereference urls should
not be encoded with the session id

-igor

On Tue, Aug 17, 2010 at 6:30 PM,  <bh...@actrix.gen.nz> wrote:
> Hi,
>
> I get two instances of wicket-event.js and other resources in the
> browser cache due to the probing for client cookie suport on the first
> page in the browser session. One with jsessionid in the URl and one
> without.
>
> Can Wicket delegate the loading of these (extracted from the jar file)
> files to outside the path of the wicket servlet filter eg ../scripts
> same as static css files, images?
>
> Example:
>
> <script type="text/javascript"
> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83"></script>
>
> Many thanks,
>
> Bernard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Delegate loading of wicket-event.js?

Posted by bh...@actrix.gen.nz.
Hi,

I get two instances of wicket-event.js and other resources in the
browser cache due to the probing for client cookie suport on the first
page in the browser session. One with jsessionid in the URl and one
without.

Can Wicket delegate the loading of these (extracted from the jar file)
files to outside the path of the wicket servlet filter eg ../scripts
same as static css files, images?

Example:

<script type="text/javascript"
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83"></script>

Many thanks,

Bernard

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