-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4350994
By: roxcastaneda
The following code below displays only labels. Is there a way for this to work in JSP? It does not trigger the event onClientInfo. Any help pls.
<?page id="testmodule" language="xhtml"?>
<html xmlns:zk="http://www.zkoss.org/2005/zk" xmlns:x="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul
http://www.zkoss.org/2005/zul/zul.xsd">
<x:grid onClientInfo="onClientInfo(event)">
<x:rows>
<x:row>Time Zone <x:label id="tm"/></x:row>
<x:row>Screen <x:label id="scrn"/></x:row>
<x:row>Browser <x:label id="brw"/></x:row>
</x:rows>
<zk:zscript>
void onClientInfo(ClientInfoEvent evt) {
tm.setValue(evt.getTimeZone().toString());
scrn.setValue(evt.getScreenWidth()+"x"+evt.getScreenHeight()+"x"+evt.getColorD
epth());
brw.setValue(evt.getDesktopWidth()+"x"+evt.getDesktopHeight());
alert("hi");
}
</zk:zscript>
</x:grid>
</html>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4351135
By: zanyking
which action you want to chose to trigger onClientInfo?
there's no such mouse or keyboard actions(event) defult named "ClientInfo".
And JSP can not run Zul tag because it's a technology that must "Compile" your page first.
and ZK's page rendering model needs more dynamic properties so it use it's own DSP model.
But, Zul page can still cowork with jsp page.
take look at dev-guide.pdf in page167
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4506087
By: rudi_black
hi guys...
i need a hand for the clientInfo... the result is simply empty... infact somehow the event onClientInfo never get fired...
i'm using the latest zk-RC..
the other thing.... how can i get the client's IP, O/S etc...?
many thx
-rudi-
the zul :
<?component name="gridInfo" class="fl.macro.gridClientInfo" extends="grid"?> <window>
<gridInfo onClientInfo="self.ClientInfo(event)"/>
</window>
The macro :
---------------
import bsh.This;
import com.sun.jdi.event.EventSet;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.*;
import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkforge.fckez.*;
import java.sql.*;
import java.lang.*;
public class gridClientInfo extends Grid{
private Columns _cols = new Columns();
private Column _col1 = new Column();
private Column _col2 = new Column();
private Rows _rows = new Rows();
private Row _row1 = new Row();
private Row _row2 = new Row();
private Row _row3 = new Row();
private Row _row4 = new Row();
private Row _row5 = new Row();
private Row _row6 = new Row();
private String _name = "";
private String _deskH = "";
private String _deskW = "";
private String _scrH = "";
private String _scrW = "";
private String _color = "";
private Label _lname = new Label();
private Label _ldeskH = new Label();
private Label _ldeskW = new Label();
private Label _lscrH = new Label();
private Label _lscrW = new Label();
private Label _lcolor = new Label();
/** Creates a new instance of gridClientInfo */
public gridClientInfo() {
}
public void onCreate(){
this._cols.appendChild(this._col1);
this._cols.appendChild(this._col2);
this._row1.appendChild(new Label("Browser's Name"));
this._row1.appendChild(this._lname);
this._row2.appendChild(new Label("Browser's Height"));
this._row2.appendChild(this._ldeskH);
this._row3.appendChild(new Label("Browser's Width"));
this._row3.appendChild(this._ldeskW);
this._row4.appendChild(new Label("Screen's Height"));
this._row4.appendChild(this._lscrH);
this._row5.appendChild(new Label("Screen's Width"));
this._row5.appendChild(this._lscrW);
this._row6.appendChild(new Label("Color"));
this._row6.appendChild(this._lcolor);
this._rows.appendChild(this._row1);
this._rows.appendChild(this._row2);
this._rows.appendChild(this._row3);
this._rows.appendChild(this._row4);
this._rows.appendChild(this._row5);
this._rows.appendChild(this._row6);
this.appendChild(_cols);
this.appendChild(_rows);
}
public void ClientInfo(ClientInfoEvent evt){
this._name = evt.getName();
this._deskH = evt.getDesktopHeight() + "";
this._deskW = evt.getDesktopWidth() + "";
this._scrH = evt.getScreenHeight() + "";
this._scrW = evt.getScreenWidth() + "";
this._color = evt.getColorDepth() + "";
this._lname.setValue(this._name);
this._ldeskH.setValue(this._deskH);
this._ldeskW.setValue(this._deskW);
this.sayMsg(this._name);
}
private void sayMsg(String __WhatEver){
try {
Messagebox.show(__WhatEver);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4508068
By: henrichen
The onClientInfo event is sent to "ROOT" components(the direct children of a
Page) only. That is, window component in your example.
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4508523
By: rudi_black
hi henri,
thx for the tip. the only reason i try to fire up the event from the grid is bcoz the dev-guide on page 184 say so. to my knowledge the grid should be a child of something (at least a window)..
k.. my next Q is.. how can i get more info about the client? let's say.. i want to know :
1. browser's type
2. user's IP
3. user's O/S
these things is easy in php... can we do it in zk or may be u can tell which java that i used use?
many thx
-rudi-
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4509163
By: rudi_black
k... i found part answer of my Q.. to know the IP, i can import java.net.Inet4Address..
1 down, thousands to go :P
-rudi-
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4509624
By: rudi_black
hmm... i guess the java.net.inet4address is only taking the local info not the remote info...
well.. the down is up again.. :(
-rudi-
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4532277
By: henrichen
Check the ZK class "Execution".
/henri
Asked: 2007-06-08 01:21:33 +0800
Seen: 379 times
Last updated: Sep 22 '07