JSplitPane divider height change listener

Is there a listener to detect splitpane divider height changes?

Check out these threads:
http://forum.java.sun.com/thread.jspa?forumID=257&threadID=468307
http://forum.java.sun.com/thread.jspa?forumID=257&threadID=219213
http://forum.java.sun.com/thread.jspa?forumID=257&threadID=138065

Similar Messages

  • Another JSplitPane divider cursor problem

    I have the same problem discussed elsewhere in that the cursor doesn't change to a E_RESIZE_CURSOR when it's over a split panel divider. The code is in a large application too huge to post, and my attempts to simplify it have been unable to reproduce the problem. I have implemented the solution suggested in [http://forums.sun.com/thread.jspa?forumID=57&threadID=642994] but, although the mouse listener methods are indeed called, the cursor doesn't change. I have also tried calling setCursor on the parent of the JSplitPane, and on the JRootPane, but it doesn't change. In each case the mouse listener is called but the setCursor call has no effect.
    All the discussions on setCursor having no effect I've found are specific to JDialog. In my case, I have a deep window stack starting with JFrame, JRootPane, JLayeredPane, down through several JPanels, a JSplitPane, more JPanels, my JSplitPane, which contains 2 JPanels, and so on.
    What would prevent the JSplitPane divider from changing the cursor itself? Assuming it's trying, just as my explicit mouse listener is, what could be overriding, obscuring, or intercepting my cursor change?
    Any help would be most welcome
    Thanks!

    I have the same problem discussed elsewhere in that the cursor doesn't change to a E_RESIZE_CURSOR when it's over a split panel divider. The code is in a large application too huge to post, and my attempts to simplify it have been unable to reproduce the problem. I have implemented the solution suggested in [http://forums.sun.com/thread.jspa?forumID=57&threadID=642994] but, although the mouse listener methods are indeed called, the cursor doesn't change. I have also tried calling setCursor on the parent of the JSplitPane, and on the JRootPane, but it doesn't change. In each case the mouse listener is called but the setCursor call has no effect.
    All the discussions on setCursor having no effect I've found are specific to JDialog. In my case, I have a deep window stack starting with JFrame, JRootPane, JLayeredPane, down through several JPanels, a JSplitPane, more JPanels, my JSplitPane, which contains 2 JPanels, and so on.
    What would prevent the JSplitPane divider from changing the cursor itself? Assuming it's trying, just as my explicit mouse listener is, what could be overriding, obscuring, or intercepting my cursor change?
    Any help would be most welcome
    Thanks!

  • JSplitPane divider (One touch expandable)

    Hi all,
    I am having some problems with the JSplitPane divider. I am using onetouch expandable.
    I want to stop the divider moving all the way up to the top of the window when the up arrow is clicked on. When you drag the divider up it stops near the top but doesn't go all the way up. but click on the up arrow on the divider bar and it rises completely to the top. How can I stop this from happening.
    I have managed to add an action listener to the buttons on the divider bar, In the action listener I do the following - splitPane.setDividerLocation(0.1);
    splitPane.updateUI();
    This works but then an exception is thrown -
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicSplitPaneDivider$OneTouchActionHandler.actionPerformed(BasicSplitPaneDivider.java:916)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
         at java.awt.Component.processMouseEvent(Component.java:3717)
         at java.awt.Component.processEvent(Component.java:3546)
         at java.awt.Container.processEvent(Container.java:1167)
         at java.awt.Component.dispatchEventImpl(Component.java:2595)
         at java.awt.Container.dispatchEventImpl(Container.java:1216)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2458)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2223)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2132)
         at java.awt.Container.dispatchEventImpl(Container.java:1203)
         at java.awt.Window.dispatchEventImpl(Window.java:918)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:336)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:134)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:101)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)
    Can anyone help me out?
    thanks,
    Paul.

    I have partial solution to the above problem but in doing so have encountered another problem that I can see no solution to. Can anyone help?
    I have a calss that extends BasicSplitPaneDivider and in this calss i overide the OneTouchActionHandler with a version that sets the top value to be the top of the frame + the height of the component I want left shown. My problem is that this code never runs. The origional OneTouchActionHandler in the BasicSplitPaneDivider runs not my version. How can I get my version to run.
    The version in BasicSplitPaneDivider is protected.
    This code never runs.
    <pre>
    * Listeners installed on the one touch expandable buttons.
    public class OneTouchActionHandlernew implements ActionListener {
         /** True indicates the resize should go the minimum (top or left)
         * vs false which indicates the resize should go to the maximum.
         private boolean toMinimum;
         OneTouchActionHandlernew(boolean toMinimum) {
         this.toMinimum = toMinimum;
    public void actionPerformed(ActionEvent e) {
    Insets insets = splitPane.getInsets();
         int lastLoc = splitPane.getLastDividerLocation();
    int currentLoc = splitPaneUI.getDividerLocation(splitPane);
         int newLoc;
         // We use the location from the UI directly, as the location the
         // JSplitPane itself maintains is not necessarly correct.
    System.out.println("The action listener is being used ");
         if (toMinimum) {
              if (orientation == JSplitPane.VERTICAL_SPLIT) {
              if (currentLoc >= (splitPane.getHeight() -
                        insets.bottom - getDividerSize()))
                   newLoc = lastLoc;
              else
                   newLoc = insets.top + 40;
              else {
              if (currentLoc >= (splitPane.getWidth() -
                        insets.right - getDividerSize()))
                   newLoc = lastLoc;
              else
                   newLoc = insets.left;
         else {
              if (orientation == JSplitPane.VERTICAL_SPLIT) {
              if (currentLoc == insets.top)
                   newLoc = lastLoc;
              else
                   newLoc = splitPane.getHeight() - getHeight() -
                   insets.top;
              else {
              if (currentLoc == insets.left)
                   newLoc = lastLoc;
              else
                   newLoc = splitPane.getWidth() - getWidth() -
                   insets.left;
         if (currentLoc != newLoc) {
              splitPane.setDividerLocation(newLoc);
              // We do this in case the dividers notion of the location
              // differs from the real location.
              splitPane.setLastDividerLocation(currentLoc);
    } // End of class BasicSplitPaneDivider.LeftActionListener
    </pre>

  • JSplitPane Divider problem...

    I'm having problem with the JSplitPane divider. Ive learned that the MouseListener class is most likely the reason why the divider isn't performing as expected. I had to learn how to use the MouseListener interface and I've also learned that the divider is an instance of BasicSplitPaneDivider. I've finally got the divider to PARTIALLY work if I only set the following:
    1) setting the setContinuousLayout(true)
    //setting it to false wont work for some reason, I want to fix that, too. By setting it to false, the divider wont move :(.
    and
    2) if I move the mouse slowly, so the divider can follow the mouse. If I move my mouse too fast, then my divider will suddenly stop the moment the mouse cursor hovers away from the divider.
    Can anyone help me fix the divider problem? Thanks in advance! Here's my code below:
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.awt.event.MouseEvent;
    import javax.swing.event.MouseInputAdapter;
    import javax.swing.plaf.basic.BasicSplitPaneDivider;
    public class JSplitPaneDemo{
         public static void main(String args[]){
              //Practice p = new Practice("SplitPane Divider Works Now?");
              JSplitPaneDemo x = new JSplitPaneDemo();
              x.new Practice("SplitPane Divider Works Now?");
         public class DendrogramListener extends MouseInputAdapter
              Container contentPane;
              Component button1, button2, button3;
              JSplitPane splitter;
              Point mLocation;
              JFrame myFrame;
              MyGlassPane glass;
              private boolean inDrag = false;
              private boolean inButton = false;
              private boolean inDivider = false;
              public DendrogramListener(JFrame frame)
                   this.myFrame = frame;
                   this.contentPane = frame.getContentPane();
                   this.mLocation = new Point();
              public DendrogramListener(AbstractButton aButton, AbstractButton b2, AbstractButton b3, MyGlassPane glass1, Container cP, JSplitPane split){
                   this.button1 = aButton;
                   this.button2 = b2;
                   this.button3 = b3;
                   this.glass = glass1;
                   this.contentPane = cP;
                   this.mLocation = new Point();
                   this.splitter = split;
              public void mouseDragged(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseMoved(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mousePressed(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseReleased(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
                   inDrag = false;
              public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void redispatchMouseEvent(MouseEvent e){
                   inButton = false;
                   inDrag = false;
                   inDivider = false;
                   Component component = null;
                   JButton tempButton;
                   Container container = contentPane;
                   Point glassPanePoint = e.getPoint();
                   mLocation = e.getPoint();
                   Point containerPoint = SwingUtilities.convertPoint(glass, glassPanePoint, contentPane);
                   int eventID = e.getID();
                 component = SwingUtilities.getDeepestComponentAt(container, containerPoint.x, containerPoint.y);
                 if (component == null) {
                      //System.out.println("NULL");
                     return;
                 if (component instanceof JButton) {
                     inButton = true;
                 if(component instanceof BasicSplitPaneDivider){
                      inDivider = true;
                      testForDrag(eventID);
                 if (inButton || inDivider)
                           Point componentPoint = SwingUtilities.convertPoint(glass, glassPanePoint, component);
                          component.dispatchEvent(new MouseEvent(component,
                                                               eventID,
                                                               e.getWhen(),
                                                               e.getModifiers(),
                                                               componentPoint.x,
                                                               componentPoint.y,
                                                               e.getClickCount(),
                                                               e.isPopupTrigger()));
                   testForDrag(eventID);
             private void testForDrag(int eventID) {
                 if (eventID == MouseEvent.MOUSE_PRESSED) {
                     inDrag = true;
         public class MyGlassPane extends JComponent {
              int x0, y0;
              Point mLocation;
              public MyGlassPane(AbstractButton aButton, AbstractButton b2, AbstractButton b3, Container cP, JSplitPane splitter){
                   DendrogramListener dl = new DendrogramListener(aButton, b2, b3, this, cP, splitter);
                   addMouseListener(dl);
                   addMouseMotionListener(dl);
             public void setPoint(Point p) {
                 mLocation = p;
         public class Practice extends JFrame implements ActionListener
              private MyGlassPane glassPane;
              public Practice(String str)
                   super(str);
                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   setDefaultLookAndFeelDecorated(true);
                   addComponents(this);
                   pack();
                   setVisible(true);
              public Practice addComponents(final Practice p)
                   JPanel leftPane = new JPanel();
                   JPanel midPane = new JPanel();
                   JPanel rightPane = new JPanel();
                   JLabel l1 = new JLabel("Left panel");
                   JLabel r1 = new JLabel("Right panel");
                   JLabel m1 = new JLabel("Middle panel");
                   JButton b1 = new JButton("Button 1");
                   JButton b2 = new JButton("Button 2");
                   JButton b3 = new JButton("Button 3");
                   leftPane.add(l1);
                   leftPane.add(b3);
                   b3.setActionCommand("b3");
                   b3.addActionListener(this);
                   leftPane.setPreferredSize(new Dimension(200, 300));
                   midPane.add(m1);
                   midPane.add(b1);
                   midPane.setPreferredSize(new Dimension(200, 300));
                   rightPane.add(r1);
                   rightPane.add(b2);
                   rightPane.setPreferredSize(new Dimension(200, 300));
                   JSplitPane splitter2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, rightPane, midPane);
                   splitter2.setOneTouchExpandable(true);
                   splitter2.setContinuousLayout(true);
                   JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPane, splitter2);
                   splitter.setOneTouchExpandable(true);
                   splitter.setContinuousLayout(true);
                   getContentPane().add(splitter);
                   glassPane = new MyGlassPane(b1, b2, b3, p.getContentPane(), splitter);
                   this.setGlassPane(glassPane);
                   glassPane.setVisible(true);
                   return p;
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
                   if("b3".equals(arg0.getActionCommand())){
                        JOptionPane.showMessageDialog(this, "Button 3 Pressed!");
    }

    The problem with your listener is that you are only dispatching events to the
    button or divider when the mouse is directly over that component. This results
    in the behavior you see with the divider: you have to move the mouse slowly
    to keep it over the divider otherwise it gets over some other component and
    you stop dispatching the events to it.
    You actually have a similar problem with the buttons: if you click on one, it
    gets the event but if you then drag the mouse out of the button and release
    the mouse, it still triggers the button! This is not how buttons work: if you
    release the mouse when it is not over the button, it shouldn't trigger.
    Try this for your listener:
         public class DendrogramListener extends MouseInputAdapter {
              Component redispatch;
              boolean inside;
              Container contentPane;
              Component button1, button2, button3;
              JSplitPane splitter;
              Point mLocation;
              JFrame myFrame;
              MyGlassPane glass;
              private boolean inDrag = false;
              private boolean inButton = false;
              public DendrogramListener( JFrame frame ) {
                   this.myFrame = frame;
                   this.contentPane = frame.getContentPane();
                   this.mLocation = new Point();
              public DendrogramListener( AbstractButton aButton, AbstractButton b2,
                        AbstractButton b3, MyGlassPane glass1, Container cP,
                        JSplitPane split ) {
                   this.button1 = aButton;
                   this.button2 = b2;
                   this.button3 = b3;
                   this.glass = glass1;
                   this.contentPane = cP;
                   this.mLocation = new Point();
                   this.splitter = split;
              public void mouseDragged( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseMoved( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseClicked( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mousePressed( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseReleased( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
                   inDrag = false;
                   inButton = false;
              public void mouseEntered( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseExited( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void redispatchMouseEvent( MouseEvent e ) {
                   int eventID = e.getID();
                   Point glassPanePoint = e.getPoint();
                   Point containerPoint = SwingUtilities.convertPoint( glass, glassPanePoint, contentPane );
                   if ( !inDrag && !inButton && eventID == MouseEvent.MOUSE_PRESSED ) {
                        redispatch = SwingUtilities.getDeepestComponentAt( contentPane, containerPoint.x, containerPoint.y );
                        inButton = ( redispatch instanceof JButton );
                        inside = inButton;
                        if ( !inButton )
                             inDrag = ( redispatch instanceof BasicSplitPaneDivider );
                   if ( inButton || inDrag ) {
                        if ( inButton )
                             eventID = possiblySwitchEventID( eventID, containerPoint );
                        Point componentPoint = SwingUtilities.convertPoint( glass, glassPanePoint, redispatch );
                        redispatch.dispatchEvent( new MouseEvent( redispatch, eventID, e.getWhen(), e.getModifiers(),
                                  componentPoint.x, componentPoint.y, e.getClickCount(), e.isPopupTrigger() ) );
              private int possiblySwitchEventID( int eventID, Point containerPoint ) {
                   int switchedID = eventID;
                   Component deepest = SwingUtilities.getDeepestComponentAt( contentPane, containerPoint.x, containerPoint.y );
                   if ( deepest == redispatch ) {
                        if ( ! inside )
                             switchedID = MouseEvent.MOUSE_ENTERED;
                        inside = true;
                   } else {
                        if ( inside )
                             switchedID = MouseEvent.MOUSE_EXITED;
                        inside = false;
                   return switchedID;
         }: jay

  • How do you change the image size and resolution in photoshop everytime I change the width the height changes my measurements will not stay

    Can someone assist me with changing image size and resolution.  each time I change the width the height changes and vice/versa?

    There's a chain link between width and height. The point is to keep the aspect ratio the same, otherwise your picture would get stretched.
    You click on the chain-link to shut that off and you can adjust width and height separately.
    Also could you give us your version of Photoshop, what OS you are running it on (Windows 7 for example) and what exactly you want to do with your document?
    Resolution is the print term for how many pixels will be printed on an inch of paper. It doesn't apply if your image is intended for screen viewing.
    Gene

  • Property change listener error with jtabbedpane

    Greetings
    I have a property change listener on my jtabbedpane (2 panes (index 0 of course and index 1). my problem is when i want to run my app it gives me a java null pointer exception. I believe it is b/c it is starting the app and it see the property change of the first tab at index 0 which is the first tab it sees and tries to run the method that makes the buttons visibility to true. but the buttons are already true. Basically how can I get the property change to run only after the app is visible? I made the buttons visibility false on startup to see if it can run the app but I still got the same error. I hope I am clear enough, if I am not please and I will attempt to reiterate the situation better. thanks for anyones help.
    tabs = new JTabbedPane();
              tabs.addChangeListener(this);
              tabs.setPreferredSize(new java.awt.Dimension(800, 400));
              tabs.addTab("Q", tab1.getMa());
              tabs.addTab("R", tab2);
      public void stateChanged(ChangeEvent changeEvent) {
                JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource();
               int index = sourceTabbedPane.getSelectedIndex();
               //System.out.println("Tab changed to: " + sourceTabbedPane.getTitleAt(index)+"  Index: "+index);
               if (index==1){
                         changeButtonsF();
                             ///makes buttons false on side panel
               else if (index==0){
                    changeButtonsT();
                     //makes buttons true on side panel
           }

    Basically how can I get the property change to run only after the app is visible?Add the PropertyChangeListener to the tabbed pane after the JFrame is visible.
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

  • Value change listener method on h:selectBooleanCheckbox in h:dataTable

    Hello,
    Does JSF handle value change listeners as expected when they are attached to h:selectBooleanCheckbox components within an h:dataTable?
    In the following example, I have a JSP that has some h:selectBooleanCheckbox components nested in an h:dataTable, and some that aren't. When I bulid and deploy the example to Tomcat 5.5, I can see (using the log4j output) that the value change listener methods for the checkboxes that are NOT in the dataTable are fired, but the ones that are in the dataTable do not get fired.
    I am using Sun's RI of JSF, version 1.1.0.1.
    Thanks,
    Scott
    ----------------------------- JSP:
    <%@ page language="java" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
    <h:form>
    <h:dataTable value="#{checkboxBean.beans}" var="thisBean">
         <h:column>
              <h:outputText  value="#{thisBean.id}: " />
         </h:column>
         <h:column>
              <h:selectBooleanCheckbox value="#{thisBean.checked}" valueChangeListener="#{checkboxBean.somethingChanged}" />
         </h:column>
    </h:dataTable>
         <h:panelGrid columns="2">
              <h:outputText value="One:"/>
              <h:selectBooleanCheckbox id="firstOne" valueChangeListener="#{checkboxBean.somethingChanged}" />
              <h:outputText value="Two:"/>
              <h:selectBooleanCheckbox id="secondOne" valueChangeListener="#{checkboxBean.somethingChanged}" />
              <h:panelGroup/>
              <h:commandButton value="Do Stuff" action="#{checkboxBean.doStuff}" />
         </h:panelGrid>
    </h:form>
    </f:view>----------------------------- Beans:
    package workshop;
    import javax.faces.event.ValueChangeEvent;
    import org.apache.log4j.Logger;
    * Test attaching value change listener methods to checkboxes.
    public class CheckboxBean {
        private static final Logger logger = Logger.getLogger(CheckboxBean.class);
        private SomeBean[] beans = null;
        public CheckboxBean() {
            logger.debug("CheckboxBean()");
        public String load() {
            SomeBean[] someBeans = new SomeBean[3];
            someBeans[0] = new SomeBean("firstGuy", false);
            someBeans[1] = new SomeBean("2ndGuy", false);
            someBeans[2] = new SomeBean("third", false);
            this.setBeans(someBeans);
            return null;
        public String doStuff() {
            logger.debug("doStuff()");
            return this.load();
        public void somethingChanged(ValueChangeEvent e) {
            logger.debug("somethingChanged() in component with id " + e.getComponent().getId() );
        public SomeBean[] getBeans() {
            logger.debug("getBeans()");
            return this.beans;
        public void setBeans(SomeBean[] beans) {
            logger.debug("setBeans()");
            this.beans = beans;
    package workshop;
    public class SomeBean {
        private boolean checked = false;
        private String id = null;
        public SomeBean() {
        public SomeBean(String anId, boolean bool) {
            super();
            this.id = anId;
            this.checked = bool;
        public String getId() {
            return this.id;
        public void setId(String id) {
            this.id = id;
        public boolean isChecked() {
            return this.checked;
        public boolean getChecked() {
            return this.checked;
        public void setChecked(boolean checked) {
            this.checked = checked;
    }----------------------------- faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <managed-bean>
        <description>Checkbox bean.</description>
        <managed-bean-name>checkboxBean</managed-bean-name>
        <managed-bean-class>workshop.CheckboxBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </faces-config>----------------------------- log4j config:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <appender  name="RollingFile" class="org.apache.log4j.RollingFileAppender" >
              <param name="File" value="/Users/scott/workshop/logs/workshop.log"/>
            <param name="Append" value="false"/>
            <param name="MaxFileSize" value="4096KB" />
            <param name="MaxBackupIndex" value="4" />
            <layout class="org.apache.log4j.PatternLayout">
              <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} : %m%n"/>
            </layout>
        </appender>
        <category name="workshop" >
          <priority value="debug" />
        </category>
        <root>
            <priority  value="warn" />
            <appender-ref  ref="RollingFile" />
        </root>
    </log4j:configuration>

    I have Just run into the same problem. When using the following code inside a data table the valueChangeListener event is not fired when the checkbox has it's value changed. Is this a bug?
    I created a simple page with just a form and the selectBooleanCheckbox. This time the valueChangeListener event fired OK. It seems the problem only occurs when the check box is inside the dataTable
    here is the code snippet
    <h:form >
    <h:column>
    <f:facet name="header">
         <h:outputText value="Add to Basket"/>
    </f:facet>
    <h:selectBooleanCheckbox immediate="true" valueChangeListener="#{reportsResultHandler.addToBasket}" value="#{reportsResultHandler.addbasketChecked}" onchange="this.form.submit
    ();"/>                              
    </h:column>
    </h:form>

  • Get action or value change listener to be invoked from phaseEvent

    Hi,
    Does a PhaseEvent object has information for which action or value change listener is to be invoked?
    I have implemented a common logging method which has to be called on any action or value change event.
    The method requires the name of the method bound to action or value change listener.
    It is convinient if a phaseEvent object has information for the listener's method name because in that case I don't have to write a code calling the logging method in each action or value change listener but only in PhaseListener.
    Regards,
    Kenji

    Same as my thread...no answers...!

  • Copy the values input in input text 1 to input text 2 using value change listener

    Hello ,
    I have two input texts :
    input text 1 & input text 2 .
    I need to copy the values input in input text 1 to input text 2 .
    How do I implement this using value change listener ?
    I did the following steps :
    1) I selected input text 1 and chose Value Change listener --> edit .
       Typed a new bean & class name .
       Which method name should I add ?
    Any help please ?

    Hi,
    Give any name to the method and bind the two input text to manged bean using bindings attribute of InputText. just follow the below given code
    Ex:
    test.java class
        private RichInputText inputVal1;
        private RichInputText inputVal2;
        public Test() {
        public void ValChange(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            inputVal2.setValue(inputVal1.getValue().toString());
        public void setInputVal1(RichInputText inputVal1) {
            this.inputVal1 = inputVal1;
        public RichInputText getInputVal1() {
            return inputVal1;
        public void setInputVal2(RichInputText inputVal2) {
            this.inputVal2 = inputVal2;
        public RichInputText getInputVal2() {
            return inputVal2;
    test.jspx page
    <af:inputText label="Label 1" id="it1" valueChangeListener="#{backingBeanScope.TestBean.ValChange}"
                                  binding="#{backingBeanScope.TestBean.inputVal1}" autoSubmit="true"/>
                    <af:inputText label="Label 2" id="it2" binding="#{backingBeanScope.TestBean.inputVal2}"
                                  partialTriggers="it1"/>
    Thanks
    nitesh

  • Problem in getting the current value of the drop down while calling value change listener

    I have 2 drop down list. I am trying to get the value of first drop down from other drop downs value change listener. Initially one drop down contains a default value. First time I got the value while calling the value change listener. But if I change the default value to other in the first drop down and call the value change listener of the second drop down then I got the old value in the bean. Can anyone suggest a process

    If I use the following code it gives me the current index.
                valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
                System.out.println(valueChangeEvent.getNewValue());
    This is also giving me current index.
    BindingContainer container = BindingContext.getCurrent().getCurrentBindingsEntry();
    AttributeBinding attrIdBinding = (AttributeBinding)container.getControlBinding("PersonTypeId1");
    if(attrIdBinding.getInputValue()!=null)
                   System.out.println(attrIdBinding.getInputValue().toString());
    But at last I got some help from Shay Shmeltzer's Weblog.
    BindingContainer bindings =
                    BindingContext.getCurrent().getCurrentBindingsEntry();
                    // Get the sepecific list binding
                    JUCtrlListBinding listBinding =
                    (JUCtrlListBinding)bindings.get("PersonTypeId1");
                    // Get the value which is currently selected
                    Object selectedValue = listBinding.getSelectedValue();
                      long value =0L;
                    if(selectedValue!=null){
                        System.out.println("Sudip.. Person Type using bindings"+selectedValue.toString());
    But this returns "ViewRow [oracle.jbo.Key[300000860721156 ]]"
    300000860721156 is the original value.. Would you please help me to figure it.

  • ADF :  Value change listener for the whole jsff page

    Is there any feature to have a value change listener for the whole jsff page ?
    How to know if user has change something in the page i.e. how to know whether the page is dirty ?

    User please tell us your jdev version!
    Read this blog https://blogs.oracle.com/groundside/entry/ever_wondered_how_uncommitteddatawarning_works
    Timo

  • Change listener not notified when tree item is deselected

    I'm attaching a listener to the selected index property of the tree view selection model to detect when a user selects or deselects on or more nodes in a tree, but it appears that the listener is not notified when a user deselects a node. So if a user selects two nodes and then while holding down the Ctrl key deselects one of the selected nodes the tree view control deselects the node, but the change listener is not notified. Is this is a bug or am I doing something wrong?
    I’m using the GA version of JavaFX 2.1 on Windows 7.
    Thanks.
    Stefan
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.SelectionMode;
    import javafx.scene.control.TreeItem;
    import javafx.scene.control.TreeView;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    public class TreeViewSample extends Application {
    private final Node rootIcon = new ImageView(
    new Image(getClass().getResourceAsStream("Folder.gif"))
    public static void main(String[] args) {
    launch(args);
    @Override
    public void start(Stage primaryStage)
    primaryStage.setTitle("Tree View Sample");
    TreeItem<String> rootItem = new TreeItem<String> ("Inbox", rootIcon);
    rootItem.setExpanded(true);
    for (int i = 1; i < 6; i++)
    TreeItem<String> item = new TreeItem<String> ("Message" + i);
    rootItem.getChildren().add(item);
    TreeView<String> tree = new TreeView<String> (rootItem);
    tree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    tree.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>()
                   @Override
                   public void changed(ObservableValue<? extends Number> ov, Number oldIndex, Number newIndex)
         System.out.println("selection changed");
    StackPane root = new StackPane();
    root.getChildren().add(tree);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
    }

    The selected index value does not change in those cases as it reflects the last selected index (useful for single selection). It does act wierd at is possible to have a selected index that is not actually selected (you can report a bug for that I think).
    However, if you want to track the full selection, try adding a ListChangeListener to the selectedIndices of the selection model. This one does fire a change every time.

  • Table height changes in Firefox

    Here is my website. Looks great in IE6, but in Firefox the
    table height changes and on my 15" monitor, the bottoms get cut
    off. I'm a graphic designer and don't know code well, so I really
    need advice on how to correct this in DW8. Thanks.
    http://bellsouthpwp.net/r/a/rarose1967/Portfolio/Portfolio2/final/Pages/

    Bobbi67 wrote:
    > Here is my website. Looks great in IE6, but in Firefox
    the table height changes
    > and on my 15" monitor, the bottoms get cut off. I'm a
    graphic designer and
    > don't know code well, so I really need advice on how to
    correct this in DW8.
    > Thanks.
    >
    http://bellsouthpwp.net/r/a/rarose1967/Portfolio/Portfolio2/final/Pages/
    >
    What happens if you remove "height" attributes from table
    and td's?
    Mick

  • Getting a value of another textbox in value change listener

    Hi
    I am associating a value change listener with textbox1. and i need the values of textbox2 inside the listener. So every time, value of textbox1 changes , i want to call a listener which executes a query depending on the value of textbox2 which is constant. But i am not able to get the value of textbox2 inside the listener method.
    Thanks in advance..

    Read on about the JSF lifecycle. The valuechangelistener will be fired at the end of the 3rd phase of the JSF lifecycle (process validations) and the input values will be set in the bean in the 4th phase of the JSF lifecycle (update model values).
    In your case, a complete rewrite of the code may be more useful. If you are actually not interested in the difference between the old value and the new value, then remove the valuechangelistener and put the code logic in the action method of the bean. This will be executed in the 5th phase of the JSF lifecycle (invoke application), after the input values are been set.
    Or, in my opinion better, introduce some AJAX framework and make use of its capabilities. For example Ajax4jsf. It saves you from synchronous form submits on every entered character which may lead to poor user experience.
    This practical article might be helpful in understanding the JSF lifecycle: [http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html]

  • Differentiating HTTP Request through a URL and a value change listener

    Version Details:
    Oracle JDeveloper 11g Release 1 11.1.1.4.0
    Studio Edition Version 11.1.1.4.0
    Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
    IDE Version: 11.1.1.4.37.59.23
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.4.37.59.23
    ADF Business Components     11.1.1.59.23
    Java(TM) Platform     1.6.0_21
    Oracle IDE     11.1.1.4.37.59.23
    Versioning Support     11.1.1.4.37.59.23
    Base Details:
    The Product, that a different team is working on (<i><b>which I cannot access, code, touch,...</b></i>), creates reports and essentially generates a URL with a bunch of parameters:
    http://<host>:<port>/myApplication/main.jspx?parameter1=value1&parameter2=value2...When the user clicks on an "Edit" button, a modal popup window is displayed (using jQuery) with an embedded iFrame with its source pointing to the above URL.
    The "myApplication" is an ADF application which brings up an ADF form based on the parameters. Once the user enters the data, validations occur and the data is written into a total of 3 different Tables in the Database. Once the operation is finished, the user closes the popup by clicking on the "X" button of the popup window, which essentially does "popup.*hide()*".
    Limitations:
    <li>Since there are varied combination of parameter values and associated ADF forms, taskflows is not* an option.
    <li>Since the logic of generating the ADF form is not straightforward, ADF BC is not* an option.
    <li>Since validations are based on the value change listeners, the managed bean has to be a session scope_ bean.
    Problem:
    When, for the first time, the user clicks on the Edit button with a particular set of parameter values, the corresponding ADF form is displayed and things work normal. Since the managed bean is under session scope, the form generated for the first popup window stays the same for any subsequent popup windows, even when the URL and its parameters are completely different. As I can not listen to the popup close event, I cannot invalidate my session either.
    I tried using filters in the web.xml to grab the request and apply the business logic. Due to the presence of multiple value change listeners (too many <tt>autosubmit=true</tt>), every value change listener triggers a request and so the business logic gets applied with every value change.
    After some tests, I deduced that the difference between the call from iFrame and the call from value change is the HTTP Request Method - GET for iFrame and POST for value change listener. So in my filter I apply the business logic when there is a GET request and not apply when its a POST request.
    Turns out, that is not a valid enough differentiation between the two requests being made. Sometimes, even the value change listeners are issuing a GET request.
    Question:
    *<font color="red">1</font>*. Is there a way to force the value change listeners to always trigger a POST request?
    *<font color="red">2</font>*. Is there a way to differentiate the requests originating from the other team's Product and those generated by my own value change listeners?
    *<font color="red">3</font>*. Is there a different approach, incorporating the above-mentioned limitations, to clear out the session scope each time when a request is made through iFrame? That is, whenever a request is made through the other team's Product?
    Edited by: user737922 on Apr 13, 2011 10:58 AM

    _(Temporary) Solution_:
    Summary:
    I am using the request parameter <b><tt>_adf.ctrl-state</tt></b> to differentiate between the HTTP requests that my application receives.
    Details:
    When I receive the request from the other team's Product, I receive a <tt>GET</tt> and a <tt>adf.ctrl-state</tt> value which I store into a local variable in my session-scoped managed bean. The <tt>adf.ctrl-state</tt> value stays the same for all requests (<tt>GET</tt> or <tt>POST</tt>) made from within my own application. It changes only when there is a new request from the other team's Product.
    Also, as my application is accessed through an iFrame, there is no possibility of the generated URL being modified by the end-user.
    For now it seems that the solution is appropriate but I am not fully confident if relying on the <tt>_adf.ctrl-state</tt> value is the best approach.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • CUCM 8.6.2 - SURL Buttons Issue related to Extension Mobility

    Hello Guys, we are running a CUCM 8.6.2.22900-2 with the extension mobility service. One the user device profiles we have applied several third application services via SURL buttons.  Actually I though it does not matter, what device type I choose du

  • How do i install OSX 10.5 on Firewire HD?

    Hello, it is possible install osx 10.5 leopard on my firewire HD? thx

  • Bug in report sorting? Sort doesn't work in last group level.

    Is this a known error? Is there documentation from Oracle about it? My query is a simple select from a table. I then created three group levels. Each group contains a value for sorting (up arrow next to column). However, data is not sorted by the val

  • Error when trying first test "midp HelloMidp"

    Hello, I'm a newbie with j2me I have a small problem to create my first application. I'm tried an example I read in a book. Here is the code of my class: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMidp ex

  • How do I Change Permissions for a UME Role:  UME.Manage_Users

    I am trying to set up a helpdesk role that will allow a limited number of users to reset passwords and unlock users. I do not want them to be able to change user data, delete or create users. I created a user and assigned it the user administration c