How to override the renderer of af:selectManyCheckbox to add images

My goal is to add an image and the handler of the image for each SelectItem of af:selectManyCheckbox.
I'm defining the customized renderer like below, but I'm not sure about the "???" part. Any advice/sample will be appreciated. Runnable project will be even better.
public class MyCheckboxRenderer extends SelectManyCheckboxRenderer{
@Override
public void encodeBegin(FacesContext context,
UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
for(SelectItem item : component.getChildren()){
if(item instanceof MySelectItem){
???writer.write(the checkbox);
???writer.write(item.image);
???register the handler for the image
???writer.write(item.label);
}else if(item instanceof SelectItem){
???render as default;
super.encodeBegin(context, component);
public class MySelectItem extends SelectItem{
String image;
In faces-config.xml
<render-kit>
<renderer>
<component-family>???</component-family>
<renderer-type>???</renderer-type>
<renderer-class>MyCheckboxRenderer</renderer-class>
</renderer>
</render-kit>
Thanks.
Edited by: Leon Zeng on Jul 19, 2012 9:55 AM

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

Similar Messages

  • 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

  • How to override the default height of tree component...

    Hi,
    Can anyone please tell me how to override the default height of <af:tree> component.
    Actual Problem:
    I have a PanelBox in which I have a ShowDetail component. ShowDetail contains Tree component. When I click on ShowDetail item the Tree component have to be displayed. But, PanelBox is expanding to TREE default height(27.27 ems) instead of expanding to exact height of Tree.
    How to manage this issue?
    Thanks
    -Sukumar

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

  • One of my kids changed my password, and now i can't access my mail accounts. Any ideas on how to override the password and set up a new one?

    one of my kids changed my password, and now i can't access my mail accounts. Any ideas on how to override the password and set up a new one?

    A mail account password or you login password?
    Which OS by the way?

  • How to recovery the deleted files from hard disk like images,media files

    How to recovery the deleted files from hard disk like images, media files by using c#.net

    It's important to define deleted and recovery. You can recover file from the recycle bin using the Win API. Here's an
    example in C/C++. You need to
    pinvoke SHFileOperation.

  • How to override the event loop

    As a windows game developer, I have always overridden the application message loop to make sure that graphics were rendered when the CPU was idle, and still being able to process windows messages like keyboard/mouse events. CPU is then maxed out (except when a forced sleep or v-sync is enabled) to give highest performance on graphics, making a simple clear opengl window render at 3500 frames per second (I know this is idiotic but I'm trying to make a point).
    Now that I'm porting my game engine (c++ code) to cocoa, I  am struggling with how to implement the main loop. I could use a timer but this will fix the framerate and might be slow. It will prevent me to use the CPU to its full extent.
    So: is there some kind of OnIdle event I can override? Or do I have to do the Event loop processing myself? And can anyone tell me how to do something like this? Is there a tutorial or a book or anything I can study to learn about this? I presume this is lower level API.
    Any help is appreciated!
    Dirk.

    etresoft wrote:
    Michael may profess ignorance about MacOS X applications, but he is still 100% correct. You need to study the architecture and find the best way to work with it. The first thing to know is that the CPU is irrelevant. Let the GPU handle your graphics - that is what it does best. You do want your CPU to be as idle as possible. Approach it from a device-driver or event-driven perspective.
    Just to clarify that I'm not a total noob trying to write his first program: of course I will not overly use the CPU if not necessary. I completely agree with what you guys say about maximizing CPU usage. My game engine on windows will put the CPU to sleep when it's not necessary making my engine perform very good with almost no CPU usage.
    But... when I want to test if changes to my engine/shaders/... improve or degrade performance of the renderings, I want to be sure that everything is maxed out so that I can be sure that the difference is correct. On maxed out CPU/GPU, I will notice the difference when framerate goes for example from 2000 to 1900 while this will not be visible when just at 60 fps and a lot of free time. I will see 60 fps even when my code is worse. That's why I need to be able to test this.
    Anyway, as I said, I completely agree and I will certainly do my very best to make sure that CPU is not overly used. So my question remains: how can I make sure that I have everything I need at the time I need it while I will do my best to make sure nothing more is used?
    Timer-events at 1/60th of a second is not the answer...
    Using threads for these things is not the answer... I use them for other things (loading from disk/processing data/generating data)
    But are there other options?
    Can you point me to where I can learn more about the architecture and its possibilities?

  • How to override the create method invoked by a create form?

    Hello everyone, I'm using ADF Faces and have the next question:
    How can I override the create method which is invoked by a create form to preset an attribute in the new row (the preset value is not fixed, I have to send it to the method as a parameter as it is obtained using an EL expression)?
    In the ADF guide I read how to override a declarative method (Section 17.5.1 How to override a declarative method), but this explains how to do it with a method that is called by a button. I don't know how to do the same with a method which is called automatically when the page is loaded.
    I also tried overriding the view object's createRow() method to receive a parameter with the preset values but it didn't work, I believe that was because the declarative create method is not the same as the view object's createRow. This caused the form to display another row from the viewobject and not the newly created one (I also set the new row into STATUS_INITIALIZED after setting the attribute).
    Well, I hope my problem is clear enough for somebody to help me.
    Thank you!

    Hello,
    I'm not sure you can do it with standard generated Create Form.
    In your view object you'll need to create your own create method with parameters, publish it to client interface and invoke instead of standard generated create action in page definition.
    Rado

  • How to get the rendered value of a cell in a table

    Hi All
    I am using a DateCellRenderer to display the date in a particular cell in the format "MM/dd/yyyy HH:mm" instead of the long date format. My proble is that when I try to retrieve the value using table.getModel().getValueAt(row, column), it returns the value in the long date format instead of the format "MM/dd/yyyy HH:mm".
    Is there anyway to get the actual rendered value of this cell.
    Rahul

    The value that is returned from the model is the actual Date object. If you want to format that Date object into a string like it is rendered, then just create a date formatter using the same pattern to output it. Trying to force the renderer to render the string seems like you are pounding a nail in with a bowling ball. Yes, it will work... but why are you doing it. :-) And you are forced to make assumptions about how the renderer works... is a label, etc.
    Seems to me it would be far more clear to staticly define the pattern you are using for formatting dates. Use that pattern string in your renderer, and use it for creating another date formatter for your other tasks. Update it once to modify all uses. Remember that date formatters are not thread safe, and should not be shared unless you are very careful. So share the pattern, not the formatter.

  • How to override the default "required" attribute for the UIComponent?

    Hi, consider the following markup: <h:inputText id="txt_firstName" value="#{myBean.firstName}" required="true"/>
    if I leave this field empty and hit the submit button, the required validator will fire an error msg. If however, I leave an empty space in the text box and hit submit button, it will go through no problem.
    I'd like to override the required attribute, so it will trim the spaces first before decide if it really is empty:
    //whatever the name of the method i'm overriding....
    String value = (String)value;
    if(value==null)throw new ValidatorException(whateverDefinedInTheBundle);
    value = value.trim();
    if(value.length==0)throw new ValidatorException(whateverDefinedInTheBundle);
    How can I go about doing that?
    Thank you.

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

  • How to override the default delete operation

    Hi,
    I am new to Jheadstart, java coding for that matter.
    Here's my situation,
    I have a view which is based on a function (function returns a collection).
    I have created instead of triggers on this view to perform insert/update/delete operations.
    All these DML operations work as expected in Oracle database.
    Now, I created an Entity object and a view object on this view in my jheadstart project.
    When I run this Jheadstart application my insert and search operations run fine but update and delete operations fail with JBO-26080 error.
    The underlying oracle error is "ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc."
    I know that delete and update operations work fine in Oracle and hence I would like to override the default Jheadstart operations. Can any body tell me how can I do it or point me in right direction?

    Hi,
    From the JHeadstart Developer's Guide, chapter TroubleShooting - Problem Assessment:
    If you are getting a JBO error (Business Components for Java error), try to perform the same data retrieval or data manipulation action using the BC4J Tester. You can
    invoke the tester through a right-mouse-click on the BC4J application module. If you get the same error using the BC4J tester, the problem is in the BC4J object definitions. If you added business rules, or other custom code to your BC4J objects that executes during your data retrieval or data manipulation action, you can debug this code line-by-line by running the tester in debug mode. You can also look up the JBO error in the JDeveloper online help, for each error possible causes and how to solve them are described.
    It sounds to me like you will also get this error in the BC4J Tester. This means that the problem is not related to JHeadstart. You can go to the JDeveloper discussion forum http://otn.oracle.com/discussionforums/jdev.html and ask your question there without mentioning JHeadstart. Maybe there is some switch you can set in the BC4J object to let BC4J not use SELECT FOR UPDATE.
    Hope this helps,
    Sandra Muller
    JHeadstart Team

  • How to override the where clause (Bind Variables) in Backing Bean.

    HI
    I am using bind variables in VO and using exeutewithparam to pass the values to bind. Which is working fine.
    But what i want now to override the values pro grammatically from backing_bean of that page.
    How can i pass the values to bind variables from bean.
    M Niaz.

    Hi
    Try this if it works. this is from 10g
    1)create value binding in the backing bean on any action
    FacesContext ctx=FacesContext.getCurrentInstance();
    ValueBinding vb= ctx.getApplication().createValueBinding("#{bindings['account_name1'].inputValue}");
    2) and then set the value for binding
    vb.setValue(ctx,(String)accountInput.getValue());
    Now execute the method with method binding and execute it
    ctx.getApplication().createMethodBinding("#{bindings.ExecuteWithParams.execute}",null).invoke(ctx,null);
    Regards
    Rohit

  • How to override the NUMBER format in BEX?

    Hi,
    I want to override the number formats in BEX queries (Excel).
    In the Query Designer -> Query Properties -> Value Display,
    or in 3.x: Query Properties -> Display -> Number Format,
    the setting "Display of +/- Signs" affects how the numeric values in Excel will be displayed. This setting seems to take effect after everything else is done.
    I can change any cell formatting (pattern, border, color, etc.) except the number format. I have tried redefining Styles, assign different styles to the Result Area, setting up a default template, even Visual Basic (Sub SAPBEXonRefresh), nothing works, my settings always get overwritten by the query setting.
    For example:
    I am trying to assign the Number Format "Accounting", with a "$" sign in the far left of the fields, to the amounts in my workbook.
    It should look like this: "$     (123,456.00)"
    The results: my settings are replaced by the format "Currency" with the "$" sign.
    "    ($123,456.00)"
    It must be due to that number format setting in the query designer.
    I was hoping the number format setting in the query designer could be switched off. But apparently it is not possible. Not even the "Adjust Formatting after Refreshing" setting affects this behavior. It always takes effect.
    Does anyone have any idea what could be done about it?
    Thank you,
    Vince

    OK, I think I have just found the answer to my own question...
    I had done something in the VB editor that created this whole problem. Now it is fixed and works as it should.
    Thanks anyway.

  • How to get the rendered image on portal.

    Hi.
    I have 2 problems..
    (i)I have installed IBR. i have configured UCM with IBR through Provider.
    Now i am able to get all the renditions.
    But, can some one tell me, how can i get the rendered formats. Through Content ID, i can able to get only the native file. I need to get the rendered image also.
    I need to use those rendered format image on portal.
    (ii)
    how to change the image resolution?
    In damconverter_baserenditions.hda file contains those details, I need to change those details like, i need to change the rendition set according to my requirement. I changed that still it is not working. Kindly suggest me something.

    (i)I have installed IBR. i have configured UCM with IBR through Provider.
    Now i am able to get all the renditions.
    But, can some one tell me, how can i get the rendered formats. Through Content ID, i can able to get only the native file. I need to get the rendered image also.
    I need to use those rendered format image on portal.If you run a search that return also content items with multiple renditions, you will see a little camera symbol which opens RENDITION_INFO (or just call the service like http://server:port/instance/idcplg?IdcService=RENDITION_INFO&dID=X&dDocName=Y ). This will open the list of available renditions. You may copy the link to the desired rendition. It will look like http://server:port/instance/idcplg?IdcService=GET_FILE&dID=X&dDocName=Y&RevisionSelectionMethod=specific&Rendition=Web&allowInterrupt=1

  • How to override the built in functions

    hi,
    how can we override the built-in functions like create, delete in ADF. I need to write a code that would work for the entire data model instead of only the view object in question. There are a set of actions and operations that should be dealt thru the template and only few operations thru the main/master screen.
    thanks all,
    Jyothi

    You can override specific methods for EOs see here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcservices.htm#CHDEIFFG
    Or if you want to change the behavior for all your EOs create an extension as described here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvgen.htm#sm0291

  • How to override the onTouchUp in the user control which can be used to fire the event not only on this user control, but whole application

     I am a new to the C# and WPF. Right now, I want to override onTouchUp event in my user control. Then I can add user control in
    the references for reuse. The problem is each time I want to test this event on the application, the event only fire at area of user control, not whole screen. Anyone has solution for this?

    You cannot just add a UserControl to a window and expect its OnTouchUp method to get invoked when a TouchUp event occurs outside of the user control. That is not how routed events work.
    The OnTouchUp method of the UserControl will only be invoked when a TouchUp event occurs from within the UserControl.
    The event will indeed bubble up to the parent elements of the UserControl and you could for example handle the event in the parent window:
    <Window x:Class="WpfApplicationSlider.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525" TouchUp="Window_TouchUp">
    The OnTouchUp method of the UserControl will however never get invoked when you touch an element outside of the UserControl because an event only travels between the source element and the handler(s). This is how routed events work.
    If you want a "global" TouchUp event handler you should override the OnTouchUp of the top-level
    window:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    protected override void OnTouchUp(TouchEventArgs e)
    base.OnTouchUp(e);
    //do your thing...
    If you want to be able to reuse the functionality across all of your windows in case you have several you could for example create an abstract window class and make all your windows inherit from this one:
    namespace WpfApplication1
    public abstract class BaseWindow : System.Windows.Window
    protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e)
    base.OnTouchUp(e);
    //do your thing...
    MainWindow:
    public partial class MainWindow : BaseWindow
    public MainWindow()
    InitializeComponent();
    <local:BaseWindow x:Class="WpfApplicationSlider.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WpfApplication1"
    Title="MainWindow" Height="350" Width="525">
    </local:BaseWindow>
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and please start a new thread if you have a new question.

Maybe you are looking for

  • How can I get my music on iTunes on my new computer?

    I just got a new computer because my old one totally died. All I want to do is get my iTunes on my new computer to have all my music on it, just like it was on my previous computer. I have an first generation iPod Touch, 16GB.

  • Agent port confilct even after removing agent in ODSEE11.1.1.7

    Hello All, I am facing DSCC agent 3997 port conflict when we try to register agent to DSCC host after removing old agent with out any errors. Port (3997) is already in use by [install path (old)/var/dcc/agent] on this hostname (xxxx1). So [install pa

  • CS6 Hide file type in tabs

    Is there a way to hide the file type next to the file name in the open files tabs? I don't need to see this and would give me more room for having more tabs on my laptop. Any suggestions would be appeciated. Thanks

  • Wrong cost centers and profit centers assigned

    hi all, In FBL3N for the TR(treasury document type) wrong cost center and profit center is being displayed can anyone tell me where is this setting made or where to change to the correct CC and PC? wishes Katya

  • Do I need to adjust channels in my network with APXtreme?

    Hi, i have been reading about an app called wifi explorer (http://www.adriangranados.com/blog/troubleshooting-wireless-networks-wifi-explor er) that offers the possibility to configure channels to avoid overlapping signals that could bring down my ho