On 4/4/07, dizzi <[EMAIL PROTECTED]> wrote:
Hello,
I have 2 questions

1.
Is there way how to use 2 velocity counters in 2 nested loops?
(i didnt test it but my colleague had problem with that)

not sure quite what you mean, but i suspect that you can't do that.
you can always define as many of your own counters as you want though:

#set( $anotherCounter = 0 )
#foreach( $foo in $foos )
#set( $anotherCounter = $anotherCounter + 1 )
....
#end

2.
I have this object (below), why I cant access to rok, mesic and den
arrays without defining getters (ive tried to make them public too) like
this

#foreach($rok in $datum.rok)
        $rok
#end

Velocity doesn't provide access to class members, only to public
methods in public classes.

even with getters defined, i cant access to members of inner class
#foreach($den in $datum.den)
        $den
#end
this works fine, but when i try

$den.svatek or $den.isSvatek()

velocity complain that $den.svatek/isSvatek() cannot be resolved.

that's because the Den class isn't declared public.  Velocity will
only provide access to public methods on public classes.

thx d.


Datum dtime = new Datum();
request.setAttribute("datum", dtime);



public class Datum {

        class Den {
                public boolean svatek=false;
                public boolean vikend=false;
                public String den=null;
                @Override
                public String toString() {
                        return den;
                }
                public Den(int den) {
                        this.den=Integer.toString(den);
                }
                public String getDen() {
                        return den;
                }
                public boolean isSvatek() {
                        return svatek;
                }
                public boolean isVikend() {
                        return vikend;
                }
        }

        String[] rok=new String[3];
        String[] mesic=new String[12];
        Den[] den;

        public Den[] getDen() {
                return den;
        }
        public String[] getMesic() {
                return mesic;
        }
        public String[] getRok() {
                return rok;
        }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to