The test will be true if the provided test returns true or in case of an object return type that object is not null.

Uli

Alex Kotchnev schrieb:
w/o looking at the docs, my impression is that the 'test' attribute of
t:if expects a boolean value. Neither of daily,monthly,and yearly
chart props are boolean.

On 3/14/09, dwi ardi irawan <penyihirke...@gmail.com> wrote:
guys, i'm so stress with "if" komponent. how to use it
here's my code


.tml
===========================================

<t:select t:id="chartType" onchange="this.form.submit()"/>

    <t:if test="dailyChart">
    AAA
    </t:if>


    <t:if test="monthlyChart">
    BBB
    </t:if>

    <t:if test="yearlyChart">
    CCC
    </t:if>

=============================================

.java
=============================================

   @Persist
    private ChartType chartType;

    public ChartType getChartType() {
        return chartType;
    }

    @Property
    private String dailyChart, monthlyChart, yearlyChart;

   Object onSuccessFromChartForm(){

        if(chartType==ChartType.DAILY){
            dailyChart = "D";
            monthlyChart = null;
            yearlyChart = null;
        }else if (chartType==ChartType.MONTHLY) {
            dailyChart = null;
            monthlyChart = "M";
            yearlyChart = null;
        }else if (chartType==chartType.YEARLY) {
            dailyChart = null;
            monthlyChart = null;
            yearlyChart = "Y";
        }



if we look the code above, it should work but it doesn't
when i choose "Daily" on select menu that means dailyChart property will
become "D" and it should render this block and output "AAA"
<t:if test="dailyChart">
    AAA
    </t:if>

is there something wrong wih my code or my perception of if component in
tapestry 5


thnx u

dwi ardi irawan - 'penyihirkecil'
http://www.dwiardiirawan.com <http://dwiardiirawan.blogspot.com/>




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

Reply via email to