Registering own Renderer to SelectOneListBox

Hi there!
I'm new in JSF. I want to register my own Renderer to the existing component SelectOneListBox. What i have to do to make this runnable? I've created a class called 'StyleSelectOneListBoxRenderer', which should render the output of <h:selectOneListBox>, but i don't know how to register this renderer. Do i have to write a custom component or can i register a new renderer to an existing component?
Thanks!
Regards,
Martin

peterl wrote:
Thank you John for your reply but that isn't exactly what I want. I read somewhere in the 467 pages of instructions about connecting the camera to the computer and using the EOS utility registering my own name directly on to the camera.
Regards,
Peter
Actually, it is exactly what you wanted. You can enter your name either way: via the copyright menu or with EOS Utility. The advantage of using EOS Utility is that you can copy in a pre-constructed text file. That doesn't make much difference if you're entering just your name, but the copyright notice itself can be tedious to type in on the camera menu. If you have two copyright notices (home and work) like I do, it's nice to be able to switch back and forth easily. And if you carry two or more cameras, you can use EOS Utility to synchronize their times with your computer. This ensures that when you sort the results of your shoot, everything will come out in the right chronological order.
Bob
Boston, Massachusetts USA

Similar Messages

  • Howto register a renderer

    Can someone tell me some more insight on how to register a renderer? Suppose I use the following XML file:
    <POLICYPROPERTYBUNDLE>
    <NAME>CUSTPOLICYPROPERTYBUNDLE</NAME>
    <PROPERTIES>
    <PROPERTY>
    <NAME>SmbRenderer</NAME>
    <VALUE Datatype="SystemObject" Classname="Policy">
    <NAME>SmbCustRenderer</NAME>
    <IMPLEMENTATIONNAME>pier.ifs.CustRenderer</IMPLEMENTATIONNAME>
    <OPERATION>SmbRenderer</OPERATION>
    </VALUE>
    </PROPERTY>
    </PROPERTIES>
    </POLICYPROPERTYBUNDLE>
    * The policy-property-bundle-name is free to choose I suppose?
    * What should be the name of the propery (SmbRenderer in my case)? Is it free to choose, or should it be a predefined keyword, based on the protocol?
    * Implementation: I suppose that refers to the class I wrote with the renderer code? Need to specify full path name (relative to custom_classes)?
    * Operation: free to choose? I think it has to be the same as the property name, can anyone confirm?
    * If some of these things are not free to choose, what are the options? Like the operation, is it only SmbRenderer, FtpRenderer and CupRenderer?
    * What operation to use in which situation. In ifsmgr I see also RenderAsText and RenderAsXml. What operation is used in which situation?
    * The second XML file I need is the following I suppose:
    <CLASSOBJECT>
    <UPDATE reftype="name">CONTACTPERSON</UPDATE>
    <POLICYBUNDLE RefType="name" Classname="PolicyPropertyBundle">CUSTPOLICYPROPERTYBUNDLE</POLICYBUNDLE>
    </CLASSOBJECT>
    * And finally, how to remove a policypropertybundle again?...
    P.S. When using the above code I'm getting errors like:
    IFS-30002: Unable to create new LibraryObject
    IFS-30010: Attribute would not be unique (NAME)
    Thanks in advance.

    Can someone tell me some more insight on how to register a renderer? Suppose I use the following XML file:
    <POLICYPROPERTYBUNDLE>
    <NAME>CUSTPOLICYPROPERTYBUNDLE</NAME>
    <PROPERTIES>
    <PROPERTY>
    <NAME>SmbRenderer</NAME>
    <VALUE Datatype="SystemObject" Classname="Policy">
    <NAME>SmbCustRenderer</NAME>
    <IMPLEMENTATIONNAME>pier.ifs.CustRenderer</IMPLEMENTATIONNAME>
    <OPERATION>SmbRenderer</OPERATION>
    </VALUE>
    </PROPERTY>
    </PROPERTIES>
    </POLICYPROPERTYBUNDLE>
    * The policy-property-bundle-name is free to choose I suppose?
    Correct.
    * What should be the name of the propery (SmbRenderer in my case)? Is it free to choose, or should it be a predefined keyword, based on the protocol?
    Pre-Defined based on Protocol. SMB will look for SmbRenderer. Ftp for FtpRenderer etc.
    * Implementation: I suppose that refers to the class I wrote with the renderer code? Need to specify full path name (relative to custom_classes)?
    Correct. You need to provide the fully qualified (package + class) name.
    * Operation: free to choose? I think it has to be the same as the property name, can anyone confirm?
    Should be the same I think.
    * If some of these things are not free to choose, what are the options? Like the operation, is it only SmbRenderer, FtpRenderer and CupRenderer?
    These names are reserved by the iFS protocol servers. If you had your own protocol server or application you could add addition policies to define the renderer mechansim for your custom protocol server or app.
    * What operation to use in which situation. In ifsmgr I see also RenderAsText and RenderAsXml. What operation is used in which situation?
    I'm not sure I'll get back to you next week once I'm back in the office.
    * The second XML file I need is the following I suppose:
    <CLASSOBJECT>
    <UPDATE reftype="name">CONTACTPERSON</UPDATE>
    <POLICYBUNDLE RefType="name" Classname="PolicyPropertyBundle">CUSTPOLICYPROPERTYBUNDLE</POLICYBUNDLE>
    </CLASSOBJECT>
    * And finally, how to remove a policypropertybundle again?...
    P.S. When using the above code I'm getting errors like:
    IFS-30002: Unable to create new LibraryObject
    IFS-30010: Attribute would not be unique (NAME)
    null

  • How to register own Transport implementation inside java

    Hi,
    My application is running on a shared host where I do not have admin rights.
    I have written my own implementation of the SMTP Transport.
    In order to be able to use it, it appears that I have to register it in
    $JAVA_HOME/jre/lib/javamail.providers
    with the line
    protocol=smtp_my; type=transport; class=com.my.app.mail.SMTPTransportMy; vendor=Me;
    this, is however not possible in all environments I want to run my app.
    Is there a way to do it inside java similar to the MailcapCommandMap approach?
    Any hints would be highly appreciated!
    Ralf
    https://www.privasphere.com/e.do?email=hauser(at)acm.org
    Just for reference how it is done there!
    MailcapCommandMap mc = (MailcapCommandMap) CommandMap
    .getDefaultCommandMap();
    mc .addMailcap("text/enriched;;x-java-content-handler=com.sun.mail.handlers.text_plain");
    //.addMailcap("text/*;;x-java-content-handler=com.sun.mail.handlers.text_plain");
    CommandMap.setDefaultCommandMap(mc);

    I don't understand what you mean by register a bean inside another bean.

  • Custom renderer for radio buttons?

    I want to change how radio buttons are rendered (so they aren't all rendered alone in their own table). What would be the best way to do this?
    One way would be to create a custom component, tag handler, and renderer (and register them all in faces-config.xml).
    But what about using the existing JSF components and just writing my own renderer. Could that work? Would just need to write a renderer and configure faces-config.xml to use the appropriate component-family (for the existing JSF radio button component) and renderer-type (for the existing component tag class for the radio button)�.like this:
    <render-kit>
    <renderer>
    <component-family>javax.faces.SelectOne</component-family>
    <renderer-type>javax.faces.Radio</renderer-type>
    <renderer-class>my.custom.renderer</renderer-class>
    </renderer>
    </render-kit>
    Could this work?
    Thanks.

    Could this work?Yes. Why do you doubt it?

  • Rendering video to different ui ?

    I m trying to bring video control into a framework .. The native classes for ui build of that framework is different from pure Java AWT or Swing.. the framework as such doesnt support AWT or Swing.. Yet it runs on JRE and it has its own UI module.. But the getVisualComponent() method of player class returns ony java.awt.Component ... this cannot be added to my framework frame unlike v add on a AWT Frame.. When i went through the JMF source code of that getVisualComponent() method it is only declared and not defined as Player is a interface. I couldnt trace the code further as it was very complex due to hundreds of api classes related to one another.. Is there a method to solve this problem?

    You can create your own renderer.
    jobs4jmf provides two one for swing and one for jogl.
    You create and register your renderer, then it will get called with the buffer for the video. JMF provides helpers to convert to a BufferedImage, from there you can put it on your other UI (assuming it supports BufferedImages, if not you'll have to convert the buffer to your UI's image format).

  • Table cell renderer works with any L&F, but not with Windows

    Hi,
    I created a table cell renderer / editor for a combobox in a table cell. This works all as expected, but if the Look&Feel is com.sun.java.swing.plaf.windows.WindowsLookAndFeel, which is the system L&F on Vista, the selected values in the combobox are not shown in the cell after loosing focus. Metal LF and Motif LF work, and a third party one "TinyLF" works as well.
    Can anyone imagine why, and what needs to be changed to get a cross platform consistency without Metal LF?
    A compilable demo:
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.io.IOException;
    import java.security.NoSuchAlgorithmException;
    import javax.swing.DefaultCellEditor;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    public class Test {
        static class CellRendererWithComboBox extends JLabel implements TableCellRenderer {
            JLabel label = new JLabel();
             * Set this renderer to the given column
             * @param column
             * @param r
             * @param editable
            public void setRendererTo(JTable table, int column, boolean editable) {
                TableColumn col = table.getColumnModel().getColumn(column);
                JComboBox xc = new JComboBox(new DefaultComboBoxModel(new Object[]{1, 2, 3, 4, 5, 6, 7}));
                col.setCellEditor(new ComboBoxEditor(xc));
                col.setCellRenderer(this);
                xc.setEditable(editable);
            @Override
            public Component getTableCellRendererComponent(JTable table, Object value,
                    boolean isSelected, boolean hasFocus, int row, int column) {
                if (hasFocus && isSelected) {
                    if (isSelected) {
                        label.setForeground(table.getSelectionForeground());
                        label.setBackground(table.getSelectionBackground());
                    } else {
                        label.setForeground(table.getForeground());
                        label.setBackground(table.getBackground());
                    label.setText((value == null) ? "" : value.toString());
                    return label;
                } else {
                    label.setText((value == null) ? "" : value.toString());
                    return label;
            class ComboBoxEditor extends DefaultCellEditor {
                private final JComboBox box;
                private boolean fire = true;
                public ComboBoxEditor(JComboBox b) {
                    super(b);
                    this.box = b;
                    b.setLightWeightPopupEnabled(false);
                @Override
                public boolean stopCellEditing() {
                    if (fire) {
                        super.stopCellEditing();
                    return true;
                public void stopCellEditingSilent() {
                    fire = false;
                    stopCellEditing();
                    fire = true;
        public static void main(String... aArgs) throws NoSuchAlgorithmException, IOException {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (ClassNotFoundException classNotFoundException) {
            } catch (InstantiationException instantiationException) {
            } catch (IllegalAccessException illegalAccessException) {
            } catch (UnsupportedLookAndFeelException unsupportedLookAndFeelException) {
            JFrame p = new JFrame();
            JTable t = new JTable();
            TableModel m = new DefaultTableModel(new Object[][]{
                        new Object[]{1, 2, 3, 4, 5, 6, 7},
                        new Object[]{1, 2, 3, 4, 5, 6, 7},
                        new Object[]{1, 2, 3, 4, 5, 6, 7},
                        new Object[]{1, 2, 3, 4, 5, 6, 7},
                        new Object[]{1, 2, 3, 4, 5, 6, 7}},
                    new Object[]{1, 2, 3, 4, 5, 6, 7});
            t.setModel(m);
            Test.CellRendererWithComboBox f = new CellRendererWithComboBox();
            f.setRendererTo(t, 1, true);
            p.setLayout(new BorderLayout());
            p.add(t, BorderLayout.CENTER);
            p.pack();
            p.setVisible(true);
    }

    1) Your custom cell renderer does nothing extra, so you can depend on default renderer.
    2) Instead of extending JLabel and implementing TableCellReneder, you should extend DefaultTableCellRenderer and override its get renderer method because DefaultTableCellRenderer itself extends JLabel and aditionally it does some optimizations etc., which you can miss if you implement your own renderer.
    3) If you set foreground and background color in last else statement also, then you can see the values correctly in windows L&F as well.
    Thanks!

  • JTree rendering failure : big empy space displayed

    Hello,
    I have a problem using a JTree with jdk 1.5 update 10. I could not find anything in the bug database that seemed to link to this problem.
    I have created a JTree that displays the content of a directory under a root node (displayed). I have created my own renderer to customize the labels and i use a TreeModel to add and remove nodes.
    The problem (possibly a known bug): sometimes (it actually seems to be completely random), the Ttree "fails" rendering one of the label, resulting in a big white space instead of the usual label (icon + file name). Other labels in the tree are displayed correctly. The "big white label" can be selected and correctly links to the file it represents (information about the file is displayed correctly). All in all, everything works perfectly fine except one item is displayed as a big empty label.
    Is there any chance this could be a java bug ? If not is there any way i could know what causes this failure ?
    Regards.
    NB: some friend of mine that is working on a different project has exactly the same problem and can't find a solution either.

    I am having the identical problem and its driving me crazy. This started happening to me after I installed new hard drives and reinstalled the OS. I then transfered all the old settings from the old drive. Everything else seems to work perfectly. If you get anywhere with this let me know.
    Hy
    My goal: To import some pictures into iMovie. Maby
    add ken burns efects to them, add a bit of narration
    and some music, edit everything and export.
    The problem: Let say I use the following method: i
    click Media tab, then i click photos, then i select
    the photo, and in the Photo Settings click apply.
    iMovie then imports the photo, puts it in the
    timeline and then the dark red bar bellow apears (the
    one that would means rendering). The problem is,
    there is no light red getting over it (that would
    indicate rendering in progress). It's the same if i
    click and drag a photo into the clip browser (only
    the dark red is displayed on the bottom of the
    thumbnail). If i try to quit iMovie it warns me that
    rendering is in progress.
    It doesn't matter how big a photo is (i tried
    300x200px, 800x500px, 1500x1000px, 3000x2000px) or
    what format (jpg, tiff, png).
    I tried restarting the application and the sistem. I
    created another user to try if anything changes. I
    erased the preferences. I even tried copying the
    whole application from frend's computer (the same
    version and all). The dark red bar doesn't start to
    fill red (i checked in the terminal how much
    processor does it eat and it's on 7%, so it probablly
    means it's doing nothing)
    I have a 2Ghz, 2GB of ram Macbook 13" Intel core duo.
    I have 67 GB of space left (format: Mac-os extended -
    journaled), running OS-X 10.4.8 and updated to the
    latest updates. iMovie version is 6.0.3 (267.2).
    What else is there to do? Would reinstalling the
    whole sistem help and is there a way to keep all of
    my preferences and mail accounts and contacts, … in
    case i have to do that?
    thx in advance
    Peter
    Macbook 13"  
    Mac OS X (10.4.8)  

  • JTable Renderer-Promblem when using custom renderer

    Hi. i've just started studying Swing component.
    So i'm about to ask for help to solve the problem during using custom TableCellRenderer.
    Here is my own Renderer which extends JLable and implements TableCellRenderer
    public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected,boolean hasFocus,int row,int column)
         if (isSelected) {
         setForeground(table.getSelectionForeground());
         super.setBackground(table.getSelectionBackground());
         else {
         setForeground(table.getForeground());
         setBackground(table.getBackground());
         JLabel right=new JLabel("LEFT");
         JLabel left=new JLabel("RIGHT");
         this.setLayout(new BorderLayout());
         this.add(left,BorderLayout.WEST);
         this.add(right,BorderLayout.EAST);
         return this;
    note: There are 3 JLabel components. Two components are added to the component will be returned.
    This code works fine.
    but whenever try to resize the column display using above renderer, The " Text " runs in resizing.(making traces)
    Please anybody try to run this code, show me some solution.
    thank you

    A renderer will have its getTableCellRendererComponent method called repeatedly, every time a cell is to be repainted, and its the renderer associated with that cell. Therefore, avoid doing things in this method that should only be done once, for example:
    JLabel right=new JLabel("LEFT");
    JLabel left=new JLabel("RIGHT");
    this.setLayout(new BorderLayout());
    this.add(left,BorderLayout.WEST);
    this.add(right,BorderLayout.EAST);Can you do that in the renderer's constructor?

  • JSF 1.2 and h:commandButton custom renderer problem

    Hi everyone!
    I'm working on my custom h:commandButton renderer for a couple of hours and I cannot solve some issues...
    First of all: what I want to do is to substiute default h:commandButton renderer with my own which will call standard renderer and puts some other tags. After all I will have something like that:
        <div class="leftbackground">     
           <div class="rightbackground">
               <input type="button" value="Ok" />  --- this is defaulty rendered by h:commandButton renderer
           </div>
        </div>So that I've put some lines info faces-config.xml:
    <render-kit>
             <renderer>
                  <component-family>javax.faces.Command</component-family>
                  <renderer-type>javax.faces.Button</renderer-type>
                  <renderer-class>test.MyCommandButtonRenderer</renderer-class>
             </renderer>
        </render-kit>I've written my own renderer which looks like this:
    package test;
    import java.io.IOException;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.render.Renderer;
    import com.sun.faces.renderkit.html_basic.HtmlBasicRenderer;
    public class MyCommandButtonRenderer extends HtmlBasicRenderer{
         public MyCommandButtonRenderer(){
              System.out.println("MyCommandButtonRenderer constructor has been calles");
         public void encodeEnd(FacesContext context, UIComponent component)
                   throws IOException {
              try{
              ResponseWriter writer = context.getResponseWriter();
              writer.startElement("h3", component);
              writer.writeText("Hello from a custom JSF UI Component!", null);          
              writer.endElement("h3");  
              }catch(Exception e){
                   e.printStackTrace();
    }After that, when I try to call h:commandButton on my JSF page:
         <f:view>
              <h:form>
                   <h:commandButton  value="Save"  />
              </h:form>
         </f:view>I can see <h3>Hello from a custom JSF UI Component!</h3>. Unfortunately my <input type="button"> isn't rendered.
    I have tried something like this:
    (in MyCommandRenderer}
    public void encodeEnd(FacesContext context, UIComponent component)
                   throws IOException {
              try{
              ResponseWriter writer = context.getResponseWriter();
              writer.startElement("h3", component);
              writer.writeText("Hello from a custom JSF UI Component!", null);          
              writer.endElement("h3");  
              String family = "javax.faces.Command";
              String renderType = "javax.faces.Button";
              Renderer baseRenderer =
                   context.getRenderKit().getRenderer(family , renderType);
              baseRenderer.encodeEnd(context, component);
              }catch(Exception e){
                   e.printStackTrace();
    }but it obviously only rendered multiple h3 elements until StackOverflowException is being thrown (it calling himself again and again).
    What am I doing wrong? Why my <input type="button"> isn't called? How to call default h:commandButton renderer and told him to render <input type=button> ? Is there any commandButton renderer class I can extend ?Which renderer is used by default by CommandButton component?
    Thanks in advance for any help. I'm really close to leave off my work and stay with something more familiar ;)
    Sorry for my bad English.
    Looking forward to hearing from you,
    Matthew
    Edited by: MatthewPL on Nov 28, 2007 12:42 AM

    To the best of my knowledge, the standard does not specify the default renderer class for any components.
    I would take a wrapper/decorator approach. Add a field to your renderer for the default renderer. Before configuring your renderer, obtain the default renderer and set it on your renderer, then configure it.
    OTOH, there might be easier ways for you to accomplish what you want to do. You could use a PhaseListener to add components to the view whenever a commandButton is encountered in the tree.

  • Urgent - Rendering cells in a JTable

    Hi,
    I am working with a JTable which contains large volumes of data. I need to be able to set different colors depending on the value in a cell and depending on which row that cell appears. I have created my own renderer and have set it. But it is incredibly slow. I also have to perform drag and drop operations and this is also slowed down in the process.
    Is this a bug in Java?
    Is there a workaround to make this any faster? Or is there a way u can get the renderer to do the setting in the bacdkground and once it's done to show the settings?
    Thanks
    itfresher

    if(cal.vecdestination.size()==0)
                   if(column ==selectedcolumn)
                        setBackground(new java.awt.Color(173, 178, 206));
                   else
                        setBackground(java.awt.Color.white);
                   return this;
                        if(cal.vecpos!=null){
                        for (int i = 0; i < cal.vecpos.size(); i++) {
                             // System.out.println("------------------------------------2");
                             java.util.Vector vec1 = (java.util.Vector) cal.vecpos.elementAt(i);
                             // System.out.println("------------------------------------3");
                             for (int j = 0; j < veccontractnumbers.size(); j++) {
                                  // System.out.println("------------------------------------4");
                                  if (veccontractnumbers.size() > 0 && vec1.size() > 0) {
                                       if (veccontractnumbers
                                            .elementAt(j)
                                            .toString()
                                            .equalsIgnoreCase(vec1.elementAt(0).toString())) {
                                            // System.out.println("------------------------------------5");
                                            if (row == Integer.parseInt(vec1.elementAt(1).toString())
                                                 && column == Integer.parseInt(vec1.elementAt(2).toString())
                                                 && row <= Integer.parseInt(vec1.elementAt(3).toString()) + 3) {
                                                 setBackground((java.awt.Color) colorarray[j]);
                                                 setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 12));
                                                 setValue(value);
                                                 // System.out.println("------------------------------------6");
                                            } else
                                                 if (getBackground() != null) {
                                                      if (value.toString().equalsIgnoreCase("")) {
                                                           setBackground(java.awt.Color.white);
                                                           setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 12));
                                                           setValue(value);
                                                      } else {
                                                           setBackground(getBackground());
                                                           setFont(getFont());
                                                           setValue(value);
                                                 } else {
                                                      setBackground(java.awt.Color.white);
                                                      setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 12));
                                                      setValue(value);
                             if (column == selectedcolumn) {
                                  if (value.toString().equalsIgnoreCase("")) {
                                       setBackground(new java.awt.Color(173, 178, 206));
                                       setValue(value);
                                  } else {
                                       setBackground(getBackground());
                                       setValue(value);
                                  if (selectedcolumn == -13) {
                                       setBackground(getBackground());
                                       setValue(value);
                             } else {
                                  if (getBackground() != null) {
                                       if (getBackground().equals(new java.awt.Color(173, 178, 206))) {
                                            setBackground(java.awt.Color.white);
                                            setValue(value);
                                       } else {
                                            setBackground(getBackground());
                                            setValue(value);
                        if (flag) {
                             if (getBackground() != null) {
                                  if (value.toString().equalsIgnoreCase("")
                                       && getBackground().equals(new java.awt.Color(173, 178, 206))) {
                                       setBackground(java.awt.Color.white);
                                       setValue(value);
    This is the calculation that has to be done before u decide on which cell is to be coloured.
    I have an array of colors.
    I have a table which has some numbers in them. Depending on the row the data appears, it has to be coloured. Also identical data are to have the same color.
    For this purpose, I have got the details like
    the value in the cell
    the row no
    the column no
    and the maxposition limit
    stored in a vector of vectors!!
    i hope this makes some sense

  • Renderer unscaledHeight in layoutContents

    I'm creating my own renderer and wonder where the value for unscaledHeight (and width) comes from when updateDisplayList is called that in turn calls layoutContents for LabelItemRenderer.
    I'm creating a grid item renderer (poor mans version of datagrid) for a mobile application. GridItemRenderer subclasses LabelItemRender. I've studied the code of LabelItemRenderer and IconItemRenderer and I think I understand the basics.
    I'm currently using a DataGroup but could just as easily be using a List and my experimentation with list yields the same information. Why are the individual rows so tall? I set the font size smaller hoping that the vertical space each renderer would take would get smaller but it doesn't and I don't understand why.
    In my measure() method, I've calculated the measuredHeight to be:
         var verticalPadding:Number = getStyle("paddingTop") + getStyle("paddingBottom");
         measuredHeight = getElementPreferredHeight(ld) + verticalPadding;
    With the fontsize set to 16, the measured height comes back as 12. The top and bottom padding I have set to 0.
    But when updateDisplayList is called which inturn calls layoutContents, unscaledHeight is set to 66. Even if the font size is set to 28, the unscaledHeight is set to 66. 66 is returned when I debug the application as an Andriod App (Droid 2) on the desktop. If I debug on an actual device like a Motorola Atrix, fontsize 16 yields a measuredHeight of 12 (just like the desktop debug) but the unscaledHeight is set to 44.
    I've tried setting the gap in the vertical layout to 0 within the datagroup but that didn't work.
    So how can I control that "row" height? What set of values is Flex looking at to come up with "66"?
    Thanks!
    Randy

    I threw the following together using only spark components to hilight the issue. It is a mobile application. To reproduce, just debug the application on the desktop. I happen to use motorola droid 2 but the problem persists with other debug configurations. I'm using flex 4.5.1.
    I don't know how else to more clearly describe the problem or how to more easily describe how to reproduce it. I await your explaination as to why the flex provided components seem to be ignoring the values in measure() or if it is working as designed, how one can override this behavior.
    The below example shows 2 examples. The first example is a spark list using a spark iconitemrenderer. The 2nd example is using a spark datagroup using a spark labelitemrenderer. Just uncomment one and comment out the other to run the examples:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/mx"
              title="HomeView">
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Style>          
              .iconItemRendererMessageStyle {
                   fontSize: 12;
         </fx:Style>     
         <!-- EXAMPLE OF List with IconItemRenderer      -->
    <!--     
         <s:List id="taskList" height="100%" width="100%">
              <s:dataProvider>
                   <mx:ArrayCollection>
                        <fx:String>one</fx:String>
                        <fx:String>two</fx:String>
                        <fx:String>three</fx:String>
                        <fx:String>four</fx:String>
                   </mx:ArrayCollection>
              </s:dataProvider>          
              <s:itemRenderer>
                   <fx:Component>
                        <s:IconItemRenderer labelFunction="getLabel" messageFunction="getMessage" fontSize="12">
                             <fx:Script>
                                  <![CDATA[
                                       private function getLabel(item:Object):String {
                                            return "myLabel";
                                       private function getMessage(item:Object):String {
                                            return "myMessage";
                                  ]]>
                             </fx:Script>
                        </s:IconItemRenderer>
                   </fx:Component>
              </s:itemRenderer>
         </s:List>
    -->     
         <!-- EXAMPLE OF DATAGROUP with LableItemRenderer -->
         <s:Scroller width="100%" height="100%">
              <s:DataGroup id="detailsDataGroup" height="100%" width="100%" >
                   <s:layout>
                        <s:VerticalLayout useVirtualLayout="false" variableRowHeight="true" rowHeight="12" gap="0"/>
         <!--
              doesn't matter which vertical layout you use
                        <s:VerticalLayout useVirtualLayout="false" variableRowHeight="false"/>
        -->                    
                   </s:layout>
                   <s:dataProvider>
                        <mx:ArrayCollection>
                             <fx:String>one</fx:String>
                             <fx:String>two</fx:String>
                             <fx:String>three</fx:String>
                             <fx:String>four</fx:String>
                        </mx:ArrayCollection>
                   </s:dataProvider>          
                   <s:itemRenderer>
                        <fx:Component>
    <!--
                             by setting the fontsize to 12 and padding to 0, when you put a break point in LableItemRenderer, the measure
                             method sets measured height to 9 (debugging on the desktop as a droid 2). measure is called 4 times.
                             layoutContents is called 8 times. twice for each record in array collection. The first time it is called for
                             each array element, the unscaledHeight is 0. The 2nd time it is called for each array element,
                             the unscaledHeight is 66 even though the measuredHeight is set to 9.
    -->
                             <s:LabelItemRenderer fontSize="12" paddingTop="0" paddingBottom="0"/>
                        </fx:Component>
                   </s:itemRenderer>
              </s:DataGroup>
         </s:Scroller>     
    </s:View>

  • JTable Rendering

    Hi, Can anyone help in the following:
    I have implmented the JCheckBox Renderer in one of the fields of the table. It works fine but the problem is i cannot check multiple rows of data. When I check on row, the other one automatically unchecl.
    Here is my piece of code.
    package tv.izone.ide.table;
    public class CheckBoxRenderer extends JCheckBox implements TableCellRenderer {
    public CheckBoxRenderer() {
    setOpaque(true);
    public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
    setForeground(table.getSelectionForeground());
    setBackground(table.getSelectionBackground());
    } else{
    setForeground(table.getForeground());
    setBackground(UIManager.getColor("Button.background"));
    setSelected(isSelected);
    setText( (value ==null) ? "" : value.toString() );
    return this;
    And I am setting my Renderer like this
    table.getColumn("Copy").setCellRenderer(new CheckBoxRenderer());
    PLease Help.
    Thanks in adv.

    Ask Swing related questions in the Swing forum.
    You don't need to write your own renderer. Swing provides a check box renderer:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=419688

  • JSF own component

    Hi.
    I am developing own JSF component, something like Switch compoennt which have oracle - ADF Faces Components.
    On JSF page will be this tag:
    <s:switch value="facet2">
    <facet name "facet1">..... </facet>
    <facet name "facet2">.....</facet>
    </s:switch>
    But I don't know how can I render only one facet, for example facet with name facet2.
    I don't know if I must develop own renderer, or in which phase encoding I could specify which facet, can be render.
    Does anybody know where can I find more informations about it, or some good example?
    Thank yopu very much for your answer.

    1) return true to getRendersChildren()
    2) in your own renderer you fetch the "choosen facet" ... guess you already know how...
    3) fetch the facets only child
    4) facet.kid.encodeBegin();
    if (!facet.kid.getRendersChildren()) {facet.kid.encodeChildren()};
    facet.kid.encodeEnd();disclaimer: answer given from memory -> might be unsharp on actual method-names, but when you look at the javadoc you should figure it out
    hth
    Alexander

  • URGENT-Table renderer problem

    I created my own renderer(which renders JCombobox) for JTable.But the problem is when i select an item,it's not setting that item in the combobox.combobox remains blank. but when i click the combobox,it shows that selected item and shows popup menu.
    please give me some solution.
    thanx in advance.
    here is my piece of code.
    public class comboRenderer extends TableCellRenderer{
    JComboBox combo;
    /* In this constructor i am getting the combobox that is being used by the cell editor for editing a particular cell */
    public comboRenderer(JComboBox cmb){
    combo=cmb;
    public Component getTableCellRendererComponent(JTable table,Object value,boolean is Selected,boolean hasFocus,int row,int column){
    setSelectedItem(combo.getSelectedItem());
    //setting the currently selected item
    return this;
    //#################################

    In you getTableCellRendererComponent you are setting the combo to getSelectedItem(). To get the new value, you need to use the value passed into the method in the parameter list:
    combo.setSelectedItem(value.toString())

  • Tree renderer - change the appearance between selected and not selected

    Hi,
    I have a JTree that I would like to show for each node different information depending on it selection status. I wrote my own renderer to create the Component to display (it is a JPanel with one JLabel in one case, and a JPanel with mulitple JLabels in the other case).
    When I run my program, the node appears ok, but when I select it the tree doesn't update the size of the composnen to be displayed, and that resualts in displaying only a fraction of the information for the selected node.
    I have tried to set the tree row height, so the tree will ignore the chached size of the renderer but it didn't work.
    Any suggestions?
    Thanks,
    Benny

    Have you tried calling tre.setRowHeight(0) - this is supposed to indicate to the tree that the renderer will determine the height of each cell.
    Never tried it, though.

Maybe you are looking for

  • Can I connect a thumb drive to my Mac on a Guest Account?

    My dad needs to use my Mac for an office presentation. He will use the guest account and present from a thumbdrive. Problem is, the Mac can't seem to detect it. Is the guest acount programmed that way? He really needs this.

  • HT5137 Problem; App bought with iTunes gift card and cannot be downloaded.

    Hey there I bought an App. Bloons TD 5HD foor iPad 4 Retina. I paid for it with a gift card iTunes. System says, when app is activated, app is bougt and can be downloaded. Again an d again. It can't be activatedd Does anybody know what to do.

  • Reg classification in freground for 531 mvmt type

    Dear all, Here for by-products we are  giving - ve sign in BOM and we are giving backflush for the material in process order and because of it in the confirmation screen in COR6N in the goods movement tab we can see the by product with 531 movement 

  • Tax Departure Country issue

    Hi, We have following situation: sales org in country NL with plants in country BE and country GB. We do not use plants abroad as this is currently not an option. When a sales order is created for plant BE (delivering plant BE), the tax departure cou

  • Java/Blackboard problem after Lion update

    After a recent update, Java no longer works with my school's Blackboard. Anyone else have this problem? I can't enable HTML in the blackboard system. I'm running Lion with Blackboard 8.3 and using Firefox 3.6 as my browser.