Author: andrei_exadel
Date: 2008-08-14 04:32:44 -0400 (Thu, 14 Aug 2008)
New Revision: 10083
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
Log:
RF-3583
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java
===================================================================
---
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java 2008-08-14
00:57:45 UTC (rev 10082)
+++
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java 2008-08-14
08:32:44 UTC (rev 10083)
@@ -31,6 +31,8 @@
import org.ajax4jsf.component.AjaxComponent;
import org.ajax4jsf.event.AjaxSource;
+import com.sun.org.apache.xpath.internal.operations.Bool;
+
/**
* JSF component class
*/
@@ -38,12 +40,14 @@
//public abstract class UISimpleTogglePanel extends UIInput implements AjaxComponent,
AjaxSource, ActionSource
{
- public static final String COMPONENT_FAMILY = "javax.faces.Command";
+ public static final String COMPONENT_FAMILY = "javax.faces.Command";
public static final String SERVER_SWITCH_TYPE = "server";
public static final String CLIENT_SWITCH_TYPE = "client";
public static final String AJAX_SWITCH_TYPE = "ajax";
public static final boolean COLLAPSED = false;
public static final boolean EXPANDED = true;
+
+ private transient Boolean openedSet = null;
private transient Boolean wasOpened = null;
@@ -154,6 +158,8 @@
if (!isRendered()) {
return;
}
+
+ updateModel();
if (isWasOpened()) {
// Process all facets and children of this component
@@ -165,8 +171,26 @@
}
}
+ private void updateModel () {
+ if (openedSet != null) {
+ setOpened(openedSet);
+ }
+ }
+
+ /**
+ * @return the openedSet
+ */
+ public boolean isOpenedSet() {
+ return openedSet;
+ }
+
+ /**
+ * @param openedSet the openedSet to set
+ */
+ public void setOpenedSet(boolean openedSet) {
+ this.openedSet = openedSet;
+ }
-
/*
* public void setValueBinding(String arg0, ValueBinding arg1) { if
* ("opened".equals(arg0)) super.setValueBinding("value", arg1);
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
---
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2008-08-14
00:57:45 UTC (rev 10082)
+++
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2008-08-14
08:32:44 UTC (rev 10083)
@@ -88,10 +88,12 @@
//xxxx by nick - denis - use constants, please!
if ((panel.isOpened() == UISimpleTogglePanel.EXPANDED)) {
- panel.setOpened(UISimpleTogglePanel.COLLAPSED);
+ //panel.setOpened(UISimpleTogglePanel.COLLAPSED);
+ panel.setOpenedSet(UISimpleTogglePanel.COLLAPSED);
} else {
//xxxx by nick - denis - use constants, please!
- panel.setOpened(UISimpleTogglePanel.EXPANDED);
+ //panel.setOpened(UISimpleTogglePanel.EXPANDED);
+ panel.setOpenedSet(UISimpleTogglePanel.EXPANDED);
}
SimpleToggleEvent event = new SimpleToggleEvent(panel,
(panel.isOpened()));
if (panel.isImmediate()) {
@@ -115,6 +117,7 @@
}
if (null == panel.getValueBinding("value"))
panel.setOpened(submittedState);
+ panel.setOpenedSet(submittedState);
}
// in case of "ajax" request and "ajax" switch mode of
toggle panel
Show replies by date