Trying to create a custom tag

I want to create a custom tag that has a attribute that ask
for a number. like below...
<cf_makeattributes number="?">
Now say I made that number something like 5
<cf_makeattributesnumber=
"5">
I would like for the tag to take that number and make 5
attributes called "Form" in a array from 1 to 5 like below...
<cfset attributes.form = arraynew(1)>
<cfloop index="i" from="1" to="#attributes.number#">
#attributes.form
</cfloop>
Is it possible to make a tag that ask for a number like 5 and
make 5 attributes and within the same tag assign values to those 5
attributes. for example consider the above.
<cf_makeattributes number="5" attribute1="hi"
attribute2="hello" attribute3="howdy" attribute4="hey"
attribute5="HOWE!">
or say i want to make 2 attributes and assign 2 values to
those attributes
<cf_makeattributes number="2" attribute1="This tag asked
for 2 numbers" attribute2="and therefore gave me the ability to
make 2 attributes">
I also have another question that kinda applies to the
question above.
How does the coldfusion server read the tags. for example
look at below
<cf_makeattributes number="2" attribute1="hello"
attribute2="world">
would the server read it like this...
step 1
<
cf_makeattributes number="2" attribute1="hello"
attribute2="world">
step 2
<cf_makeattributes
number="2" attribute1="hello" attribute2="world">
step 3
makeattributes.CFM (it now goes to the template that holds
the tags scripts)
Or does it first read all thats bold below
<cf_makeattributes
number="2" attribute1="hello" attribute2="world">
then goes to the makeattributes template. Is there away I
can compile my script one step at a time like C# and C++ just to
see the steps
PLUS Do i have to put my custom tag into a specific folder or
can I just put it in the same folder as the document thats calling
the custom tag

> I could either make a bunch of attributes that will grab
all the
> values or I could loop out a array of attributes. Thats
my goal
I was with you until that line. The term attributes is
confusing in this context. I'm not sure if you're talking about
attributes in a generic sense or the custom tag attribute
scope.
> Now here wat im thinking now. What if instead I put the
forms in a list. something like this...
> <cf_Formentry
Forms="#Form.one#,#form.two#,#form.three#">
Do you mean form
fields?
Let's try this from a different angle. Can you give a
concrete example of the desired results using this form?
<form>
<input name="username1" value="Alice">
<input name="username2" value="Bob">
<input name="username3" value="Kyle">
<input name="username4" value="Michelle">
<input name="username5" value="Robert">
</form>

Similar Messages

  • How To create a custom tag in jsf

    I'm trying to create a custom tag in jsf.what should be the approach to create it.it would be better if somebody will explain me from the skretch.

    There's a decent tutorial here, Priyo:
    http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf
    Hope it helps,
    Illu

  • Unable to create a custom tag

    Hi All
    i am trying to make a custom tag in jsp2.0. I have made the java class which override the doTag method. I have created the tld file and put it in the directly WEB-INF FOLDER.I have written a jsp as well which uses this tag and the uri in the jsp mathces the uri in the tld file. Then it gives me the error message that unable to find the tld file.
    then i made entry in the web.xml as well but now it is giving me an error:
    JSPG0227E: Exception caught while translating /UseCustom.jsp: /UseCustom.jsp(19,1) --> JSPG0009E: Unable to load tag handler class com.hcl.taghandlers
    I am using jstl 1.1 and jsp2.0 and the IBM Rational editor.
    please help as soon as possible.
    thanks in advance!!!!!!!!

    There was a very minute syntax mistake in the web.xml.
    now it is working fine.
    By the thanks to all those who devoted some time to think over it.

  • How to create a custom tag for a custom converter

    In Jdeveloper 11g, I have a project where I have created a custom converter class that impements the javax.faces.convert.Converter class. I have registered the converter with an id in the faces-config.xml file of the project, and the converter works fine by using the <f:converter type="myconverter"> tag. However, the custom converter has a field which I would like to set from the tag itself. Hence, I would like to add an attribute to <f:converter> tag if possible or create a custom tag that has the attribute.
    I have done some reserach and I found that a custom tag can be implemented: I need to create a class which extends from the ConverterTag class or javax.faces.webapp.ConverterElTag class, which I did, but I also need to create ".tld" (tag library) file which defines the tag itself.
    The part about creating the ".tld" file and registring the new tag is what I'm not sure how to do.
    Does someone know how to do this?
    thank you

    Hi frank,
    that's a good document, and it explains how to make a custom converter. I already created the custom converter, it converts a number to any currency pattern. I know java already has a currency converter, but it doesn't support Rupee currency format, and I need that format.
    My converter works, but I would like to pass the pattern of the format through an attribute in a tag. Since f:converter doesn't seem to support that, I created a custom tag which uses my converter, and it enables me to pass a pattern to the converter.
    All of that works, but I need to be able to pass the pattern as an EL expression, and it's not evaluating the expression before passing it to the converter. It just passes the whole expression as a string. I'm thinking It may be something I'm doing wrong.
    this is the tag library definition file:
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.2</tlib-version>
    <jsp-version>2.1</jsp-version>
    <short-name>custom</short-name>
    <uri>custom-currency-converter</uri>
    <description>
    custom currency custom tag library
    </description>
    <tag>
    <name>CurrencyConverter</name>
    <tag-class>
    converter.Tag.CurrencyConverterTag
    </tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <name>pattern</name>
    <type>java.util.String</type>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    Edited by: Abraham Ciokler on Feb 4, 2011 11:20 AM

  • Problem in creating a custom tag

    Hi All,
    I'm new to jstl. I want to create a custom tag. I created a sample java class and sample tld file and I used this file at my page it give me an error. The java and tag file code is as follow
    package mytag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * This is a simple tag example to show how content is added to the
    * output stream when a tag is encountered in a JSP page.
    public class Hello extends TagSupport {
         private String name=null;
          * Getter/Setter for the attribute name as defined in the tld file
          * for this tag
    public void setName(String value){
        name = value;
         public String getName(){
              return(name);
    * doStartTag is called by the JSP container when the tag is encountered
        public int doStartTag() {
           try {
            JspWriter out = pageContext.getOut();
            out.println("<table border=\"1\">");
              if (name != null)
               out.println("<tr><td> Hello " + name + " </td></tr>");
            else
               out.println("<tr><td> Hello World </td></tr>");
           } catch (Exception ex) {
             throw new Error("All is not well in the world.");
           // Must return SKIP_BODY because we are not supporting a body for this
           // tag.
           return SKIP_BODY;
    * doEndTag is called by the JSP container when the tag is closed
         public int doEndTag(){
            return EVAL_PAGE;
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>sample</shortname>
         <info>My sample tag</info>
      <tag>
        <name>hello</name>
        <tagclass>tag.Hello</tagclass>
        <bodycontent>empty</bodycontent>
        <info>
         This is a simple hello tag.
        </info>
      <attribute>
          <name>name</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
      </attribute>
    </tag>
    </taglib>And I use this tld file in my jsp code I got below error
    * org.apache.jasper.JasperException: /mytag.jsp(9,15) Unable to load tag handler class "tag.Hello" for tag "sample:hello"
    Help me about this problem.
    Edited by: Get2win4world on Dec 15, 2009 1:12 AM

    Your class (according to what is posted) is in the package mytag.
    So in your tld: <tagclass>tag.Hello</tagclass>should be<tagclass>mytag.Hello</tagclass>cheers,
    evnafets

  • Build failed when trying to create a custom Android viewer

    I am experiencing the same issue, I get the : 'build failed. try again later' without any further information, when trying to create a custom viewer for android. Is this caused by server overloads or are there some things to check?
    Any help is appreciated! Thank you

    hey Bob,
    I did not before as I was assigned a mac that had everything running (untill now ), but to be sure I followed the steps just now using the keytool in terminal but looks like this is not making any differance.
    also, I can see the previous apps listed showing the download apk option, I have not been prompted for a certificate yet, where in iOS apps you are asked for it on save before the build starts and when you download the zip again if I'm not mistaking.
    Right now I always get the build faild error, try again later when I save the last step in the viewer creation process.

  • Trying to create a custom layout.

    Hello. I am trying to create a custom layout. The
    format I'm going for is three rows, with the top and
    bottom row being comprised of three columns each. IE:
    | X | X | X |
    |     X     |
    | X | X | X |
    -------------I have written a corresponding .html.txt file for my
    intended layout and it looks correct. However, the
    actual layout file's end results looks like a horizontal
    flow layout with line wrapping after every third column.
    IE:
    |     X     | X | X |
    |     X     | X | X |
    |     X     |
    -------------The code I have created is as follows. Thanks for your
    time and assistance.
    <?xml version="1.0" encoding="UTF-8"?>
    <netuix:markupDefinition
    xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0 markup-netuix-1_0_0.xsd">
        <netuix:locale language="en"/>
        <netuix:markup>
        <netuix:borderLayout columns="3"
           title="Seven Layout" description="This layout has seven positions." rows="3"
                               htmlLayoutUri="/framework/markup/layout/seven.html.txt" layoutStrategy="title"
                               markupType="Layout" markupName="seven">
                <!--// Row One //-->
                <netuix:placeholder title="west" description="The left column in the first row."
                                    width="33%" flow="horizontal" usingFlow="true"
                                    markupType="Placeholder" markupName="rowOneColumn_left">
                </netuix:placeholder>
                <netuix:placeholder title="center" description="The middle column in the first row."
                                    width="34%" flow="horizontal" usingFlow="true"
                                    markupType="Placeholder" markupName="rowOneColumn_center">
                </netuix:placeholder>
                <netuix:placeholder title="east" description="The right column in the first row."
                                    width="33%" flow="horizontal" usingFlow="true"
                                    markupType="Placeholder" markupName="rowOneColumn_right">
                </netuix:placeholder>
                <!--// Row Two //-->
                <netuix:placeholder title="center" description="The only column in the second row."
                                    width="100%" flow="horizontal" usingFlow="true"
                                    markupType="Placeholder" markupName="rowTwoColumn_single">
                </netuix:placeholder>
                <!--// Row Three //-->
                <netuix:placeholder title="west" description="The left column in the third row."
                                    width="33%" flow="horizontal"
                                    markupType="Placeholder" markupName="rowThreeColumn_left">
                </netuix:placeholder>
                <netuix:placeholder title="center" description="The middle column in the third row."
                                    width="34%" flow="horizontal"
                                    markupType="Placeholder" markupName="rowThreeColumn_center">
                </netuix:placeholder>
                <netuix:placeholder title="east" description="The right column in the third row."
                                    width="33%" flow="horizontal" usingFlow="true"
                                    markupType="Placeholder" markupName="rowThreeColumn_right">
                </netuix:placeholder>
            </netuix:borderLayout>
        </netuix:markup>
    </netuix:markupDefinition>

    Have you created a custom skeleton file to render this particular layout ??
    If not, create a skeleton file with cutom prepended to the layout name. And here , just go with any HTML-Table based layout you want. The portal designer may not pick it up , but when its rendered, the layout turns up fine.
    HOpe this helps.
    If u need more help , lemme know,
    i will send over some files.

  • Creating first custom tag, problems importing in  WebSphere studio...

    I'm trying to write a tag handler for my .tld file, but WebSphere won't recognize the following import statements:
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    TLD file:
    <?xml version = "1.0" encoding = "ISO-8859-1"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/Web-jsptaglibrary_1_2.dtd">
    <taglib xmlns = "http://java.sun.com/JSP/TagLibraryDescriptor">
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>Custom Tags Library</short-name>
    <description>
    Custom tags test.
    </description>
    <tag>
    <name>customTags</name>
    <tag-class>source.com.tags</tag-class>
    <description>
    formatted text box:
    </description>
    <attribute>
    <name>mandatory</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <name>optional</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    - ls6v

    You have to find the JAR(s) that contain the J2EE API (found in your Server download) and include them in the WebSphere classpath.

  • How to create the customizing TAG coloum in So10  transaction

    Hi All,
      I need to create the Tag Coloum in in SO10 ( standard text) transaction .
    Basically i want to create the customised tag format and attach it to the format where we will see all the standard tag in so10.
      I need to create the TAG in which first line should be start from 0.00 and from the second line onwards it should be start from the 2.3 .
    Dhiraj.

    Dhiraj,
    What you will have to do is to create a separate STYLE in sMART FORMS transaction and assign that STYLE to the TEXT in S010. You can do that Format --> Change STYLE.
    The tag column contains format keys which define the output formatting of the text or initiate control commands. The format keys possible and their respective meanings are defined in styles or forms. If a style or form is assigned to a text module you can use the paragraph formats defined there to format your text. Format keys which can be defined by the user can consist of one or two characters.
    I have not tried this though.
    regards,
    Ravi
    Note : Please mark the helpful answers

  • Internal Error when trying to create a custom controller with execute comma

    Hi,
    I have got the following problem. I created a new web dynpro project and added an existing RFC model. But when I try to create a custom controller by applying a service controller including an execute command, I only get an internal error message. The message shows the following information:
    Plugin name:
    Web Dynpro Controller Editor Services
    Plugin ID:
    com.sap.ide.webdynpro.service.controllereditor
    Class:
    com.sap.ide.webdynpro.service.controllereditor.implementation.ImplementationService
    Method:
    getJDTMethod(Controller, String, IProgressMonitor)
    Message:
    Source controller implementation file is not accessible (Path to workspace folder: P:/.../gen_wdp/packages/com/clariant/ml5/types/ML5Cust.java)
    Exception:
    java.lang.Exception: 0
    Maybe someone could help me to fix this problem.
    Thanks Andy
    Ok... I found a way to fix by myself. All I have to do is to create a controller first and after this I have to apply the service controller. I don´t know why but it works. Both steps together doesn´t.
    Bye
    Andy
    Message was edited by: Andreas Choma

    I e-mailed tech support and got my answer.
    I should have been using /dev/rdsk and not /dev/dsk when specifying the disk slice to put the file system on.

  • Trying to store a custom tag in a database field

    I have a simple custom tag that displays an image.  We'll call it <cf_checkmark>.  All it does is display a nice little checkmark.  Saves me from having to rewrite the <img src="...."> tag over and over and over.  I want to store this tag in a database field, so it is returned as a value in my query results.  (I'm not storing the code in the database, just the text "<cf_checkmark>").  Only problem is coldfusion doesn't render the custom tag when I output the result.  The tag is there, it's just not rendering or executing.  If I do a View Source I can see <cf_checkmark> in the source.  It just doesn't execute or render.
    My guess is that ColdFusion executes all the cf code before it outputs the query results.  Therefore it doesn't recognize the text in the query result as a custom tag.  Is there any way to get this to work?

    Write it to a file and cfinclude the file.
    But for one line of code, why bother.

  • Help creating a custom tag from a scriplet

    I am trying to make a cusom tag to replace this peice of code:
    <TABLE >
    <% 
    out.println("<TABLE >\n" +
                    "<TR BGCOLOR=\"#FFDDAA\">\n" +
                    "  <TH>ID Number\n" +
                    "  <TH>Artist\n"
    Iterator it = pricePassed.getpricePassed().iterator();
    while( it.hasNext() ){
       MySite.VideoBean vids = (MySite.VideoBean) it.next();
       out.println( "<TR>\n" +
                   "<TD><Center><B>" + vids.getRecId() + "</TD>" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
    %></TABLE>The following is no where near perfect i just want to post it so i can get opinions to see if i am going about it the right way:
    import java.io.*;
    import java.util.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TableTag extends BodyTagSupport {
    private List passedIn;
    public void setItems(List workon) {
      passedIn = workon;
    public int doAfterBody() throws JspException {
      BodyContent body = getBodyContent();
      String body1 = body.getString();
       body.clearBody();
      List list = body1.length() >0 ? text2List(body1) : passedIn;
      if (list == null) return SKIP_BODY;
      try {
        JspWriter out = body.getEnclosingWriter();
        out.println("<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
                    "<TR BGCOLOR=\"#AADDFF\">\n" +
                    "  <TH>Artist\n" +     
    Iterator it = passedIn.setItems().iterator();
    while( it.hasNext() ){
       MySite.videoBean vids = (MySite.videoBean) it.next();
       out.println( "<TR BGCOLOR=\"#FFAD00\">\n" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
      } catch (IOException ex) {
        throw new JspTagException(ex.getMessage());
      } // try
      return SKIP_BODY;
    }

    If you go to the page where it lists all the forums and scroll way, way, down you will find there's a JSP forum. That is really where you should post this kind of question.

  • "No active legal regulations found for country US "  while trying to create the Customs Import Declaration

    Dear Experts,
    As part of creating Customs Import Declaration manually, when I selected the FTO and try to use create button I am getting error message .
    Can you please help me in this regard .
    No active legal regulations found for country US
    Ram

    Hi Ram,
    As the error message straight away tells , you need to activate Legal Regulation for Customs Management ( in standard case, it will be ACE) for US country through the below path:
    SPRO-->SAP Global Trade Services-->Customs Management-->Activate Leagl Regulation for Customs Management at Country/Country Group level
    In case of any further queries, please let me know it.
    Regards,
    Aman

  • Trying to create a customized PDF form to save and re-use

    Hi,
    New to this program. I have created a "fill-in-the-blanks" PDF form and have saved it. But now when I print the form, there are characters in the beginning of the text boxes.  They are T and E. I don't understand why she characters are there and how do I get rid of them. We want this form to fill in the blanks format, then we want to be able to save it, and go on to the next one. In other words we will be re-using this format over and over again. Can someone help me? I am frustrated as I am almost there. Plus I downloaded a 30 day trial of Adobe Pro 9 to see if I could do this.....so I don't know if I will need to buy this program or not. Thanks.

    I don't want to post this form. I've attached it here for you to look at. I think I created it using forms. 
    "Bill@VT" <[email protected]> wrote:
    Also indicate if you created the form in Acrobat (using the tools in the TOOLS menu) or in Designer (using the package that is called from the FORMS menu.
    >

  • Multiple picklist field not showing up when trying to create a custom repor

    I recently have created 4 new fields in CRM, and 3 of the 4 fields can be found to create a report. For some reason, the multiple picklist field has not shown up. Any suggestions or advice on why this is an issue?

    Hi,
    The multi-select picklist should be available in the Analytics reports not in real-time reports.
    Another thing is that there is a delay in metadata refresh in reports, in staging it is about a week, in production it is 1 day, I think. so if you created a multi-select picklist in staging today, it would be available in analytics reports maybe after a week.
    Regards,
    Ani

Maybe you are looking for

  • Client-cert auth impl in web.xml does not work in Oracle Application Server

    Hi, I am new to implementing security features on the web applications.. I have developed a new web service using jdev1012 and deployed in OAS 10.1.2. Its working fine according to the business requirements, but I am in need of implementing client-ce

  • Need to not have a split by business area at vendor payment step (F110)

    Hello, Under my case : I have several invoices for one vendor. Each invoice has a business area. Invoice 1 - BA = 001 - 1000 Invoice 2 - BA = 001 -   500 Invoice 3 - BA = 002 - 1000 Now the point is that when I run the F110 for this vendor, the syste

  • IPhone4 not mounting correctly in KDE

    Hey everyone, I know this has come up before, and I have searched through the forum as well as using Google, but everything I have found doesn't work for me. The problem: I want to use iTunes in VirtualBox for my iPhone I have VirtualBox with a windo

  • Calculation delivery date for items

    Hello, I am looking for the option to set a delivery date calculation in master data so this will be automatically calculated in sales and purchase documents. The only thing that comes remotely close is the 'Lead Time' in tab 'Planning Data' but this

  • Import for project

    hi sap guru's i just want run import procument procedure againt project how i can run what is configurations required explain step by step