You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2012/10/18 15:44:38 UTC

"omComponentInit" is only called the first time a panel is loaded

Hi Maxim,

you've added the function "omComponentInit" to be called everytime a Panel
is loaded.

But the function is only called the first time you load the panel, if you
click another menu item and then return to the previous it is not called
again.

That is also the reason why the calendar UI is only shown on the first
click from my point of view.
Do you have an idea what went wrong here?
We once had some code that had an if-else construct to check if its the
first loading of the Panel or if it gets reloaded. Depending on that the JS
was called differently. I think I had implemented that in some Panel and
then removed it again.

This was the solution I've implemented:
http://markmail.org/message/7k2jlhivtkz6fb7f

However I can't see where we would put this in the MenuPanel.
Basically I think the whole call of the omComponentInit should go into the
Panel Header itself instead of the Menu.

What do you think?

-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by Maxim Solodovnik <so...@gmail.com>.
looks good :)
Irina says it's pretty :))

On Fri, Oct 19, 2012 at 1:20 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> Hi,
>
> I like that approach. I just have slightly modified it. I have just
> committed that.
>
> Instead of calling the JavaScript in the MenuPanel I forward the call to
> the BasePanel class and have an method: onMenuPanelLoad(AjaxRequestTarget
> target)
> In the Panel itself you can then overwrite this method to execute or do
> whatever with the AjaxRequestTarget.
> I think its makes it easier, cause in that way you can configure the
> initialization/behaviour of the Panel inside the Panel and not elsewhere.
>
> I also have committed some changes to the Form layout but only UsersPanel
> is completed, rest will follow soon :)
> But maybe you can check the UsersPanel already.
>
> One open thing that I have not done yet is for example to handle browser
> resize events.
>
>
> Sebastian
>
> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>
>> I would like to propose simple and powerfull solution for this issue.
>> Since we unable to use document.ready (because of our singlepage nature)
>> lets try to use the following method:
>>
>> GroupsPanel declaring JS method groupsInit
>> CalendarPanel declaring JS method calendarInit
>> LangPanel declaring JS method labelsInit
>>
>> MenuPanel calling one of these methods correspondingly
>> this way we will have JS code in markup (it will be easier to read and at
>> least partially verified by Eclipse)
>> And the method will be called each tipe component is loaded
>>
>> please take a look at just commited code: revision 1399702
>>
>>
>> On Thu, Oct 18, 2012 at 9:50 PM, Maxim Solodovnik <so...@gmail.com>wrote:
>>
>>> I guess this is why i had window.omComponentInit = null; in the code.
>>> I'll try to investigate a little bit more
>>>
>>>
>>> On Thu, Oct 18, 2012 at 9:46 PM, seba.wagner@gmail.com <
>>> seba.wagner@gmail.com> wrote:
>>>
>>>> 3) Load the application with:
>>>> localhost:5080/openmeetings/html/#calendar => calendar is loaded
>>>> (omComponentInit is called)
>>>> Click on the UsersPanel menu entry => do Panel is shown
>>>> Click on the calendar panel => do Panel is shown => Calendar is NO more
>>>> loaded
>>>>
>>>> => From my point of view everytime you add that function to the header,
>>>> you will either overwrite something or definitely break something.
>>>>
>>>> Sebastian
>>>>
>>>> 2012/10/18 seba.wagner@gmail.com <se...@gmail.com>
>>>>
>>>> yes and no :)
>>>>>
>>>>> Add
>>>>>     <wicket:head>
>>>>>        <script type="text/javascript">
>>>>>            function omComponentInit() {
>>>>>                alert("do");
>>>>>            }
>>>>>        </script>
>>>>>     </wicket:head>
>>>>>
>>>>> to the UsersPanel.java
>>>>>
>>>>> 1) You can click around, you might see the "do" box twice, but as soon
>>>>> as you switch to other menu entries 1-2 times and return to the UsersPanel
>>>>> => The dialog is no more shown.
>>>>> So omComponentInit is not executed every time you load the Panel from
>>>>> my point of view.
>>>>>
>>>>> 2) If you load
>>>>> localhost:5080/openmeetings/html/#admin/configs
>>>>> then: click on the UsersPanel => do alert is shown
>>>>> then click on the ConfigurationsPanel => do alert is shown => ?!?! =>
>>>>> in the ConfigPanel.html has no such JavaScript Method, so it will execute
>>>>> something from the UsersPanel when you click on the ConfigsPanel menu entry?
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>>>>>
>>>>>> I did fix it
>>>>>> please see revision 1399671
>>>>>> The only issue: JS errors caused by calendar autoreload (please
>>>>>> ignore them for now)
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <
>>>>>> solomax666@gmail.com> wrote:
>>>>>>
>>>>>>> I was sure it works as expected.
>>>>>>> let me double check.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi Maxim,
>>>>>>>>
>>>>>>>> you've added the function "omComponentInit" to be called everytime
>>>>>>>> a Panel is loaded.
>>>>>>>>
>>>>>>>> But the function is only called the first time you load the panel,
>>>>>>>> if you click another menu item and then return to the previous it is not
>>>>>>>> called again.
>>>>>>>>
>>>>>>>> That is also the reason why the calendar UI is only shown on the
>>>>>>>> first click from my point of view.
>>>>>>>> Do you have an idea what went wrong here?
>>>>>>>> We once had some code that had an if-else construct to check if its
>>>>>>>> the first loading of the Panel or if it gets reloaded. Depending on that
>>>>>>>> the JS was called differently. I think I had implemented that in some Panel
>>>>>>>> and then removed it again.
>>>>>>>>
>>>>>>>> This was the solution I've implemented:
>>>>>>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>>>>>>
>>>>>>>> However I can't see where we would put this in the MenuPanel.
>>>>>>>> Basically I think the whole call of the omComponentInit should go
>>>>>>>> into the Panel Header itself instead of the Menu.
>>>>>>>>
>>>>>>>> What do you think?
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sebastian Wagner
>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>> http://www.webbase-design.de
>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>> seba.wagner@gmail.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> WBR
>>>>>>> Maxim aka solomax
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sebastian Wagner
>>>>> https://twitter.com/#!/dead_lock
>>>>> http://www.webbase-design.de
>>>>> http://www.wagner-sebastian.com
>>>>> seba.wagner@gmail.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Hi,

I like that approach. I just have slightly modified it. I have just
committed that.

Instead of calling the JavaScript in the MenuPanel I forward the call to
the BasePanel class and have an method: onMenuPanelLoad(AjaxRequestTarget
target)
In the Panel itself you can then overwrite this method to execute or do
whatever with the AjaxRequestTarget.
I think its makes it easier, cause in that way you can configure the
initialization/behaviour of the Panel inside the Panel and not elsewhere.

I also have committed some changes to the Form layout but only UsersPanel
is completed, rest will follow soon :)
But maybe you can check the UsersPanel already.

One open thing that I have not done yet is for example to handle browser
resize events.

Sebastian

2012/10/18 Maxim Solodovnik <so...@gmail.com>

> I would like to propose simple and powerfull solution for this issue.
> Since we unable to use document.ready (because of our singlepage nature)
> lets try to use the following method:
>
> GroupsPanel declaring JS method groupsInit
> CalendarPanel declaring JS method calendarInit
> LangPanel declaring JS method labelsInit
>
> MenuPanel calling one of these methods correspondingly
> this way we will have JS code in markup (it will be easier to read and at
> least partially verified by Eclipse)
> And the method will be called each tipe component is loaded
>
> please take a look at just commited code: revision 1399702
>
>
> On Thu, Oct 18, 2012 at 9:50 PM, Maxim Solodovnik <so...@gmail.com>wrote:
>
>> I guess this is why i had window.omComponentInit = null; in the code.
>> I'll try to investigate a little bit more
>>
>>
>> On Thu, Oct 18, 2012 at 9:46 PM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>>> 3) Load the application with:
>>> localhost:5080/openmeetings/html/#calendar => calendar is loaded
>>> (omComponentInit is called)
>>> Click on the UsersPanel menu entry => do Panel is shown
>>> Click on the calendar panel => do Panel is shown => Calendar is NO more
>>> loaded
>>>
>>> => From my point of view everytime you add that function to the header,
>>> you will either overwrite something or definitely break something.
>>>
>>> Sebastian
>>>
>>> 2012/10/18 seba.wagner@gmail.com <se...@gmail.com>
>>>
>>> yes and no :)
>>>>
>>>> Add
>>>>     <wicket:head>
>>>>        <script type="text/javascript">
>>>>            function omComponentInit() {
>>>>                alert("do");
>>>>            }
>>>>        </script>
>>>>     </wicket:head>
>>>>
>>>> to the UsersPanel.java
>>>>
>>>> 1) You can click around, you might see the "do" box twice, but as soon
>>>> as you switch to other menu entries 1-2 times and return to the UsersPanel
>>>> => The dialog is no more shown.
>>>> So omComponentInit is not executed every time you load the Panel from
>>>> my point of view.
>>>>
>>>> 2) If you load
>>>> localhost:5080/openmeetings/html/#admin/configs
>>>> then: click on the UsersPanel => do alert is shown
>>>> then click on the ConfigurationsPanel => do alert is shown => ?!?! =>
>>>> in the ConfigPanel.html has no such JavaScript Method, so it will execute
>>>> something from the UsersPanel when you click on the ConfigsPanel menu entry?
>>>>
>>>> Sebastian
>>>>
>>>>
>>>> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>>>>
>>>>> I did fix it
>>>>> please see revision 1399671
>>>>> The only issue: JS errors caused by calendar autoreload (please ignore
>>>>> them for now)
>>>>>
>>>>>
>>>>> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <
>>>>> solomax666@gmail.com> wrote:
>>>>>
>>>>>> I was sure it works as expected.
>>>>>> let me double check.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Maxim,
>>>>>>>
>>>>>>> you've added the function "omComponentInit" to be called everytime a
>>>>>>> Panel is loaded.
>>>>>>>
>>>>>>> But the function is only called the first time you load the panel,
>>>>>>> if you click another menu item and then return to the previous it is not
>>>>>>> called again.
>>>>>>>
>>>>>>> That is also the reason why the calendar UI is only shown on the
>>>>>>> first click from my point of view.
>>>>>>> Do you have an idea what went wrong here?
>>>>>>> We once had some code that had an if-else construct to check if its
>>>>>>> the first loading of the Panel or if it gets reloaded. Depending on that
>>>>>>> the JS was called differently. I think I had implemented that in some Panel
>>>>>>> and then removed it again.
>>>>>>>
>>>>>>> This was the solution I've implemented:
>>>>>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>>>>>
>>>>>>> However I can't see where we would put this in the MenuPanel.
>>>>>>> Basically I think the whole call of the omComponentInit should go
>>>>>>> into the Panel Header itself instead of the Menu.
>>>>>>>
>>>>>>> What do you think?
>>>>>>>
>>>>>>> --
>>>>>>> Sebastian Wagner
>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>> http://www.webbase-design.de
>>>>>>> http://www.wagner-sebastian.com
>>>>>>> seba.wagner@gmail.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by Maxim Solodovnik <so...@gmail.com>.
I would like to propose simple and powerfull solution for this issue.
Since we unable to use document.ready (because of our singlepage nature)
lets try to use the following method:

GroupsPanel declaring JS method groupsInit
CalendarPanel declaring JS method calendarInit
LangPanel declaring JS method labelsInit

MenuPanel calling one of these methods correspondingly
this way we will have JS code in markup (it will be easier to read and at
least partially verified by Eclipse)
And the method will be called each tipe component is loaded

please take a look at just commited code: revision 1399702

On Thu, Oct 18, 2012 at 9:50 PM, Maxim Solodovnik <so...@gmail.com>wrote:

> I guess this is why i had window.omComponentInit = null; in the code.
> I'll try to investigate a little bit more
>
>
> On Thu, Oct 18, 2012 at 9:46 PM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> 3) Load the application with:
>> localhost:5080/openmeetings/html/#calendar => calendar is loaded
>> (omComponentInit is called)
>> Click on the UsersPanel menu entry => do Panel is shown
>> Click on the calendar panel => do Panel is shown => Calendar is NO more
>> loaded
>>
>> => From my point of view everytime you add that function to the header,
>> you will either overwrite something or definitely break something.
>>
>> Sebastian
>>
>> 2012/10/18 seba.wagner@gmail.com <se...@gmail.com>
>>
>> yes and no :)
>>>
>>> Add
>>>     <wicket:head>
>>>        <script type="text/javascript">
>>>            function omComponentInit() {
>>>                alert("do");
>>>            }
>>>        </script>
>>>     </wicket:head>
>>>
>>> to the UsersPanel.java
>>>
>>> 1) You can click around, you might see the "do" box twice, but as soon
>>> as you switch to other menu entries 1-2 times and return to the UsersPanel
>>> => The dialog is no more shown.
>>> So omComponentInit is not executed every time you load the Panel from my
>>> point of view.
>>>
>>> 2) If you load
>>> localhost:5080/openmeetings/html/#admin/configs
>>> then: click on the UsersPanel => do alert is shown
>>> then click on the ConfigurationsPanel => do alert is shown => ?!?! => in
>>> the ConfigPanel.html has no such JavaScript Method, so it will execute
>>> something from the UsersPanel when you click on the ConfigsPanel menu entry?
>>>
>>> Sebastian
>>>
>>>
>>> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>>>
>>>> I did fix it
>>>> please see revision 1399671
>>>> The only issue: JS errors caused by calendar autoreload (please ignore
>>>> them for now)
>>>>
>>>>
>>>> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <solomax666@gmail.com
>>>> > wrote:
>>>>
>>>>> I was sure it works as expected.
>>>>> let me double check.
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>>>>> seba.wagner@gmail.com> wrote:
>>>>>
>>>>>> Hi Maxim,
>>>>>>
>>>>>> you've added the function "omComponentInit" to be called everytime a
>>>>>> Panel is loaded.
>>>>>>
>>>>>> But the function is only called the first time you load the panel, if
>>>>>> you click another menu item and then return to the previous it is not
>>>>>> called again.
>>>>>>
>>>>>> That is also the reason why the calendar UI is only shown on the
>>>>>> first click from my point of view.
>>>>>> Do you have an idea what went wrong here?
>>>>>> We once had some code that had an if-else construct to check if its
>>>>>> the first loading of the Panel or if it gets reloaded. Depending on that
>>>>>> the JS was called differently. I think I had implemented that in some Panel
>>>>>> and then removed it again.
>>>>>>
>>>>>> This was the solution I've implemented:
>>>>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>>>>
>>>>>> However I can't see where we would put this in the MenuPanel.
>>>>>> Basically I think the whole call of the omComponentInit should go
>>>>>> into the Panel Header itself instead of the Menu.
>>>>>>
>>>>>> What do you think?
>>>>>>
>>>>>> --
>>>>>> Sebastian Wagner
>>>>>> https://twitter.com/#!/dead_lock
>>>>>> http://www.webbase-design.de
>>>>>> http://www.wagner-sebastian.com
>>>>>> seba.wagner@gmail.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by Maxim Solodovnik <so...@gmail.com>.
I guess this is why i had window.omComponentInit = null; in the code.
I'll try to investigate a little bit more

On Thu, Oct 18, 2012 at 9:46 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> 3) Load the application with:
> localhost:5080/openmeetings/html/#calendar => calendar is loaded
> (omComponentInit is called)
> Click on the UsersPanel menu entry => do Panel is shown
> Click on the calendar panel => do Panel is shown => Calendar is NO more
> loaded
>
> => From my point of view everytime you add that function to the header,
> you will either overwrite something or definitely break something.
>
> Sebastian
>
> 2012/10/18 seba.wagner@gmail.com <se...@gmail.com>
>
> yes and no :)
>>
>> Add
>>     <wicket:head>
>>        <script type="text/javascript">
>>            function omComponentInit() {
>>                alert("do");
>>            }
>>        </script>
>>     </wicket:head>
>>
>> to the UsersPanel.java
>>
>> 1) You can click around, you might see the "do" box twice, but as soon as
>> you switch to other menu entries 1-2 times and return to the UsersPanel =>
>> The dialog is no more shown.
>> So omComponentInit is not executed every time you load the Panel from my
>> point of view.
>>
>> 2) If you load
>> localhost:5080/openmeetings/html/#admin/configs
>> then: click on the UsersPanel => do alert is shown
>> then click on the ConfigurationsPanel => do alert is shown => ?!?! => in
>> the ConfigPanel.html has no such JavaScript Method, so it will execute
>> something from the UsersPanel when you click on the ConfigsPanel menu entry?
>>
>> Sebastian
>>
>>
>> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>>
>>> I did fix it
>>> please see revision 1399671
>>> The only issue: JS errors caused by calendar autoreload (please ignore
>>> them for now)
>>>
>>>
>>> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <so...@gmail.com>wrote:
>>>
>>>> I was sure it works as expected.
>>>> let me double check.
>>>>
>>>>
>>>>
>>>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>>>> seba.wagner@gmail.com> wrote:
>>>>
>>>>> Hi Maxim,
>>>>>
>>>>> you've added the function "omComponentInit" to be called everytime a
>>>>> Panel is loaded.
>>>>>
>>>>> But the function is only called the first time you load the panel, if
>>>>> you click another menu item and then return to the previous it is not
>>>>> called again.
>>>>>
>>>>> That is also the reason why the calendar UI is only shown on the first
>>>>> click from my point of view.
>>>>> Do you have an idea what went wrong here?
>>>>> We once had some code that had an if-else construct to check if its
>>>>> the first loading of the Panel or if it gets reloaded. Depending on that
>>>>> the JS was called differently. I think I had implemented that in some Panel
>>>>> and then removed it again.
>>>>>
>>>>> This was the solution I've implemented:
>>>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>>>
>>>>> However I can't see where we would put this in the MenuPanel.
>>>>> Basically I think the whole call of the omComponentInit should go into
>>>>> the Panel Header itself instead of the Menu.
>>>>>
>>>>> What do you think?
>>>>>
>>>>> --
>>>>> Sebastian Wagner
>>>>> https://twitter.com/#!/dead_lock
>>>>> http://www.webbase-design.de
>>>>> http://www.wagner-sebastian.com
>>>>> seba.wagner@gmail.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
3) Load the application with:
localhost:5080/openmeetings/html/#calendar => calendar is loaded
(omComponentInit is called)
Click on the UsersPanel menu entry => do Panel is shown
Click on the calendar panel => do Panel is shown => Calendar is NO more
loaded

=> From my point of view everytime you add that function to the header, you
will either overwrite something or definitely break something.

Sebastian

2012/10/18 seba.wagner@gmail.com <se...@gmail.com>

> yes and no :)
>
> Add
>     <wicket:head>
>        <script type="text/javascript">
>            function omComponentInit() {
>                alert("do");
>            }
>        </script>
>     </wicket:head>
>
> to the UsersPanel.java
>
> 1) You can click around, you might see the "do" box twice, but as soon as
> you switch to other menu entries 1-2 times and return to the UsersPanel =>
> The dialog is no more shown.
> So omComponentInit is not executed every time you load the Panel from my
> point of view.
>
> 2) If you load
> localhost:5080/openmeetings/html/#admin/configs
> then: click on the UsersPanel => do alert is shown
> then click on the ConfigurationsPanel => do alert is shown => ?!?! => in
> the ConfigPanel.html has no such JavaScript Method, so it will execute
> something from the UsersPanel when you click on the ConfigsPanel menu entry?
>
> Sebastian
>
>
> 2012/10/18 Maxim Solodovnik <so...@gmail.com>
>
>> I did fix it
>> please see revision 1399671
>> The only issue: JS errors caused by calendar autoreload (please ignore
>> them for now)
>>
>>
>> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <so...@gmail.com>wrote:
>>
>>> I was sure it works as expected.
>>> let me double check.
>>>
>>>
>>>
>>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>>> seba.wagner@gmail.com> wrote:
>>>
>>>> Hi Maxim,
>>>>
>>>> you've added the function "omComponentInit" to be called everytime a
>>>> Panel is loaded.
>>>>
>>>> But the function is only called the first time you load the panel, if
>>>> you click another menu item and then return to the previous it is not
>>>> called again.
>>>>
>>>> That is also the reason why the calendar UI is only shown on the first
>>>> click from my point of view.
>>>> Do you have an idea what went wrong here?
>>>> We once had some code that had an if-else construct to check if its the
>>>> first loading of the Panel or if it gets reloaded. Depending on that the JS
>>>> was called differently. I think I had implemented that in some Panel and
>>>> then removed it again.
>>>>
>>>> This was the solution I've implemented:
>>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>>
>>>> However I can't see where we would put this in the MenuPanel.
>>>> Basically I think the whole call of the omComponentInit should go into
>>>> the Panel Header itself instead of the Menu.
>>>>
>>>> What do you think?
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
yes and no :)

Add
    <wicket:head>
       <script type="text/javascript">
           function omComponentInit() {
               alert("do");
           }
       </script>
    </wicket:head>

to the UsersPanel.java

1) You can click around, you might see the "do" box twice, but as soon as
you switch to other menu entries 1-2 times and return to the UsersPanel =>
The dialog is no more shown.
So omComponentInit is not executed every time you load the Panel from my
point of view.

2) If you load
localhost:5080/openmeetings/html/#admin/configs
then: click on the UsersPanel => do alert is shown
then click on the ConfigurationsPanel => do alert is shown => ?!?! => in
the ConfigPanel.html has no such JavaScript Method, so it will execute
something from the UsersPanel when you click on the ConfigsPanel menu entry?

Sebastian

2012/10/18 Maxim Solodovnik <so...@gmail.com>

> I did fix it
> please see revision 1399671
> The only issue: JS errors caused by calendar autoreload (please ignore
> them for now)
>
>
> On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <so...@gmail.com>wrote:
>
>> I was sure it works as expected.
>> let me double check.
>>
>>
>>
>> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>>> Hi Maxim,
>>>
>>> you've added the function "omComponentInit" to be called everytime a
>>> Panel is loaded.
>>>
>>> But the function is only called the first time you load the panel, if
>>> you click another menu item and then return to the previous it is not
>>> called again.
>>>
>>> That is also the reason why the calendar UI is only shown on the first
>>> click from my point of view.
>>> Do you have an idea what went wrong here?
>>> We once had some code that had an if-else construct to check if its the
>>> first loading of the Panel or if it gets reloaded. Depending on that the JS
>>> was called differently. I think I had implemented that in some Panel and
>>> then removed it again.
>>>
>>> This was the solution I've implemented:
>>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>>
>>> However I can't see where we would put this in the MenuPanel.
>>> Basically I think the whole call of the omComponentInit should go into
>>> the Panel Header itself instead of the Menu.
>>>
>>> What do you think?
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by Maxim Solodovnik <so...@gmail.com>.
I did fix it
please see revision 1399671
The only issue: JS errors caused by calendar autoreload (please ignore them
for now)

On Thu, Oct 18, 2012 at 8:46 PM, Maxim Solodovnik <so...@gmail.com>wrote:

> I was sure it works as expected.
> let me double check.
>
>
>
> On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> Hi Maxim,
>>
>> you've added the function "omComponentInit" to be called everytime a
>> Panel is loaded.
>>
>> But the function is only called the first time you load the panel, if you
>> click another menu item and then return to the previous it is not called
>> again.
>>
>> That is also the reason why the calendar UI is only shown on the first
>> click from my point of view.
>> Do you have an idea what went wrong here?
>> We once had some code that had an if-else construct to check if its the
>> first loading of the Panel or if it gets reloaded. Depending on that the JS
>> was called differently. I think I had implemented that in some Panel and
>> then removed it again.
>>
>> This was the solution I've implemented:
>> http://markmail.org/message/7k2jlhivtkz6fb7f
>>
>> However I can't see where we would put this in the MenuPanel.
>> Basically I think the whole call of the omComponentInit should go into
>> the Panel Header itself instead of the Menu.
>>
>> What do you think?
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Re: "omComponentInit" is only called the first time a panel is loaded

Posted by Maxim Solodovnik <so...@gmail.com>.
I was sure it works as expected.
let me double check.



On Thu, Oct 18, 2012 at 8:44 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> Hi Maxim,
>
> you've added the function "omComponentInit" to be called everytime a Panel
> is loaded.
>
> But the function is only called the first time you load the panel, if you
> click another menu item and then return to the previous it is not called
> again.
>
> That is also the reason why the calendar UI is only shown on the first
> click from my point of view.
> Do you have an idea what went wrong here?
> We once had some code that had an if-else construct to check if its the
> first loading of the Panel or if it gets reloaded. Depending on that the JS
> was called differently. I think I had implemented that in some Panel and
> then removed it again.
>
> This was the solution I've implemented:
> http://markmail.org/message/7k2jlhivtkz6fb7f
>
> However I can't see where we would put this in the MenuPanel.
> Basically I think the whole call of the omComponentInit should go into the
> Panel Header itself instead of the Menu.
>
> What do you think?
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax