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);