Pass structure or array into a custom tag?

Is it possible to pass a CF structure or array to a custom
tag (C++/MFC) as an argument? Is it possible to create a CF array
or structure *from* a custom tag?

Passing a structure out is as easy as using a period in the
variable name in your SetVariable() call.
For example,
pRequest->SetVariable ("SPP_zResults.bHadErroredPts", "0");
pRequest->SetVariable ("SPP_zResults.dMax",
"3.14159265");
Passing a struct in may be just as easy, I haven't ever
needed to try it.
Let us know if it works.

Similar Messages

  • How to  pass a variable value into a custom planning function via a web

    Can some one tell me
    How to  pass a variable value into a custom planning function via a web template?
    What are the different types of Planning function parameters available and what is the difference between them?
    Thanks
    babu

    Hi Sutrtha,
    Yeah I got the pop up asking to select the variables used, I have selected ENTITY_ID that was used by the interfaces, but on execution of the package the Scenario did not work as the passeed variable #ENTITY_ID is set to 0 instead of the value I am passing.
    Am I missing something?
    Regards
    B

  • How to access variables passed in custom tag body

    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".
    Edited by: coolkomal on Jun 3, 2009 7:45 AM

    coolkomal wrote:
    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    <myTags:display var="<%=someVariable>"/> is a valid syntax for performing respective action of that variable. You can also use EL to pass the variable ${someVariable} provided the custom tag provide support for EL.
    >
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />
    Just ensure that you declare all the related variables in Main.jsp and statically include Main.jsp in your jsp such that you do the checking
    [http://java.sun.com/products/jsp/tags/11/syntaxref117.html]
    >
    I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".Can be done provided you code it the right way. Start learning basics of how to create custom taglibraries to gain more knowledge on how things can be managed.
    [http://java.sun.com/javaee/5/docs/tutorial/doc/bnalj.html]

  • Custom Tag: pass my own type in as attribute

    I thought I can pass any type as attribute into my custom tag. I tried, but failed. The exception is:
    org.apache.jasper.JasperException: Unable to convert '${myType}' to class MyTpye for attribute myAttribute: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager.
    I know I can pass the value in using PageContext attribute. However, still want to figure out how to do it through custom tag attribute.
    Here's my taglig file:
    <tag>
    <name>myTag</name>
    <tag-class>MyTagClass</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <name>myAttribute</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>MyType</type>
    </attribute>
    </tag>
    What am I missing here? Thanks.

    Hi
    Pls tell me how did you resolve this issue. I am also facing the same problem.
    Thanks
    Prakash

  • Custom Tag and CFC : Nate Weiss

    Hi,
    being a beginner I'm trying with some marginal degree of
    success to understand CFC's and Custome Tags.
    In the CFMX7 W.A.C.K. There is an example shopping cart. This
    start off as a basic affair then expands into more object based
    principles using a custom tag add products to the cart
    (ShoppingCart.cfc) and later on the same page uses a custome Tag to
    display the cart items, calling it once for each item to display.
    I am using the MVC structure under Fusebox 4, so this method
    of using the same template, (reloading etc) is alien to me as with
    MVC you usually have the data type intructions in different files
    (anyway, I digress)
    Now that I have the thing adding products and generally
    working with my "shop", I thought about having a "special offer"
    facility. With these "Hot Deals" being stored in another database
    table, with their productID and new price.
    However, obviously the shopping cart needs to be made aware
    of this. With I would have thought an extra variable in the array
    telling the custom tag to retrieve the special price and the
    product information using a diufferent inner join query to normal.
    I have attemtped this by adding an additional URL parameter
    thus /..../HSOP/Y ("Has Special Offer Price" being set to "Y")
    When this reloads the page the CFC invoke is set thus
    <CFIF IsDefined("URL.HSOP") AND #URL.HSOP# EQ "Y">
    <CFINVOKE
    COMPONENT="#SESSION.MyShoppingCart#"
    METHOD="Add"
    MERCHID="#URL.AddMerchID#"
    SOPH="Y">
    <cfelse>
    This successfully passes
    Add(SOPH = Y, MERCHID = xxxx)
    to the CFC. However I get this error......,
    ..................Element SOPH is undefined in ARGUMENTS.
    the CFC simpley isnt adding the new variable to the array...
    I think... it wont do a CFDump so there is no way of telling
    <CFFUNCTION
    NAME="Add"
    HINT="Adds an item to the shopping cart">
    <!--- Three Arguments: MerchID, Quantity and SOPH (flag
    to state if there is a special price) --->
    <CFARGUMENT NAME="MerchID" TYPE="numeric"
    REQUIRED="Yes">
    <CFARGUMENT NAME="Quantity" TYPE="numeric" REQUIRED="No"
    DEFAULT="1">
    <CFARGUMENT NAME="SOPH" type="string">
    <!--- Get structure that represents this item in cart,
    --->
    <!--- then set its quantity to the specified quantity
    --->
    <CFSET CartItem = GetCartItem(MerchID)>
    <CFSET CartItem.Quantity = CartItem.Quantity +
    Arguments.Quantity>
    <CFSET CartItem.SOPH = Arguments.SOPH>
    </CFFUNCTION>
    I cant see why this wouldn't create the variable
    "CartItem.SOPH" and set it to "Y" as passed to it.
    I notice the CFC performs an iteration of sorts to put the
    cart items into an array. But I'm afraid I cant fathom what this
    problem might be.
    Any ideas. I have attached the whole CFC code (post editing
    by me)
    MAny thanks and Happy new Year

    Hi,
    As for me, I am testing the related pdf-417 barcode scanner these days. Do you have any ideas about it? Or any good suggestion? I am totally a green hand on barcode field. Any suggestion will be appreciated. Thanks in advance.
    Best regards,
    Arron

  • Accessing JSP Variables in Custom Tag Handler.

    Hi,
    I am creating a custom tag which builds a list view. I have certain String array in my JSP and I need to pass the same into my Tag Handler class. I tried following ways :
    1. In doStartTag() implementation I used
       public int doStartTag() {
             String[] myArray = (String[])pageContext.getAttribute("mystringarray", PageContext.PAGE_SCOPE;
       }This is not recognizing the String array variable defined in my JSP.
    2. I used separate attribute which is passed from the JSP to the custom tag as parameter having "rtexprvalue" as true. But I cann't pass a Sting array into my tag handler class. I can pass only String.
    How can I access variables which are defined in the JSP using declaration block. i.e.
    <%!
    String[] myArray = new String[100];
    %>
    Thanks for the time.

    You should be able to pass any type you like as an attribute to the tag.
    You just have to define its type as String[] in your tld:
    <attribute>
    <name>stringArray</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.String[]</type>
    </attribute>
    Alternatively, If you declare your array like:
    <%!
    String[] myArray = new String[100];
    %>You can do this:
    pageContext.setAttribute("mystringarray", myArray);
    which will put it into the page context for you to pick up in your custom tag.
    Hope this helps,
    evnafets

  • Simple question about custom tags really easy!!

    I am trying to make my own custom tags, so far i have created simple one that have i use for heading or to set the page layout for a jsp page, My question is I want to make a custom tag with a body , with a start and end tag can anybody give a simple example of a custom tag which has a body.
    I do not mean write me a tag i mean what could a tag with a body be used for? Can you give me some example of what a tag of this kind could do?

    Thanks having read that and some other pages i have another question:
    would it be possible to put the following code into a custom tag so that i can pass in a list and have it output it to a table?
    <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>At the moment i use the above in a jsp to put data into a table, would it be a massive task to undertake to put into a custom tag?

  • Custom Tag Error with Weblogic SP9

              Hi
              I seem to be having a problem with a custom tag that I wrote. When I run the JSP
              on WLS (without a service pack), the generated java code uses the weblogic.utils.StringUtils
              class to interprete jsp expressions that are passed into the custom tag's attribute
              (on the JSP). The method called on this StringUtils class is valueOf(). This method
              in essence makes sure that the result of the expression is not null and then subsequently
              calls a toString() on the value. Note that if the value is null it simply returns
              an empty string.
              The problem is that when we go to service pack 9, this method is not called (StringUtils.valueOf()).
              Now the problem arises if first of all the result of the expression statement
              in the custom tag definintion (on the JSP) is null. Secondly, it will also error
              out when the setter method is called within the custom tag, if the object returned
              from the expression does not match the one that is expected by the tag... in our
              case a String.
              Here's a sample usage of the tag:
              <wescombop:selectTag
              selectName="buildingNumber"
              selectedItem="<%= buildingJB.getBuildingNumber()%>"
              trimSelectedItem="true"
              selectTagDataName="buildingNumberDataAttribute" />
              Note: buildingJB.getBuildingNumber() returns BigDecimal
              Here's a snipett of the line generated java:
              * Without the service pack
              comwestfieldgrp_wescom_bop_view_tag_SelectTag_1.setSelectedItem(weblogic.utils.StringUtils.valueOf(buildingJB.getBuildingNumber()));
              *With Service Pack 9
              comwestfieldgrp_wescom_bop_view_tag_SelectTag_1.setSelectedItem(buildingJB.getBuildingNumber());
              Note: The setSelectedItem() method expects a String object as a parameter, so
              the code with service pack 9 will result in a compilation error, since buildingJB.getBuildingNumber()
              returns a BigDecimal.
              Let me know if you need more explanation.
              Has anyone experience this problem before... Any help would be deeply appreciated.
              Thanks all.
              Niran
              

              Modify the <cewolf:param> tag.
              <cewolf:chart id="confchart" title="Reports" type="bar3d" yaxislabel="Time"> <cewolf:data>
              <cewolf:producer id="report"> <cewolf:param name="type" value="all" > </cewolf:param>
              </cewolf:producer> </cewolf:data> </cewolf:chart>
              "Balakrishnan" <[email protected]> wrote:
              >
              >We are using cewolf charting library in weblogic 7.0. The charting library
              >is implemented
              >as custom jsp tag library module.
              >
              >However, when the use the tag for displaying the chart, weblogic is producing
              >this compiler error.
              >
              >/reports/reportsView.jsp(108): no corresponding open tag for tag extension
              >close:
              >//[ null; Line: 108]
              >
              >Here's the corresponding source of the jsp file:
              >
              > <cewolf:chart id="confchart" title="Reports" type="bar3d" yaxislabel="Time">
              > <cewolf:data>
              > <cewolf:producer id="report">
              > <cewolf:param name="type" value="all" /> (<-- Error occurs
              >here.
              >Line no: 108)
              > </cewolf:producer>
              > </cewolf:data>
              > </cewolf:chart>
              >
              >I've also checked the corresponding tld file and it is in place.
              >
              >The same code without any modifications is working fine in tomcat. Can
              >you please
              >let me know what needs to be corrected to make this work?
              

  • Select Option Custom Tag JQUERY

    I have multiple select options on many of my pages, I just just added a jquery filter plugin to one of the select options i.e As User types on an input box the values in the select options gets filtered. This works very well now. How can I make it this into a custom Tag where it can be resused by all the select options on the site. That is the id of the select option and the input box has to be passed to the jquery to automtically filter the content of the Select Option. below is my jquery script.
    <div>Filter<br>
        <input id="txtcomm" type="text" name="">       
    </div>
    <div>
        <select id="slctcomm" multiple style="width:220px">
            <cfloop query="qryobjComm">
                <option value="#Comm#">#Comm#</option>
            </cfloop>
        </select>   
    </div> 
    <script>
        jQuery.fn.filterByText = function(txtcomm, selectSingleMatch) {
          return this.each(function() {
            var slctcomm = this;
            var options = [];
            $(slctcomm).find('option').each(function() {
              options.push({value: $(this).val(), text: $(this).text()});
            $(slctcomm).data('options', options);
            $(txtcomm).bind('change keyup', function() {
              var options = $(slctcomm).empty().data('options');
              var search = $.trim($(this).val());
              var regex = new RegExp(search,'gi');
              $.each(options, function(i) {
                var option = options[i];
                if(option.text.match(regex) !== null) {
                  $(slctcomm).append(
                     $('<option>').text(option.text).val(option.value)
              if (selectSingleMatch === true &&
                  $(slctcomm).children().length === 1) {
                $(slctcomm).children().get(0).selected = true;
        $(function() {
          $('#slctcomm').filterByText($('#txtcomm'), true);
    </script>

    Hi umuayo,
    I guess you want pass the jquery selector for textbox and selectbox. I have created a file named filterByText.cfm which will act as customtag for me.
    for more information regarding custom tag follow this link http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0b2e1 -7fff.html
    In this example i have created custom tag in the same directory where I will use it. You can create it in different place also. Let us get into the main topic. I will pass the jquery selector for textbox and selectbox to the custom tag by "FilterId" and "slctcomm" attribute and inside customtag I will convert coldfusion valiable to javascript variable and use them to call your function.
    dynamicselectbox.cfm
    CODE:
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <cfquery name="getEmps" datasource="cfdocexamples">
        SELECT * FROM EMPLOYEE
    </cfquery>
    <div>Filter<br>
        <input id="txtcomm" type="text" name="">      
    </div>
    <div>
        <select id="slctcomm" multiple style="width:220px" class="selclass">
            <cfoutput query="getEmps">
                <option value="#Emp_ID#">#FirstName#</option>
            </cfoutput>
        </select>
              <select id="slctcomm2" multiple style="width:220px" class="selclass">
            <cfoutput query="getEmps">
                <option value="#Emp_ID#">#FirstName#</option>
            </cfoutput>
        </select>  
    </div>
    <cf_filterByText FilterId="##txtcomm" slctcomm=".selclass">
    filterByText.cfm
    Code:
    <script type="text/javascript">
    //get the jquery selector from attribute scope
              var filterId="<cfoutput>#Attributes.FilterId#</cfoutput>";
              var selectBoxId="<cfoutput>#Attributes.slctcomm#</cfoutput>";
        jQuery.fn.filterByText = function(txtcomm, selectSingleMatch) {
                        console.log(this);
                        var retvar;
            retvar = this.each(function() {
            var slctcomm = this;
            var options = [];
            $(slctcomm).find('option').each(function() {
              options.push({value: $(this).val(), text: $(this).text()});
            $(slctcomm).data('options', options);
            $(txtcomm).bind('change keyup', function() {
              var options = $(slctcomm).empty().data('options');
              var search = $.trim($(this).val());
              var regex = new RegExp(search,'gi');
              $.each(options, function(i) {
                var option = options[i];
                if(option.text.match(regex) !== null) {
                  $(slctcomm).append(
                     $('<option>').text(option.text).val(option.value)
              if (selectSingleMatch === true &&
                  $(slctcomm).children().length === 1) {
                $(slctcomm).children().get(0).selected = true;
                return retvar;
    //call the function with the selector passed by user.
        $(function() {
          $(selectBoxId).filterByText($(filterId), true);
    </script>
    Thanks
    Saurav

  • Passing Values back from Custom Tag

    I'm using custom tags, and I'm trying to pass back values to the JSP page from a tag which is iterating over values it gets from an Array. But for some reason I can't access the values.
    Here is the Tag:
    public class MemberHelper extends TagSupport implements IterationTag {
        private Iterator iterator;
        protected Tag parent;
        protected PageContext pageContext;
        public MemberHelper() {
            super();
        public void otherDoStartTagOperations() { 
            sfmember_prop_desc desc = new sfmember_prop_desc();
         ArrayList allt = new ArrayList();
         try {
                 allt = desc.GetAllCustom();
         } catch (java.sql.SQLException ex) {}
            if(allt.size() > 0)
             iterator = allt.iterator();

        public void otherDoEndTagOperations()  {
        public boolean shouldEvaluateRestOfPageAfterEndTag()  {
            return true;
        public int doStartTag() throws JspException, JspException {
           otherDoStartTagOperations();
           if (theBodyShouldBeEvaluated()) {
              return EVAL_BODY_INCLUDE;
           } else {
              return SKIP_BODY;
         public int doEndTag() throws JspException, JspException {
           otherDoEndTagOperations();
           if (shouldEvaluateRestOfPageAfterEndTag()) {
              return EVAL_PAGE;
           } else {
              return SKIP_PAGE;
        public int doAfterBody() throws JspException {
           if (theBodyShouldBeEvaluatedAgain()) {
              return EVAL_BODY_AGAIN;
           } else {
              return SKIP_BODY;

  • Is it possible to pass dynamic values to custom tag?

    Hi there, I'm trying to build a calendar custom tag so I can drop the calendar into an existing webpage easily.
    I have got the calendar displaying on the page but the problem I have is when I try to create 'previous' and 'next' links. Is it possible to pass parameters to a custom tag that have dynamic values?
    In PHP it would looks something like:
    <a href="bla.php?page=$pagenumber">next page</a>When I create the calendar object I set it to the current date so when I try to increase or decrease the month (next/prev month) it doesn't work because the code is run again and hence setting the current date again.
    Any ideas?
    Cheers in advance
    Message was edited by:
    MajorMahem

    for eg
    <a href=" Display.jsp?id='+<%=customerId%>">Result Page</a>
    Please try this,
    i didn't work out, any how apply this sample to your code

  • Custom tags:without package structure,showing error

    Hi evrybdy
    While making a simple jsp using custom tags,if i m keeping my java file wothout package structure it is giving jasper exception.On the contrary if i m keeping it inside pckg structure it is working properly.Any idea why so???????

    This reason would be why so: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4361575
    Basically you can't access classes in the 'unnamed' package from classes which are in a 'named' package.
    JSPs always compile into servlets in a 'named' package.
    Your classes should always be in a package structure.

  • Custom tag setting a parameter as an array String[]

    I would like to pass a number of bind variable as an array of strings to a custom tag.
    So far I can pass an array to the tag in the following way:
    <%
    String[] bindv = {"1000","01010","EMP"};
    pageContext.setAttribute("bindv",bindv);
    %>
    <jm:q2b bind="${bindv}"/>Is there a way to do this without using the scriptlet ?

    The parameters are bind variable and usually are set from the http requestThe fact that they're bind variables doesn't make any difference. If they're passed in the request you can access them using jstl. You just need to do requestScope.bindv (replace bindv with the variable(s) name).
    If you're using an array you must know how many variables are passed, so it's easy. If you don't know just put the variables in an array (or something similar) before you put them in the request and use the forEach tag.

  • Passing array into resultset

    hi,
    is it possible to pass an array into a resultset? if yes please indicate how.
    thank you all in advance

    Hi,
    Sorry for the confusion, here's what I'm trying to accomplish.
    I'm trying to create a report in Crystal Report and use Java as data source. My Java application needs to generate some value and pass them to the report as parameters. After some research I've found that I can use a Java Bean class as data source for Crystal Report that returns a ResultSet. Therefore I'm trying to pass some values in my Java app into the Bean class as array and convert them to a ResultSet for Crystal Report.
    If you know of a different way please let me know, otherwise, this is what I meant by passing array into resultset.
    thanks for your reply,

  • JSP Custom Tags, Tag Handlers, Passing values

    Multiple questions here while I try to work with custom tags (its a requirement):
    From what I have had so far - I have a .tld file, a .java file and a .jsp page.
    (this is not a working version as I just got it from a website)
    platform: tomcat on an xp box.
    I was wondering if we can pass the parameters that are passed to the the jsp page (like blah.jsp?param1=value1&param2=valu2 ) to the tag handler?
    This is because the processing that I need to do in the handler would depend on what I have in the passed values.
    Any help in letting me know where to place those files on the tomcat context root would help. Please see, I do have a couple of servlets running on the box also and they might be in the same context root.
    Any good short tutorial link is also welcome as a short answer as I try to unravel the custom tags in jsp.

    I am using TomCat 5.5
    What I need to do using tags is to build a web-page on the fly by polling a couple of different tables in the database.
    This is to be done using a jsp and custom tag (requirement) which would be able to handle any resultsets. We also have to come up with pageContext attribute names and supply column names as those attributes. Thus we will have to come up with the meta data file and a tag library descriptor as well.
    I found a helloworld solution on a website and was trying to modify it to meet my needs. But I guess I under-estimated the work that needed to be done in this one.

Maybe you are looking for

  • How does movies model work?

    I've been a Mac user since 1987 and always loved Apple for its intuitive UI. However, the model Apple's using for viewing purchased movies on iDevices is absolutely confounding me. At one time, purchased movies seem to need to be downloaded, and you

  • Need to place a pipe | delimiter in extract

    I am using Crystal 11, and need to know if there is a way to place a pipe | delimiter between each field.  I am pulling data from one application to another, and the receiving analyst has requested a pipe between each field.  I know I can export the

  • Quality Managment Total Process

    Dear All, Please explain the QM total process with steps & T.codes .(Master Data, Quality Certificate, Notification etc) What is the link between MIC -- Planning & Material how they are interlinked? What isthe Link between Quality information record

  • Where to get the evaluation license of system ID NW4

    hi, I have installed successfully the SAP Netweaver 04 Testdrive SR1 (wen application server 6.4). I am searching the evaluated license key at the SAP website. I checked this one.......... http://www.sap.com/minisap but here no entry for the SAP syst

  • L305-S5919 Locks Up

    I've had my Toshiba L305-S5919 for about 5 months. When I haven't done something on the computer within about 10-20 minutes, the computer locks up. The keyboard won't respond, so it won't accept alt-ctrl-del. At that point, I have to remove both powe