Custom Table Editor: values are not populated to the model

H,
I wrote a custom table renderer which uses JComboBox + editor, which seem to work (after editing, the displayed cell reflects the change) but after editing the table manually, the model is not altered when i call table.getModel();
The editor part is as simple as
  class MPComboBoxEditor extends DefaultCellEditor {
        private final JComboBox box;
        public MPComboBoxEditor(JComboBox b) {
            super(b);
            this.box = b;
    }The renderer:
public class CellRendererWithMPComboBox extends JLabel implements TableCellRenderer {
    private final Context c;
    private final JTable table;
    private DefaultTableCellRenderer rend = new DefaultTableCellRenderer();
    private JLabel label = new JLabel();
    public CellRendererWithMPComboBox(Context c, JTable table) {
        super();
        this.c = c;
        this.table = table;
     * Set this renderer to the given column
     * @param column
    public void setRendererTo(int column) {
        TableColumn col = table.getColumnModel().getColumn(column);
        col.setCellEditor(new JComboBoxEditor(JComboBox(<some values>)));
        col.setCellRenderer(this);
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        if (hasFocus && isSelected) {
            if (isSelected) {
                setForeground(table.getSelectionForeground());
                super.setBackground(table.getSelectionBackground());
            } else {
                setForeground(table.getForeground());
                setBackground(table.getBackground());
             label.setText((value == null) ? "" : value.toString());
            return label;
        } else {
            label.setText((value == null) ? "" : value.toString());
            return label;
    }the model simply extends DeafultTableModel to get formatted numbers.
    @Override
    @SuppressWarnings("unchecked")
    public Object getValueAt(int row, int column) {
        Object o = super.getValueAt(row, column);
        Class t = getColumnClass(column);
        if (!t.getName().equals("java.lang.Object")) {
            if (o != null && (t.isAssignableFrom(Double.class) ||
                    t.isAssignableFrom(double.class) ||
                    t.isAssignableFrom(float.class) ||
                    t.isAssignableFrom(Float.class))) {
                return FormatNumber.formatDezimal(Double.valueOf(o.toString()));
            } else {
                return o;
        } else {
            return o;
    }Do i need to override some setValueAt method in the editor/renderer or something?
Thanks one more time!
Regards,
Andreas

I don't see any getModel() in your code extract. If the renderer renders it right after edition, then the value is probably correct in the model.
Also, remember [this thread|http://forums.sun.com/thread.jspa?threadID=5396048], where it appeared you were not clear about which model you were looking at.
Do i need to override some setValueAt method in the editor/renderer or something?No. But have you overridden the model's setValueAt?
Edited by: jduprez on Jul 15, 2009 4:56 PM

Similar Messages

  • Values are not populating...

    After selecting the data from LOV the values are not populating in the respective fields.
    i've checked the 'LOV' no problem in that,but im think below coding have a problem.
    declare
         b boolean;
    begin
         :global.job:=null;
         clear_form(no_validate);     
         b:=show_lov('view');
         :GLOBAL.ADDNEW1:=0;
    --     go_block('JOB_CARD_MAIN');
         GO_ITEM('JOB_CARD_MAIN.BRANCH_CODE');
         set_block_property('job_card_main',default_where,'job_no='||chr(39)||:job_card_main.job_no||chr(39));
         execute_query(no_validate);------after this line get execute the values get disappear from the field
         insert into da.mylog(username,tname,mdate,oper) values(user(),'Job Creation',sysdate,'S');
         commit;
    end;
    Pls help..

    Which trigger do you have this code in? I'm guessing it is a Key-ListVal trigger.
    Have you tested the WHE RE clause in SQL*Plus to ensure it returns a record set? Most likely, the query returns no rows which could explain why the block is empty. Also, why are you clearing the entire Form instead of just the JOB_CARD_MAIN data block? Perhaps you should try:
    Go_Block('JOB_CARD_MAIN');
    Clear_Block(NO_VALIDATE);Also, the EXECUTE_QUERY built-in does not have a NO_VALIDATE parameter. It only supports the following parameters:
    ALL_RECORDS
    FOR_UPDATE
    or the combination of the two (ALL_RECORDS,FOR_UPDATE). It also allows you to set the Locking mechinism by passing the parameter NO_WAIT.
    Just a suggestion, try your query in SQL*Plus to make sure it produces a record set and Comment out all the extra stuff in your code and only keep the SHOW_LOV, CLEAR_BLOCK, SET_BLOCK_PROPERTY and EXECUTE_QUERY to see if a row is returned. If yes, then add the rest of your code back one line at a time.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Custom field values are not storing in the data base

    Hi Friends,
    We have created one  Custom field called   ZZ_APPROVER in Rfx Header , we have included this field in the below  stuctures
    1.INCL_EEW_PD_HEADER_CSF_BID
    2.INCL_EEW_PD_HEADER_CSF
    The data type of this field ( ZZ_APPROVER ) is CHAR and the length is 1 .  we have given 2  fixed values in Value Range
    1 -
    X+2 Approver
    2 --- Provisional Approver
    so when we select either 1 or 2 ( in Drop Down ), its displaying properly on RFx Screen, but when we try save this document the values are not strong in the data base.
    Can any one give me idea why its not stroring in the data base
    Thanks in Advance
    Kumar Srini

    Hi Ganapathy,
    A Record is created in table BBP_PDHSC , for other z fields, the values are stroing , but for this field ( ZZ_APPROVER ) [ drop down list ], the value is not stroring
    Thnx
    Kumar Srini

  • Report Painter values are not populating for a particular cost center

    Report Painter(GR55) values are not populating for a particular cost center for the months of April 1 2011 where as for May onwards values are displaying correctly..We have check the transaction code KSB1 for this cost center there are some values posted for the period of April..
    Can any one help me to find out where exactly the issue is and how to resolve the same..

    Please check your variables in your report.

  • Custom propertie's values are not updated for workflow metadata

    Hi,
    I've a requirement where I need to add and update some properties. to /etc/workflow/instance/<Instancename>/data/metadata node.
    I've two workflow Process steps,
    Process step 1:
        Adds some properties to metadata.
    Process step 2:
        Updates the propertie's values which are added in Process step 1.
    But the issue is update is not working when the node is /etc/workflow/instance/<Instancename>/data/metadata.
    i.e. In the step 1, Properties are added to metadata node but In the step 2 propertie's values are not updated to the same node.
    Here is my process code:
    =================================================
    import java.util.Locale;
    import java.util.StringTokenizer;
    import javax.jcr.Node;
    import javax.jcr.Session;
    import org.apache.felix.scr.annotations.Component;
    import org.apache.felix.scr.annotations.Properties;
    import org.apache.felix.scr.annotations.Property;
    import org.apache.felix.scr.annotations.Reference;
    import org.apache.felix.scr.annotations.Service;
    import org.osgi.framework.Constants;
    import javax.jcr.Value;
    import com.adobe.granite.workflow.WorkflowException;
    import com.adobe.granite.workflow.WorkflowSession;
    import com.adobe.granite.workflow.exec.WorkItem;
    import com.adobe.granite.workflow.metadata.MetaDataMap;
    import com.adobe.granite.workflow.exec.WorkflowProcess;
    import com.adobe.granite.workflow.model.WorkflowModel;
    import org.apache.sling.api.resource.ResourceResolver;
    import org.apache.sling.api.resource.ResourceResolverFactory;
    import org.apache.sling.jcr.resource.JcrResourceUtil;
    import org.apache.sling.api.resource.PersistableValueMap;
    import org.apache.sling.api.resource.PersistenceException;
    import org.apache.sling.api.resource.Resource;
    @Component
    @Service
    @Properties({
           @Property(name = Constants.SERVICE_DESCRIPTION, value = "Test"),
           @Property(name = Constants.SERVICE_VENDOR, value = "Adobe"),
           @Property(name = "process.label", value = "Test 1")})
    public class Test1 implements WorkflowProcess
        @Reference
        private ResourceResolverFactory resourceResolverFactory;
              public void execute(WorkItem workItem, WorkflowSession wfsession, MetaDataMap metadata)
                                  throws WorkflowException {
                        System.out.println("Testing");
            try{
                ResourceResolver resolver;
                resolver = resourceResolverFactory.getAdministrativeResourceResolver(null);
                String instancePath = workItem.getWorkflow().getId();
                Node instanceNode=null;
                Session jcrSession = wfsession.adaptTo(Session.class);
               String payload = (String) workItem.getWorkflowData().getPayload();
               //instanceNode=JcrResourceUtil.createPath(payload+"/jcr:content", "nt:resource","nt:resource", jcrSession, true);
                                  instanceNode=JcrResourceUtil.createPath(instancePath+"/data/metaData", "nt:resource","nt:resource", jcrSession, true);
                                  System.out.println("Test: instance PAth:"+instanceNode.getPath());
                Resource resource = resolver.getResource(instanceNode.getPath());
                    if(resource != null)
                        PersistableValueMap valueMap= resource.adaptTo(PersistableValueMap.class);
                        valueMap.put("name", "Rajesh");
                        valueMap.put("id", "A002");
                        valueMap.put("designation","SE");
                        valueMap.save();
                        System.out.println("Name:"+valueMap.get("name"));
                        System.out.println("Id:"+valueMap.get("id"));
                jcrSession.save();
                resolver.close();
            }catch(Exception e)
                System.out.println("Exception:"+e.getMessage());
    ===================
    The code works fine when the node is payload/jcr:content.
    Note : Process 1 and Process 2 code is same expect the values I'm passing to the PersistableValueMap.
    Any pointers would be more helpful..
    Thanks
    Siva

    Is there anything wrong in my code/ it's a bug..  
    Thanks
    Siva

  • Possibele entries are not populating for the fields on the selection screen

    Hi,
    Possible entries are not populating for the fields on the selection screen for the query.But its working fine in Development and Quality Systems.
    Can any body help me out
    Regards,
    Amit.

    Hi,
    In the Selection screen,go to Settings->Value Restrictions tab->Read Mode Settings->Custom radio button and select the options Values in Master Data or Only Values in InfoProv or Only Posted values for navigation.
    After this setting,check whether you are getting the data or not.
    Rgds,
    Murali

  • Billing tab of BP are not populated in the sales order automatically

    Hi
    Business Partners Billing Tab details like customer pricing procedure, currency, price group, Customer group etc are not populated in the Sales order automatically?
    I have checked the pricing procedure determination also.
    Thanks

    Thanks problem is solved.

  • Values are not populated to backing session bean from editable table!

    I have a table which has drop down list and checkbox columns. I binded table row group to an object list and binded selected properties of these columns to corresponding fields of object (#{currentRow.value['selected']}). However selected properties are not passed thru the backing bean. In action method i call the object.getSelected method and it always returns null. I am googling for 2 days but i could not find an obvious solution for this problem. please help! thanks in advance.

    put your bean code here, for resoving your problem with implicit object,

  • Possible Bug with SqlDataAdapter.Fillschema DataColumn.Unique values are not populated.

    Hi all,
    I have done a lot of searching for answer to this problem this evening and so far have not found a solution but have found multiple people with the same issue.
    When using SqlDataAdapter.FillSchema() from a table that contains a Primary Key and columns with Unique constraints the only DataColumn.Unique value to be populated is the Primary Key.
    From reading the MSDN entry for dbDataAdapter this is not the intended functionality
    Can anyone suggest avenues to try or where to raise this issue if the method truly is not functioning as intended?

    Hello HarborneD,
    >>When using SqlDataAdapter.FillSchema() from a table that contains a Primary Key and columns with Unique constraints the only DataColumn.Unique value to be populated is the Primary Key.
    From your description, it is not very clear how your table is defined, I tried to reproduce this issue with below table(not sure if it is similar with yours, if not, please share it with us):
    CREATE TABLE [dbo].[T20141230] (
    [ID] INT NOT NULL,
    [Name] NCHAR (10) NULL,
    [Birthday] DATETIME NULL,
    PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT uc_PersonID UNIQUE ([Name])
    And the code used to full the schema:
    SqlConnection con = new SqlConnection(@"Server=(localdb)\Projects;Database=ADO.NET;Trusted_Connection=True;");
    try
    con.Open();
    SqlCommand cmd = new SqlCommand("select * from [T20141230]", con);
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    DataTable dt = new DataTable();
    da.FillSchema(dt, SchemaType.Mapped);
    da.Fill(dt);
    catch (Exception)
    finally
    con.Close();
    However, I could all columns populated with values from database. I used VS2013, .NET 4.5 and windows 8.1, you could have a try with my demo.
    >>Can anyone suggest avenues to try or where to raise this issue if the method truly is not functioning as intended
    If it is an exact issue which is not reported yet, you could post it to this site below:
    https://connect.microsoft.com/VisualStudio
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Created a trigger but new values are not inserting in the backup table

    I have created a backup table and writter a trigger on a table such that after update old values and new values are to be inserted into the backup table, but new values are not inserting. I am giving the code please help me
    create or replace trigger "SUPPQUOTES_AUDIT"
    after update or delete on phsuppquotes for each row
    begin
    insert into phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values
    (:new.cprc,:old.suppcode,:old.itemcode,:old.cprc,:old.negodt,:old.validdt,:old.userid,SYSDATE);
    end;

    old values and new
    values are to be inserted into the backup table, butwell you have only one insert there, inserting old values with a new id (which is ok if you don't update the id column, but I don't think that :new is available for deleting ops); you should have two inserts:
    insert into
    phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values (:old.cprc,:old.suppcode,:old.itemcode,:old.cprc,:old.negodt,:old.validdt,:old.userid,SYSDATE);
    if (updating) then
    insert into phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values (:new.cprc,:new.suppcode,:new.itemcode,:new.cprc,:new.negodt,:new.validdt,:new.userid,SYSDATE);
    end if;
    gojko adzic
    http://gojko.net

  • Table control values are not able to read with out a user action.

    Hi All,
    I am working with a module pool programing and I am calling 3 sub screens into my main normal screen.
    In one of the sub screen, I have created a table control and getting the initial values from database and displaying.
    Now I try to change the couple of fields in my table control and with out user action (not pressing Enter after changing the values in table control).
    I try to save the edited/changed values in table control into the database. But I am not able to do so, since the change values are not able to pick.
    My requirement is end user will not do any action(press the enter key ) and he directly presses the save button which is defined in the main normal screen.
    Kindly suggest some solution.
    Thanks
    Geetha

    Hi Geetha,
                    in SAP Default While pressing save button the modified value will pick up because
    Save button will perform enter function also.
    Regards,
    Thangam.P

  • Measure Values are not shown in the pivot tables

    Measures without aggregation (in rpd) are not shown in pivot table.
    Im trying to add multiple columns in the fact table as measures,one which is summable had has the SUM function and three which are not summable.
    The initial report will be as follows and I have been able to get the data displayed.
    Year | Month| Company Name| SUM(C1)| C2|C3
    However if I pivot the table as follows data in column C2 and C3 are not Displayed.
    Columns
         Year     
              Month     
              Company     
    Rows                    
    Measure Lablel                    
    Measures
         SUM(C1)     
                   C2     
                   C3                    
    Should we have an aggregation rule applued in C2 and C3 ?

    Yes, all the column entries must have agg rule. You can specify one such as 'first' in the pivot table.

  • PDF file opening with blank fields - the field values are not populated.

    Recently, our users have been facing this issue, "data not populating in the PDF fields".
    We are using FDF in PHP to load the PDF templates and apply the data to the PDF fields. This works fine on many adobe versions but showing empty fields in few adobe versions. For e.g It worked fine with Adobe Reader 10.1.3 but did not work in 11.0.
    This has been critical now as it is showing empty fields in IE11. Can you please help me overcome this issue.
    Thanks!

    All I can suggest is to try the latest Reader versions, i.e. 10.1.11 or 11.0.8.

  • Values are not populating into Custom Context..

    Hi,
    Currently we are in CRM 2007(6.0), recently upgraded from SP 5 to SP 7. After upgrade one of the custom control is NOT getting populated with the values. When I click on the button, it's idsplaying CRM_UI_FRAME/WorkAreaViewSet on top of the window i.e. TITLE area. Iit's dispalying empty vlaues in 'display' mode. It supposed to display actual values. Before upgrade version it's working fine.
    I am new to CRM BOL, and not sure where to start and how to validate the functionality and where exactly the issue is? IT would be great if some one can help..and provide steps to analyse the issue. Thanks in Advance..

    Hi Mady_kris,
    If you turn on the following flag does it help?
    'Display Duplicate Variables Only Once' box in the
    workboox settings.
    thanks
    Orla.

  • Urgent:-Values are not inserted into the custom table

    Hi, I am inserting the data from the custom OAF form into a custom table. Only the WHO columns are populated into the table but no field value is populated into the custom table. I have written the following code -
    In CO
    if (pageContext.getParameter("Continue") != null)
    OAApplicationModule am = pageContext.getRootApplicationModule();
    OAViewObject CwkInfo = (OAViewObject)am.findViewObject("CWKInfoVO1");
    am.invokeMethod("initializevo");
    in AM
    public void initializevo()
    CWKInfoVOImpl testVo = (CWKInfoVOImpl) this.getCWKInfoVO1();
    testVo.insertRow(testVo.createRow());
    getTransaction().commit();
    Urgent Help is required.
    Regards,
    Ashish

    Hi Ashish,
    Double check whether you have attached the correct EO based VO attribute to the columns.
    In the Controller
    Process Request use the following code:-
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (!pageContext.isFormSubmission())
    am.invokeMethod("initQuery", null);
    ProcessForm Request
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    System.out.println("Inside Process Form Request");
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("submitButton")!=null)
    am.invokeMethod("submit")
    AM Code
    public void initQuery()
    OAViewObject vvo = (OAViewObject)getEmployeeEOVO1();//Give you EO based VO Name
    if (!vvo.isPreparedForExecution())
    vvo.executeQuery();
    Row row = vvo.createRow();
    vvo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void submit()
    getTransaction().commit();
    Import necessage classes.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Is there any way to get keywords to show up in grid view?

    Being able to see the keywords assigned to each photo in grid view would be incredibly helpful to me for managing my photos and videos as I add new keywords.  Just seeing the "this photo has keywords" tag does not help.  I need to see the actual keyw

  • Photoshop CC 2014 Crashes on Startup

    Hi, i have just finishing installing Adobe CC 2014, all application works perfect beside Photoshop.. one opening the software it crashes down and i dont know what seems to be the problem.. i am using MS Windows 8.1 64bit. once entering the Event Log

  • SQL Server Error 3930

    Hi Everyone, I am getting the following error while inserting rows in a table "Unexpected error: 3930-"The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction." The table has an

  • Creating new/ modifying existing interco mismatch report

    Can someone help me understand how I can modify an existing interco mismatch report or create a new one in HFM? I am familiar with financial reporting studio but that does not not seem to be where you work with mismatch reports. Any help would be gre

  • Notifications from IDoc processing not working right

    I am having a problem where the IDoc error notifications are appearing in everyone's inboxes. I followed the instructions in SAP notes 44416 & 116610. If the tasks are set as general tasks, they go to everyone. If they are not general tasks, they go