Best Practice : Creating Custom Renderer for Standard Component

I've been reading the docs and a few threads about Custom Renderers. The best practice seems to be to create a Custom Component where you need a Custom Renderer. Is this the case?
See [this post|http://forums.sun.com/thread.jspa?forumID=427&threadID=520422]
I've created several Custom Renderers to override the HTML provided by the Standard Components, however I can't see the benefit in also creating a Custom Component when the behaviour of the standard component is just fine.
Thanks,
Damian.

It all depends on what you are trying to accomplish. Generally speaking if all you need is for the user interface output to be changed then a renderer will work just fine. A new component is usually made in order to provide some fundamental change in server side functionality not related to the user interface. - Ponderator

Similar Messages

  • Writing a custom renderer for the component  "af:processTrain" in 10g

    Hello,
    I have a requirement where we need to customize the way the af:processTrain is rendered. For this, the simpler and the more generic way would be to write a custom renderer for the af:processTrain component. Is there any documentation or examples that could help in accomplishing this as I could not get any relevant examples or documents.
    Thanks,
    Swapna

    Hi,
    Thanks for the quick response. Could you please suggest me a way to go about writing your own custom renderers?
    Thanks.

  • Custom renderer on standard component

    I try to implement a custom renderer to a standard component (<h:outputText>), but
    my Tomcat failed to start the webcontainer.
    here are my files:
    faces-config.xml
    <render-kit>
    <renderer>
    <renderer-type>MyRenderer</renderer-type>
    <renderer-class>renderkit.MyRenderer</renderer-class>
    </renderer>
    <supported-component-class>
    <component-class>javax.faces.Text</component-class>
    </supported-component-class>
    </render-kit>
    ...renderkit.MyRenderer.java
    package renderkit;
    import java.io.IOException;
    import javax.faces.component.UIComponent;
    import javax.faces.component.UIOutput;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.render.Renderer;
    public class MyRenderer extends Renderer {
         public void decode(FacesContext context, UIComponent component) {
              System.out.println("decode");
              if ((context == null) || (component == null)) {
                   throw new NullPointerException();
         public void encodeBegin(FacesContext context, UIComponent component)
              throws IOException {
              System.out.println("encodeBegin");
              if ((context == null) || (component == null)) {
                   throw new NullPointerException();
         public void encodeChildren(FacesContext context, UIComponent component)
              throws IOException {
              System.out.println("encodeChildren");
              if ((context == null) || (component == null)) {
                   throw new NullPointerException();
         public void encodeEnd(FacesContext context, UIComponent component)
              throws IOException {
              System.out.println("encodeEnd");
              UIOutput comp = (UIOutput) component;
              ResponseWriter writer = context.getResponseWriter();
              StringBuffer sb = null;
              writer.startElement("<test>", comp);
              writer.write(comp.getValue().toString());
              writer.endElement("</test>");
    }

    <h:outputText> will use a rendererType of "javax.faces.Text"; to use a custom renderer on a standard component, you must not only write a renderer and register it, but also add a custom tag that uses that renderer type. Alternatively, you could use the "binding" attribute to set the renderer type like:
      <h:outputText binding="#{someBean.customText}" .../>
    public class SomeBean
      public SomeBean()
       HtmlOutputText customText = new HtmlOutputText();
        customText.setRendererType("MyRenderer");
        setCustomText(customText);
      public HtmlOutputText getCustomText()
        return _customText;
    public void setCustomText(HtmlOutputText customText)
       _customText = customText;
    private HtmlOutputText _customText;
    }-- Adam Winer (EG member)

  • How to override the renderer for ADF component?

    I want to overide the renderer for ADF components, without using <default-render-kit>, I defined every render class. But It does not work.
    Always told me: Could not find renderer for CoreOutputText[UIXFacesBeanImpl, id=_id0], rendererType = oracle.adf.Text
    How can I config custom renderer for exsiting component or new components?
    Thanks a lot!
    <render-kit>
    <render-kit-id>oracle.adf.core</render-kit-id>
    <renderer>
    <component-family>oracle.adf.Output</component-family>
    <renderer-type>oracle.adf.Formatted</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.OutputFormattedRenderer</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.Choose</component-family>
    <renderer-type>oracle.adf.Date</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.ChooseDateRenderer</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.Input</component-family>
    <renderer-type>oracle.adf.Text</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.InputTextRenderer</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.SelectInput</component-family>
    <renderer-type>oracle.adf.Date</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.SelectInputDateRenderer</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.Object</component-family>
    <renderer-type>oracle.adf.Separator</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.uinode.UINodeRendererBase</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.Command</component-family>
    <renderer-type>oracle.adf.Link</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.CommandLinkRenderer</renderer-class>
    </renderer>
    <renderer>
    <component-family>oracle.adf.Panel</component-family>
    <renderer-type>oracle.adf.Group</renderer-type>
    <renderer-class>oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer</renderer-class>
    </renderer>
    </render-kit>

    Seems I need override the encodeSelectItem() method.
    But not sure which class is the renderer for af:selectManyCheckbox. And how to set below
    <component-family>???</component-family>
    <renderer-type>???</renderer-type>
    Edited by: Leon Zeng on Jul 19, 2012 2:18 PM

  • Possible to create a custom renderer for rendering standard component ?

    This is in context for creating dynamic Data tables. Is it possible to create a custom Renderer for rendering component (standard) without creating a custom component?
    namanc

    Let's assume you want to create a custom renderer which will be used to render the error-messages (the h:messages tag). The component-family in this case is: javax.faces.Messages, the renderer-type javax.faces.Messages.
    Therefor in your application's faces-config.xml add this renderer-statement (inside a render-kit, obviuosly):
    <faces-config>
      <!-- other stuff like components, managed beans, navigation-rules,... -->
      <render-kit>
        <renderer>
          <component-family>javax.faces.Messages</component-family>
          <renderer-type>javax.faces.Messages</renderer-type>
          <renderer-class>my.very.special.MessagesRenderer</renderer-class>
        </renderer>
      </render-kit>
      <!-- other renderers... -->
    </faces-config>The code for MessagesRenderer is very dependent on your needs, therefor I will not post something here. Basically you need to extend javax.faces.render.Renderer. For help in that camp, surf to the online tutorials or get yourself a book (I learned a lot from Kito Mann's "JSF in Action"). Additionally grab the source for Sun's RI AND Myfaces and dig into that java-code. There is a huge learning potential looking at that source-material.
    hth
    Alexander

  • Missing Customizing settings for software component ECC-DIMP

    Hi all,
    While running the T-code IE4n I am getting this error:
    Missing Customizing settings for software component ECC-DIMP
    This is working fine in IDES ECC 6.0 ,Could u please tell me how to resolve it for my othersystems.
    Thanks
    Yinyan Lu

    Dear Yinyan Lu,
    Please, have a look into the SAP note 767108 (IE4N: Problems due to missing notification Customizing)
    Solution                                                                  
    To correct this error, implement the correction instructions contained    
    in this note or import the relevant Support Package.                                                                               
    In packages                                                                               
    o  DI in Release 4.6C2                                                                               
    o  DIMP in Release 4.71 and higher                                                                               
    o  EA-APPL as of Release 4.7 Extension Set 2 and higher                                                                               
    notifications are created when installing and dismantling. In this case,  
    Customizing must be complete, otherwise errors will occur.                                                                               
    In DI Release 4.6C2 and DIMP Release 4.71 (and higher),                   
    follow the following Customizing path:                                    
      Plant Maintenance and Customer Service                                  
        -> Maintenance and Service Processing                                 
          -> Maintenance and Service Notifications                            
            -> Determine Properties of Notifications for Installing and                                                                               
    Dismantling Parts                                                                               
    Always maintain the notification type for installation and for            
    dismantling.                                                                               
    Follow the following Customizing path on EA-APPL as of Release 4.7        
    Extension Set 2 (and higher):                                             
    follow the following Customizing path:                                    
      Plant Maintenance and Customer Service                                  
        -> Maintenance and Service Processing                                 
          -> Configuration Control                                            
            - > Determine Properties of Notifications for Installing and      
               Dismantling Parts.                                             
    Always maintain the notification type for installation and for            
    dismantling.                                                                               
    What must you do if you do not want to use notifications in IE4N?                                                                               
    1.  You must always maintain the notification type in accordance with     
        Customizing described above.                                                                               
    2.  Create an individual, empty implementation for the BADI               
        BADI_CCM_NOTIF_GENER. To do this, proceed as follows:                                                                               
    a) Execute transaction SE18.                                                                               
    b) Specify BADI_CCM_NOTIF_GENER as the BADI name.                                                                               
    c) Use the menu <Implementation><create> to create an individual      
           implementation with a corresponding name in the Z namespace.                                                                               
    d) You enter the BADI Builder. Name the implementation, and then      
           save and activate your implementation. It is important that the    
           methods CREATE, FILL_CUST_DATA, MODIFY, SET_HEADER_MESSAGE, and    
           PRINT_NOTIF are empty.                                                                               
    Note that these steps are required, since the BADI                    
        BADI_CCM_NOTIF_GENER is equipped with a default source code that      
        includes the use of the notification.                                                                               
    As of ECC600, Note 1368876 replaces error message IEN 126 with error      
      message IEN 026, which is more precise.                                                                               
    Caution:                                                                               
    o  The error message mentioned above indicates that Customizing is    
             missing. To correct the problem, you must perform the relevant     
             Customizing settings for transaction IE4N.                                                                               
    o  As of ECC600, you do not have to activate the DIMP switch (this    
             may not be useful).                                                                               
    o  For more information, see Note 1368876.                                                                               
    I hope, it helps.
    Best regards,
    Roland

  • How to create custom template for webcenter portal application

    Hi,
    I created webcenter portal application in my jdev using the webcenter portal application template provided by the webcenter framework.
    I tried to create custom template for my application by following steps:
    1. Created new application using webcenter portal application template with all default package structure.
    2. Right click pagetemplates folder under webcontent package and select new option.
    3. New gallery opens up.
    4. Selected JSF under webtier and JSF Page Template under items in the right hand side and clicked Ok button.
    5. New wizard opens up for creating new JSF page template.
    6. Gave template name(file name) and Page Template Name(template def name).
    7. Selected checkbox staing start a Quick Start Layout and selected three column layout and selected Ok.
    8. Selected checkbox for Create Associated ADFm Page Defination(so that page templates can be changes at run time).
    9. Created some Facet Definations (header, footer, content1, content2, LHN, RHN).
    10. Clicked Ok button which will create custom template.
    11. Added some Panel Group Layout component from Component Palette.
    12. Created new page (.jspx) with this template.
    Now when I try to add producer portlets created using Producer Portlet application template and connected to the above application using WSRP2.0, I'm facing problem.
    The prolem is that I'm not able to add more than one portlet in one single page?
    Kindly let me know whether the steps followed by me is wrong some where and needs to corrected and let me know how I can add more than one portlet to page?
    Basically I cant see more than one placeholders in my page to add portlets.

    Thanks Yannick.
    In the step 9 I had mentioned that I created various facet definations (header, footer, content, content1 RHN and LHN).
    Is this is not facet you are talking about or should I drop facet ref from the resource palette?
    Can't I add moer than one portlet to my page at design time itself?
    Annoying since in weblogic portal we do this at design time(.portal).

  • How to create transport request for standard text created using SO10.

    Hi,
    How to create transport request for standard text created using SO10?
    Regards
    Ramakrishna L

    Hi,
    For the Standard text created in SO10,
    please go to transaction SE78 -> FORM GRAPHICS->STORED AS TEXT->STANDARD TEXTS->
    Double click on ADRS or ST or what ever your type of text->
    Enter your standard text name
    Click on transport button->SHIFT+f6-> It will ask you for a transport request.
    Best regards,
    Siva

  • Create interface method in standard component.

    Hi Experts,i want to enhance standard component.in that i created one attribute and i used in my component.For that attribute the value is passing from some other component.i try to create interface method in standard component.but it is not possible.so please help me out this issue.
    Regards
    prasad

    Hi,
    No, You cannot create Interface Methods/Nodes in Standard Component by Enhancing. I would suggest to create a Singleton class and create your method in that class and can access across components.
    Regards,
    Kiran

  • How to create custom infotype for training and event management

    hai freinds can any one tell me how to create custom infotype for training and event managment with following fields
    PS No – PA0000-> PERNR
    Name   - PA0001 -> ENAME
    IS PS.No. – PA0001-> PS no. of Immediate Superior
    IS name PA0001 -> ENAME
    thanx in advance
    afzal

    Hi,
    Your question is not clear for me. Since it is a TEM infotype, it could be a PD infotype.
    If you wish to create a PD infotype, use transaction PPCI to create the infotype.
    But before that you need to create a structure HRInnnn (where nnnn is the infotype number) with all the fields relevant for the infotype.
    If you wish to create a PA infotype, use transaction PM01 to create the infotype.
    But before that you may be required to create a strcuture PSnnnn  (where nnnn is the infotype number) with all the fields relevant for the infotype.
    Regards,
    Srini

  • Best practice to define length for varchar field of table in sql server

    What is best practice to define length for a varchar field in table
    where field suppose Remarks By Person  varchar(max) or varchar(4000)
    Could it affect on optimization in future????
    experts Reply Must ... 
    Dilip Patil..

    Hi Dilip,
    Varchar(n/max) is a variable-length, non-unicode character data. N defines the string length and can be a value from 1 through 8,000. Max indicates that the maximum storage size is 2^31-1 bytes (2 GB). The storage size is the actual length of the data entered
    + 2 bytes. We always use varchar when the sizes of the column data entries vary considerably. While if the filed data size might exceed 8,000 bytes in some way, we should use varchar(max).
    So the conclusion is just like Uri said, use varchar(max) or varchar(4000) is depends on how much characters we are going to store.
    The following document about varchar in SQL Server is for your reference:
    http://technet.microsoft.com/en-us/library/ms176089.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Best practice on Oracle VM for Sparc System

    Dear All,
    I want to test Oracle VM for Sparc System but I don't have new model Server to test it. What is the best practice of Oracle VM for Sparc System?
    I have a Dell laptop which has spec as below:
    -Intel® CoreTM i7-2640M
    (2.8GHz, 4MB cache)
    - Ram: 8GB DDR3
    - HDD: 750GB
    -1GB AMD Radeon
    I want to install Oracle VM VirtualBox on my laptop and then install Oracle VM for Sparc System in Virtual Box, is it possible?
    Please kindly give advice,
    Thanks and regards,
    Heng

    Heng Horn wrote:
    How about computer desktop or computer workstation with the latest version has CPU supports Oracle VM or SPARC?Nope. The only place you find SPARC T4 processors is in Sun Servers (and some Fujitsu servers, I think).

  • Best practices to reduce downtime for Database releases(rolling changes)

    Hi,
    What are best practices to reduce downtime for database releases on 10.2.0.3? What DB changes can be rolling and what can't?
    Thanks in advance.
    Regards,
    RJiv.

    I would be very dubious about any sort of universal "best practices" here. Realistically, your practices need to be tailored to the application and the environment.
    You can invest a lot of time, energy, and resources into minimizing downtime if that is the only goal. But you'll generally pay for that goal in terms of developer and admin time and effort, environmental complexity, etc. And you generally need to architect your application with rolling upgrades in mind, which necessitates potentially large amounts of redesign to existing applications. It may be perfectly acceptable to go full-bore into minimizing downtime if you are running Amazon.com and any downtime is unacceptable. Most organizations, however, need to balance downtime against other needs.
    For example, you could radically minimize downtime by having a second active database, configuring Streams to replicate changes between the two master databases, and configure the middle tier environment so that you can point different middle tier servers against one or the other database. When you want to upgrade, you point all the middle tier servers against database A other than 1 that lives on a special URL. You upgrade database B (making sure to deal with the Streams replication environment properly depending on requirements) and do the smoke test against the special URL. When you determine that everything works, you configure all the app servers to point at B and have Streams replication process configured to replicate changes from the old data model to the new data model), upgrade B, repeat the smoke test, and then return the middle tier environment to the normal state of balancing between databases.
    This lets you upgrade with 0 downtime. But you've got to license another primary database. And configure Streams. And write the replication code to propagate the changes on B during the time you're smoke testing A. And you need the middle tier infrastructure in place. And you're obviously going to be involving more admins than you would for a simpler deploy where you take things down, reboot, and bring things up. The test plan becomes more complicated as well since you need to practice this sort of thing in lower environments.
    Justin

  • How to create a hint for a component(awt),thanks

    How to create a hint for a component(awt),the component of awt has not the property.

    If you are talking about a tooltip, this is going to be hard.
    You are probably going to have to use a mouseMotionListener to get the event that the mouse is over the component and then a Timer to fire the showTooltip event if the mouse hasn't moved in some amount of time.

  • To create custom colors for exception

    Hi experts......
    I need to create custom colors for my report in order to set exceptions. Shades of red,yellow and green is just not enough for my client, they want to see blue as well when certain exception rises. Can someone please give me a hint as to how to implement that ...is it got to do st with the mime repository?
    Thnaks in advance!
    Tina

    Hi Tina,
    You can do this by formatting in the workbook. Run the query and in the workbook, on the BEx toolbar, there is a button for formatting. Select the exception cell whose color you want to change > in the Format button choos epatterns and select the color you would like. Once you have made the changes, save the workbook. The changes will remain in place the next time the user runs this workbook.
    Take a look at this link for more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a559ee09411d2acb90000e829fbfe/content.htm
    Hope this helps...

Maybe you are looking for

  • InDesign problems on Macbook Air running Lion.

    HI folks, I have recently purchased a 2011 Macbook Air, running Lion. I have a copy of Indesign CS4 that I am trying to get running on this machine. I previously had it activated on my macbook pro and had no problems. I deactivated it from that compu

  • How do I delete any previous versions of Java from my machine

    My name is Mason McFadden. I like to play on a game site called http://www.pogo.com/ in safari & several other internet browsers for the mac. I'm having many issues with the games such as freezing, my game window being squished smaller, games not loa

  • Best Practice for Removing Zeroes from Database

    Does anyone have some clever bits of code or best practices for evaluating a database and instances of zeroes? I'm working on cleaning up our rules file and am thinking the best way to start would be to write some code to look for zeroes and write th

  • SAP DMS Document reviewers

    Hi Experts, I am creating custom report based on CV03N transaction. I want to display core + additional reviewers for a document and add/remove additional reviewers for a document. Please let me know is there any standard BAPI available for this func

  • Upgraded to new phone, Original Phone will not initalize.

    I upgraded to the new phone, works great. I erased the data on the old phone (original iPhone) and now want to give it to my kid to use as an IPOD. I can't get it past the Apple Logo Screen. Hooked it up to iTunes... doesn't recognize it. Now I'm stu