Thanks for the info jamesr.
Yes that is the way that i m looking for. By declaring a method,  i could
workaround it.
I hope someone will have time to answer the other 2 questions.
Thanks again.

Cem

2010/9/9 jamesr <[email protected]>

> I can state that you cannot override handlers, whose philosophy is one of
> hooking or extending events, not replacing them. That task is reserved for
> overriding methods, where the new method will replace any previous methods
> defined (unless you call the "super" construct to invoke the previously
> defined method in your overriding method)\
>
> I think what you might be looking for is having your onclick handler invoke
> a method in the same class, and then that method in the class could be
> overridden by subclasses.
>

> -jamesr
>
> cem sonmez wrote:
>
>> Hi, as i said in my earlier post, i have some questions that are probably
>> so simple for you.
>>
>> 1-) I have two classes like below.
>>
>> <class name="chatView" extends="view" align="center">
>>  <!--shared object for chat-->
>>        <sharedObjectChat id="soChat">
>>            <handler name="onconnected" reference="conn">
>>                //Debug.info("connected attribute operation, value
>> :%w",conn.connectionOK);
>>                if (conn.connected) {
>>                    this.connect("chat", conn._conn, true);
>>                    this.so.client=this;
>>                }
>>            </handler>
>>        </sharedObjectChat>
>> ...
>> </class>
>>
>> <class name="login" extends="window">
>> <button name="loginButton" >Login
>>     <handler name="onclick"><![CDATA[
>>          *conn.connect('rtmp://127.0.0.1/fi6en' <
>> http://127.0.0.1/fi6en%27>);*
>>
>>          //Debug.info("connected attribute operation, value
>> :%w",conn.connected);
>>          *soChat.send("writeInfo", username + " logged in");*
>>     </handler>
>> ....
>> </button>
>>
>> in the chatView class definetion, i am creating the soChat object depend
>> on the connection status of *conn*.
>> The problem causes at the lines that i have made bold. in the debugger, i
>> see that soChat.send() method is being called before the connected message
>> of the conn object and getting flash runtime error as expected *Error 1009 :
>> *Cannot access a property or method of a null object reference. .
>> And later i see that i can use the soChat  clearly.
>>
>> So my goal is to delay the soChat.send() method depend on the message
>> NetConnection.Connect.Success. Is there any way to do something for this.
>>
>>
>> 2-)
>> Is it possible to override a handler of an element in a class object.
>> For the clarification :
>>
>> <class name="registerNewUser" extends="window" title="Register">
>>    <button name="registerButton">Register
>>           <handler name="onclick">
>>               Debug.info('Username : %w', classroot.getUsername());
>>               ....
>>           </handler>
>>    </button>
>> ....
>> </class>
>>
>> <canvas>
>>    <registerNewUser name="registerWindow">
>> *                // here i want to override the onclick handler of the
>> registerButton button*
>>   </registerNewUser>
>> </canvas>
>>
>>
>> 3-) Actually, this is not a specific question:) I am not sure that
>> somebody has the same idea with me, but it takes a long time to organize the
>> visual elements in openlaszlo.
>> At this situation, i strongly need a visual openlaszlo editor. Max
>> recommended me one, named "dragn", but i got some problems on installing
>>  and running issues.
>> For openlaszlo-dev team: do you have any plan for developing an openlaszlo
>> IDE as the developer team.
>>
>> Thanks
>> --
>> Cem SONMEZ
>>
>
>


-- 
Cem SONMEZ

Reply via email to