Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/6.0-Stable'

  • Loading branch information...
commit 1868531d8439421627d68335cd726954f7f3326d 2 parents c6df20d + ba69dd9
Jumper Chen jumperchen authored
14 zk/src/org/zkoss/zk/ui/http/SerializableSession.java
View
@@ -42,6 +42,20 @@ public SerializableSession(WebApp wapp, HttpSession hsess, Object request) {
super(wapp, hsess, request);
}
+ /** Constructs a ZK session with either a HTTP session or a Portlet session.
+ *
+ * @param navsess the original session, either an instance of
+ * HttpSession or PortletSession.
+ * Notice: we don't declare PortletSession in API
+ * to avoid this class failed to be loaded in some system (without
+ * portlet-api.jar)
+ * @param request the original request causing this session to be created.
+ * If portlet, it is javax.portlet.RenderRequest.
+ * @since 6.0.3
+ */
+ public SerializableSession(WebApp wapp, Object hsess, Object request) {
+ super(wapp, hsess, request);
+ }
//-- HttpSessionActivationListener --//
public void sessionWillPassivate(HttpSessionEvent se) {
sessionWillPassivate();
6 zk/src/org/zkoss/zk/ui/http/SerializableUiFactory.java
View
@@ -18,6 +18,7 @@
*/
package org.zkoss.zk.ui.http;
+import javax.portlet.PortletSession;
import javax.servlet.http.HttpSession;
import org.zkoss.zk.ui.WebApp;
@@ -33,6 +34,9 @@
*/
public class SerializableUiFactory extends AbstractUiFactory {
public Session newSession(WebApp wapp, Object nativeSess, Object request) {
- return new SerializableSession(wapp, (HttpSession)nativeSess, request);
+ if (nativeSess instanceof HttpSession)
+ return new SerializableSession(wapp, (HttpSession)nativeSess, request);
+ else
+ return new SerializableSession(wapp, (PortletSession)nativeSess, request);
}
}
4 zk/src/org/zkoss/zk/ui/http/SimpleSession.java
View
@@ -97,7 +97,7 @@
/** Indicates if {@link #invalidateNow} was called. */
private boolean _invalidated;
- /** Construts a ZK session with a HTTP session.
+ /** Constructs a ZK session with a HTTP session.
*
* @param hsess the original HTTP session.
* @param request the original request causing this session to be created.
@@ -108,7 +108,7 @@
public SimpleSession(WebApp wapp, HttpSession hsess, Object request) {
this(wapp, (Object)hsess, request);
}
- /** Construts a ZK session with either a HTTP session or a Portlet session.
+ /** Constructs a ZK session with either a HTTP session or a Portlet session.
*
* <p>Note: it assumes the scope of attributes is
* PortletSession.APPLICATION_SCOPE.
10 zkdoc/release-note
View
@@ -51,6 +51,16 @@ ZK 6.5.0
When using the molds above, the component will use default supported mold instead.
--------
+ZK 6.0.3
+* Features
+
+* Bugs
+ ZK-1128: Use SerializableUiFactory with a portal environment will cause ClassCastException
+ ZK-1303: listbox select mold with 1 rows onSelect event not fired for first item
+
+* Upgrade Notes
+
+ --------
ZK 6.0.2
Jul 24, 2012
* Features
31 zktest/src/archive/test2/B60-ZK-1303.zul
View
@@ -0,0 +1,31 @@
+<zk>
+ <div>
+ Ste 1: Click "update"<separator/>
+ Step 2: Select first item in the lsitbox "test1"<separator/>
+ Step 3: Click "test"<separator/>
+ Message box should show "test1"
+ </div>
+ <window border="normal" title="hello" width="400px" height="400px">
+ <label value="test" />
+ <listbox id="listbox" mold="select" rows="1" onSelect=""></listbox>
+ <button id="btn2" label="update" onClick="update();" />
+ <button id="btn" label="test" onClick='Messagebox.show(listbox.getSelectedItem().getValue().toString());' />
+ <zscript><![CDATA[
+ listbox.getItems().clear();
+ Listitem li = new Listitem("test3", "test3");
+ li.setSelected(true);
+ li.setParent(listbox);
+ public void update() {
+ listbox.getItems().clear();
+ Listitem li = new Listitem("test1", "test1");
+ li.setParent(listbox);
+ li = new Listitem("test2", "test2");
+ li.setParent(listbox);
+ li = new Listitem("test3", "test3");
+ li.setSelected(true);
+ li.setParent(listbox);
+ }
+]]>
+ </zscript>
+ </window>
+</zk>
1  zktest/src/archive/test2/config.properties
View
@@ -1395,6 +1395,7 @@ B60-ZK-1182.zul=B,E,Stubonly,Textbox,onChange
B60-ZK-1205.zul=B,M,Notification,onFloatUp
B60-ZK-1176.zul=B,M,Button,Toolbarbutton,autodisable,setDisabled,onClick
B60-ZK-1160.zul=B,M,Tab,Include
+B60-ZK-1303.zul=B,M,Listbox,Select
#ZK6.5
B65-ZK-1285.zul=B,M,Input,Modal,Window,iPad
6 zul/src/archive/web/js/zul/sel/Option.js
View
@@ -102,6 +102,12 @@ zul.sel.Option = zk.$extends(zul.Widget, {
getMaxlength: function () {
return this.parent ? this.parent.getMaxlength() : 0;
},
+ bind_: function () {
+ this.$supers('bind_', arguments);
+ //B60-ZK-1303: force update parent's selected index.
+ if (this.isSelected())
+ this.parent._selectedIndex = this._index;
+ },
/**
* The index for option widget only , not including the listhead.etc
* @since 6.0.1
Please sign in to comment.
Something went wrong with that request. Please try again.