0

Modal window from JSP

asked 2006-09-06 03:14:22 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3900962

By: herbison

Is it possible to do a modal window from JSP using zk?

If I do something like this:
K
jsp
K

<zk:zscript>
void setSchedule(String cp)
{
String oc="";
oc =cp+"zul/userList.zul";
final Window getWn = Executions.createComponents(oc, null, null);
getWn.doModal();
}
</zk:zscript>

<x:image src="/images/schedule_reporting.gif"
onClick='setSchedule("<%=urlPreFix%>");' />

K
jsp
K

I always get page not found?


delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2006-09-06 13:57:45 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3901635

By: tomyeh

What is the value of cp? It shall not contain the servlet context path. ZK will prefix the context path (i.e., the prefix you mapped the app to) automatically.

link publish delete flag offensive edit

answered 2006-09-08 01:51:58 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3904248

By: herbison

Here is my example:
It finds the first button but complains: cannot cast com.potix.zul.html.Window to java.awt.Window.

It can't find the other 3.
JSP....
<%@ page language='java' contentType='text/html' %> <%@ page errorPage="errorpage.jsp?debug=log" %>

<%
request.setAttribute("sourcePage", request.getRequestURI());

String contextPath = request.getContextPath();
String urlPreFix = "http://"+request.getHeader("host")+contextPath+"/";
%>
<TABLE border="0" width='100%' align='right' class='content'
xmlns:x="http://www.potix.com/2005/zul"
xmlns:zk="http://www.potix.com/2005/zk"
>
<TR>
<TD>
<zk:zscript>
void setSchedule(String oc)
{
final Window getWn = Executions.createComponents(oc, cow, null);
getWn.doModal();
}
</zk:zscript>

<x:image src="/images/schedule_reporting.gif" tooltip="sr"
onClick='setSchedule("/zul/yy.zul");' sclass="buttonTwo"/> <x:image src="/images/schedule_reporting.gif" tooltip="sr"
onClick='setSchedule("<%=contextPath%>/zul/yy.zul");' sclass="buttonTwo"/> <x:image src="/images/schedule_reporting.gif" tooltip="sr"
onClick='setSchedule("yy.zul");' sclass="buttonTwo"/> <x:image src="/images/schedule_reporting.gif" tooltip="sr"
onClick='setSchedule("<%=urlPreFix%>/zul/yy.zul");' sclass="buttonTwo"/> <x:popup id="sr">Schedule</x:popup>
</TD>
</TR>
<x:window id="cow">
</x:window>
</TABLE>

ZK...
<?xml version="1.0" encoding="UTF-8"?>

<?taglib uri="/WEB-INF/tld/web/core.dsp.tld" prefix="c" ?>

<window id="mainWindow">
<grid>
<columns>
<column label="Col 1" align="right"/>
<column label="Col 2" align="left"/>
</columns>
<rows>
<row>
<label value="Val 1"/>
<label value="Val 2"/>
</row>
<row>
<label value="Val 3"/>
<label value="Val 4"/>
</row>
</rows>
</grid>
</window>


link publish delete flag offensive edit

answered 2006-09-08 04:57:37 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3904375

By: henrichen

try to use full qulified class name for Window.

<zk:zscript>
void setSchedule(String oc)
{
final com.potix.zul.html.Window getWn = Executions.createComponents(oc, cow, null); getWn.doModal(); } </zk:zscript>

link publish delete flag offensive edit

answered 2006-09-08 13:44:39 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3905537

By: herbison

Well, I got a different error. Now it is saying: Failed to process doModal 'style' is null or not an object _pcb undefined.

I assume it can't find one of zk native style sheets?

link publish delete flag offensive edit

answered 2006-09-08 14:01:55 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3905561

By: henrichen

Do you have related stack trace?

/henri

link publish delete flag offensive edit

answered 2006-09-08 18:49:59 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3905971

By: herbison

I placed a zk.zml with this as the content in WEB-INF, <zk> <log> <log-base>com.potix</log-base> </log> </zk>

and a WEB-INF/classes/i3-log.conf with contents:
com.potix.zk.ui.impl.UiEngineImpl=FINER
com.potix.zk.ui.http=DEBUG
com.potix.zk.au.http.DHtmlUpdateServlet=OFF
com.potix=ALL

but the stack trace failed to materialized on the first error. If I hit the button again I do get a stack trace but I'm not too sure of what use it would be.

Two windows are generated on the error,
Window 1 contains:
Failed to process doModal
'style' is null or not an object
_pcb
undefined

And Window 2 contains:
Failed to process addChd
Invalid source HTML for this operation.
_pca
<div id="_pcb" zk_type="zul.html.widget.Wnd" zk_idsp="true" zk_autoz="true"
class="modal-none" style="width:100px;"> <div id="_pcc" zk_type="zul.html.grid.Grid" class="grid"> <div id="_pcc!head" class="grid-head"> <table width="100%" border="0" cellpadding="0" cellspacing="0"
style="table-layout:fixed">
<tr id="_pcd">
<td id="_pce" zk_type="Col" align="right">Col 1</td> <td id="_pcf" zk_type="Col" align="left">Col 2</td> </tr> </table> </div> <div id="_pcc!body" class="grid-body"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody id="_pcg"> <tr id="_pch"> <td id="_pci!chdextr" align="right" class="gridev"> <span id="_pci">Val 1</span></td> <td id="_pcj!chdextr" align="left" class="gridev"> <span id="_pcj">Val 2</span></td> </tr> <tr id="_pck"> <td id="_pcl!chdextr" align="right" class="gridev"> <span id="_pcl">Val 3</span></td> <td id="_pcm!chdextr" align="left" class="gridev"> <span id="_pcm">Val 4</span></td> </tr> <tr id="_pcn"> <td id="_pco!chdextr" align="right" class="gridev"> <table id="_pco" zk_type="Box" cellpadding="0" cellspacing="0"> <tr valign="top"> <td id="_pcp!chdextr" class="hbox"> <button id="_pcp" zk_type="zul.html.widget.Button"> Cancel </button> </td> <td style="display:none" id="_pco!child"></td> </tr> </table> </td> </tr> </tbody> </table> </div> </div> </div> close Failed to process doModal 'style' is null or not an object _pcb undefined


link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-09-06 03:14:22 +0800

Seen: 726 times

Last updated: Sep 08 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More