I do have similar kind of requirement and I have extended the necessary
classes.
check the latest version 1.1, you can extend those taglibs....


Panchasheel

-----Original Message-----
From: Nicolas Parisé [mailto:[EMAIL PROTECTED]
Sent: Monday, May 26, 2003 5:19 PM
To: Struts Users Mailing List
Subject: Re: Extending STRUTS!!!


Hi ,

I already extended all struts tags for supporting multiple display-mode
(readOnly,hidden and readWrite).
this can be done easylly by doing new class that are a composition of struts
basic tags.

good luck!


Nicolas Parise
SCJP 1.4


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 26, 2003 8:39 AM
Subject: RE: Extending STRUTS!!!


But most of those tags already have a attribute whcih allows you to specify
the css class to use...Cant u not use that?

-----Original Message-----
From: Tarun Dewan [mailto:[EMAIL PROTECTED]
Sent: Monday, May 26, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: Extending STRUTS!!!


Hi All,

In our project we are trying to extend some struts classes for displaying
TextBox, Select, TextArea with different CSS classes.

While working for the same, i found that in Struts Souces there are two
packages org.apache.struts.tabglib (which is actually used by Struts
Framework and most of the classes are marked as final) and
org.apache.struts.tabglib.html (with higher versions than the earlier).

Pls. advise if i should modify classes in org.apache.struts.tabglib packages
or extend classes in org.apache.struts.tabglib.html package.

Eagerly waiting for favorable response.

Thanks & regards,

Tarun Dewan.

Note : Example of modification required is as follows :

package org.apache.struts.taglib.html.nuc.los;

import org.apache.struts.taglib.html.TextTag;

/**
 * @author Tarun
 *
 * This class is extended from org.apache.struts.taglib.html.TextTag
 * to provide additional Facitlities to HTML TextBox object
 */
public class NucTextTag extends TextTag {

    /**
     * Construct a new instance of this tag.
     */
    public NucTextTag() {

 super();
 this.type = "text";

    }

    /**
     * The named Type associated with this tag.
     * This will define whether element is to be displayed as Mandatory
     * or Enable or Incomplete or Normal
     */
    private String displayClass = null;

    public String getDisplayClass() {
        return displayClass;
    }

    public void setDisplayClass(String displayClass) {
        this.displayClass = displayClass;
        if(this.displayClass == null)
        {
         this.displayClass = "N";
        }
        if(this.displayClass.equals("M"))
        {
         setStyleClass("MAND");
        }
        else if(this.displayClass.equals("D"))
        {
         setStyleClass("DABL");
         setDisabled(false);
        }
        else if (this.displayClass.equals("I"))
        {
         setStyleClass("INCO");
        }
        else
        {
         setStyleClass("NORM");
        }
    }
}



---------------------------------------------------------------------
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]

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

Reply via email to