You guys were right...[of course]...

Thanks a million.

Here's my abbreviated final solution:


JAVA:

    @Property
    private Integer index= 0;


    @Persist
    @Property
    Integer year;


    @Property
    private Integer[] funDays = new Integer[13];

    public Integer getFunDay() {
        return funDays[index];
    }

    public void setFunDay(Integer value) {
        funDays[index] = value;
    }

  public String month(Integer num) {
        String month = "invalid";
        DateFormatSymbols dfs = new DateFormatSymbols();
        String[] months = dfs.getMonths();
        if (num >= 0 && num <= 11) {
            month = months[num];
        }
        return month.substring(0, 3);
    }

    public Boolean getDisplayTr() {
        //Logic needed to format information in billableDays in a 3 by 4
table.
        return (index == 3 || index == 7);
    }


TML:

<t:form t:id="ChangeFunDays" t:autofocus="true">

    

                
            <label for="${month(index)}">${month(index)}</label>
            <t:textfield value="funDay"/>
            <t:if test="DisplayTr">
                

            </t:if>
        
    


    

                
            <t:submit t:id="submit" value="Save"/>
        
    

</t:form>



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Binding-an-array-and-accessing-elements-of-that-array-in-a-template-tp5716045p5716127.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to