Custom AS3 Component / Event Definition for MXML Tag

Custom AS3 Component / Event Definition for MXML Tag
Exposing custom event in custom MXML tag.
I have made an AS3 custom component named,
'CustomListComponent'.
Is a list type component extending UIComponent.
When an item is clicked (selected) I generate a custom event
named, 'selChange'
I want the user to be able to use this tag, define a handler
on the MXML tag.
I tried using metadata like [Event("selChange")] in the
component AS3 file with no luck.
Any help / examples to expose a custom event from an AS3
custom component to the MXML tag for the end user/developer would
help significantly.
Anyone? Thank you.

Well, That did not take long.
My mistake, Typo type.
[Event(nane="selChange", type="flash.events.Event")]
That is: naNe not naMe :(
Thank you all for your time and responses.
I WILL check my code more closely next time I post a
question.
P.S.: @VarioPegged : My code is big and not needed now. If
you would like it anyway just message me. TY

Similar Messages

  • How do I add custom style to custom AS3 component via .css file?

    Hi all,
    I have created a flex application which displays a custom component I created in actionscript. My custom component is just an extended canvas component which displays a gradient background. When I add the component to my flex app, see code below, the component works great.
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="http://localhost/mycomps">
        <ns1:GradientCanvas fillColors="[#ffffff, #000000]" />
    </mx:Application>
    However, I also want to support css styles to add the gradient colors to my component, like so
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="http://localhost/mycomps">
        <mx:Style source="test.css" />
        <ns1:GradientCanvas styleName="gradientCanvas" />
    </mx:Application>
    test.css
    .gradientCanvas {
        fill-colors: #ffffff, #000000;
    When I try this my component doesn't display a gradient. I have followed the tutorials online that I could find but it seems to be the same example from Adobe repeated on multiple site and it doesn't work.
    My component code is added below, if anyone could show me how to get this to work it would be much appreciated.
    Thanks in advance,
    Xander
    GradientCanvas.as
    package mycomps {
        import flash.display.GradientType;
        import flash.geom.Matrix;
        import mx.containers.Canvas;
        import mx.styles.CSSStyleDeclaration;
        import mx.styles.StyleManager;
        public class GradientCanvas extends Canvas {
            private static var classConstructed:Boolean = constructStyle();
            public function GradientCanvas() {
                super();
                this.width = 100;
                this.height = 20;
            private static function constructStyle():Boolean {
                var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("GradientCanvas");
                if (style) {
                    if (style.getStyle("fill-colors") == undefined) {
                        style.setStyle("fill-colors", [0xffffff, 0x000000]);
                } else {
                    style = new CSSStyleDeclaration();
                    style.defaultFactory = function():void {
                        this._fillColours = [0xffffff, 0x000000];
                    StyleManager.setStyleDeclaration("GradientCanvas", style, true);
                return true;
            override public function styleChanged(styleProp:String):void {
                super.styleChanged(styleProp);
                if (styleProp == "fill-colors") {
                    this._fillColours = getStyle("fill-colors");
                    this._fillColoursChanged = true;
                    this.invalidateDisplayList();
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                if (this._fillColoursChanged == true) {
                    var direction:Number = 90 * (Math.PI / 180);
                    var matrix:Matrix = new Matrix();
                    matrix.createGradientBox(unscaledWidth, unscaledHeight, direction, 0, 0);
                    graphics.clear();
                    graphics.beginGradientFill(GradientType.LINEAR, this._fillColours, [1,1], [0, 255], matrix, "pad", "rgb", -1);
                    graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
                    graphics.endFill();
                    this._fillColoursChanged = false;
            [Inspectable(category="Gradient", type="Array", format="Color", name="Fill Colours")]
            private var _fillColours:Array;
            private var _fillColoursChanged:Boolean = false;
            public function get fillColours():Array {
                return this._fillColours;
            public function set fillColours(value:Array):void {
                this._fillColours = value;
                this._fillColoursChanged = true;
                this.invalidateProperties();
                this.invalidateDisplayList();

    Never mind, I've discovered how to do it for myself.
    Thanks...

  • Custom Pre Process Event Handler in OIM 11g for middle initials

    Hi,
    I am trying to congiure a Custom Pre Process Event Handler for generating middle name in OIM 11g and I am following the steps as given in metalink ID: *1262803.1*
    Even after successfully performing all the steps I am not able to get the middle initials in Admin Console when I create a new user.
    1) Directory structure for the application that I have created through JDeveloper.
    CustomApplication/
    |-- CustomApplication.jws
    `-- CustomProject
    |-- CustomProject.jpr
    |-- classes
    | `-- com
    | `-- example
    | `-- custompph
    | `-- CustomPreProcessEventHandler.class
    `-- src
    `-- com
    `-- example
    `-- custompph
    `-- CustomPreProcessEventHandler.java
    2) Directory structure for Plugins directory
    My Plugin.xml :
    <?xml version="1.0" encoding="UTF-8" ?>
    <oimplugins>
    <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass="com.example.custompph.CustomPreProcessEventHandler"
    version="1.0" name="CustomPreProcessEventHandler" />
    </plugins>
    </oimplugins>
    plugin/
    |-- lib
    | `-- com
    | `-- example
    | `-- custompph
    | `-- CustomPreProcessEventHandler.class
    |-- middlename.zip
    `-- plugin.xml
    Copied the middlename.zip in the plugin folder in OIM_HOME and registered it successfully.
    3) Created a EventHandlers file and imported it successfully using importmetadata.
    My EventHandlers.xml:
    <?xml version='1.0' encoding='utf-8'?>
    <eventhandlers>
    <!-- Custom preprocess event handlers -->
    <action-handler
    class="com.example.custompph.CustomPreProcessEventHandler"
    entity-type="User"
    operation="CREATE"
    name="CustomPreProcessEventHandler"
    stage="preprocess"
    order="10"
    sync="TRUE"/>
    </eventhandlers>
    I checked the logs as well but could not find something which can help me to proceed.
    Also please advise is their any mapping that I need to do in *"Design Console"*
    Please advise !!!!!
    Thanks

    My lib file contains the package as mentioned in the metalink.
    Heirarchy in Plugin folder :
    1) plugin.xml
    2) Lib ( lib contains 3 folders : com/example/custompph; And inside custompph is my CustomPreProcessEventHandler.class file)
    You mean to say i should not copy the entire package in lib but only the jar file of the CustomPreProceessEventHandler.class* file.
    If i put only a .jar file in lib i get the following error.
    "Error occured during the use of plugin registering utility. The plugin zip does not contain the definition of plugin class com.example.custompph.CustomPreProcessEventHandler"
    Thanks
    Edited by: 870050 on Jul 4, 2011 4:30 AM

  • [svn:fx-trunk] 12962: Fix for ASDoc not saving event type for [Bindable] metadata tag

    Revision: 12962
    Revision: 12962
    Author:   [email protected]
    Date:     2009-12-15 10:32:23 -0800 (Tue, 15 Dec 2009)
    Log Message:
    Fix for ASDoc not saving event type for metadata tag
    QE notes: None.
    Doc notes: None
    Bugs: SDK-24706
    Reviewed By:Corey
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24706
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    Which correspondents fine with the
    device "hw:0,3"
    in my mpd.conf alsa section.
    Also sound worked fine withh this config before I started installing ffmpeg-svn and alikes
    hokasch:
    I tried changing the mixer to "Master" but that did not change much.

  • Create Component that Listens for Custom Event

    I've read a lot of tutorials and posts in this forum but still seem to be missing something.
    I want to be able to create an arbitrary number of instances of a custom class (based on Button) that each listen to a custom event dispatched in the application.  Eventually the event will carry data (including information that will let each Button determine whether it should react to the event), but for now I just want them to be able to hear the event.
    What's supposed to happen is
    1) Clicking the button labeled "I Make the Button" creates an instance of EventHearingButton using this.addElement.
    2) Clicking the button labeled "I Send the Event" dispatches the SuperCustomEvent custom event, with the additional information "I heard that" stored in the Information string
    3) The created EventHearingButton hears the event and updates its label to the value in the Information string.
    What actually happens is the EventHearingButton is created OK, but nothing happens when the "I Send the Event" button is clicked.
    Main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/halo">
         <fx:Metadata>
              [Event(name="SuperCustomEvent", type="Classes.SuperCustomEvent")]
         </fx:Metadata>
         <fx:Script>
              <![CDATA[
                   import Classes.EventHearingButton;
                   import Classes.SuperCustomEvent;
                   protected function EventDispatcherButton_clickHandler(event:MouseEvent):void
                        var NewEvent:SuperCustomEvent = new SuperCustomEvent("I heard that");
                        this.dispatchEvent(NewEvent);
                   protected function button1_clickHandler(event:MouseEvent):void
                        var NewButton:EventHearingButton = new EventHearingButton();
                        NewButton.x=270;
                        NewButton.y=130;
                        this.addElement(NewButton);
              ]]>
         </fx:Script>
         <s:Button x="270" y="90" label="I Send The Event" id="EventDispatcherButton" click="EventDispatcherButton_clickHandler(event)"/>
         <s:Button x="270" y="50" label="I Make the Button" click="button1_clickHandler(event)"/>
    </s:Application>
    Classes.EventHearingButton.as
    package Classes
         import spark.components.Button;
         import flash.events.Event;
         import Classes.SuperCustomEvent;
         public class EventHearingButton extends Button
              public function EventHearingButton()
                   super();
                   this.label="I haven't heard yet";
                   this.addEventListener(SuperCustomEvent.SUPERCUSTOMEVENT,SuperCustomEventHandler);
              private function SuperCustomEventHandler(event:SuperCustomEvent):void {
                   this.label=event.EventInformation;
    Classes.SuperCustomEvent.as
    package Classes
         import flash.events.Event;
         public class SuperCustomEvent extends Event
              public var EventInformation:String;
              public static const SUPERCUSTOMEVENT:String = "SuperCustomEvent";
              public function SuperCustomEvent(Information:String)
                   super(SuperCustomEvent.SUPERCUSTOMEVENT, true);
                   this.EventInformation=Information;
              override public function clone():Event{
                   return new SuperCustomEvent(EventInformation);

    "nikos101" <[email protected]> wrote in
    message
    news:ga59t5$8nh$[email protected]..
    >I tried something like what AMy described in a custom
    component
    >
    > dispatchEvent(new Event("Cancelled_Form"));
    >
    > I then added the following Listener in my application
    file;
    >
    > this.addEventListener("Cancelled_Form",cancelledForm);
    >
    > but it is never heard. Does anyone know what I have done
    wrong?
    Try attaching the event listener to your component rather
    than the
    application.
    HTH;
    Amy

  • Event handlers:  click in mxml tags or in AS?

    Is there an advantage to putting click event handlers in AS rather than in the mxml tags?  For example
    in AS
    button_1.addEventListenter(MouseEvent.CLICK, someFunctionName);
    or in mxml tags
    <s:Button click="someHandlerName(event) />
    Thanks

    I will say that there is another advantage to MXML.
    For instance, say that I have a static function I want to run any time you click a component and don't care about the event. I can do this in MXML:
    <s:Whatever>
    click="{doMyStaticMethod()}"
    </s:Whatever>
    In AS, I cannot do this. A click event in AS requires that I add an ActionListener and that the ActionListener be void and take an event. MXML gives a way around that if you like.

  • How does one define a default style for a custom Flex component?

    How does one define a default style for a custom Flex component?
    hello
    I created a new set of Flex component library slib.swc (Flex 4.5). Would also like to have a default style. defaults.css file, making it the default style of the component library.
    Like flex the builder install directory of sdks \ 4.5.0 \ frameworks out \ libs directory has a spark.swc file, open with Winrar will see defaults.css this file. Defaults.css file defines the default style of the flex spark components.
    How can it be achieved?
    As follows
    slib.swc contains a CLabelEx components, and a defaults.css file
    defaults.css source file as follows:
    @ namespace s "library :/ / ns.adobe.com / flex / spark";
    @ namespace mx "library :/ / ns.adobe.com / flex / mx";
    @ namespace cn "http://os.slib.cn";
    cn | CLabelEx
            styBackgroundAlpha: 1;
            styBackgroundColor: # 569CC0;
            styBorderAlpha: 1;
            styBorderColor: # 569CC0;
            styBorderWeight: 1;
            styCornerRadius: 3;
    In slib.swc the application MyLabel.mxml of the source file as follows:
    <? xml version = "1.0" encoding = "utf-8"?>
    <s: Application, the xmlns: fx = "http://ns.adobe.com/mxml/2009
                               xmlns: s = "library :/ / ns.adobe.com / flex / spark"
                               xmlns: mx = "library :/ / ns.adobe.com / flex / mx"
                               xmlns: cn = "http://os.slib.cn
                               the minWidth = "955" The minHeight = "600">
            <fxeclarations>
            </ fxeclarations>
            <cn:CLabelEx x="67" y="112"/>
    </ s: Application>
    I hope CLabelEx default use cn | CLabelEx, style to display its appearance.
    I refer to above approach, but failed to achieve. Can you please re-Detailed
    Thanks!

    dj is right. Any Folder can be a picture folder.
    Create a root level folder and add it to your Pictures Library in Windows.  It will show up with all the scattered pictures from other programs. It can even be a different dirve if you like.  You  can even specify one to be the default save location for pictures in this dialog.
    Navigate to Pictures in your Libraries in Windows Explorer Right Click and select Properties.
    Message was edited by: Rikk Flohr forgot the instructions...

  • Custom JSF Component tags ignored after converting to Facelets layout

    I am currently using JDeveloper 10.1.3.3.
    I have a project consisting of .jspx pages. These pages mainly use components from ADF faces core. I also created my own custom JSF component that I use in several of these pages.
    Then, I needed to use Facelets so that I could apply a standard layout to all my .jspx pages. I looked at all the tutorials, and I created a layout.xhtml for my .jspx pages to use. This worked great for my .jspx pages that don't have my custom JSF component.
    Now, when I run my page with my custom component <img:newimage ...etc >
    the tag is ignored and it appears in the page's source as is when it should render as <img.src=...etc>. Attributes of newimage are changed on the page appropriately like width and height, but my component's tag, component, and servlet java files are never accessed.
    How can I fix this? Please help!
    Thanks.

    Hi,
    did you post this issue to the Facelets open source site ? Sounds like an issue with using Facelets
    Frank

  • Field 'Contract Period' does not exist in definition for business component

    Hi everyone
    I create a Field "Contract Period" in BC "Quote" with an extended table and put it in the applet view "Quote Full Form Applet" the field works fine in the view, we can update and insert information in it and shows perfect in the database also.
    Our problem is when create a Integration Object for reports in BIP Reports the system said something like this when we try to generate the sample data:
    ObjMgrLog     Error     1     0000002d4cd016bc:0     2010-11-02 13:18:39     (adptutils.cpp (5715)) SBL-EAI-04376: Method 'FieldValue' of business component 'Quote' (integration component 'Quote Template') returned the following error:
    "Field 'Contract Period' does not exist in definition for business component 'Quote'.
    We compiled the BC and the IC, and did the Deployment of the IC in Tools but it didn't work, the thing here is if I remove this field the report works fine. Is there any other component or Object that we have to compile to get Siebel recognition?
    Any ideas?
    Thanks in advance
    Edited by: user7286211 on Nov 2, 2010 8:05 PM

    To do the same change with the transaccion FB02 y FB03, create an enhancemente point in the program: SAPMF05L dynpro: 1301, module: DYNPRO_MODIFIKATION, at the of perform open_fi_dynpro_mod and write:
    LOOP AT SCREEN.
      IF sy-tcode = 'FB02'.
        IF screen-name = 'BSEG-HKTID'.
          screen-input = 1.
          screen-invisible = 0.
          screen-active = 1.
          screen-output = 1.
          screen-group4 = ' '.
          MODIFY SCREEN.
          EXIT.
        ENDIF.
      elseif sy-tcode = 'FB03'.
          IF screen-name = 'BSEG-HKTID'.
          screen-input = 0.
          screen-invisible = 0.
          screen-active = 1.
          screen-output = 1.
          screen-group4 = ' '.
          MODIFY SCREEN.
          EXIT.
        ENDIF.
      endif.
      ENDLOOP.
    and, all ready.

  • SBL-SRQ-00103: Unable to find definition for component WfProcMgr

    Hi,
    When I start the Siebel server, all the Workflow components active except the Workflow Process Manager with the error in WfProcMgr_.log:
    SBL-SRQ-00103: Unable to find definition for component WfProcMgr
    Have you experienced with this error?
    Thanks,
    Liem.

    TanteKaethe,
    Thank you for replying. The Workflow component group was enabled during the installation process. I have not manually synchronized the Workflow components . I wonder why all other components of Workflow are running except the Workflow Process Manager. When I try to synchonize, it gave me an error (SBL-SCM-00028: Key not found) when going to Server Configuration screen and select Enterprises.
    Thanks.

  • NO Event created for Customer Billing Document (VF01) in Work Flow

    Hi expert ,
    I would like to trigger a work flow from the customer invoice created event.
    Bus Object should be "VBRK" or "BUS2037" ( Customer billing document )
    But ,I cannot get any event after the billing transaction in VF01.
    I use the "SWEL" transaction to monitor all events triggered, but I don't see any event related with billing ( I only see events for sales order creation ).
    Also in "SWO1" BUS2037 has only one event  : "ItCustBillingDoc.assigned"; but It doesn't make any sense to me .Why isn't there a created event for invoice ?
    Has any of you been thru that problem ?
    Thanks for advising .
    Sincerely
    Yvon.

    Hi thanks for your answer.
    SWELS is activated.
    PB still remains :
    In  SWEL i see no event triggered after the creation of a billing invoice .
    I can only see an event related to BUS2032 which is the sales order creation .
    But nothing related to the billing document although the doument is created in SD ( I have the record in VBRK ).
    Any idea Why ?
    Thanks again

  • When, where, and how is a GUI event created for a Swing component?

    Somebody please help me with this issue !
    Heavy weight (AWT) components such as JFrame, JDialog, JApplet, and JWindow have
    native peers. As I understand, the senario of event creation for such heavy components
    is something like follows:
    1. A mouse click happens in a heavy component.
    2. The native platform (i.e. the OS) captures the mouse click event and
    store it as a native event somewhere in the system.
    3. java.awt.EventDispatchThread gets this message and translates the native message
    into an AWTEvent. When creating the AWTEvent, AWT actually looks up a hashtable
    for the reference to the heavy component from the reference to the native window.
    The hashtable stores all the pairs of heavy components and their native peers ever
    created during the session. Now the AWTEvent includes a reference to the "source"
    component that generates the event.
    4. java.awt.EventDispatchThread dispatches the AWTEvent to the heavy component
    for furture processing.
    As for light weight (Swing) components such as JButtion, no native peers are attached.
    So, there is no mapping from native peers to light weight components.
    After a mouse click happens over a JButton, how, when, and where is the corresponding
    event created and finnally routed to JButton. Could somebody give a sketch of the
    senario? Thanks a lot.

    Basically for Swing components, it would have to figure out based on the size and location of the components which one the click happens in. One could simply know that this panel is so big and it has such and such components in it which are however big and located at whatever point. It's a matter of digging down through components to find the lowest (or would it be highest) one.

  • Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55' when trying to activate feature with references a custom field type

    I´ve a solution which contains a custom field type (found somewhere on the net, the custom field type maps a choice field to managed metadata). There is a second solution which contains site column and site content type definitions using the custom field
    type definition from field type solution.
    On my developement environment, there is no problem with this two solutions. When field type solution is deployed, i can deploy the content type solution and activate the feature and everything is fine.
    However if i give the two solutions to our adminstrator to deploy them into our staging environment, content type feature activation fails. Deploying the field type solution makes no problems. The field type is then available and i can manually creates
    columns with this new field type. However activating the content type solution fails with the error shown in the title of this message. The FieldID from the message is not part of my content type project. Searching the net doens´t show any results for that
    id. So i think it´s not some of the standard field id´s from sharepoint.
    Can anyone help?

     Stack Trace
    Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes) -
    -- End of inner exception stack trace ---
    at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.SPFieldCollection.FetchFieldsFromWeb()

  • Custom for loop tag

    Hi all,
    I am trying to implement a custom "for loop tag". But it seems to me that there is a type conversion problem. I've tried many ways to fixed it but I still cannot get it to work. I've dug through my books, searched the internet and this forum but I can't found anythig useful. I am really lost now! Can anyone help me with this? Many many many thanks!!
    loopTag.jsp
    <%@ taglib prefix="myTag" uri="/WEB-INF/myTag.tld" %>
    <% int num=5; %>
    <myTag:loop index="i" count="<%=num%>">
         body1here: i expr: <%=i%> i property: <jsp:getProperty name="i" property="value"/> <br>
    </myTag:loop>
    myTag.tld
    <?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>simple</shortname>
      <tag>
        <name>loop</name>
        <tagclass>myTag.LoopTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop</info>
        <attribute>
            <name>index</name>
            <required>true</required>
        </attribute>
        <attribute>
            <name>count</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
    </taglib>
    LoopTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.Hashtable;
    import java.io.Writer;
    import java.io.IOException;
    public class LoopTag extends BodyTagSupport {   
        String index;
        int count;
        int i=0;
        public void setIndex(String index){
          this.index=index;
        public void setCount(String count){
          this.count=Integer.parseInt(count);
        public int doStartTag() throws JspException {
            return EVAL_BODY_TAG;
        public void doInitBody() throws JspException {
            pageContext.setAttribute(index, i);
            i++;
        public int doAfterBody() throws JspException {
            try {
                if (i >= count) {
                   bodyContent.writeOut(bodyContent.getEnclosingWriter());
                    return SKIP_BODY;
                                  else{
                                       pageContext.setAttribute(index, i);
                                  i++;
                return EVAL_BODY_TAG;
                        catch (IOException ex) {
                throw new JspTagException(ex.toString());
    Error message:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /loopTag.jsp
    Generated servlet error:
    The method setCount(String) in the type LoopTag is not applicable for the arguments (int)
    An error occurred at line: 5 in the jsp file: /loopTag.jsp
    Generated servlet error:
    i cannot be resolved
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.11 logs.

    I took the custom for-loop one step further and now it can be nested with in other for-loop.
    Hope this is the last time I have to reinvent the wheel. Now I REALLY apprecate JSTL!!
    loopTag.jsp
    <%@ taglib prefix="myTag" uri="/WEB-INF/myTag.tld" %>
    <% int row = 5; %>
    <% int col = 5; %>
    <table border=0>
         <myTag:loop index="i" count="<%= row %>">
              <tr>
                   <myTag:loop index="j" count="<%= col %>">
                        <td>index: i=<myTag:printIndex parentLevel="2" /> j=<myTag:printIndex parentLevel="1" />, <br></td>
                   </myTag:loop>
              </tr>
         </myTag:loop>
    </table>
    myTag.tld
    <?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>simple</shortname>
      <tag>
        <name>loop</name>
        <tagclass>myTag.LoopTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop</info>
        <attribute>
            <name>index</name>
            <required>true</required>
                        <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>count</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>printIndex</name>
        <tagclass>myTag.LoopPrintTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop print</info>
              <attribute>
            <name>parentLevel</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
    </taglib>
    LoopTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.Hashtable;
    import java.io.Writer;
    import java.io.IOException;
    public class LoopTag extends BodyTagSupport {   
        String index;
        int count;
        int i=0;
        public void setIndex(String index){
          this.index=index;
        public String getIndex(){
          return String.valueOf(pageContext.getAttribute(index));
        public void setCount(int count){
          this.count=count;
        public int doStartTag() throws JspException {
                         i = 0;
            return EVAL_BODY_TAG;
        public void doInitBody() throws JspException {
            pageContext.setAttribute(index, i);
            i++;
        public int doAfterBody() throws JspException {
            try {
                if (i >= count) {
                   bodyContent.writeOut(bodyContent.getEnclosingWriter());
                    return SKIP_BODY;
                                  else{
                                       pageContext.setAttribute(index, i);
                                  i++;
                return EVAL_BODY_TAG;
                        catch (IOException ex) {
                throw new JspTagException(ex.toString());
    LoopPrintTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.io.*;
    import javax.servlet.*;
    public class LoopPrintTag extends BodyTagSupport {
         private int parentLevel = 1;
      public int doStartTag() throws JspTagException {
              LoopTag parent = (LoopTag)findAncestorWithClass(this, LoopTag.class);
              for(int i=1; i<parentLevel; i++){
                   parent = (LoopTag)findAncestorWithClass(parent, LoopTag.class);
        if (parent == null) {
          throw new JspTagException("print not inside loop");
              else{
                   try {
                             JspWriter out = pageContext.getOut();
                             out.print(parent.getIndex());
                   } catch(IOException ioe) {
                             System.out.println("Error in printTag: " + ioe);
        return(SKIP_BODY);
         public void setParentLevel(int _parentLevel){
              if(_parentLevel > 0){
                   parentLevel = _parentLevel;
    Output:
    index: i=0 j=0, index: i=0 j=1, index: i=0 j=2, index: i=0 j=3, index: i=0 j=4,
    index: i=1 j=0, index: i=1 j=1, index: i=1 j=2, index: i=1 j=3, index: i=1 j=4,
    index: i=2 j=0, index: i=2 j=1, index: i=2 j=2, index: i=2 j=3, index: i=2 j=4,
    index: i=3 j=0, index: i=3 j=1, index: i=3 j=2, index: i=3 j=3, index: i=3 j=4,
    index: i=4 j=0, index: i=4 j=1, index: i=4 j=2, index: i=4 j=3, index: i=4 j=4,

  • SP2013 Remote Event Receivers for Office365 and Custom Web Service

    Hello I'm starting to work with remote event receivers for Office365 and I read that the RERs runs only as Provider-Hosted or Auto-Hosted Apps, so If I wanted to implement for example prevent to the user add items to some list, my question is : 
    is it needed an account in a  platform cloud like Azure(to support .net apps) or have a custom server like IIS(with public IP, dns) in order to hosting my WFC service and to be able to manage the events registered into office365 ? or exist another option
    to achieve this goal(prevent to users perform some actions) ? please, can you help me to clarify this ?....

    Hi,
    The following articles would be helpful:
    Deploying SP2013 provider-hosted apps/Remote Event Receivers to Azure Websites (for Office 365 apps)
    http://www.sharepointnutsandbolts.com/2013/07/deploying-sp2013-provider-hosted.html
    Remote Event Receiver (RER) for Host Web using SharePoint Provider Hosted App in Office 365/SharePoint Online Environment
    http://blog.kloud.com.au/2014/03/13/remote-event-receiver-rer-for-host-web-using-sharepoint-provider-hosted-app-in-office-365sharepoint-online-environment/
    About Office 365 questions, you can also post it to Office 365 Forum, you will get more help and confirmed answers from there.
    http://community.office365.com/en-us/forums/default.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

Maybe you are looking for

  • PDF files scanned at B & W print to an HP 2055dn Postscript printer as white on black

    PDF files scanned at B & W print to an HP 2055dn Postscript printer as white on black. Non postscript printers print the same file correctly. This is the case with three different scanners. Scanning the same sheets into greyscale prints fine with all

  • How i can open the form in Internet Explorer

    Dears. I am using Developer 6i and Oracle8. I want to learn how i can execute my form in IE. Please teach me about that how i can be able to execute my form in IE. waiting for reply Zaheer

  • Settings for Television

    What is the best preset to use in Premier 5.5 for converting TV commercials in HD for broadcast?  Is it H.264 HDTV? Also, if I am editing using various files such as RED, DVCPRO and other HD files which initial project settings should I use?  This is

  • Performance effects of writing code in Application Package

    Hi all, I just have this strange doubt about the performance of the system if we write the code in "Application Package". Writing code in application package is a good practice as it is good in trems of readability but I am wondering whether performa

  • Creative cloud invites not being sent

    We're having an issue with out corporate account where the invites does not seem to be sent out to users. We add users with their email address but they never receive them. We've checked in users spam folders in Outlook and also on our spam filter (s