Package org.richfaces.event

Examples of org.richfaces.event.SimpleToggleEvent


      } else {
        submittedState = !currentState;
      }

      if (currentState != submittedState) {
        SimpleToggleEvent event = new SimpleToggleEvent(panel, submittedState);
        event.queue();

        SimpleTogglePanelSwitchEvent stateEvent = new SimpleTogglePanelSwitchEvent(panel, submittedState);
        stateEvent.queue();
      }
View Full Code Here


                } else {
                    //xxxx by nick - denis - use constants, please!
                    //panel.setOpened(UISimpleTogglePanel.EXPANDED);
                    panel.setOpenedSet(UISimpleTogglePanel.EXPANDED);
                }
                SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                if (panel.isImmediate()) {
                    event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                } else {
                    event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                }
                event.queue();
               
            } else {
                boolean submittedState = Boolean.parseBoolean((String) clnId);
              if (panel.isOpened() != submittedState){
                  //panel.setAjaxSingle(false);
                    SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                    if (panel.isImmediate()) {
                        event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                    } else {
                        event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                    }
                    event.queue();
                }
                if (null == panel.getValueBinding("value"))
                  panel.setOpened(submittedState);
                  panel.setOpenedSet(submittedState);
            }
View Full Code Here

        event = null;
        stp = null;
    }

    public void testEvent() throws Exception {
        event = new SimpleToggleEvent(stp, false);
        assertFalse(event.isIsOpen());
        event.setIsOpen(true);
        assertTrue(event.isIsOpen());

        assertFalse(event.isAppropriateListener(new TestFacesListener()));
View Full Code Here

                    panel.setOpened(UISimpleTogglePanel.COLLAPSED);
                } else {
                    //xxxx by nick - denis - use constants, please!
                    panel.setOpened(UISimpleTogglePanel.EXPANDED);
                }
                SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                if (panel.isImmediate()) {
                    event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                } else {
                    event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                }
                event.queue();
               
            } else {
                if (panel.isOpened()!= new Boolean((String) clnId).booleanValue()){
                  panel.setAjaxSingle(false);
                    SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                    if (panel.isImmediate()) {
                        event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                    } else {
                        event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                    }
                    event.queue();
                }
                if (null == panel.getValueBinding("value"))
                  panel.setOpened(new Boolean((String) clnId).booleanValue());
            }
           
View Full Code Here

      } else {
        submittedState = !currentState;
      }

      if (currentState != submittedState) {
        SimpleToggleEvent event = new SimpleToggleEvent(panel, submittedState);
        event.queue();

        SimpleTogglePanelSwitchEvent stateEvent = new SimpleTogglePanelSwitchEvent(panel, submittedState);
        stateEvent.queue();
      }
View Full Code Here

                    panel.setOpened(UISimpleTogglePanel.COLLAPSED);
                } else {
                    //xxxx by nick - denis - use constants, please!
                    panel.setOpened(UISimpleTogglePanel.EXPANDED);
                }
                SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                if (panel.isImmediate()) {
                    event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                } else {
                    event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                }
                event.queue();
               
            } else {
                if (panel.isOpened()!= new Boolean((String) clnId).booleanValue()){
                  panel.setAjaxSingle(false);
                    SimpleToggleEvent event = new SimpleToggleEvent(panel, (panel.isOpened()));
                    if (panel.isImmediate()) {
                        event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                    } else {
                        event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                    }
                    event.queue();
                }
                if (null == panel.getValueBinding("value"))
                  panel.setOpened(new Boolean((String) clnId).booleanValue());
            }
           
View Full Code Here

    }
    @Override
    public void broadcast(FacesEvent event) throws AbortProcessingException {
      if(event instanceof SimpleToggleEvent) {
        SimpleToggleEvent simpleToggleEvent = (SimpleToggleEvent) event;
        setOpened(simpleToggleEvent.isIsOpen());
      }
      super.broadcast(event);
    }
View Full Code Here

      String switchType = panel.getSwitchType();
      if (!(UISimpleTogglePanel.CLIENT_SWITCH_TYPE.equals(switchType))) {

        // xxxx by nick - denis - use constants, please!
        SimpleToggleEvent event;
        if (panel.isOpened()) {
          event = new SimpleToggleEvent(panel, UISimpleTogglePanel.COLLAPSED);
          // panel.setOpened(UISimpleTogglePanel.COLLAPSED);
          // panel.setOpenedSet(UISimpleTogglePanel.COLLAPSED);
        } else {
          event = new SimpleToggleEvent(panel, UISimpleTogglePanel.EXPANDED);
          // xxxx by nick - denis - use constants, please!
          // panel.setOpened(UISimpleTogglePanel.EXPANDED);
          // panel.setOpenedSet(UISimpleTogglePanel.EXPANDED);
        }
        // if (panel.isImmediate()) {
        // event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
        // } else {
        // event.setPhaseId(PhaseId.INVOKE_APPLICATION);
        // }
        event.queue();

      } else {
        boolean submittedState = Boolean.parseBoolean((String) clnId);
        if (panel.isOpened() != submittedState) {
          // panel.setAjaxSingle(false);
          SimpleToggleEvent event = new SimpleToggleEvent(panel, submittedState);
          // if (panel.isImmediate()) {
          // event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
          // } else {
          // event.setPhaseId(PhaseId.INVOKE_APPLICATION);
          // }
          event.queue();
        }
//        TODO: should we remove it ??
        if (null == panel.getValueBinding("value"))
          panel.setOpened(submittedState);
        // panel.setOpenedSet(submittedState);
View Full Code Here

TOP

Related Classes of org.richfaces.event.SimpleToggleEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.