BC4J Custom Renderers

Does JHeadStart support these?
http://www.oracle.com/technology/products/ids/daily/aug02.html
I have used them before but when I tried to use them in my JHS project it doesn't seem to pick them up.
Thanks.

JHeadstart does not recommend or support Business Components data tags (tags with the jbo: prefix). The reason is that we prefer a sound Model-View-Controller architecture.
Since JDeveloper 10g the Business Components data tags are deprecated (see http://www.oracle.com/technology/products/jdev/collateral/others/desupport10g.html).
kind regards,
Sandra Muller
JHeadstart Team
Oracle Consulting

Similar Messages

  • Custom Renderers in JTreeTable (or extending JTable)?

    I am wondering about what the best approach is to display a table in a Swing component. My table will by default have all rows collapsed (occupying a single line), but someone may click on a row to expand it (so it occupies multiple lines and displays more information). Nothing in the table should be editable.
    Example:
    (collapsed) 1. data     data     data
    (expanded) 2. data     data     data
    ...more data that wouldn't fit on on one line...
    ... still more data (additional data doesn't have same column format as collapsed rows)...
    (collapsed) 3. data     data     dataSo the additional data displayed when a row is expanded aren't conceptually `children' of the data in the collapsed display. I've looked at JTreeTable, but I'm not sure it's right for this purpose, and it seems complicated.
    For one thing, I need some of my columns to have custom renderers--for example, renderers that display a button with text or an image instead of just a label. However, it looks like the JTreeTable approach forces you to declare the JTree (extension) as the renderer of everything in a row, so would that prevent me from specifying custom renderers for other columns, or am I misunderstanding?
    Another feature I need is to be able to filter out entire rows from the view (so they don't show up at all). I will also want to add custom sort buttons that can apply four different sorts to each column.
    Would I be better off using a JTreeTable for this or somehow using custom renderers or otherwise extending an ordinary JTable to make the column larger and display additional information when the user clicks the expand icon?
    Also, how do I specify a different renderer for header rows than for other rows?
    Message was edited by:
    The.Joy.of.Java

    Check how editingStopped is being done. For a ComboBox there is no common operation that one can assume means that the user is done with the editing component. By default JTable leaves it active until the mouse clicks somewhere outside it, then does, essentially, fireEditingStopped() to give the cell back to the renderer. Then a second mouse click is required to start a new cell editor.
    If you're using ComboBox as a custom editor, you have to decide what event you want to be final and call fireEditingStopped() yourself. For instance, in your TableCellEditor:
        @Override
        public Component getTableCellEditorComponent(final JTable table,
                                                     final Object value,
                                                     final boolean isSelected,
                                                     final int row,
                                                     final int column) {
    ...             if( editor.supportsCustomEditor() )  {
                        JComboBox c = (JComboBox)editor.getCustomEditor();
                        c.removeActionListener( this );
                        c.addActionListener( this );
                        return c;
        @Override
        public void actionPerformed ( final ActionEvent ev ) {
            else if( "comboBoxChanged".equals( ev.getActionCommand() ) )  {
                fireEditingStopped();
        }The actionEvent is fired when just about anything happens in the ComboBox, including selection of the currently selected item. But unless you have a more specific requirement, it should be good enough.

  • BC4J Custom API: Batch Validation with Sequence-based primary key

    Hi people,
    I am trying to create a BC4J Custom API using the Batch Validation feature of iSetup Framework. However, my entity object has a sequence-based primary key, and this key is carried to the View Object. This way, i have three attributes marked as key attributes in the VO: InvoiceTypeId (the sequence), OrganizationId and InvoiceTypeCode (The alternate, developer key). the primary key is marked AZ_EXPORTABLE=FALSE, because it must be rebuilt in the target using the alternate key.
    I was able to successfully extract a single row to XML using this API (i am testing locally). When i try to import this XML file containing a single row, i get the following exception. Is this feature supported in Batch Validation mode?
    Regards
    Thiago Souza
    ** Exception starts **
    Started import...
    An exception occurred in API 'CLL Invoice Types'.
    oracle.apps.fnd.framework.OAException: An exception occurred in API 'CLL Invoice Types'.
         at oracle.apps.az.fwk.BEUtil.wrapperException(BEUtil.java:395)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1927)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 32, column 29:
    PL/SQL: ORA-00904: "KEY31": invalid identifier
    ORA-06550: linha 32, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 33, coluna 29:
    PL/SQL: ORA-00904: "KEY32": invalid identifier
    ORA-06550: linha 33, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 34, coluna 29:
    PL/SQL: ORA-00904: "KEY33": invalid identifier
    ORA-06550: linha 34, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 35, coluna 29:
    PL/SQL: ORA-00904: "KEY34": invalid identifier
    ORA-06550: linha 35, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 36, coluna 29:
    PL/SQL: ORA-00904: "KEY35": invalid identifier
    ORA-06550: linha 36, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 37, coluna 29:
    PL/SQL: ORA-00904: "KEY36": invalid identifier
    ORA-06550: linha 37, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 38, coluna 29:
    PL/SQL: ORA-00904: "KEY37": invalid identifier
    ORA-06550: linha 38, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 39, coluna 29:
    PL/SQL: ORA-00904: "KEY38": invalid identifier
    ORA-06550: linha 39, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 40, coluna 29:
    PL/SQL: ORA-00904: "KEY39": invalid identifier
    ORA-06550: linha 40, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 41, coluna 29:
    PL/SQL: ORA-00904: "KEY40": invalid identifier
    ORA-06550: linha 41, coluna 1:
    PL/SQL: SQL Statement ignored
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.executeSql(BEValidationXMLParser.java:288)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.collectUKFKValues(BEValidationXMLParser.java:254)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1897)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)

    Hi Thiago,
    I would suggest to test your API first with row by row validation mode where you would be resolving the foreign and primary keys as specified in the framework. This would help you to understand the framework better and once it starts working for you and then you can try with batch validation mode.
    Thanks
    Mugunthan.

  • TileLists, custom renderers and accessibility

    I have a tile list which implements a custom item renderer for each list item. The renderer contains 3 buttons. I've noticed that I can tab to the tile list itself, then use the cursor keys to move to indvidual items within it, but I can't then navigate to the buttons within each item.
    Is this possible, or a complete non-starter?
    Also I've noticed that there is ListEvent for the item roll over and roll out, but I can'd find anything to provide notification of keyboard-driven highlight as above. I want to change the state of the item on mouse hover or keyboard navigation...
    Cheers

    The ViewHandler, together with the StateManager, takes care of all of this when you save state on the server, so your custom renderers do not need to do anything. The request path includes enough information to figure out which view it's for, and the RI maintains views per session (other implementations are possible), which in turn is identified by a cookie or a session ID encoded in the request path (just as for any Java web application).
    For client-side state saving, the StateManager also uses a ResponseStateManager, which is part of the render kit, to encode and decode the state. It's only if you want to use client-side state and develop renderers for a different markup than HTML that you need to develop a complete render kit, including a ResponseStateManager and a form renderer that interacts with the ViewHandler and StateManager to encode the state in the response.

  • What is custom renderers?

    hello,
    im a little bit in the web area..so forgive me for maybe the obvious question.
    what is renderer?? is that the proccess where the server proceess all written in jsp page and put it as an html and send it back to user?
    also, what is custom renderers?
    thanks in advanced.

    A "component" is some UI widget, like an input text field, or even a date picker that consists of serveral HTML fields. JSF defines a component in at least 2 pieces: 1) a UIComponent subclass; and 2) a Renderer subclass.
    A "Renderer" for a component is responsible for producing some output for a particular markup (like HTML) for a given component. Therefor a "custom renderer" is a modified or user-defined renderer that replaces another renderer.
    The easiest way to define custom components (including the renderer) is with JSFTemplating. It is the only framework (that I know of) that helps create JSF renderers. It does this by allowing you define the renderer in a JSP-like format.
    I hope this answered your question.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • BC4J Custom Type Maps   (MS-SQL cont.)

    (FYI using JDeveloper 9.0.2.0.0, MS-SQL 2000 spk2 and MS-SQL's JDBC driver Version 2.2.0022)
    In the process of trying to get JDeveloper working fully with MS-SQL, I am at the point of developing a custom type map.
    Should this typemap include all mappings or only those different than the "Java" or "Oracle" type map? I was assuming all at first. Now I wonder how it's handling missing mappings.
    How does it find a matching typemap? I noticed that Entity's database column types looked like "int(10,0)" and "bit(1,0)", but in my typemap, like the examples, it's just "INT", "BIT" with no precision, scale. Is this a case of where it's assuming the driver will return a string for type and it's returning type(p,s)? Or is JDev building that string? Either way, would you need a different mapping for "bit(1,0)" than "bit"?
    As "bit(1,0)" it had problems with both the Java map and my custom map. Changing it to "bit" seem to get it to work. So what typemapping was it trying to use as "bit(1,0)"?
    [Bug?] I noticed that when I view the bc4j settings (project (rt-click) -> edit business components project), the value for type map is incorrect if I am using a custom type map. If I am using the Java type map it says "Java" in the greyed out select, but if I am using my custom map ("MS-SQL"), it says "Oracle". I checked the bc4j.xcfg for the one using my custom map and it does say the right class name for jbo.TypeMapEntries.
    On a related note, when testing the bc4j modules, we are instructed to use the edited local configuration, but how do view/edit the project default configuration?
    ====================================================================
    typemap in progress...
    ================================
    public class MsSqlTypeMapEntries
    public MsSqlTypeMapEntries()
    /* ColumnType, JavaClassName, JdbcSqlType, JdbcSqlTypeID, DefaultDisplayLength, isNumericType */
    new JboTypeMap("BIGINT", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BIGINT IDENTITY", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BINARY BINARY
    new JboTypeMap("BIT","java.lang.Boolean","BIT",java.sql.Types.BIT,null,true);
    new JboTypeMap("CHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("DATETIME" ,"java.sql.Timestamp","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("DECIMAL","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    //new JboTypeMap("DECIMAL() IDENTITY DECIMAL
    //new JboTypeMap("FLOAT FLOAT
    //new JboTypeMap("IMAGE LONGVARBINARY
    new JboTypeMap("INT","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("INT IDENTITY","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("MONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("NCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("NTEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    new JboTypeMap("NUMERIC","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    //new JboTypeMap("NUMERIC() IDENTITY","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    new JboTypeMap("NVARCHAR","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    //new JboTypeMap("REAL REAL
    new JboTypeMap("SMALLDATETIME" ,"java.sql.Date","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("SMALLINT","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLINT IDENTITY","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLMONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("SQL_VARIANT","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("SYSNAME","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("TEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    //new JboTypeMap("TIMESTAMP BINARY
    new JboTypeMap("TINYINT","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("TINYINT IDENTITY","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("UNIQUEIDENTIFIER","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    //new JboTypeMap("VARBINARY VARBINARY
    new JboTypeMap("VARCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    }

    (FYI using JDeveloper 9.0.2.0.0, MS-SQL 2000 spk2 and MS-SQL's JDBC driver Version 2.2.0022)
    In the process of trying to get JDeveloper working fully with MS-SQL, I am at the point of developing a custom type map.
    Should this typemap include all mappings or only those different than the "Java" or "Oracle" type map? I was assuming all at first. Now I wonder how it's handling missing mappings.
    How does it find a matching typemap? I noticed that Entity's database column types looked like "int(10,0)" and "bit(1,0)", but in my typemap, like the examples, it's just "INT", "BIT" with no precision, scale. Is this a case of where it's assuming the driver will return a string for type and it's returning type(p,s)? Or is JDev building that string? Either way, would you need a different mapping for "bit(1,0)" than "bit"?
    As "bit(1,0)" it had problems with both the Java map and my custom map. Changing it to "bit" seem to get it to work. So what typemapping was it trying to use as "bit(1,0)"?
    [Bug?] I noticed that when I view the bc4j settings (project (rt-click) -> edit business components project), the value for type map is incorrect if I am using a custom type map. If I am using the Java type map it says "Java" in the greyed out select, but if I am using my custom map ("MS-SQL"), it says "Oracle". I checked the bc4j.xcfg for the one using my custom map and it does say the right class name for jbo.TypeMapEntries.
    On a related note, when testing the bc4j modules, we are instructed to use the edited local configuration, but how do view/edit the project default configuration?
    ====================================================================
    typemap in progress...
    ================================
    public class MsSqlTypeMapEntries
    public MsSqlTypeMapEntries()
    /* ColumnType, JavaClassName, JdbcSqlType, JdbcSqlTypeID, DefaultDisplayLength, isNumericType */
    new JboTypeMap("BIGINT", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BIGINT IDENTITY", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BINARY BINARY
    new JboTypeMap("BIT","java.lang.Boolean","BIT",java.sql.Types.BIT,null,true);
    new JboTypeMap("CHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("DATETIME" ,"java.sql.Timestamp","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("DECIMAL","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    //new JboTypeMap("DECIMAL() IDENTITY DECIMAL
    //new JboTypeMap("FLOAT FLOAT
    //new JboTypeMap("IMAGE LONGVARBINARY
    new JboTypeMap("INT","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("INT IDENTITY","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("MONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("NCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("NTEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    new JboTypeMap("NUMERIC","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    //new JboTypeMap("NUMERIC() IDENTITY","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    new JboTypeMap("NVARCHAR","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    //new JboTypeMap("REAL REAL
    new JboTypeMap("SMALLDATETIME" ,"java.sql.Date","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("SMALLINT","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLINT IDENTITY","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLMONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("SQL_VARIANT","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("SYSNAME","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("TEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    //new JboTypeMap("TIMESTAMP BINARY
    new JboTypeMap("TINYINT","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("TINYINT IDENTITY","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("UNIQUEIDENTIFIER","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    //new JboTypeMap("VARBINARY VARBINARY
    new JboTypeMap("VARCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    }

  • Invoking BC4J custom methods from a JSP

    I developed a JSP application using exclusively BC4J Data tags, but now I have a problem.
    I wrote a custom method in the .java file of the Application Module of my BC4J project and I should invoke it from a JSP.
    I looked for a specific BC4J Data tag to do it, but I couldn't find it.
    How can I do? Should I write a bean to encapsulate the call and use the bean in the JSP?
    Is anyone else having the same problem?
    Michele De Santis
    null

    Michele,
    You would use a scriptlet tag to call the application method. The tag is found in the JSP element wizard under the JSP Tags node. You can also check http://java.sun.com/products/jsp/tags/tags.html for more information on the standard jsp tags.

  • Custom renderers

    I have use case where i need to have the custom renderer
    format a LinkButton. I want to pass a function reference/pointer so
    that when the LinkButton is clicked, the method is invoked in the
    parent component. How do I accomplish this? I tried passing it in
    and referring it as {data.functionReference} within the renderer,
    but nothing happens. Is this even possible?
    Thanks for any help!

    This is not a good approach. Renderers need to be data
    driven. For example, is the link button method the same for all
    rows? I'm sure not. So how were you planning to pass a different
    function to each row?
    The best solution is to use events.
    Have a string in your data that indicates what action is to
    take place.
    In the renderer, read this string from data, and set it in a
    public property
    On click of the LinkButton, dispatch and event:
    dispatchEvent(new Event("myLinkButtonClick",true); //the
    'true' makes the event bubble.
    in the parent app, set a listener for "myLinkButtonClick".
    In the handler, use event.target to get a reference to the
    renderer instance that dispatched the event.
    From that reference, get the action string, and then go from
    there.
    Tracy

  • Advanced Data Grid customized renderers interaction

    I created an advancedDataGrid with two customized colums:
    The first has a customized item renderer which is used also
    as the item editor and it is a check box.
    The second has a customized item editor - once the cell is
    clicked, a button appears. When the button is clicked - a popup
    window appears for selection. the selection is the new text of the
    cell.
    Seperatly, they work fine. There is only one scenario where
    the check box disturbs the button - When the check box is clicked
    and without exiting the row, the other customized cell is edited,
    its item rendered does not get updated.
    Here is the grid's colum definition:
    <mx:AdvancedDataGrid id="dataGrid"
    allowDragSelection="false"
    draggableColumns="false"
    editable="true"
    width="100%" height="100%"
    dataProvider="{dataGridSource}"
    defaultLeafIcon="{null}"
    folderClosedIcon="{null}"
    folderOpenIcon="{null}"
    change="onRowSelectionChanged(event)"
    itemEditEnd="onItemEndEdit(event)"
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="isSelected"
    headerText="" width="20"
    rendererIsEditor="true"
    editorDataField="selected"
    >
    <mx:itemRenderer>
    <mx:Component>
    <mx:CheckBox selectedField="selected"
    change="data.isSelected = selected;
    StatesTable(document).updateDashletState(data)"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:AdvancedDataGridColumn>
    <mx:AdvancedDataGridColumn id="statesColumn"
    dataField="event"
    headerText="{ResourceManager.getString('state_grid_header')}"
    editable="false" width="150"
    labelFunction="localizeLabelFunction"/>
    <mx:AdvancedDataGridColumn dataField="dashletName"
    headerText="{ResourceManager.getString('dashlet_grid_header')}"
    width="150" editable="false"/>
    <mx:AdvancedDataGridColumn dataField="contentName"
    headerText="{ResourceManager.getString('report_grid_header')}"
    width="180"
    itemEditor="com.documentum.bpm.dashboard.components.configuration.DataGridReportChooser"
    editorDataField="selectedItem"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    //this code is for preventing default behavior of the item
    editor for the customized item editor for opening a popup window
    instead:
    private function
    onItemEndEdit(event:AdvancedDataGridEvent):void
    var item:Object = dataGridSource.getItemAt(event.rowIndex);
    if (event.dataField == "contentName")
    event.preventDefault();
    Please help

    Thanks, if I do this I get an error: 'HBox' declaration must be contained within the <Declarations> tag since it does not implement
    'mx.core.IUIComponent'.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:AdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/halo" width="400" height="300">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                /* override public function set data(value:Object):void
                    var currencyFormatter:CurrencyFormatter=new CurrencyFormatter();
                    currencyFormatter.precision=2;
                    currencyFormatter.currencySymbol='';
                    if (value != null)
                        numberOfItems.text = value.totalTransfers + ' items';
                        notionalAmount.text = currencyFormatter.format(value.totalNotional)+ ' Notional amount';
                        numberUnmatched.text = new Number(value.totalUnmatched) >0? value.totalUnmatched + ' Unmatched':'';
            ]]>
        </fx:Script>
        <mx:HBox  height="18" backgroundColor="#B0D9FF" horizontalScrollPolicy="off">
            <mx:Text text="Text" width="94" id="numberOfItems" color="#000A8A"/>
            <mx:VRule height="100%"/>
            <mx:Text text="Text" width="291" id="notionalAmount" color="#000a8a"/>
            <mx:VRule height="100%"/>
            <mx:Text text="Text" id="numberUnmatched" width="103" color="#000a8a"/>
        </mx:HBox>
    </mx:AdvancedDataGridItemRenderer>

  • Spark datagrid - custom renderers

    In my Spark DG I have a column that serves a purpose of starting and ending an editing session. I use a custom item renderer with a button that when I click on it initiates editing and gets its icon changed.
    When I click on the same button in another row I want to end editing in the first row and flip its button back to original. I am using states for that.
    Everything seems to be working except when I start editing in row #1 from the top and then click on a button in any other row the button in the first row does not change its icon.
    It has been already days of work trying figuring out what is so special in the row #1. No luck. Please help.
    Thank you.

    I am implementing the datagrid that only redraws and refreshed the cells that are updated insted of refreshing the whole datagrid.
    There is already and example  on MX Datagrid which refreshed only particular cells. Here is the link http://blogs.adobe.com/tomsugden/2010/04/optimizing_the_flex_datagrid_f.html . we can test it by launching application, right click on the application and select "Show redraw regions"
    I have the similar requirement (updating only the refreshed cells, insted of whole datagrid) but I want this feature in Spark Datagrid.
    (similar  one on spark is in this link http://hansmuller-flex.blogspot.com/2011/07/high-performance-christmas-tree.html)
    I am using the prepare method, but still the functionality is not working. When I right click and select show redraw regions. The whole daatgrid is redrawn instead of particular cells.
    override public function prepare(hasBeenRecycled:Boolean):void  {

  • Questions/comments on "How to Use BC4J HTML Field Renderers"

    BTW thanks for getting this HOWTO on custom renderers up. Good stuff. Probably one of the first things someone should read after getting past the first BC4J-JSP tutorial.
    But after having just read it, I have some questions and comments.
    What would be the best way to localize the YES|NO values from the first example? I know I can create property files for resource bundles and get the values from there, but where do I get the users Locale? And given that BC4J has a place for localized field labels, is there some better place (for JDev/BC4J integration) than going off and creating my own property files?
    I was hoping to see examples of actually writing the HTML so I can add properties for validation, etc. The examples were about custom data for the renders rather than custom HTML. I assume that I just output HTML in the renderToString() method and it would just start with "<select" or "<input" not TDs or spans or anything, right? But in such cases, what can I extend / not extend? In the case of lists, I would have to handle all the different control types, right?
    I am confused on control types. There's a control type on the control hints tab and in the HOWTO creates a new propery called MY_CONTROL_TYPE. Why? How do they relate? (and is that question about the RADIOGROUP suppose to be in the HOWTO doc?)
    Can we not get the list control types as options on control hints tab? Or if we are creating our own renders, say for a boolean, I could create different renderers for the different control types (checkbox, select, radio, maybe selectYesNo, selectTrueFalse,...) or create one with a control type setting for them all. Which should I do when? And is there a way to expose these control types in the control hints tab?
    BTW do these custom renders work the same in UIX-JSP and UIX-XML?
    Since we are extending Oracle's classes we need more complete JavaDocs, not just the public methods. For example the HOWTO uses "ds" from PickList. BTW I have to give my opinion on Java style, maybe consider coding like "this.ds" for clarity. But anyway....
    thanks for all the help!

    Some comments:
    1. the provided renderers read the properties every time becuase they are meant to be 'generic' and there are possible parameter differences between one attribute and another. You can easily hard-code the property values into the renderer implementation and 'never' look at the properties for parameters. The same applies for the dynamic renderer.
    2. The set of renderers applis to both UIX JSP and JSP. There some bugs in the UIX JSP that prevent this in 9.0.2, but they will be fixed in Jdev 9.0.3.
    3. The 'control type' is a shortcut way to select some of the default renderers. If you specify the 'Renderer' properties, they take precedence over any control types selected at design-time.
    4. A cool way to re-use renderers is to create a new domain class and setup the renderer properties at that level. You can then use tihs domain type in your entity objects. all the rendering selection will happen automatically.
    5. You can retrieve the current locale by using the ApplicationModule.getSession().getLocale() , make sure you use this method instead of the default locale since a single web application may be used by different users with different locale settings. We take the http locale information and map it into the application module's locale. If you need locale specific values, use resource bundles.

  • Restrict all the text in a datagrid input without having to create custom item renderers

    Is there a way to restrict all the text in a datagrid input
    without having to create custom item renderers for each
    column?

    How are you trying to restrict it? If you're trying to
    restrict it uniformly, for example, to entirely numerical inputs,
    then the easiest way I know of to do so is with an itemEditor. You
    can just add the same itemEditor to each column that way.
    This only saves work over custom renderers if you're trying
    to restrict multiple columns in the same manner, but for numeric
    only tables, it's pretty short.
    You could probably also do it with itemEdit and
    itemEditBeginning events, but that would likely be more work then
    simply declaring a single global itemEditor and using it in all
    your columns.

  • Is it OK to re-use 1 instance of editors and renderers?

    Hi,
    The simple version of the question, is can I make 1 instance of my custom cell editor and cell renderer classes and safely use it in all my JTable instances?
    For example, I have a DateRenderer class, and instantiate it in a static member, and use it in all Date columns and tables, many of which will be instatiated at one time. If a column needs a non-default format, then I guess I'd create a special instance for it, other wise it would use the default instance.
    It seems to be OK so far, but but my program hasn't received any serious usage yet.
    As to why, I'm thinking this way, I've been messing around with CellEditors and renderers and despite wanting to use default functionality whenver possible, I find that I'm using custom versions for every situation... so if possible, I'd like to keep the number of instances to a minimum.
    Regards
    Iain

    OK, I see what you mean.
    Stop cell editing on focus lost isn't the default behaviour, but I've had to use it anyway (it seems to make sense).
    The reason I asked is that, to get the behaviour that I want, it looks like I'll have to have my custom renderers and editors on every column of every table so I'd like to avoid unneccessary instantiation.
    I'm aiming for a system where:
    - 1 click selects the row (default behaviour),
    - 2 clicks starts editing the cell (also default),
    - but tabbing or pressing enter after editing a cell keeps you in editing mode.
    I don't suppose that many people here have had experience with this, but entering Japanese (and presumably other non ascii type character sets) using MS's IME doesn't work very well with the standard JTable behaviour. If you don't double click, the entered japanese text appears in a little IME window somewhere on the screen (no neccessarily near the editing cell) and just gets lost when you press enter. You have to double click every time, and I can't see the users accepting that.
    I'll be investigating this over tme, and hopefully will be able to get it working smoothly.
    Thanks,
    Iain

  • 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

  • Custom combobox problem

    Hi,
    With the help of JDC i am able to finish the work of creating the customized comobo but I'm stuck at the edge.
    I have a customized comobobox, which can show multiple columns in its combo popup, but only one item of column should be shown as selected in combo, This i achieved when combobox status is editable. but not working when combo is non editable.
    kindly see( can execute too ) the code and let me know where i'am going wrong.
    public class TestCoeusComboBox2 extends javax.swing.JFrame {
    /** Creates new form TestCoeusComboBox2 */
    public TestCoeusComboBox2() {
    initComponents();
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    //jPanel1.setLayout( new java.awt.GridLayout(2,4,10,10));
    jPanel1.setLayout( new java.awt.FlowLayout());
    java.util.Vector people = new java.util.Vector();
    for( int i= 0 ; i< 15 ; i++ ){           
    people.add(new ComboBoxBean(""+i,"Yaman kumar-"+i));
    javaEditable = new javax.swing.JLabel("java-Editable");
    javaNonEditable = new javax.swing.JLabel("java-NON Editable");
    coeusEditable = new javax.swing.JLabel("Coeus - Editable ");
    coeusNonEditable = new javax.swing.JLabel("Coeus - NON Editable");
    coeusComboEditable = new CoeusComboBox(people,true);
    coeusComboEditable.setPopupSelectionBackground(Color.yellow);
    coeusComboEditable.setPopupBackground(Color.white);
    coeusComboNonEditable = new CoeusComboBox(people,false);
    coeusComboNonEditable.setPopupSelectionBackground(Color.gray);
    coeusComboNonEditable.setPopupBackground(Color.white);
    javaComboEditable = new javax.swing.JComboBox(people);
    javaComboEditable.setEditable(true);
    javaComboNonEditable = new javax.swing.JComboBox(people);
    javaComboNonEditable.setEditable(false);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    jPanel1.setPreferredSize(new java.awt.Dimension(1000, 200));
    jPanel1.add(javaEditable); jPanel1.add(javaComboEditable);
    jPanel1.add(javaNonEditable); jPanel1.add(javaComboNonEditable);
    jPanel1.add(coeusEditable); jPanel1.add(coeusComboEditable);
    jPanel1.add(coeusNonEditable); jPanel1.add(coeusComboNonEditable);
    getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
    pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new TestCoeusComboBox2().show();
    private javax.swing.JPanel jPanel1;
    private CoeusComboBox coeusComboEditable;
    private CoeusComboBox coeusComboNonEditable;
    private javax.swing.JComboBox javaComboEditable;
    private javax.swing.JComboBox javaComboNonEditable;
    private javax.swing.JLabel javaEditable;
    private javax.swing.JLabel javaNonEditable;
    private javax.swing.JLabel coeusEditable;
    private javax.swing.JLabel coeusNonEditable;
    * @(#)CoeusComboBox.java 08/29/2002, 5:06 AM
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.plaf.metal.*;
    import javax.swing.event.*;
    import java.util.Vector;
    import javax.swing.border.*;
    public class CoeusComboBox extends JComboBox {
    private boolean editable = false;
    private Color popupSelBackground ;
    private Color popupBackGround;
    * Initializes the properties of CoeusComboBox as it needs to set custom Renderers
    * and Editors for CoeusComboBox
    private void initProperties(){       
    CoeusComboBoxRenderer renderer= new CoeusComboBoxRenderer();
    CoeusComboCellEditor editor = new CoeusComboCellEditor();
    setBorder(new LineBorder(Color.black,1));
    setRenderer(renderer);
    setEditor(editor);
    //setEditable(true);
    /** Creates a new instance of CoeusComboBox */
    public CoeusComboBox() {
    super();
    setUI(new StateComboBoxUI());
    initProperties();
    * Constructor with default ComboBoxModel
    public CoeusComboBox(ComboBoxModel aModel) {
    super(aModel);
    setUI(new StateComboBoxUI());
    initProperties();
    * Constructor with default items that are shown in popup when the combo is selected
    public CoeusComboBox(final Object[] items) {
    super(items);
    setUI(new StateComboBoxUI());
    initProperties();
    * Constructor with default items that are shown in popup when the combo is selected
    * @param items An array of elements that are shown in popup
    * @param editable Status of ComboBox, If true the combobox value can be modified.
    public CoeusComboBox(final Object[] items, boolean editable) {
    super( items);
    this.editable =editable;
    setEditable(editable);
    setUI(new StateComboBoxUI());
    initProperties();
    * Constructor with default items that are shown in popup when the combo is selected
    * @param items a Vector of combobox items.
    public CoeusComboBox(Vector items) {
    super(items);
    setUI(new StateComboBoxUI());
    initProperties();
    * Constructor with default items that are shown in popup when the combo is selected
    * @param items A vector of items that are shown in popup
    * @param editable Status of ComboBox, If true the combobox value can be modified.
    public CoeusComboBox(Vector items, boolean editable){
    super( items);
    this.editable = editable;
    setEditable(editable);
    setUI(new StateComboBoxUI());
    initProperties();
    * Sets combobox Popup Background Color
    * @param color background color of Combobox popup.
    public void setPopupBackground( Color color){
    this.popupBackGround = color;
    * Sets combobox Popup Selection Background Color
    * @param color Selected Item background color of Combobox popup.
    public void setPopupSelectionBackground( Color color){
    this.popupSelBackground = color;
    * Sets the Status(Editable/NonEditable) of combobox, Based on which the combo
    * value can be changed. Default is not editable
    * @param flag If true the combobox is editable.
    // public void setEditable( boolean flag){
    // editable = flag;
    * An inner class to set the Default renderer for CoeusComboBox. As this combobox
    * can show multiple columns in combo popup, so add number columns to this panel, like
    * that as many as number panel will be added to panel as many items available in combobox.
    * that is rendered in every cell.
    class CoeusComboBoxRenderer extends JPanel implements ListCellRenderer {
    private JLabel left;
    private JLabel right;
    private JLabel middle;
    * Constructor to set the layout and border for this panel.
    public CoeusComboBoxRenderer() {
    //setLayout(new GridLayout(1, 2,0,0));
    BoxLayout boxLayout =new BoxLayout(this,BoxLayout.X_AXIS);
    setLayout( boxLayout);
    setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    left = new JLabel();
    middle= new JLabel();
    right = new JLabel();
    add(left);
    add(middle);
    add(right);
    * An overridden method to render this component in desired cell.
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    if (isSelected) {
    if(popupSelBackground == null ){
    popupSelBackground = list.getSelectionBackground();
    setBackground(popupSelBackground);
    setForeground(list.getSelectionForeground());
    } else {
    if( popupBackGround == null){
    popupBackGround = list.getBackground();
    setBackground(popupBackGround);
    setForeground(list.getForeground());
    if( value instanceof ComboBoxBean ){
    ComboBoxBean comboBoxBean = (ComboBoxBean) value;
    left.setText(comboBoxBean.getCode());
    middle.setText(" ");
    right.setText(comboBoxBean.getDescription());
    return this;
    }// end of CoeusComboBoxRenderer class
    * An inner class to set the editor of CoeusComboBox when it gets focus and about to be
    * selected by the user
    class CoeusComboCellEditor extends javax.swing.plaf.basic.BasicComboBoxEditor {
    public CoeusComboCellEditor() {
    super();
    System.out.println(" editable "+editable);
    editor.setEditable(true);
    //editor.setBackground(editorSelBackground);
    }// end of CoeusComboCellEditor
    }// end of CoeusComboBox
    * @(#)StateComboBoxUI.java 08/20/2002 9:21 AM
    import javax.swing.plaf.basic.*;
    import javax.swing.*;
    public class StateComboBoxUI extends BasicComboBoxUI{
    * Creates the ComboBox popup that is displayed when the implemented combobox is selected.
    * As in Basic LAF the combobox does not provide the horizontal scrollbar for popup this
    * method is overridden with that property.
    protected ComboPopup createPopup(){
    BasicComboPopup popup = new BasicComboPopup(comboBox){
    protected JScrollPane createScroller() {
    return new JScrollPane( list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED );
    }//end of method createScroller
    return popup;
    }//end of method createPopup
    * The Class is used to populate any combo box
    public class ComboBoxBean implements java.io.Serializable{
    private String code;
    private String description="";
    /** Default Constructor */
    public ComboBoxBean() {
    /** Constructor with parameters */
         public ComboBoxBean(String code, String description) {
                   this.code = code;               this.description = description;
    * This method gets the Code
    * @return String code
    public String getCode() {
    return code;
    * This method sets the Code
    * @param String code
    public void setCode(String code) {
    this.code = code;
    * This method gets the Description
    * @return String description
    public String getDescription() {
    return description;
    * This method sets the Description
    * @param String description
    public void setDescription(String description) {
    this.description = description;
    public String toString(){
    return getDescription();

    Gregor,
              As an alternative way i did take "selectedItem" away from MXML and used it on "creationComplete". But not i am running in to different problem which i am going to open as new discussion.
    Between i have documented this issue on my blog @ http://www.srinivaskusunam.com/2009/05/13/flex-combobox-selecteditem-problem/
    Thanks,
    Srini

Maybe you are looking for