You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2012/09/01 22:04:23 UTC

[t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

It must be something wrong I'm doing because It's working fine in the same
environment for the tapestry's quickstart application !

What exactly happens is that after few alerts are generated from different
sources (event link and form submits), if I click "Dismiss all", all alerts
disappear and the ajax request is sent but If I generate another alert
without refreshing the page, all the same old alerts appear again in
addition to the new alert !

. My alert tag is in my layout component

> *<t:alerts />
> <t:body />*


. The event link is in the *ProbesHealth* page and surrounded by a dummy
zone

> *<t:zone><t:eventlink t:id="updateSNLink" t:event="UpdateSerialNumbers"
> t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*


The form producing alerts too is in the same page and surrounded by a dummy
zone too

> *<t:zone>
> <t:form class="post_message" t:zone="^">
>  <t:textfield maxlength="128" t:value="probeComment"/>
> <t:submit class="btn_post_message" t:value="Update" t:context="literal:2"
> t:event="UpdateComment"/>
> </t:form>
> </t:zone>*


 The *ProbesHealth* page code has the following

> *@Inject
> private AlertManager alert;
> *



> *@SuppressWarnings("unused")
> @OnEvent(value = "UpdateComment")
> private void updateProbeComment(int probeId) {
> alert.error("Feature not supported yet");
> }
> *



> *private void onUpdateSerialNumbers() {
> alert.info("Probes serial numbers will be collected.");
> }*


So I have a few questions:
1. What am I doing wrong here ?
2. Is it better to use a dummy zone to have it's id in the form's and
eventlink's zone attribute or to have a zone for each element ? I'm asking
because I will have up to 250 forms in the future.

Re: [t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

Posted by Dmitry Gusev <dm...@gmail.com>.
Thats purgeChildren(...) probably needs to be fixed too :)

On Sun, Sep 2, 2012 at 1:35 AM, Muhammad Gelbana <m....@gmail.com>wrote:

> I've been debugging the code too and found out that the method
> purgeChildren(element); looks up the element's children through
> element.childNodes which is always undefined. What's confusing me is that
> this case isn't so special and isn't hard to fix, so why is it still there
> ?!
>
> On Sat, Sep 1, 2012 at 11:26 PM, Dmitry Gusev <dmitry.gusev@gmail.com
> >wrote:
>
> > This seems to be bug in tapestry5-jquery.
> >
> > In file t5-dom-jquery.js:
> >
> >             /**
> >              * Removes all children form the element, properly purging
> > child elements
> >              * of any listeners, etc.
> >              * @param element to purge
> >              */
> >             function removeChildren(element) {
> >                 purgeChildren(element);
> >                 element.innerHTML = '';
> >             }
> >
> > should be
> >
> > element.children().remove();
> >
> > instead of:
> >
> > element.innerHTML = '';
> >
> > On Sun, Sep 2, 2012 at 12:04 AM, Muhammad Gelbana <m.gelbana@gmail.com
> > >wrote:
> >
> > > It must be something wrong I'm doing because It's working fine in the
> > same
> > > environment for the tapestry's quickstart application !
> > >
> > > What exactly happens is that after few alerts are generated from
> > different
> > > sources (event link and form submits), if I click "Dismiss all", all
> > alerts
> > > disappear and the ajax request is sent but If I generate another alert
> > > without refreshing the page, all the same old alerts appear again in
> > > addition to the new alert !
> > >
> > > . My alert tag is in my layout component
> > >
> > > > *<t:alerts />
> > > > <t:body />*
> > >
> > >
> > > . The event link is in the *ProbesHealth* page and surrounded by a
> dummy
> > > zone
> > >
> > > > *<t:zone><t:eventlink t:id="updateSNLink"
> t:event="UpdateSerialNumbers"
> > > > t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*
> > >
> > >
> > > The form producing alerts too is in the same page and surrounded by a
> > dummy
> > > zone too
> > >
> > > > *<t:zone>
> > > > <t:form class="post_message" t:zone="^">
> > > >  <t:textfield maxlength="128" t:value="probeComment"/>
> > > > <t:submit class="btn_post_message" t:value="Update"
> > t:context="literal:2"
> > > > t:event="UpdateComment"/>
> > > > </t:form>
> > > > </t:zone>*
> > >
> > >
> > >  The *ProbesHealth* page code has the following
> > >
> > > > *@Inject
> > > > private AlertManager alert;
> > > > *
> > >
> > >
> > >
> > > > *@SuppressWarnings("unused")
> > > > @OnEvent(value = "UpdateComment")
> > > > private void updateProbeComment(int probeId) {
> > > > alert.error("Feature not supported yet");
> > > > }
> > > > *
> > >
> > >
> > >
> > > > *private void onUpdateSerialNumbers() {
> > > > alert.info("Probes serial numbers will be collected.");
> > > > }*
> > >
> > >
> > > So I have a few questions:
> > > 1. What am I doing wrong here ?
> > > 2. Is it better to use a dummy zone to have it's id in the form's and
> > > eventlink's zone attribute or to have a zone for each element ? I'm
> > asking
> > > because I will have up to 250 forms in the future.
> > >
> >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: [t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

Posted by Muhammad Gelbana <m....@gmail.com>.
Thanks a lot for your help :)

On Sat, Sep 1, 2012 at 11:35 PM, Muhammad Gelbana <m....@gmail.com>wrote:

> I've been debugging the code too and found out that the method
> purgeChildren(element); looks up the element's children through
> element.childNodes which is always undefined. What's confusing me is that
> this case isn't so special and isn't hard to fix, so why is it still there
> ?!
>
>
> On Sat, Sep 1, 2012 at 11:26 PM, Dmitry Gusev <dm...@gmail.com>wrote:
>
>> This seems to be bug in tapestry5-jquery.
>>
>> In file t5-dom-jquery.js:
>>
>>             /**
>>              * Removes all children form the element, properly purging
>> child elements
>>              * of any listeners, etc.
>>              * @param element to purge
>>              */
>>             function removeChildren(element) {
>>                 purgeChildren(element);
>>                 element.innerHTML = '';
>>             }
>>
>> should be
>>
>> element.children().remove();
>>
>> instead of:
>>
>> element.innerHTML = '';
>>
>> On Sun, Sep 2, 2012 at 12:04 AM, Muhammad Gelbana <m.gelbana@gmail.com
>> >wrote:
>>
>> > It must be something wrong I'm doing because It's working fine in the
>> same
>> > environment for the tapestry's quickstart application !
>> >
>> > What exactly happens is that after few alerts are generated from
>> different
>> > sources (event link and form submits), if I click "Dismiss all", all
>> alerts
>> > disappear and the ajax request is sent but If I generate another alert
>> > without refreshing the page, all the same old alerts appear again in
>> > addition to the new alert !
>> >
>> > . My alert tag is in my layout component
>> >
>> > > *<t:alerts />
>> > > <t:body />*
>> >
>> >
>> > . The event link is in the *ProbesHealth* page and surrounded by a dummy
>> > zone
>> >
>> > > *<t:zone><t:eventlink t:id="updateSNLink"
>> t:event="UpdateSerialNumbers"
>> > > t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*
>> >
>> >
>> > The form producing alerts too is in the same page and surrounded by a
>> dummy
>> > zone too
>> >
>> > > *<t:zone>
>> > > <t:form class="post_message" t:zone="^">
>> > >  <t:textfield maxlength="128" t:value="probeComment"/>
>> > > <t:submit class="btn_post_message" t:value="Update"
>> t:context="literal:2"
>> > > t:event="UpdateComment"/>
>> > > </t:form>
>> > > </t:zone>*
>> >
>> >
>> >  The *ProbesHealth* page code has the following
>> >
>> > > *@Inject
>> > > private AlertManager alert;
>> > > *
>> >
>> >
>> >
>> > > *@SuppressWarnings("unused")
>> > > @OnEvent(value = "UpdateComment")
>> > > private void updateProbeComment(int probeId) {
>> > > alert.error("Feature not supported yet");
>> > > }
>> > > *
>> >
>> >
>> >
>> > > *private void onUpdateSerialNumbers() {
>> > > alert.info("Probes serial numbers will be collected.");
>> > > }*
>> >
>> >
>> > So I have a few questions:
>> > 1. What am I doing wrong here ?
>> > 2. Is it better to use a dummy zone to have it's id in the form's and
>> > eventlink's zone attribute or to have a zone for each element ? I'm
>> asking
>> > because I will have up to 250 forms in the future.
>> >
>>
>>
>>
>> --
>> Dmitry Gusev
>>
>> AnjLab Team
>> http://anjlab.com
>>
>
>

Re: [t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

Posted by Muhammad Gelbana <m....@gmail.com>.
I've been debugging the code too and found out that the method
purgeChildren(element); looks up the element's children through
element.childNodes which is always undefined. What's confusing me is that
this case isn't so special and isn't hard to fix, so why is it still there
?!

On Sat, Sep 1, 2012 at 11:26 PM, Dmitry Gusev <dm...@gmail.com>wrote:

> This seems to be bug in tapestry5-jquery.
>
> In file t5-dom-jquery.js:
>
>             /**
>              * Removes all children form the element, properly purging
> child elements
>              * of any listeners, etc.
>              * @param element to purge
>              */
>             function removeChildren(element) {
>                 purgeChildren(element);
>                 element.innerHTML = '';
>             }
>
> should be
>
> element.children().remove();
>
> instead of:
>
> element.innerHTML = '';
>
> On Sun, Sep 2, 2012 at 12:04 AM, Muhammad Gelbana <m.gelbana@gmail.com
> >wrote:
>
> > It must be something wrong I'm doing because It's working fine in the
> same
> > environment for the tapestry's quickstart application !
> >
> > What exactly happens is that after few alerts are generated from
> different
> > sources (event link and form submits), if I click "Dismiss all", all
> alerts
> > disappear and the ajax request is sent but If I generate another alert
> > without refreshing the page, all the same old alerts appear again in
> > addition to the new alert !
> >
> > . My alert tag is in my layout component
> >
> > > *<t:alerts />
> > > <t:body />*
> >
> >
> > . The event link is in the *ProbesHealth* page and surrounded by a dummy
> > zone
> >
> > > *<t:zone><t:eventlink t:id="updateSNLink" t:event="UpdateSerialNumbers"
> > > t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*
> >
> >
> > The form producing alerts too is in the same page and surrounded by a
> dummy
> > zone too
> >
> > > *<t:zone>
> > > <t:form class="post_message" t:zone="^">
> > >  <t:textfield maxlength="128" t:value="probeComment"/>
> > > <t:submit class="btn_post_message" t:value="Update"
> t:context="literal:2"
> > > t:event="UpdateComment"/>
> > > </t:form>
> > > </t:zone>*
> >
> >
> >  The *ProbesHealth* page code has the following
> >
> > > *@Inject
> > > private AlertManager alert;
> > > *
> >
> >
> >
> > > *@SuppressWarnings("unused")
> > > @OnEvent(value = "UpdateComment")
> > > private void updateProbeComment(int probeId) {
> > > alert.error("Feature not supported yet");
> > > }
> > > *
> >
> >
> >
> > > *private void onUpdateSerialNumbers() {
> > > alert.info("Probes serial numbers will be collected.");
> > > }*
> >
> >
> > So I have a few questions:
> > 1. What am I doing wrong here ?
> > 2. Is it better to use a dummy zone to have it's id in the form's and
> > eventlink's zone attribute or to have a zone for each element ? I'm
> asking
> > because I will have up to 250 forms in the future.
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>

Re: [t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

Posted by Dmitry Gusev <dm...@gmail.com>.
I created issue for this in tapestry5-jquery:

https://github.com/got5/tapestry5-jquery/issues/230

On Sun, Sep 2, 2012 at 1:26 AM, Dmitry Gusev <dm...@gmail.com> wrote:

> This seems to be bug in tapestry5-jquery.
>
> In file t5-dom-jquery.js:
>
>             /**
>              * Removes all children form the element, properly purging
> child elements
>              * of any listeners, etc.
>              * @param element to purge
>              */
>             function removeChildren(element) {
>                 purgeChildren(element);
>                 element.innerHTML = '';
>             }
>
> should be
>
> element.children().remove();
>
> instead of:
>
> element.innerHTML = '';
>
> On Sun, Sep 2, 2012 at 12:04 AM, Muhammad Gelbana <m....@gmail.com>wrote:
>
>> It must be something wrong I'm doing because It's working fine in the same
>> environment for the tapestry's quickstart application !
>>
>> What exactly happens is that after few alerts are generated from different
>> sources (event link and form submits), if I click "Dismiss all", all
>> alerts
>> disappear and the ajax request is sent but If I generate another alert
>> without refreshing the page, all the same old alerts appear again in
>> addition to the new alert !
>>
>> . My alert tag is in my layout component
>>
>> > *<t:alerts />
>> > <t:body />*
>>
>>
>> . The event link is in the *ProbesHealth* page and surrounded by a dummy
>> zone
>>
>> > *<t:zone><t:eventlink t:id="updateSNLink" t:event="UpdateSerialNumbers"
>> > t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*
>>
>>
>> The form producing alerts too is in the same page and surrounded by a
>> dummy
>> zone too
>>
>> > *<t:zone>
>> > <t:form class="post_message" t:zone="^">
>> >  <t:textfield maxlength="128" t:value="probeComment"/>
>> > <t:submit class="btn_post_message" t:value="Update"
>> t:context="literal:2"
>> > t:event="UpdateComment"/>
>> > </t:form>
>> > </t:zone>*
>>
>>
>>  The *ProbesHealth* page code has the following
>>
>> > *@Inject
>> > private AlertManager alert;
>> > *
>>
>>
>>
>> > *@SuppressWarnings("unused")
>> > @OnEvent(value = "UpdateComment")
>> > private void updateProbeComment(int probeId) {
>> > alert.error("Feature not supported yet");
>> > }
>> > *
>>
>>
>>
>> > *private void onUpdateSerialNumbers() {
>> > alert.info("Probes serial numbers will be collected.");
>> > }*
>>
>>
>> So I have a few questions:
>> 1. What am I doing wrong here ?
>> 2. Is it better to use a dummy zone to have it's id in the form's and
>> eventlink's zone attribute or to have a zone for each element ? I'm asking
>> because I will have up to 250 forms in the future.
>>
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: [t.5.3.4] [Alerts] "Dismiss all" doesn't clear the alerts from the session !

Posted by Dmitry Gusev <dm...@gmail.com>.
This seems to be bug in tapestry5-jquery.

In file t5-dom-jquery.js:

            /**
             * Removes all children form the element, properly purging
child elements
             * of any listeners, etc.
             * @param element to purge
             */
            function removeChildren(element) {
                purgeChildren(element);
                element.innerHTML = '';
            }

should be

element.children().remove();

instead of:

element.innerHTML = '';

On Sun, Sep 2, 2012 at 12:04 AM, Muhammad Gelbana <m....@gmail.com>wrote:

> It must be something wrong I'm doing because It's working fine in the same
> environment for the tapestry's quickstart application !
>
> What exactly happens is that after few alerts are generated from different
> sources (event link and form submits), if I click "Dismiss all", all alerts
> disappear and the ajax request is sent but If I generate another alert
> without refreshing the page, all the same old alerts appear again in
> addition to the new alert !
>
> . My alert tag is in my layout component
>
> > *<t:alerts />
> > <t:body />*
>
>
> . The event link is in the *ProbesHealth* page and surrounded by a dummy
> zone
>
> > *<t:zone><t:eventlink t:id="updateSNLink" t:event="UpdateSerialNumbers"
> > t:zone="^">Update Serial Numbers</t:eventlink></t:zone>*
>
>
> The form producing alerts too is in the same page and surrounded by a dummy
> zone too
>
> > *<t:zone>
> > <t:form class="post_message" t:zone="^">
> >  <t:textfield maxlength="128" t:value="probeComment"/>
> > <t:submit class="btn_post_message" t:value="Update" t:context="literal:2"
> > t:event="UpdateComment"/>
> > </t:form>
> > </t:zone>*
>
>
>  The *ProbesHealth* page code has the following
>
> > *@Inject
> > private AlertManager alert;
> > *
>
>
>
> > *@SuppressWarnings("unused")
> > @OnEvent(value = "UpdateComment")
> > private void updateProbeComment(int probeId) {
> > alert.error("Feature not supported yet");
> > }
> > *
>
>
>
> > *private void onUpdateSerialNumbers() {
> > alert.info("Probes serial numbers will be collected.");
> > }*
>
>
> So I have a few questions:
> 1. What am I doing wrong here ?
> 2. Is it better to use a dummy zone to have it's id in the form's and
> eventlink's zone attribute or to have a zone for each element ? I'm asking
> because I will have up to 250 forms in the future.
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com