hi all,

originally have an accessor method:

    public int getNumericValue()
    {
       return myInteger; // auto-boxes to int
    }

and wanted to use the following if:

    <t:if test="numericValue == 3">

however '==' doesn't work, but i know method calls work so i changed to:

    public Integer getNumericValue()
    {
        return myInteger; // no boxing
    }

and
    <t:if test="numericValue.equals(3)">

this still didn't work, reason being, tapestry 'coerces' "3" into "new Long(3)" and

    new Integer(3) .equals(new Long(3))

returns false.

So i've changed to

    public Long getNumericValue()
    {
        return new Long(myInteger); // a bit ugly
    }

and
    <t:if test="numericValue.equals(3)">

now works....

SO....................

should tapestry do a better job of
a) coercing 'primative == primative' and the like
b) coercing '3' to 'new Integer(3)' when it is preferable
c) nothing, everything above is as it should be.


discuss.......

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to