Strange behavior of JTable..Help plz

Hi,
Assume i have 5 rows in my JTable. I wrote a function on right click i get a popup window with an option delete row, which deletes the row successfully,
The problem is when i sort the data in JTable. on column click JTable is getting sorted, in which assume 2nd row got replaced with 4th row and vice versa.
Now when i try to delete the 4th row, it is delete the 2nd row data, which was there at the place of 4th row before sorting. In this regard i am trying to print the row number before deleting. It is displaying as 4th, but deleting 2nd row.
Hope i am clear. Please suggest me in solving this strange behavior of JTable sorting problem.
Regards,
Ravi

MyTableModel tablemodel = new MyTableModel(colnames,values);
TableSorter sorter = new TableSorter(tablemodel);
JTable table = new JTable(sorter)
tablemodel.removeRow(row); // last line is the code where i am deleting the row, it's deleting the wrong row.
do i need to remove the last line code and make respective changes in TableSorter.java class.
ore
here itself do i need to do some changes. ?
There is a method that will convert the view row to the model row private Row[] getViewToModel()
my question is how TableSorter.java class comes to know that i am deleting the perticular row.

Similar Messages

  • Strange behavior of JTable with TableCellRender.

    Hi, all!
    i am creating a graphic application using Swing. i wanna use a single column table to display list of pictures.
    JScrollPane tablePane = new JScrollPane();
    TableValues tv = new TableValues(TableValues.TYPE_FRAME);
    JTable picTable = new JTable(tv);
    picTable.setCellSelectionEnabled(true);
    TableColumnModel tcm = picTable.getColumnModel();
    TableColumn tc = tcm.getColumn(0);
    tc.setCellRenderer(new PicRender());
    tablePane.setViewportView(picTable);
    this.getContentPane().add(tablePane);
    When i run the code, the JTable seems refreshing the cells at all the time! (And i did not click anything or move the cursor above the table).
    and CPU time runs as high as 99%!
    Please help. Thank you in advance.
    the following is my TableCellRender:
    public class PicRender extends JLabel implements TableCellRenderer {
    static Border selectedBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.magenta, Color.magenta);
    static Border unselectedBorder = BorderFactory.createEmptyBorder();
    static int counter = 0;
    public PicRender() {
    super();
    System.out.println("Creating label");
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
    try {
    TableValues tv = (TableValues) table.getModel();
    BufferedImage image = tv.getPic(row);
    int imageHeight = image.getHeight();
    int imageWidth = image.getWidth();
    Icon icon = new ImageIcon(image);
    //setIcon(icon);
    setText("#" + row);
    setToolTipText(tv.getToolTip(row));
    table.setRowHeight(row, imageHeight + 10);
    setHorizontalAlignment(SwingConstants.CENTER);
    if(isSelected) {
    setBorder(selectedBorder);
    }else{
    setBorder(unselectedBorder);
    catch (Exception ex) {
    setIcon(null);
    setText("Thumbnails N/A");
    System.out.println("Paint: " + row + "\t" + (++counter));
    return this;
    * The following methods copied from Sun's DefaultTableCellRender.java.
    * Overridden for performance reasons.
    public void validate() {}
    public void revalidate() {}
    public void repaint(long tm, int x, int y, int width, int height) {}
    public void repaint(Rectangle r) {}
    protected void firePropertyChange(String propertyName, Object oldValue,
    Object newValue) {
    // Strings get interned...
    if (propertyName == "text") {
    // super.firePropertyChange(propertyName, oldValue, newValue);
    public void firePropertyChange(String propertyName, boolean oldValue,
    boolean newValue) {}

    It is probably related to the fact that you are setting the tables row height in the renderer this will fire a render message when the height changes. One height is applied to all rows of a table. This means that is you have images of different heights you are continually changing the tables row height and therefore continually rendereing.
    My approach would be to have all the images fit into a set size ( say 64*64 ( with scaling if neccesary ) you could then have a popup show the full size image if required.

  • Strange behavior in JTable using JFileChooser as custom editor

    I have an application that I am working on that uses a JFileChooser (customized to select images) as a custom editor for a JTable. The filechooser correctly comes up when I click (single click) on a cell in the table. I can use the filechooser to select an image. When I click on the OPEN button on the filechooser, the cell then displays the editor class name.
    I have added prints to the editor methods and have determined that editing is stopped before the JTable adds the listener. I have looked at the code and have searched doc for examples but have not found what I am doing wrong. Can anyone help?
    I configured the table editor as follows:
    //Set up the editor for the Image cells.
    private void setUpPictureEditor(JTable table) {
    table.setDefaultEditor(String.class, new PictureChooser());
    Below is the code for the JTable editor that I am using:
    package com.board;
    import java.io.*;
    import java.util.Vector;
    import java.util.EventObject;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JFileChooser;
    import javax.swing.JPanel;
    import javax.swing.table.TableCellEditor;
    import javax.swing.event.CellEditorListener;
    import javax.swing.event.ChangeEvent;
    public class PictureChooser extends JLabel implements TableCellEditor
    boolean DEBUG = true;
    int line=0;
    static private String newline = "\n";
    protected boolean editing;
    protected Vector listeners;
    protected File originalFile;
    protected JFileChooser fc = new JFileChooser("c:\\java\\jpg");
    protected File newFile;
    public PictureChooser()
    super("PictureChooser");
    if (DEBUG)
         System.out.println(++line + "-PictureChooser constructor");
         listeners = new Vector();
         fc.addChoosableFileFilter(new ImageFilter());
         fc.setFileView(new ImageFileView());
         fc.setAccessory(new ImagePreview(fc));
    private void setValue(File file)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.setValue method");
         newFile = file;
    public Component getTableCellEditorComponent(JTable table,
                                  Object value,
                                  boolean isSelected,
                                  int row,
                                  int col)
    if (DEBUG)
         System.out.println(line + "-PictureChooser.getTableCellEditorComponent row:" + row + " col:" + col + " method");
         fc.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   String cmd = e.getActionCommand();
                   System.out.println(++line + "-JFileChooser.actionListener cmd:" +
                                       cmd);
                   if (JFileChooser.APPROVE_SELECTION.equals(cmd))
                        stopCellEditing();
                   else
                        cancelCellEditing();
         //editing = true;
         //fc.setVisible(true);
         //fc.showOpenDialog(this);
         int returnVal = fc.showOpenDialog(this);
         if (returnVal == JFileChooser.APPROVE_OPTION)
         newFile = fc.getSelectedFile();
         table.setRowSelectionInterval(row,row);
         table.setColumnSelectionInterval(col,col);
         return this;
    // cell editor methods
    public void cancelCellEditing()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.cancelCellEditing method");
         fireEditingCanceled();
         editing = false;
         fc.setVisible(false);
    public Object getCellEditorValue()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.getCellEditorValue method");
         return new ImageIcon(newFile.toString());
    public boolean isCellEditable(EventObject eo)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.isCellEditable method");
         return true;
    public boolean shouldSelectCell(EventObject eo)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.shouldSelectCell method");
         return true;
    public boolean stopCellEditing()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.stopCellEditing method");
         fireEditingStopped();
         editing = false;
         fc.setVisible(false);
         return true;
    public void addCellEditorListener(CellEditorListener cel)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.addCellEditorListener method");
         listeners.addElement(cel);
    public void removeCellEditorListener(CellEditorListener cel)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.removeCellEditorListener method");
         listeners.removeElement(cel);
    public void fireEditingCanceled()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.fireEditingCanceled method");
         setValue(originalFile);
         ChangeEvent ce = new ChangeEvent(this);
         for (int i=listeners.size()-1; i>=0; i--)
         ((CellEditorListener)listeners.elementAt(i)).editingCanceled(ce);
    public void fireEditingStopped()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.fireEditingStopped method");
         ChangeEvent ce = new ChangeEvent(this);
         for (int i=listeners.size()-1; i>=0; i--)
    System.out.println(++line + "-PictureChooser listener " + i);
         ((CellEditorListener)listeners.elementAt(i)).editingStopped(ce);

    try this code. it work fine.
    regards,
    pratap
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.io.*;
    public class TableDialogEditDemo extends JFrame {
         public TableDialogEditDemo() {
              super("TableDialogEditDemo");
              MyTableModel myModel = new MyTableModel();
              JTable table = new JTable(myModel);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              //Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(table);
              //Set up renderer and editor for the Favorite Color column.
              setUpColorRenderer(table);
              setUpColorEditor(table);
              //Add the scroll pane to this window.
              getContentPane().add(scrollPane, BorderLayout.CENTER);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
         private void setUpColorRenderer(JTable table) {
              table.setDefaultRenderer(File.class, new PictureRenderer(true));
         //Set up the editor for the Color cells.
         private void setUpColorEditor(JTable table) {
              table.setDefaultEditor(File.class, new PictureChooser());
         class PictureRenderer extends JLabel     implements TableCellRenderer {
              Border unselectedBorder = null;
              Border selectedBorder = null;
              boolean isBordered = true;
              public PictureRenderer(boolean isBordered) {
                   super();
                   this.isBordered = isBordered;
                   setOpaque(false);
                   setHorizontalAlignment(SwingConstants.CENTER);
              public Component getTableCellRendererComponent(
                                            JTable table, Object value,
                                            boolean isSelected, boolean hasFocus,
                                            int row, int column) {
                   File f = (File)value;
                   try {
                        setIcon(new ImageIcon(f.toURL()));
                   catch (Exception e) {
                   e.printStackTrace();
                   return this;
         class MyTableModel extends AbstractTableModel {
              final String[] columnNames = {"First Name",
                                                 "Favorite Color",
                                                 "Sport",
                                                 "# of Years",
                                                 "Vegetarian"};
              final Object[][] data = {
                   {"Mary", new Color(153, 0, 153), "Snowboarding", new Integer(5), new File("D:\\html\\f1.gif")},
                   {"Alison", new Color(51, 51, 153), "Rowing", new Integer(3), new File("D:\\html\\f2.gif")},
                   {"Philip", Color.pink, "Pool", new Integer(7), new File("D:\\html\\f3.gif")}
              public int getColumnCount() {
                   return columnNames.length;
              public int getRowCount() {
                   return data.length;
              public String getColumnName(int col) {
                   return columnNames[col];
              public Object getValueAt(int row, int col) {
                   return data[row][col];
              public Class getColumnClass(int c) {
                   return getValueAt(0, c).getClass();
              public boolean isCellEditable(int row, int col) {
                   if (col < 1) {
                        return false;
                   } else {
                        return true;
              public void setValueAt(Object value, int row, int col) {
                   data[row][col] = value;
                   fireTableCellUpdated(row, col);
         public static void main(String[] args) {
              TableDialogEditDemo frame = new TableDialogEditDemo();
              frame.pack();
              frame.setVisible(true);
    import java.awt.Component;
    import java.util.EventObject;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.io.*;
    public class PictureChooser extends JButton implements TableCellEditor, ActionListener {
         protected EventListenerList listenerList = new EventListenerList();
         protected ChangeEvent changeEvent = new ChangeEvent(this);
         private File file;
         public PictureChooser() {
              super("");
              setBackground(Color.white);
              setBorderPainted(false);
              setMargin(new Insets(0,0,0,0));
              addActionListener(this);
         public Component getTableCellEditorComponent(JTable table, Object value,
                                                 boolean isSelected, int row, int column) {
         File f = (File)value;
         try {
              setIcon(new ImageIcon(f.toURL()));
         catch (Exception e) {
              e.printStackTrace();
         return this;
         public void actionPerformed(ActionEvent e)
         JFileChooser chooser = new JFileChooser("d:\\html");
         int returnVal = chooser.showOpenDialog(this);
              if(returnVal == JFileChooser.APPROVE_OPTION) {
                   file = chooser.getSelectedFile();
                   System.out.println("You chose to open this file: " + chooser.getSelectedFile().getName());
                   fireEditingStopped();
              else
                   fireEditingCanceled();
         public void addCellEditorListener(CellEditorListener listener) {
         listenerList.add(CellEditorListener.class, listener);
         public void removeCellEditorListener(CellEditorListener listener) {
         listenerList.remove(CellEditorListener.class, listener);
         protected void fireEditingStopped() {
         System.out.println("fireEditingStopped called ");
         CellEditorListener listener;
         Object[] listeners = listenerList.getListenerList();
         for (int i = 0; i < listeners.length; i++) {
              if (listeners[i] == CellEditorListener.class) {
              listener = (CellEditorListener) listeners[i + 1];
              listener.editingStopped(changeEvent);
         protected void fireEditingCanceled() {
         CellEditorListener listener;
         Object[] listeners = listenerList.getListenerList();
         for (int i = 0; i < listeners.length; i++) {
              if (listeners[i] == CellEditorListener.class) {
              listener = (CellEditorListener) listeners[i + 1];
              listener.editingCanceled(changeEvent);
         public void cancelCellEditing() {
         System.out.println("cancelCellEditing called ");
         fireEditingCanceled();
         public boolean stopCellEditing() {
         System.out.println("stopCellEditing called ");
         fireEditingStopped();
         return true;
         public boolean isCellEditable(EventObject event) {
         return true;
         public boolean shouldSelectCell(EventObject event) {
         return true;
         public Object getCellEditorValue() {
              return file;

  • Strange behaviors between TextInputSkin and StageTextInputSkin

    Hi All,
    I met a very strange behaviors, and need help with, any idea will be truly appreicated.
    I have a phone field and date field both from TextInput field, I aslo have textfieldskin which is original from TextInputSkin.
    When I apply the TextInputSkin to the TextInput field, the softKeyboard Type can not be modified. I found out that as TextDisplay is not StyleableStageText, the autocorrect, type, etc can not be modified while StageTextInputSkin will work just fine.
    However, when I applied the StageTextInputSkin to my fields, the mouse click event can not be rececived any more...
    My question: How can I change the softkeyboardType and be able to receive mouse click event at same time if my control is from TextInput?
    Kind Regards,

    6 months, and a new cs6 with no improvements on this issue.
    My biggest problem is with an android ICS unit the softkeyboarddeactivated gets called when the keyboard switches and shows the mic speak input keyboard but softkeyboardactivating or activated does not get called when the mic input keyboard is shown.
    Also the scrolling bug is horrible and needs to be fixed.
    and keypresses are needed.
    and being able to layer the native components would be great.
    im sad.

  • Help with strange behavior starting a db on XP

    I have a db (9.2.0) on a W-XP machine (I am not a dba but I must handle these things because there is no dba). I dropped the instance and the db and created both again. Now I am having a strange behavior:
    When I start the windows service the database is not opened, but I need to do this if I want to connect as sysdba in order to launch the startup command. When I launch a shutdown the service is not stopped.
    I think this is not the normal behaviour because I think that, with the old db, the service used to open the db when it was started and used to close the db and instance when it was stopped.
    Some idea?

    try oradim command . e.g.
    oradim -STARTUP -SID orcl -USRPWD orclpwd -STARTTYPE srvc,inst

  • Strange behavior when "trying" to burn a disk.

    At least I think this is strange behavior, following the instructions in the help viewer, topic "Backing up your music to a CD or DVD." One thing for sure, it's not burning a disc and it ain't telling me why.
    I select the playlist and click "Burn Disc"
    Requests a blank disc. I insert one.
    Message "checking media"
    after about a minute, the disc ejects
    Message "checking media" displays another 30 seconds
    No other messages displayed.
    What the ??? Shouldn't it at least display an error message??
    Super-Drive information..... from System Profiler
    MATSHITA DVD-R UJ-845C:
    Firmware Revision: DPP9
    Interconnect: ATAPI
    Burn Support: Yes (Apple Shipped/Supported)
    Cache: 2048 KB
    Reads DVD: Yes
    CD-Write: -R, -RW
    DVD-Write: -R, -RW, +R, +RW
    Burn Underrun Protection CD: Yes
    Burn Underrun Protection DVD: Yes
    Write Strategies: CD-TAO, CD-SAO, DVD-DAO
    Media: No
    Using Sony DVD+R discs.
    Mac Mini   Mac OS X (10.4.8)  

    Whoops, sorry, this was while burning a playlist.
    I've also tried some Pleomax CD disks (Samsung), with no luck. I've tried burning directly from iTunes, and from Toast 7.
    Of the types I've tried, the Sony DVD's have been the best for me. Haven't tried many types though. Maybe I can get disks one at a time until I find a brand my burner likes.
    Still, isn't it strange that there is NO error message? It just quits?
    Mac Mini   Mac OS X (10.4.8)  

  • Strange behavior in report Output

    Hi,
    Strange behavior in report output , please some one help me out of this problem.
    I am using Oracle order capture rdf file ASOPQTEL.rdf.
    My working environment:
    Windows,apps instance .Now this rdf file is working fine in my work Environment.
    when this same file is deployed in client environment (UNIX and different apps instance from my working environment apps instance)
    for some cases it is giving output.
    for some cases it's throughing error.
    Thanks,
    Mithun

    Please specify what kind of error you are getting and what is command you are firing on Unix.

  • Strange behavior of the Macbook pro display

    Hi to all
    I'm using my MacBook pro, and notice some strange behavior after open several windows or applications, I don't know how to explain, so here is a photo:
    http://www.flickr.com/photos/86155326@N00/
    I have tried: go back to 10.4.6 / create a new account / Hardware test... and Nothing.
    Any suggestions?
    Pedro

    I am having the exact same problem(and no one is replying to my post either), I read in another post of someone who had a somewhat similar issue and someone commented that it was bad VRAM and warranted the logic board to be replaced. I'm hoping this is not the case, or at least hoping the problem does not get worse because I am in school and can't be without this computer for 2 weeks while it gets repaired..I'm hoping I can last til the holidays...
    pictures of my problem:
    http://www.rpi.edu/~neala/pics/display/Messed%20up%20desktop.png
    http://www.rpi.edu/~neala/pics/display/Picture%204.png
    Sometimes I can make it go away by moving windows, and sometimes that makes it worse... this computer is only 100 days old...come on apple..help us out!

  • Strange behavior with Zoom and Image control

    HELP - I have a strange behavior (bug?) with using Zoom
    effect on an Image that has been placed on a Canvas. I am using
    dynamically instantiated images which are placed on a canvas inside
    a panel. I then assign a Zoom IN and Zoom Out behavior to the
    image, triggered by ROLL_OVER and ROLL_OUT effect triggers. THE BUG
    is that the image jumps around on the Zoom OUT and lands on a
    random place on the canvas instead of coming back to the original
    spot. This is especially true if the mouse goes in and out of the
    image very quickly. HELP -- what am I doing wrong? Computer = Mac
    OS X 10.4.9 Flex 2.0.1
    Here's a simple demo of the bug -- be sure to move the mouse
    in and out rapidly:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="setUp();">
    <mx:Script><![CDATA[
    import mx.events.EffectEvent;
    import mx.effects.Fade;
    import mx.effects.Zoom;
    import mx.rpc.events.ResultEvent;
    import flash.display.Sprite;
    import mx.core.UIComponent;
    import mx.controls.Image;
    private var zoomIn:Zoom;
    private var zoomOut:Zoom;
    private function setUp():void {
    var image:Image = new Image();
    image.id = "album_1_1";
    image.x = 200;
    image.y = 200;
    image.width = 64;
    image.height = 64;
    image.source = "
    http://s3.amazonaws.com/davidmccallie/album-128.jpg";
    image.addEventListener(MouseEvent.ROLL_OVER, doZoom);
    image.addEventListener(MouseEvent.ROLL_OUT, doZoom);
    myCanvas.addChild(image);
    zoomIn = new Zoom();
    zoomIn.zoomHeightTo = 2.0;
    zoomIn.zoomWidthTo = 2.0;
    zoomIn.captureRollEvents = true;
    zoomIn.suspendBackgroundProcessing = true;
    zoomOut = new Zoom();
    zoomOut.zoomHeightTo = 1.0;
    zoomOut.zoomWidthTo = 1.0;
    zoomOut.captureRollEvents = true;
    zoomOut.suspendBackgroundProcessing = true;
    private function doZoom(event:MouseEvent):void {
    var image:Image = Image(event.currentTarget);
    if (event.type == MouseEvent.ROLL_OVER) {
    zoomIn.target = event.currentTarget;
    zoomIn.play();
    } else if (event.type == MouseEvent.ROLL_OUT) {
    zoomOut.target = event.currentTarget;
    zoomOut.play();
    ]]>
    </mx:Script>
    <mx:Panel width="100%" height="100%"
    layout="absolute">
    <mx:Canvas id="myCanvas" width="100%" height="100%">
    </mx:Canvas>
    </mx:Panel>
    </mx:Application>

    There must be bugs in the Zoom effect code -- I changed the
    Zoom to Resize in the above code, and it works perfectly. Of
    course, Resize is not as nice as Zoom because you can't set the
    resize to be around the center of the image, but at least it works.
    Does anyone know about bugs in the Zoom effect?

  • Strange behavior from a PB G4 (Part 2)

    On to my next issue. Often when I'm typing the insertion point will jump to someplace other than where it should be or just disappear all together. I'm not doing anything to cause it to do this. I've been being really carefull to not to do anything wrong. I'ts often enough to be a real nuisance. It happened 7 times during my first post (Strange behavior from a PB G4) and 3 times during this one. Please help. Thanks.

    Igor_G5 wrote:
    ... I thought about putting in a larger drive but when I looked up instructions for it i was surprized at how difficult it was.
    Did you use the iFixit website? It has excellent pictures and instructions that are easy to follow.
    Replacing any hard disk drive will be challenging for a paraplegic, but with someone's help it can be done fairly inexpensively. There are many tiny fasteners that require tiny tools. Use an egg carton to store them, separated by their location in the PowerBook.
    Earlier PowerBooks are easier to work on than later ones.
    I still use a PowerBook G4 on occasion, mostly for importing video for editing in iMovie. I upgraded its original 60 GB HD to a much larger one. If you were to do this you would need to locate the PowerBook's original System Install DVD to install and subsequently update OS X and all its original programs.
    If you ensure at least a few gigabytes free space, I think most of your problems will be fixed. When free disk space gets down to a few hundred megabytes or less, performance will suffer dramatically. You don't want it to ever get anywhere near that low. Strange things start to happen.
    Keep the number of icons on the Desktop to a minimum also. That makes a difference, for reasons that I do not fully understand.

  • Strange Behavior of GET PERNR

    Hi All,
    I am facing a strange behavior with GET Event for PNP LDB.
    In my selection-screen, i have fields like Payroll Area, Current Period, Other Period, personnel number.
    Usually, i populate Payroll area, other period(say 06-2007) and input some personnel number.
    When i tried to debug for one personnel, its not at all going into GET PERNR event...it directly goes to END-OF-SELECTION event.
    Please help on this.
    Regards,
    Kiran Chennapai

    Hi Manoj,
    The below is some part for my coding:
    START-OF-SELECTION.
      IF pnptimr9 = 'X'.
        PERFORM f_get_next_period.    "Take next period when the selection
        " is current period
      ENDIF.
    Get deatils of actions and pay-scales
      PERFORM f_get_data.
      CLEAR: g_num_processed, g_num_skipped, g_num_success, g_num_error.
    GET pernr.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      IF pnp-sw-found = 1.
    Verify whether the personnel is under the given Payroll area or not
        CHECK p0001-abkrs = pnpxabkr.
        IF p_eegrp IS NOT INITIAL.
    Verify personnel's employee group is under the given EEgroup
          CHECK p_eegrp = p0001-persg.
        ENDIF.
    start processing for the selected personnel
        PERFORM f_process_data.
      ENDIF.
    END-OF-SELECTION.
    Do increment process for all the selected personnel
      IF NOT git_process[] IS INITIAL.
        PERFORM f_increment_process.
      ENDIF.
    When i tried to put a break-point at the first statement in the GET event and executed, its not going into GET event at all.(personnel number is existing in the system)
    Regards,
    Kiran Chennapai

  • Strange Behavior in modifying the values in VO

    I have a VO based on EO from a custom table. The query is something like:
    select EO.x, EO.y, (EO.x*EO.y) xy from EO
    I have displayed the values from this VO on to a table in OAF page. All the columns are messageTextInput but the third column (xy) is read-only. I have written a fireAction to execute when x or y values are changed to update the xy value accordingly.
    Code in CO:
    if ("ValueChange".equals(pageContext.getParameter(EVENT_PARAM)))
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("UpdateXY");
    pageContext.forwardImmediately(<Same Page>, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null, null, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    Code in AM:
    public void UpdateXY()
    xxVOImpl vo = getxxVO1();
    Row r = vo.first();
    while (vo.hasNext())
    r = vo.next();
    Object X = r.getAttribute("X");
    String X_string = X.toString();
    float X_value = Float.parseFloat(X_string);
    Object Y = r.getAttribute("Y");
    String Y_string = Y.toString();
    float Y_value = Float.parseFloat(Y_string);
    Float XY = new Float(X_value*Y_value);
    r.setAttribute("XY",(Object)XY);
    The problem is as follows. During the first time I try to update a value, the control goes through the logic and returns to the page but the XY value is not updated. But if i change a second value and tab out, the codes works and displays both the updated values of XY. From then on, the code is working fine.
    I'm also not updating the first row and so I didnt perform any logic in AM for the first row.
    Please help me out in finding out the reason for this strange behavior.

    This nature is fine, basically initially your EO x and y columns are null and unless you do a commit, these values don't go in db. The third column will take x and Y coumns values from db and multiply and will get null.
    To solve this issue, you get the values from VO columns x and y in PPR and and put x*y in the third column of Vo, IN THAT ROW.or you can directly get hold of the bean which hold the value of x*y and use setValue after getting x*y.
    ---Mukul

  • Strange behavior in Financial Reports (drop down feature)

    Hello Gurus,
    I have currently performed migration of Financial Reports from 11.1.1.3 environment to 11.1.2.2 environment with the help of a staging environment.
    We migrated the reports over to 11.1.2.2 using LCM from the Staging 11.1.2.2 environment.
    We are observing some strange behavior with the Financial Reports that have drop down functionality in our new environment.
    When we open a report in our current environment (113) and select a particular member (India) from the Page dimension(Page has almost 30 members in it) it returns appropriate data, however when the same report is opened in new environment (122) and when we select the same member(India), it does not return appropriate data(Page has almost 30 members in it).
    However if we design a sample report with the same member in the page (Page has only 1 member (India)) and then open the report it shows correct data.
    So the issue occurs only when we have more than 1 members in page and it works as expected when we have only 1 member in page.
    Any help would be highly appreciated.
    Thanks,
    hyperionEPM

    Hello Neeraj,
    We are trying to understand the potential reason as to why is it causing this. Is there anything similar caught in .303 patch?? I will have a look at the .303 patch readme.
    Thanks,
    hyperionEPM

  • Strange behavior in Photos App

    Hello guys! Is anyone having this strange behavior in Photos App?
    http://img24.imageshack.us/img24/9312/img0020b.png
    http://img689.imageshack.us/img689/3803/img0019ss.png

    Hey Ericmusic,
    Thanks for the question. After reviewing your post, it sounds like you are having trouble with an app. I would recommend that you read these articles, they may be able to help you resolve or isolate the issue.
    iOS: Force an app to close
    Turn your iOS device off and on (restart) and reset
    Use iTunes to restore your iOS device to factory settings
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Strange behavior in a table with dropTarget and delete action

    I am having a strange behavior in a table with drag and drop and action component to delete row.
    Steps:
    Drag the first row to the table and appears in the destination table (works well)
    Select and change the value by 156, appears an error (works fine)
    delete the row, the row disappears (works well)
    Add the first row again and the value is 156 instead of 158 (why ????)
    I guess the error is the deletion that is not correct, but do not know how?
    Can anyone help?
    I add the source code if you see where I'm wrong
    Java class:
    +public class BeanExample {+
    private ArrayList<RowExample> starttValues;
    private ArrayList<RowExample> endValues;
    +public BeanExample() {+
    super();
    +}+
    +public void setStarttValues(ArrayList<BeanExample.RowExample> starttValues) {+
    this.starttValues = starttValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getStarttValues() {+
    +if (starttValues == null) {+
    starttValues = new ArrayList<BeanExample.RowExample>();
    starttValues.add(new RowExample("1", new Number(158)));
    starttValues.add(new RowExample("21", new Number(12565464)));
    +}+
    return starttValues;
    +}+
    +public void setEndValues(ArrayList<BeanExample.RowExample> endValues) {+
    this.endValues = endValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getEndValues() {+
    +if (endValues == null) {+
    endValues = new ArrayList<BeanExample.RowExample>();
    +}+
    return endValues;
    +}+
    +public void validatorExample(FacesContext facesContext, UIComponent uIComponent, Object object) {+
    Number number = (Number)object;
    +if ((number.longValue() % 2) == 0) {+
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "ES PAR", "ES PAR");
    throw new ValidatorException(message);
    +}+
    +}+
    +public DnDAction handleDrop(DropEvent dropEvent) {+
    Transferable transferable = dropEvent.getTransferable();
    DataFlavor<RowKeySet> rowKeySetFlavor = DataFlavor.getDataFlavor(RowKeySet.class, "loteDrag");
    RowKeySet rowKeySet = transferable.getData(rowKeySetFlavor);
    +if (rowKeySet != null) {+
    CollectionModel dragModel = transferable.getData(CollectionModel.class);
    +if (dragModel != null) {+
    Object currKey = rowKeySet.iterator().next();
    dragModel.setRowKey(currKey);
    RowExample table = (RowExample)dragModel.getRowData();
    getEndValues().add(new RowExample(table.getId(), table.getValue()));
    return dropEvent.getProposedAction();
    +}+
    +}+
    return DnDAction.NONE;
    +}+
    +public void borrarFila(ActionEvent actionEvent) {+
    endValues.remove(0);            RequestContext.getCurrentInstance().addPartialTarget(FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:t2"));
    +}+
    +public static class RowExample {+
    private String id;
    private Number value;
    +public RowExample(String id, Number value) {+
    super();
    this.id = id;
    this.value = value;
    +}+
    +public void setId(String id) {+
    this.id = id;
    +}+
    +public String getId() {+
    return id;
    +}+
    +public void setValue(Number value) {+
    this.value = value;
    +}+
    +public Number getValue() {+
    return value;
    +}+
    +}+
    +}+JSF
    +<?xml version='1.0' encoding='windows-1252'?>+
    +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"+
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    +<jsp:directive.page contentType="text/html;charset=windows-1252"/>+
    +<f:view>+
    +<af:document id="d1">+
    +<af:form id="f1">+
    +<af:panelGroupLayout id="pgl1">+
    +<af:table value="#{beanExample.starttValues}" var="row"+
    rowBandingInterval="0" id="t1" rowSelection="single"
    displayRow="selected" contentDelivery="immediate">
    +<af:column sortable="false" headerText="Id" align="start" id="c2">+
    +<af:outputText value="#{row.id}" id="ot1"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c1">+
    +<af:outputText value="#{row.value}" id="ot2"/>+
    +</af:column>+
    +<af:collectionDragSource actions="COPY" modelName="loteDrag"/>+
    +</af:table>+
    +<af:panelCollection id="pc1">+
    +<f:facet name="toolbar" >+
    +<af:toolbar id="dc_t2" >+
    +<af:commandToolbarButton shortDesc="Delete"+
    icon="/imagesDemo/delete_ena.png"
    id="dc_ctb3" immediate="true"
    +actionListener="#{beanExample.borrarFila}"/>+
    +</af:toolbar>+
    +</f:facet>+
    +<af:table value="#{beanExample.endValues}" var="row"+
    +rowBandingInterval="0" id="t2">+
    +<af:column sortable="false" headerText="Id" align="start" id="c3">+
    +<af:outputText value="#{row.id}" id="ot3"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c4" >+
    +<af:inputText value="#{row.value}" autoSubmit="true" id="it1" validator="#{beanExample.validatorExample}"/>+
    +</af:column>+
    +<af:collectionDropTarget actions="COPY" modelName="loteDrag"+
    +dropListener="#{beanExample.handleDrop}"/>+
    +</af:table>+
    +</af:panelCollection>+
    +</af:panelGroupLayout>+
    +</af:form>+
    +</af:document>+
    +</f:view>+
    +</jsp:root>+

    I think the problem is the validator
    I changed the practical case, I added an InputText to enter new values in the first row.
    +<af:inputText immediate="true" label="new value" id="it2"+
    +valueChangeListener="#{beanExample.newvalue}" autoSubmit="true"/>+
    +public void newvalue (ValueChangeEvent valueChangeEvent) {+
    +String valor = (String)valueChangeEvent.getNewValue();+
    +Number valorNumber=null;+
    +try {+
    +valorNumber = new Number (valor);+
    +} catch (SQLException e) {+
    +}+
    +RowExample example = (RowExample) endValues.get(0);+
    +example.setValue(valorNumber);+
    +example.setId(valorNumber.toString());+
    +RichTable table = (RichTable)FacesContext.getCurrentInstance().getViewRoot().findComponent(id);+
    +RequestContext.getCurrentInstance().addPartialTarget(table);+
    +}+
    Case 1
    I drag the first row to the target table (ok)
    The new row appears (ok)
    Enter the value 77 in the InputText (ok)
    id content and value change (ok)
    Case2
    I drag the first row to the destination table
    The new row appears (ok)
    Change the value of the first row by 80 (ok)
    errors appears (by validator) (ok)
    Enter the value 77 in the InputText (ok)
    the id is changed but the value NO (*KO*)
    I do not understand the behavior
    Edited by: josefuente on 27-oct-2010 16:03

Maybe you are looking for