if (currentState != submittedState) {
SimpleToggleEvent event = new SimpleToggleEvent(panel, submittedState);
event.queue();
SimpleTogglePanelSwitchEvent stateEvent = new SimpleTogglePanelSwitchEvent(panel, submittedState);
stateEvent.queue();
}
// in case of "ajax" request and "ajax" switch mode of toggle panel
// set the regions to be rendered (reRendered) after operating this
// "ajax" request