So far I have to clutter up my component with this...... wish I could just do 
it in the tml like ognl as-is in t-4.1.2
not interested in chenelle

    @Persist("session")
    @Property
    private int cursorStartPosition;
    
    @Persist("session")
    @Property
    private int cursorEndPosition;

    @Persist("session")
    @Property
    private int collectionSize;

    @BeginRender
    public void beginRender()
    {
        itemsPerPage = 50;
        tableColumns = 3;

        /**
         *  auto paging metrics
         */
        cursorStartPosition = cursor + 1;
        
        cursorEndPosition = cursor + (collection == null ? 0 : 
java.lang.Math.min(collection.size(), itemsPerPage));

        collectionSize = (collection == null ? 0 : collection.size());        
    }

kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: RE: outputting expression logic
Date: Thu, 15 Sep 2011 22:53:18 -0400








I guess I am asking for an ognl engine... to do these calculations within tml 
files

be nice if there were an expression operator in T5 to do these...

guess I will have to make a java method...

any solutions or canonical approach are appreciated...

kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: RE: outputting expression logic
Date: Thu, 15 Sep 2011 22:47:03 -0400








<t:outputRaw value="    (${cursor} + 1)    "/>

this seems to produce "0 + 1" instead of the desired "1"

all i am trying to do is have the arithmetic performed before the output

thanks
kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: outputting expression logic
Date: Thu, 15 Sep 2011 22:00:46 -0400








Hi All,

I have this expression in a component definition...

<t:label for = "tableColumnsSelect">    ${cursor} + 1    </t:label>

For my case cursor is initially 0

After render... I view page source and I see the following...

0 + 1

when what I actually wanted to see is... the sum of the expression and the 
value rendered...

1

Any tips on how i can do this ? Is there an arithmetic or expression operator 
that I can prefix before my "${cursor} + 1" ?

Thanks
                                                                                
                                                                                
  

Reply via email to