JDev Team - how to add a Data Aware Control to grid control

The default editor for GridControl cells is a data-aware TextField, but I want to use a ComboBoxControl. If I use the setEditor() method of the TableColumn, the cell is edited using a combo, but there are problems:
1. Navigated events do not fire when focus is moved in or out of the cell and
2. When focus moves to another cell in the same column, the cell losing focus is blanked.
How can I setup/attach a custom editor based on a Data Aware Control to avoid these problems?
The code I am using
1. declares combobox controls to be used with grid as member variables of my frame class
ComboBoxControl comboBoxSrcSystem = new ComboBoxControl();
ComboBoxControl comboBoxSrcSysVersion = new ComboBoxControl();
ComboBoxControl comboBoxSrcTable = new ComboBoxControl();
ComboBoxControl comboBoxSrcColumn = new ComboBoxControl();
2. sets up the combo in the jbInit method of the frame class :
// for gridControlMapRuleSrcCols column SystemName
comboBoxSrcSystem.setListKeyDataItemName("infobus:/oracle/sessionMapTool/rowSetSystemCombo/SystemName");
comboBoxSrcSystem.setListValueDataItemName("infobus:/oracle/sessionMapTool/rowSetSystemCombo/SystemName");
comboBoxSrcSystem.setDataItemNameForUpdate("infobus:/oracle/sessionMapTool/rowSetMapRuleSrcCols/SystemName");
3. In the frame constructor calls a method to add combos to the grid
addMapSrcColGridCombos();
which is defined as
private void addMapSrcColGridCombos() {
// add combos to gridControlMapRuleSrcCols grid
JTable mapSrcColTable = gridControlMapRuleSrcCols.getTable(); // access the JTable
addComboEditor( mapSrcColTable, "SystemName", comboBoxSrcSystem );
addComboEditor( mapSrcColTable, "SystemVersion", comboBoxSrcSysVersion );
addComboEditor( mapSrcColTable, "TableName", comboBoxSrcTable );
addComboEditor( mapSrcColTable, "ColumnName", comboBoxSrcColumn );
4. It makes use of the following method:
private void addComboEditor( JTable table, String colName, ComboBoxControl combo )
TableColumn col = table.getColumn(colName);
col.setCellEditor( new DefaultCellEditor( combo ) );
null

Given the usual deafening silence from the JDev team, I'll post my resolution of the problem.
I could not find a way of creating an editor directly from a ComboBoxControl which would behave properly in a GridControl. However, JComboBox does work, so I
1. add a Navigated listener to the GridControl
2. in the navigatedInColumn event handler I create a JComboBox from a ScrollableRowsetAccess and
3. use it to create a custom CellEditor for the target column.
(I also remove the editor in the currently focused column in the navigatedOutColumn, but I don't think this is strictly necessary.)
This solution also works after a Rollback, when the columns of the gridcontrol are reset/rebuilt, and handles dynamic combos that are dependent on the current row values.
Unfortunately, unlike ComboBoxControl JComboBox does not allow for a key/value mapping, so the combo editor can only display the values to selected from, not a user-friendly label.
I attach some code snippets to illustrate the solution:
1. declare member variables
// declarations for Custom Grid Editors
NavigationManager navMgr = NavigationManager.getNavigationManager();
static String SYS_NAME_COL_NAME = "SystemName";
static String SYS_VER_COL_NAME = "SystemVersion";
static String TAB_NAME_COL_NAME = "TableName";
static String COL_NAME_COL_NAME = "ColumnName";
RowSetInfo rowSetSystemCombo = new RowSetInfo();
AttributeInfo SystemNamerowSetSystemCombo = new AttributeInfo();
ScrollableRowsetAccess sysNameComboRS = (ScrollableRowsetAccess)rowSetSystemCombo.getRowsetAccess();;
static ImmediateAccess sysNameComboIA = SystemNamerowSetSystemCombo.getImmediateAccess();
static RowSetInfo rowSetMapTgtColTableCombo = new RowSetInfo();
static AttributeInfo TableNamerowSetMapTgtColTableCombo = new AttributeInfo(java.sql.Types.VARCHAR);
static ScrollableRowsetAccess tgtTabNameComboRS = (ScrollableRowsetAccess)rowSetMapTgtColTableCombo.getRowsetAccess();;
static ImmediateAccess tgtTabNameComboIA = TableNamerowSetMapTgtColTableCombo.getImmediateAccess();
2. in jbInit() set up the combo rowsets (use Design mode)
SystemNamerowSetSystemCombo.setName("SystemName");
rowSetSystemCombo.setAttributeInfo( new AttributeInfo[] {
SystemNamerowSetSystemCombo} );
rowSetSystemCombo.setQueryInfo(new QueryViewInfo(
"SystemComboView",
rowSetSystemCombo.setSession(sessionMapTool);
rowSetSystemCombo.setName("rowSetSystemCombo");
SystemVersionrowSetMapSrcColSysVersionCombo.setName("SystemVersion");
rowSetMapSrcColSysVersionCombo.setAttributeInfo( new AttributeInfo[] {
SystemVersionrowSetMapSrcColSysVersionCombo} );
rowSetMapSrcColSysVersionCombo.setQueryInfo(new QueryViewInfo(
"SourceSystemVersionComboView",
"SYSTEM_VERSION DESC"));
rowSetMapSrcColSysVersionCombo.setMasterLinkInfo
(new ViewLinkInfo(rowSetMapRuleSrcCols,"MapTool.MapRuleSrcColSysVersionComboLink"));
rowSetMapSrcColSysVersionCombo.setSession(sessionMapTool);
rowSetMapSrcColSysVersionCombo.setName("rowSetMapSrcColSysVersionCombo");
TableNamerowSetMapSrcColTableCombo.setName("TableName");
rowSetMapSrcColTableCombo.setAttributeInfo( new AttributeInfo[] {
TableNamerowSetMapSrcColTableCombo} );
rowSetMapSrcColTableCombo.setQueryInfo(new QueryViewInfo(
"SourceTableComboView",
"TABLE_NAME"));
rowSetMapSrcColTableCombo.setMasterLinkInfo
(new ViewLinkInfo(rowSetMapRuleSrcCols,"MapTool.MapRuleSrcColTableComboLink"));
rowSetMapSrcColTableCombo.setSession(sessionMapTool);
rowSetMapSrcColTableCombo.setName("rowSetMapSrcColTableCombo");
ColumnNamerowSetMapTgtColColumnCombo.setName("ColumnName");
rowSetMapTgtColColumnCombo.setAttributeInfo( new AttributeInfo[] {
ColumnNamerowSetMapTgtColColumnCombo} );
rowSetMapTgtColColumnCombo.setQueryInfo(new QueryViewInfo(
"TargetColumnComboView",
"column_name"));
rowSetMapTgtColColumnCombo.setMasterLinkInfo
(new ViewLinkInfo(rowSetMapRuleTgtCols,"MapTool.MapRuleTgtColColumnLink"));
rowSetMapTgtColColumnCombo.setSession(sessionMapTool);
rowSetMapTgtColColumnCombo.setName("rowSetMapTgtColColumnCombo");
3. add methods to handle the Navigated events (use Design mode to ensure add listener code
is generated)
void gridControlMapRuleSrcCols_navigatedInColumn(NavigatedEvent e) {
debug("gridControlMapRuleSrcCols_navigatedInColumn");
show_nav_info();
String dataItemName = navMgr.getTargetDataItemName();
String columnName = dataItemName.substring(dataItemName.lastIndexOf("/")+1);
JTable table = gridControlMapRuleSrcCols.getTable();
if ( SYS_NAME_COL_NAME.equals( columnName)) {
addComboEditor( table, columnName, dbMapTool.sysNameComboRS, dbMapTool.sysNameComboIA );
else if ( SYS_VER_COL_NAME.equals( columnName)) {
addComboEditor( table, columnName, dbMapTool.srcSysVerComboRS, dbMapTool.srcSysVerComboIA );
else if ( TAB_NAME_COL_NAME.equals( columnName)) {
addComboEditor( table, columnName, dbMapTool.srcTabNameComboRS, dbMapTool.srcTabNameComboIA );
else if ( COL_NAME_COL_NAME.equals( columnName)) {
addComboEditor( table, columnName, dbMapTool.srcColNameComboRS, dbMapTool.srcColNameComboIA );
void addComboEditor
( JTable table
, String colName
, ScrollableRowsetAccess rs
, ImmediateAccess ia
// note must get TableColumn afresh each time because when grid is reset
// on rollback the Table ColumnModel is rebuilt
TableColumn tc = table.getColumn(colName);
debug("add JComboBox as editor");
Vector v = new Vector();
try {
// Retrieve and store values for JComboBox using the InfoBus API.
boolean moreRows = rs.first();
while (moreRows) {
// stores value in vector
v.addElement(new String(ia.getValueAsString()));
moreRows = rs.next();
// make column Cell Editor a JComboBox with retrieved values
tc.setCellEditor(new DefaultCellEditor(new JComboBox(v)));
catch (Exception e0) {
e0.printStackTrace();
void show_nav_info() {
debug( "Focused Data Item = " + navMgr.getFocusedDataItemName() );
debug( "Target Data Item = " + navMgr.getTargetDataItemName() );
void debug(String s)
System.out.println(s);
void gridControlMapRuleSrcCols_navigatedOutColumn(NavigatedEvent e) {
debug("gridControlMapRuleSrcCols_navigatedOutColumn");
show_nav_info();
String dataItemName = navMgr.getFocusedDataItemName();
String columnName = dataItemName.substring(dataItemName.lastIndexOf("/")+1);
JTable table = gridControlMapRuleSrcCols.getTable();
if ( SYS_NAME_COL_NAME.equals( columnName)) {
removeComboEditor(table, columnName);
else if ( SYS_VER_COL_NAME.equals( columnName)) {
removeComboEditor( table, columnName );
else if ( TAB_NAME_COL_NAME.equals( columnName)) {
removeComboEditor( table, columnName );
else if ( COL_NAME_COL_NAME.equals( columnName)) {
removeComboEditor( table, columnName );
void removeComboEditor ( JTable table, String colName ) {
debug("remove JComboBox as editor");
TableColumn tc = table.getColumn(colName);
tc.setCellEditor(null);
4. Note that when navigated event code is added through the designer, jbInit() is
amended to add a Navigated Listener to the grid
gridControlMapRuleSrcCols.addNavigatedListener(new oracle.dacf.control.NavigatedAdapter() {
public void navigatedInColumn(NavigatedEvent e) {
gridControlMapRuleSrcCols_navigatedInColumn(e);
public void navigatedOutColumn(NavigatedEvent e) {
gridControlMapRuleSrcCols_navigatedOutColumn(e);
null

Similar Messages

  • How to add the date field in the dso and info cube

    Hi all.
    I am new to bi 7. in the earlier version v hav to button to add the date field. but in the bi 7 der is no option so can any body tell me how to add the date field in the data targets
    Thanks & Regard
    KK

    my prob is solved
    KK

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • How to add TIMESTAMP data type in  Enterprise Architect...?

    Hi all
    There is no data type of timestamp in Enterprise Architech. There is only
    DATE type. I have ERD prepared from Enterprise Architech. How to modify
    DATE type to TIMESTAMP type.
    How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
    Thanks in advance,
    Pal

    Have you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
    Justin

  • How to add new data file

    Hi Friends,
    We have 4 below file systems.
    Sybase/TST/sapdata_1
    Sybase/TST/sapdata_2
    Sybase/TST/sapdata_3
    Sybase/TST/sapdata_4
    Already we have added one data file each in sapdata_1 and 2.  Sapdata3 and 4 are emptry.
    How to add new data file in sapdata3 or 4.
    Please provide syntax for creating a new data file and steps for the same.
    Regards,
    Karthik.

    Just for the record: you have here the DBACockpit documentation:
    https://websmp201.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700000571562012E
    And this is a sample of the extend to be executed:
    Regards,
    Victoria.

  • How to add the Date Track Button

    How to add the Date Track Button on a customized Form ?
    1. Profile of Datetrack:Enabled = Yes
    2. All HR Forms includes the Date Trak Button
    3. On the Customized Form "Alter Date Track" can be activated from Menu :Tool --> Alter Date Track.
    I'd Like the Button to appear on button ruller.
    Thanks for help

    Rachel,
    Please review the following notes, it may be helpful.
    Note: 177733.1 - How Date Track Works
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=177733.1
    Note: 169059.1 - Understanding the Flow of Date Track Dates Through the Forms
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=169059.1

  • Does anyone know how to Add a date drop down list to a pdf file?

    Can someone tell me how to add a Date drop down list in a form

    There's no built-in function that does that in Acrobat, but there are some third-party tools that do.
    The two most known ones are by FormRouter, which is free and based on form fields (but also a bit buggy), and a non-free version created by Max Wyss, which is based on a dialog object.

  • How to add a date suffix to the log file name

    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.date

    AZ wrote:
    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.datemy best friend name is "google", refer to this [url | http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-usi]
    This is what i did
    1) created a dummy file in c drive
    2) copy pasted below lines, you can play around more with the format
    set _my_datetime=%date%_%time%
    set _my_datetime=%_my_datetime: =_%
    set _my_datetime=%_my_datetime::=%
    set _my_datetime=%_my_datetime:/=_%
    set _my_datetime=%_my_datetime:.=_%3) Rename the file from dos
    ren some.txt dummy_file_%_my_datetime%.txt4) Here goes the output
    C:\dir
    dummy_file_Mon_09_20_2010_161347_21.txt
    Most of the code i copied from above url, you can tweak a little bit based on ur requirement and format.
    Regards
    Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to add a data-source.xml to the project to config DB connections and to be SCM'ed

    I'd like to explicitly manage a data-sources.xml for my JSP + BC4J project.
    Any helps on getting the released Jdev to add a data-source.xml that would then
    be what the .ear deploys to OC4J?
    Thanks, curt

    I have a JSP + BC4J project:
    So far my naive experiments to explicitely add data-sources.xml to a
    project that is picked up by the deploy to .ear step and put in the
    root of the .ear have failed.
    Is this one of those gaps like the orion-application.xml file, that has no
    solution at present?
    Or is the back-door via adding an EJB component to my project, then deleting it??
    Thanks, curt

  • How to add "Prepare Data" from a web service to the form

    Hello,
    Can any one please advise on how to add the "Prepare Data" process from the existing web service and have the form to pre-populate the data from this "Prepare Data" process instead of using schema xsd. I heard that this is an alternative or may be a better way to pre-populate data in ES2/ES3 to avoiding creating a data source in Form Designer. I try to find a sample on Adobe site but could not find one, most of them are using schema.
    Any guidance or URL to the sample would be helpful.
    Thanks,
    HD

    Thanks

  • How to add rows in table control for data recording BDC?

    hello,
    pl tell me the way to upload data through BDC in table control of screen .
    how to add fields inrecording of table control?
    Please give some code in this regard.
    I am generous in giving points..pl help!

    Hi,
    While doing code under recording first you need to do the recording with sample data under a particular transaction like T-code XK01 (Vendor creation).
    Take an example of create vendor using T-code XK01:
    Go to t-code 'SHDB' under make recording for XK01 with sample data and once if you complete the recording means after vendor creation check the source code bye by pressing the button  'Program', it shows the total coding for recording of what you entered the test data.
    Then you will create one program and copy that source code of recording into your program, and now you have to remove the values at perform statement and give the internal table field name.
    Like that you can develop your own code along with your validations.
    my best suggestion is don’t see the example code of recording method because any one for standard t-code should get the code from recording with sample data, so first tryout with your own recording method and you can understand the code step by step.
    With these I hope you will get some idea of recoding method.
    Let me know for further doubts.
    Regards,
    Vijay.

  • How to add PO date and Vendor name in SAP table MB5S

    How do I add PO date field and Vendor name field in SAP table MB5S?? Kindly Help

    As a general recommendation just tell the ABAPer your requirement, don't tell him how to do it.... he probably knows, or should know, better ways of doing something then a functional consultant.
    And please don't tell people to copy standard reports, most of the times there is a BADI, enhancement, or an implicit enhancement spot available. I'm a consultant who can program ABAP (including complex programs), and I've never had to copy a standard program. Ever.
    PS: And no, I didn't have to register the object for modification either.
    EDIT: I went to check the program and you have two explicit enhancement spots to use:
    ENHANCEMENT-POINT read_data_01 SPOTS es_rm07msal - You use this to fill the extra fields of itab;
    ENHANCEMENT-POINT EHP605_RM07MSAL_03 SPOTS ES_RM07MSAL - You use this to enhance the field catalog of the ALV if you are on EhP5, if not create an implicit enhancement on the same stop.
    Current SAP allows enhancements everywhere, copying programs should be forbidden.

  • Compiling form data: how to add FDF data?

    Hi there
    I've created a PDF form and am testing the distribution and compilation process. I created the form in Acrobat. I suspect most of the end users will have Reader, so after having distributed it through the Acrobat wizard (to myself) I filled it in with Reader and sent it back (the FDF file).
    When I open this FDF file from my email application, it doesn't automatically add it to the data set created in the distribution process. Instead it says that the data file cannot be located and asks if I'd like to browse for it. I do so, find it, and the completed form opens in Reader, not Acrobat. I can get around this by ctrl-clicking in Mail and telling it to open with Acrobat.
    However, when I do manage to get the completed form open in Acrobat it does not add the data to the spreadsheet field at the top. If I try to Import Data, the FDF file is greyed out – it wants a PDF. And if I import the FDF by going to Forms > Manage form data > Import data..., it shows the completed form but not the data in the spreadsheet again.
    So, how can I add this FDF data to the data set and get it to display in the spreadsheet area? Alternatively, how can I save this completed form as a PDF (not a data set as happens if I go File > Save) so that I can import that into the data set?
    I hope I've explained it clearly enough! Any help would be appreciated.

    Priya,
    Preview the iview and try shiftright click or ctrlright click and add the additional fields.
    if it doesnot work then you need to customise the code as per the requirements.

  • How to add IPTC data to multiple photos w/o overwriting other data?

    I need to see if there's a way to add IPTC data to one or more fields to mulitple photos without disturbing the other fields' data that's already there. For example, I've keyworded & captioned my images, but now would like to add the City or the Country to all the shots, or a group of shots.
    Conventional Lift & Stamp will override the keyword & caption field info on the stamped images, which I don't want. How to I lift & stamp other select fields? I sure don't want to have to type in the city or country on hundreds/thousands of images!
    Randy
    Power Mac G5, dual 2.5, 2.5 gb   Mac OS X (10.4.4)  

    Thanks for the reply.
    In the Lift & Stamp HUD, under the IPTC heading,
    there's no way to de-select the sub-categories of
    Caption & Kepyword, leaving just State (or other
    fields which don't seem to be even present). One can
    de-select the major categories of Keywords, Caption,
    IPTC, etc. but not the subcategories. This is the
    problem I'm running into -- no way to just add
    additional data in select fields.
    Unless I'm missing something.
    Indeed! Aperture does not make this at all obvious, but with any line highlighted in the Lift & Stamp HUD just hit the "delete" key and that line is gone. If you delete a category (line with a checkbox) the whole category goes, if you expand a category you can delete individual lines, whatever you like. Also very handy for adjustment stamping when you don't want to stamp a clone job, just white balance.
    It remembers what you have removed until you do another Lift.

  • How to add two date format in web i report.

    Hi Every One,
                     I have Fields like Start Date,New Date, Close Date, End date balance.
    that Fields all are in date format like start date(05/05/14), New date(06/05/14),Close date(09/05/14)
    But i need result (start date+new date)-close date=enddate balance .
    How will achieve this requirement in web i please replay me.

    Hi Stefen Jay,
    For suppose, let us assume you have START DATE, NEW DATE and CLOSE DATE as mentioned below.
    And please make sure that all START DATE, END DATE, NEW DATE are in same format.(MM/dd/yyyy)
    Now first you need to add start date and new date. Create a variable
    Start Date & New Date  = RelativeDate([Start Date];DayNumberOfMonth([New Date]))  // Gives 5/11/14 as result.
    And now subtract Close Date from the above result using this formula.
    End Date = RelativeDate([Start Date & New Date];-DayNumberOfMonth([Close Date]))  //Gives 5/2/14 as result.
    Find below screenshot for reference.
    Regards,
    G Sujitha

Maybe you are looking for

  • Transfer Data from BW Server to NON SAP(I2) Server

    Hi Experts I have a requirement where I want to transfer the data from BW Infocube to a Non SAP System (I2). Please let me know the step by step process to accomplish the requirement. Regards Akshay Chonkar

  • Equation Editor (Office 2003) to Office for Mac 2011???

    Thought I was doing OK converting to my Mac and Office 2001 for Mac until I tried to edit an old algebra test done on my old PC and Office 2003.  I can't understand the compatibility suggestions.  I want to update my tests to the newer format.  Do I

  • How to blink jframe title bar?

    hi, i have an application i dont know how to blink the title bar of the frame when it is minimized. I hope you can help me. Thanx in advance.

  • Video/Photo Graphic Problem

    I have two iPhones purchased at the same time (Oct 07) with the same updates (1.1.4). One of the iPhones within the last two days has an issue with video/photo playback. When viewing images/video on the iPhone they appear as if I am viewing them thro

  • I NEED SOME HELP WITH UPDATING MY IPOD TOUCH PLEASE

    i need some help with my ipod the version is 3.1.3 and every time I'm trying to update it says it can not be restored then it says unknown error so i need some help updating my ipod to version 4.2