For this kind of problem I have implemented a new tag (<my:tr>) to manage color in function of index. This tag write the html tag (then it has the same attribute) and to manage color I use "classodd" and "classeven". The name of index object is in IndexId attribute. This is a part of doStartTag code:

                if (getIndexId() != null){
                        String name = getIndexId();
                        Object indexObj = retrieveData(getIndexId(), getScope());
                        if (indexObj != null){
                                setIndex(new Integer(indexObj.toString()));
                        }
                }

                String outString = new String("<tr ");
                if (getIndex() != null && getIndex().intValue() % 2 == 0){
                        outString = outString + new String("class=\"" + getClasseven() + 
"\" ");
                }
                if (getIndex() != null && Math.abs(getIndex().intValue() % 2) == 1){
                        outString = outString + new String("class=\"" + getClassodd() + "\" 
");
                }
                if (getHeight() != null){
                        outString = outString + new String("height=\"" + getHeight() + "\" 
");
                }
                if (getWidth() != null){
                        outString = outString + new String("width=\"" + getWidth() + "\" 
");
                }
                if (getAlign() != null){
                        outString = outString + new String("align=\"" + getAlign() + "\" 
");
                }
                if (getValign() != null){
                        outString = outString + new String("valign=\"" + getValign() + "\" 
");
                }
                if (getId() != null){
                        outString = outString + new String("id=\"" + getId() + "\" ");
                }
                outString = outString + new String(">");

                JspWriter out = pageContext.getOut();
                try{
                        out.write(outString);
                } catch (IOException ioe){
                        _log.error("IOException error writing in jsp out", ioe);
                }

return EVAL_BODY_INCLUDE;


RetrieveData method switches in scope anche then look for index object in the specified scope.


I hope it can help you!
Bye,
        Betty.


Ramesh Kannery wrote:
Hi

In a table i hav to show rows in different colors.
Odd nos in one color and even nos in another color.
I thnk i can achieve through logic\iterate tag.
how to use the index id for this purpose?

regards
ramesh

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



--



   Elisabetta Freschi
--------------------------------------
Synapsis S.r.l.
     in Computer Science

P.zza Dante, 19/20
57121 Livorno
Phone: +39 0586 426790
fax: +39 0586 443954
mailto:[EMAIL PROTECTED]
http://www.websynapsis.com
--------------------------------------


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



Reply via email to