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 2011/10/20 22:36:30 UTC

[t5.2.6] Possible bug related to prototype

Unfortunately I don't have enough information to tell but here is all what I
think that matters.

I have an ajax form. On it's success, I return a mutli zone update object:

    @OnEvent(component = "trendForm", value = EventConstants.SUCCESS)

    Object formSuccess() {
        MultiZoneUpdate mzu = null;
        switch (testType) {
        case DNS:
            errorResponses =
dnsResponseDao.getScheduledResponsesWithErrors(tclRequest.getId(), dFrom,
dTo);
            mzu = new MultiZoneUpdate("chartsZone", this.dnsCharts);
            break;
        case RADIUS:
            errorResponses =
radiusResponseDao.getScheduledResponsesWithErrors(tclRequest.getId(), dFrom,
dTo);
            mzu = new MultiZoneUpdate("chartsZone", this.radiusCharts);
            break;
        }
        if (errorResponses != null && errorResponses.size() != 0) {
            errorResponsesLastIndex = errorResponses.size() - 1;
            return mzu.add("testErrorsTableZone", testErrorsTable);
        }
        return mzu.add("testErrorsTableZone",
testErrorsTableZone.getBody());
    }

So basically if there are errors, I return a block in the "
testErrorsTableZone". But if there isn't, I clear it by returning the zone's
body.
Here is a part of my .tml file:

<t:zone t:id="trendFormZone">
<t:form t:id="trendForm" t:zone="trendFormZone">
            <tr>
                <td><t:select t:id="testType" t:validate="required"
t:zone="testSelectZone" />
                </td>
                <td><t:zone t:id="testSelectZone">
                        <t:select t:id="tclRequest" t:value="tclRequest"
t:model="testNamesModel" t:encoder="testNameEncoder" t:validate="required"
/>
                    </t:zone></td>
            <tr>
                <td colspan="6"><t:zone t:id="chartsZone"
t:update="slidedown" /></td>
            </tr>
            <tr>
                <td colspan="6"><t:zone t:id="testErrorsTableZone"
t:update="slidedown" /></td>
            </tr>
        </table>
    </t:form>
</t:zone>

<t:block t:id="testErrorsTable"><!-- html here --></t:block>
<t:block t:id="radiusCharts"><!-- html here --></t:block>


Here is what happens, when the form success *returns blocks*, one into each
zone, everything works fine.
But when I return "testErrorsTableZone" 's body to itself and a block to the
"chartsZone" zone, ONLY the zone updated with it's body is updated but the
other zone, which is updated with a block (i.e. chartsZone), doesn't !

Using firebug I found that JSON responses are returned fine. So I debugged
the javascript calls and found that the following method catches an
exception saying "element.down() is null". After a quick search I got a hint
that this happens because of the "t:update" effect. So I removed the effect
and left it to use the default and everything worked !

var Enumerable = (function() {

function each(iterator, context) {

var index = 0;

try {

this._each(function(value) {

iterator.call(context, value, index++);

});

} catch (e) {

if (e != $break) throw e; <<<<<<<<<<<<<<<<<<<<

}

return this;

}


I think the MOST important thing here is that the exception catched at the
line with the arrows, isn't shown at all to the user (me). It just doesn't
work. Nothing is logged in the javascript console and nothing shows up in
the browser !!!

I have no idea why this happens exactly. I just need to know if it's
protoype's or tapestry's issue

Thank you all for your time.

-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.2.6] Possible bug related to prototype

Posted by Muhammad Gelbana <m....@gmail.com>.
I forgot to mention that the JS snippet exists in prototype.js, line 828.

On Thu, Oct 20, 2011 at 10:36 PM, Muhammad Gelbana <m....@gmail.com>wrote:

> Unfortunately I don't have enough information to tell but here is all what
> I think that matters.
>
> I have an ajax form. On it's success, I return a mutli zone update object:
>
>     @OnEvent(component = "trendForm", value = EventConstants.SUCCESS)
>
>     Object formSuccess() {
>         MultiZoneUpdate mzu = null;
>         switch (testType) {
>         case DNS:
>             errorResponses =
> dnsResponseDao.getScheduledResponsesWithErrors(tclRequest.getId(), dFrom,
> dTo);
>             mzu = new MultiZoneUpdate("chartsZone", this.dnsCharts);
>             break;
>         case RADIUS:
>             errorResponses =
> radiusResponseDao.getScheduledResponsesWithErrors(tclRequest.getId(), dFrom,
> dTo);
>             mzu = new MultiZoneUpdate("chartsZone", this.radiusCharts);
>             break;
>         }
>         if (errorResponses != null && errorResponses.size() != 0) {
>             errorResponsesLastIndex = errorResponses.size() - 1;
>             return mzu.add("testErrorsTableZone", testErrorsTable);
>         }
>         return mzu.add("testErrorsTableZone",
> testErrorsTableZone.getBody());
>     }
>
> So basically if there are errors, I return a block in the "
> testErrorsTableZone". But if there isn't, I clear it by returning the
> zone's body.
> Here is a part of my .tml file:
>
> <t:zone t:id="trendFormZone">
> <t:form t:id="trendForm" t:zone="trendFormZone">
>             <tr>
>                 <td><t:select t:id="testType" t:validate="required"
> t:zone="testSelectZone" />
>                 </td>
>                 <td><t:zone t:id="testSelectZone">
>                         <t:select t:id="tclRequest" t:value="tclRequest"
> t:model="testNamesModel" t:encoder="testNameEncoder" t:validate="required"
> />
>                     </t:zone></td>
>             <tr>
>                 <td colspan="6"><t:zone t:id="chartsZone"
> t:update="slidedown" /></td>
>             </tr>
>             <tr>
>                 <td colspan="6"><t:zone t:id="testErrorsTableZone"
> t:update="slidedown" /></td>
>             </tr>
>         </table>
>     </t:form>
> </t:zone>
>
> <t:block t:id="testErrorsTable"><!-- html here --></t:block>
> <t:block t:id="radiusCharts"><!-- html here --></t:block>
>
>
> Here is what happens, when the form success *returns blocks*, one into
> each zone, everything works fine.
> But when I return "testErrorsTableZone" 's body to itself and a block to
> the "chartsZone" zone, ONLY the zone updated with it's body is updated but
> the other zone, which is updated with a block (i.e. chartsZone), doesn't !
>
> Using firebug I found that JSON responses are returned fine. So I debugged
> the javascript calls and found that the following method catches an
> exception saying "element.down() is null". After a quick search I got a hint
> that this happens because of the "t:update" effect. So I removed the
> effect and left it to use the default and everything worked !
>
> var Enumerable = (function() {
>
>  function each(iterator, context) {
>
>  var index = 0;
>
>  try {
>
>  this._each(function(value) {
>
>  iterator.call(context, value, index++);
>
>  });
>
>  } catch (e) {
>
>  if (e != $break) throw e; <<<<<<<<<<<<<<<<<<<<
>
>  }
>
>  return this;
>
> }
>
>
> I think the MOST important thing here is that the exception catched at the
> line with the arrows, isn't shown at all to the user (me). It just doesn't
> work. Nothing is logged in the javascript console and nothing shows up in
> the browser !!!
>
> I have no idea why this happens exactly. I just need to know if it's
> protoype's or tapestry's issue
>
> Thank you all for your time.
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*