Extending functionality from existing custom taglib

Hi!
I'm trying to extend the functionality of an already existing custom taglib. To test this possibility I�ve so far created a small taglib containing two tags. QbeTag.java and QbeSumTag.java.
The QbeTag class handles a database connection and constructs a table showing the result of a query passed in as an attribute in the tag. (The database contains a �dummy table� holding information about persons.)
Now let�s pretend that I don�t have the source code for the QbeTag but need to/ want to extend its functionality. For instance:
In the QbeSumTag I want to summarize all the persons ages and present it in a new text field somewhere else on the page.
To do this I probably need to access the QbeTag class from the QbeSumTag class, or is there any other way to achieve this wanted functionality?
Up to this point:
What I�ve tried is to implement the QbeSumTag so that It extends the QbeTag class. This means that I now can access the doStartTag, doEndTag, and so on methods from the QbeSumTag by typing super.doStartTag().
The problem with this approach is that this way only gives me the possibility to run the methods not altering the process it self and I can�t alter the out stream. A syntax like:
public int doStartTag() throws JspException
return super.doStartTag();
Will only result in a call for the QbeTag�s doStartTag() method to run and do it�s stuff.
Is there any way I can solve this or am I stuck? Maybe one approach would be to nest the QbeSumTag with the QbeTag wich would mean that there will be a dependency between the tow tags.
I believe that this question is quite difficult to answer but it could be the starting point for an interesting discussion. Hasn�t anyone tried to extend the functionality of the Jakarta taglib, say the DB tags or Mail tag.
All thoughts and replies will great fully received.
/Daniel

Well, the answer to this is the same as the answer to extending any third party classes... it depends on how the original class was created.
If the original class was designed with extension in mind, then (hopefully) its realy functionality will be isolated to a series of protected methods (that you would have access to) and private methods (you would not have access to).
You would use the public and protected methods to retrieve the data you need to do your work, or override those ones whose work you want to replace (for instance, if it has a protected displayOutput(Map dataMap) method, you are in luck!).
If everything is done giving you know access to the pieces, then you may be stuck providing a tag that has the original tag nested inside it. Buffer the output from the original tag and parse it, retrieving the info you need, then output your own stuff...

Similar Messages

  • How to call function from a custom module in a grid?

    I have a module with an advanced data grid in it. One of the columns of this grid has an itemRenderer="myCustom"
    MyCustom is a separate MXML Module. In this module, I have defined a vBox with 2 buttons. In the click event of the button how can I call a custom function that is defined in the parent module? click="myCustomFuction()" doesn't work and I get an 1180 warning . I'm thinking something like click="this.parent.myCustomFunction()" but I don't know the proper syntax.

    I tried your suggestion, but it's not working. Can you figure out what I'm doing wrong?
    <mx:Button name="bLotView" label="View" click="Object(this.owner).MyCustomFunction()"
    This button is contained in a VBox which is contained in it's own module: MyVBox
    In the "parent" MyGrid module I have an AdvancedDataGrid and one of the columns of this grid uses ItemRender="MyVBox"
    If I place a button in the parent MyGrid module (not in the grid), and set it's click to MyCustomFunction() then the function fires. But the function never fires from the MyVBox module's button click which is contained in the grid.
    Does Object(this.owner) refer to the owning module or the owning control? If it refers to the owning control, wouldn't this point to the VBox in the same module, not the owning module? Would I have to do something like Object(this.owner.owner.owner).MyCustomFunction()  ??

  • Calling a function from a custom component

    I got source files from another company that did a flex project for us before I started working here.  They have custom compenents (mxml files) that they are currently calling public functions in, but when I add a new public function to the mxml component, it won't allow me to call that function.  It tells me it can't access a property of a method of a null object reference... but it still calls the function that was there before I started working with the file..
    I cleaned the project, and did a "build all" but can't figure out why it won't allow me to create new public functions to call.... can anyone tell me why?

    I have the partsLocator_panel in the mxml
    not sure what "new" is with that... first time working with custom components, but it looks like your just working with custom classes in AS3...
    <mx:Panel 
    width="100%" height="100%" layout="absolute" styleName="DashboardPanel" title="PARTS LOCATER" backgroundAlpha=".6" id="partsLocater_panel">
    <mx:Image x="10" y="38" source="assets/icons/gear.png"/>  
    <mx:Image x="10" y="63" source="assets/icons/gear.png"/>  
    <mx:Image x="10" y="89" source="assets/icons/gear.png"/>  
    <mx:Label x="40" y="39" text="Block 30" width="227" styleName="DashboardText" click="openParts()"/>  
    <mx:Label x="40" y="63" text="Block 40" width="227" styleName="DashboardText" color="#9D9D9D"/>  
    <mx:Label x="40" y="88" text="Block 50" width="227" styleName="DashboardText" color="#9D9D9D"/>  
    </mx:Panel>

  • Is it possible to call the Print Quote functionality from Custom ADF page

    Hi,
    We are researching if it is possible to call the Print Quote functionality from the Custom ADF application.
    Goal is to pop up the PDF report upon clicking the Print Quote button on the custom page. Is it possible ?
    Atleast advice on the direction to go forward is appreciated.
    Thanks
    Sai

    Hi ,
    Please check following thread on forum -
    Re: ADF: Calling OAF Page from ADF page
    Check this may also be useful-
    https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    I have not tried yet but Steven Chan (Sr. Director OATG) suggest following methodolgy for this-
    https://blogs.oracle.com/stevenChan/entry/appsdatasource_jaas_ebs
    Thanks,
    Ashish

  • Trouble migrating Crystal Reports Custom Functions from BOXI R2 to BOXI 3.1

    I can't seem to migrate the custom functions from the custom function repository in my R2 environment to the 3.1 with FP 1.3 environment.
    When I migrate Crystal Reports using the Import Wizard, they all come over and they retain their custom functions, however, they don't bring over or create a new custom function repository. 
    When I do run the import wizard I have selected the repository radio button, but it does not have any affect .
    How can I migrate all of these custom functions without having to manually open up reports and placing them back into the repository on the new server?
    Thanks,
    Randy

    Hi,
    so if they are published to Rel.2 this looks different.
    Just to clarify it a bit more...these Files are no Datasources for Reports and Universes and your Users dont consume them via InfoView?!
    Whats the purpose for these Files? If they have none, you can de- select them in the UMT and dont migrate them (or better said move them cause you wont actually migrate .csv files). But if nobody touches them, you can move them with the UMT during daily business...how long it will take i cant estimate it. But 65GB for .CSV files is a huge amount.
    But you are correct, to move them from Rel.2 to BI4 you have to use the UMT.
    If you have the ressources and time i would recommend the following (Thats what i usually do with my customers):
    1. Setup a Machine (could be a VM) with the same OS and BOE Version (included SPs and FPs) as your production Rel.2
    2. Schedule a half day or day Downtime to copy the content 1:1 from the production Rel.2 to the VM Rel.2 with the IW or CMS DB Copy. Or do this after Business Hours.
    - With this Size of your FileStore i would recommend the CMS DB copy way.
    - Now you have a 1:1 Testing Environment of your Production Environment
    3. Use the UMT to migrate from your VM Rel.2 to your BI4 installation
    - Here you can see how long it takes
    - You can check if the UMT is capable for this 65GB transfer
    - Can sort out other possible issues
    - Do some other Testing
    After you did that you have a perfect estimation on how long the Migration will take and what for issues you are facing. With this information you can decide if you need a downtime or can do it after Business Hours f.e.
    Regards
    -Seb.

  • How to use custom functions from Dlls

    I would like to know if there a way to import functions from
    a custom DLL?
    Thanks

    Hi Wardell,
    Did you get any break through on this I was exploring on same.
    Egarly awaiting reply....
    Regards,
    Ankeet Pujara

  • How to invoke ADF custom application from existing R12 EBS application

    Hi Guru's,
    We have a requirement to invoke ADF custom application from existing EBS R12.1.3 application.
    Is there any documentation provided by ORACLE or any online help on how to integrate/invoke ADF pages from existing EBS application?
    And can we pass any EBS session level parameters like(user info, language, operating unit etc) to ADF layer while invoking the ADF application?
    I have thoroughly searched the forums and got some info related to JAAS security links and all. but i am looking for exact integration specific steps.
    Any help in this regard is a great help!!
    Thanks alot for your help!!
    Subba.

    lets raise your question over here
    JDeveloper and ADF
    Thanks
    vamshi.

  • Calling C Functions in existing DLL's from Java

    Hi Guys ,
    The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
    regards
    murali

    What you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
    The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
    If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
    Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
    You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-)

  • Executing a BDC Session using a Function Module from a Custom Z-Report

    Hello,
              I have a requirement where I need to Create a BDC Session for the given Transaction Code. But instead of executing the Session from SM35 manually, I need to Execute the Session Immediately from my Custom Z-Report itself.
             Is there any Function Module for this Activity? Please let me know.
    Thanks and Regards,
    Venkata Phani Prasad K

    1) fm job_open
    2) submit report
    3) fm job_close
    4) finally select table TBTCO
    example:
    DATA: jobcount_test LIKE tbtcjob-jobcount,
            job_released    LIKE btch0000-char1,
            rcode(2),
            strtimmed LIKE btch0000-char1 VALUE 'X'.
      DATA jobname  LIKE tbtcjob-jobname.
      CONCATENATE  'TEST_' sy-repid '_' sy-datum INTO jobname.
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = jobname
           IMPORTING
                jobcount         = jobcount_test
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
      IF sy-subrc NE 0.
        MESSAGE x000(yp) WITH 'JOB-START ' jobname ' failed !!!'.
      ELSE.
    *--Step insert
        SUBMIT rsbdcsub
        USER sy-uname VIA JOB jobname NUMBER jobcount_test
        WITH mappe = map
        WITH von = pdatum
        WITH z_verarb = 'X'
        AND RETURN .
        CALL FUNCTION 'JOB_CLOSE'
             EXPORTING
                  jobcount             = jobcount_test
                  jobname              = jobname
                  strtimmed            = strtimmed
                  targetsystem         = sy-host
             IMPORTING
                  job_was_released     = job_released
             EXCEPTIONS
                  cant_start_immediate = 1
                  invalid_startdate    = 2
                  jobname_missing      = 3
                  job_close_failed     = 4
                  job_nosteps          = 5
                  job_notex            = 6
                  lock_failed          = 7
                  OTHERS               = 8.
        IF sy-subrc > 1.
          MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.
        ENDIF.
      ENDIF.

  • Custom component calling function from main.mxml

    I have a main.mxml that has the following function in it:
    public function SubChooseField(evt:Event):void{
    Alert.show( "Sub has been chosen" );
    main.mxml also places the following custom component:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="180" close="parent.SubChooseField(event)">
    <mx:dataProvider>
    <mx:Object data="1" label="choice 1 />
    <mx:Object data="2" label="choice 2" />
    <mx:Object data="3" label="choice 3" />
    </mx:dataProvider>
    </mx:ComboBox>
    I want it so that when you chose one of the options in the
    comboBox, it will call the function SubChooseField in the
    main.mxml. But when I compile this, no matter what i try, i get the
    error:
    Error: Call to a possibly undefined method SubChooseField
    through a reference with static type my_custom_opponent.
    OR if i change the codeand remove the 'parent' to say:
    close="SubChooseField(event)"> i get error:
    Error: Call to a possibly undefined method SubChooseField.
    any help much appreciated.

    Rather than trying to use parent, using events might help
    here. In your main mxml file, just listen for the change event that
    is dispatched from your custom component. Since it is a ComboBox
    component, it automatically dispatches this event. If your
    component was more complex, you would need to dispatch a custom
    event.
    If your custom component was named CustomCombo, then the mxml
    in your main file would look something like this:
    <ns1:CustomCombo id="cb" x="70" y="39" width="160"
    change="SubChooseField(event)"/>
    Vygo

  • Adding new custom field in already existing custom tab for MM01

    Hello Guru,
    I have a requirement that add a custom field in already existing custom view of MM01. I did the following steps :
    1. I have cerated a new field in MARA using APPEND structure.
    2. I have found the function group(Y_FE_MARA) that already there other subscreens, so that I have added another subscreen in that function group and created a field from MARA in the screen.
    3. in SPRO went for the path Logistics General->Material Master->Configuring the Material->Define Structure of Data screens for Each Screen sequence
    In the 3rd step, I have choosen already existing screen sequence(Y1) and went for Data Screens and choosen for Custom tab and double click on subscreens and then I have added the program as SAPLY_FE_MARA and subscreen number(011) and saved it.
    After all the above steps, I have run MM02/MM03 then the field is not getting displayed in the screen of custom view.
    Did I miss any steps here? Please suggest me if I did something wrong.
    Thanks and Regards,
    Muralikrishna Peravali

    Hi Raymond,
    Thank you for the reply. As per the note some one already implemented the Screen Enhancement with 2 custom views. I need to add the field in any one of existing custom view. So for this I have created a Subscreen in copied function group of MGD1(Y_FE_MARA). But in the function group already 10 Subscreens were created. Is this is the problem? or else copy the FG MGD1 into another FG and create the subscreen will be feasible to my scenario?
    Please suggest me.
    Thanks and Regards,
    Muralikrishna Peravali

  • Custom taglib with nested tag not working

    Hi everybody,
    I have a question concerning a custom taglib. I want to create a tag with nested child tags. The parent tag is some kind of iterator, the child elements shall do something with each iterated object. The parent tag extends BodyTagSupport, i have overriden the methods doInitBody and doAfterBody. doInitBody initializes the iterator and puts the first object in the pageContext to be used by the child tag. doAfterBody gets the next iterator object and puts that in the pageContext, if possible. It returns with BodyTag.EVAL_BODY_AGAIN when another object is available, otherwise BodyTag.SKIP_BODY.
    The child tag extends SimpleTagSupport and does something with the given object, if it's there.
    In the tld-file I have configured both tags with name, class and body-content (tagdependent for the parent, empty for the child).
    The parent tag is being executed as I expected. But unfortunately the nested child tag does not get executed. If I define that one outside of its parent, it works fine (without object, of course).
    Can somebody tell me what I might have missed? Do I have to do something special with a nested tag inside a custom tag?
    Any help is greatly appreciated!
    Thanks a lot in advance!
    Greetings,
    Peter

    Hi again,
    unfortunately this didn't work.
    I prepared a simple example to show what isn't working. Perhaps it's easier then to show what my problem is:
    I have the following two tag classes:
    public class TestIterator extends BodyTagSupport {
        private Iterator testIteratorChild;
        @Override
        public void doInitBody() throws JspException {
            super.doInitBody();
            System.out.println("TestIterator: doInitBody");
            List list = Arrays.asList(new String[] { "one", "two", "three" });
            testIteratorChild = list.iterator();
        @Override
        public int doAfterBody() throws JspException {
            int result = BodyTag.SKIP_BODY;
            System.out.println("TestIterator: doAfterBody");
            if (testIteratorChild.hasNext()) {
                pageContext.setAttribute("child", testIteratorChild.next());
                result = BodyTag.EVAL_BODY_AGAIN;
            return result;
    public class TestIteratorChild extends SimpleTagSupport {
        @Override
        public void doTag() throws JspException, IOException {
            super.doTag();
            System.out.println(getJspContext().getAttribute("child"));
            System.out.println("TestIteratorChild: doTag");
    }The Iterator is the parent tag, the Child shall be shown in each iteration. My taglib.tld looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <taglib
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
         <tlib-version>1.0</tlib-version>
         <short-name>cms-taglib</short-name>
         <uri>http://www.pgoetz.de/taglibs/cms</uri>
         <tag>
              <name>test-iterator</name>
              <tag-class>de.pgoetz.cms.taglib.TestIterator</tag-class>
              <body-content>tagdependent</body-content>
         </tag>
         <tag>
              <name>test-iterator-child</name>
              <tag-class>de.pgoetz.cms.taglib.TestIteratorChild</tag-class>
              <body-content>empty</body-content>
         </tag>
    </taglib>And the snippet of my jsp is as follows:
         <!-- TestIterator -->
         <cms:test-iterator>
              <cms:test-iterator-child />
         </cms:test-iterator>The result is that on my console I get the following output:
    09:28:01,656 INFO [STDOUT] TestIterator: doInitBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    So the child is never executed.
    It would be a great help if anybody could tell me what's going wrong here.
    Thanks and greetings from germany!
    Peter
    Message was edited by:
    Peter_Goetz

  • Functional specs for customer hierachy

    Dear Gurus,
    I need to develop functional specs for customer hierarchy.the requirement is to create a new hierarchy type and move all the existing records from the present customer hierarchy setup since the present system has lot of scrap data.for this i need to develop a functional and technical specs.can anyone please send it to me.can any one please help me here at vsapservicesatgmail.com.
    thanks,
    sap_consultant
    Edited by: sap_consultant1234 on Dec 30, 2011 5:51 AM

    Hi Utpal,
    Welcome to SDN,
    Being a newcomer to forum before posting the thread read the forum rules,you are asking to send the details to your mail which is forbidden by the forum.
    Coming to the thread  Customer Hierarchies stored in table KNVH,go to SE16N give the table KNVH get valid inputs and build
    valid logic.
    Regards
    Ram

  • How do I call a function from an Itemrenderer?

    Hi, Im new in flex and I wonder if I can call a function from within an AdvancedDataGridRendererProvider
    for example:
      <mx:AdvancedDataGrid>
        <mx:columns>
            <mx:AdvancedDataGridColumn  dataField="id" />
        </mx:columns>  
        <mx:rendererProviders> 
            <mx:AdvancedDataGridRendererProvider 
                dataField="detail"
                renderer="components.myRendererProvider"  
                columnIndex="2" 
                depth="2"                     
                />     
        </mx:rendererProviders>       
      </mx:AdvancedDataGrid>
    <mx:Script>
         <![CDATA[
              public function outerFunction(){
        ]]>
    </mx:Script>
    myRendererProvider
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" paddingLeft="10" paddingRight="2" horizontalGap="2" paddingTop="0">
    <mx:Script>
        <![CDATA[   
         public function callOuterFunction( ){
              how do I call the outerFunction() from here?
        ]]>
    </mx:Script>
        <mx:LinkButton fontSize="13"  fontWeight="bold" click="callOuterFunction( )" label="label"  />
    </mx:HBox>
    thank you in advance.

    There are two ways to call a function from within an ItemRenderer. One way is to dispatch an event from your ItemRenderer and listen for the event in your main application. This approach has the advantage of creating loosely coupled code which is eaiser to maintain and extend if needed, but it takes a bit more work to set things up than using the second aproach lised below. You could also create a custom event to have greater control over what data is sent with the event.
    private function callOuter():void {
         this.dispatchEvent(new MouseEvent());
    The other approach is to call the main application by using parentDocument.
    private function callOuter():void {
         parentDocument.handleItemRenderer();
    Chris

  • How to call a standard page from a custom BSP-iView by URL

    Dear readers,
    I have to implement a scenario as described in the guide "Administration of the Business Package for SAP CRM 4.0", chapter "Object Links in the Portal" scenario 1 and/or 2 (page 404).
    In my case, a custom iView-BSP lists certain business partners in a tree view as hyperlinks. Which URL do I have to use for these hyperlinks to call the "Accounts" page (within role Account Management (com.sap.pct.crm.AccountManager)) with the selected business partner.
    The guide informs that there exists among others a table CRMC_PRT_ROLE_MO where I can find the ID Page/Servie URL for each Role/CRM Object type/CRM Method.
    My question is if I can use this URL fragment within the URL I have to build, and if yes, how must I construct the full URL to call the account page? If now, which URL must I use to call the account page?
    thank you
    Andreas

    Hi Niladri,
    My requirement was calling the OAF page from standard form (menu), below are the steps that I followed,
    1) Get the OAF page function name
    2) Personalize the form, by calling the OAF page function
    a) Function Code: Give the OAF function code
    b) Parameter: Here pass the parameters
    example: ='contractLineId='||:OKS_LINES.ID
    Note: If you are calling from a custom form you can also try using fnd_function.execute to call the OAF page
    Thanks,
    Bharat

Maybe you are looking for