<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<%
ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
if (servoy_hc == null)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_01");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("customers");
if (!ok)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_01");
session.setAttribute("servoy",servoy_hc);
}
String custid = request.getParameter("custid");
String pageid = request.getParameter("pageid");
if (null==pageid) pageid = "1";
String filter = request.getParameter("filter");
String showOrders = request.getParameter("showOrders");
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
color: #333333;
}
a{
text-decoration: none;
font-size: 11px;
font-family: verdana, sans-serif;
}
A:link
{
color: #036;
}
A:visited
{
color: #036;
}
A:active
{
text-decoration: underline;
color: #F90;
}
A:hover
{
text-decoration: underline;
color: #F90;
}
td
{
font-size: 11px;
border-color: #CCCCCC;
border-width: 1;
border-style: solid;
}
td.sub
{
background-color: #003366;
color: #FFFFFF;
}
td.red
{
background-color: #990000;
color: #FFFFFF;
}
table
{
border-color: #CCCCCC;
border-width: 1;
border-style: solid;
}
td.lg
{
color: #FFFFFF;
background-color: #999999;
}
.small
{
font-size: 10px;
}
.x-small
{
font-size: 8px;
}
-->
</style>
<title>Servoy Headless Client test</title>
</head>
<body onload="javascript:document.searchform.filter.focus()">
<%
String theTable = "";
if(null==custid || null != filter)
{
theTable= (String)servoy_hc.executeMethod(null,"getList",new Object[]{pageid,filter});
}
else if(null==showOrders)
{
theTable = (String)servoy_hc.executeMethod(null,"getDetails",new Object[]{custid,pageid});
}
else
{
theTable = (String)servoy_hc.executeMethod(null,"getOrders",new Object[]{custid,pageid});
}
out.println(theTable);
%>
<br><font class="small">Company, Name or City:</font><form action="" method="post" name="searchform"><input name="filter" type="text" class="lg" id="filter" size="20" maxlength="10" onBlur="javascript:if (this.value.length>0) document.searchform.submit()"></form>
</body>
</html>
jcompagner wrote:if youre users must login before opening the solution. Then you have to make youre login dialog yourself. So create a jsp page before making the sessionclient and with the input of the first login page you make the session client with the user/password you got.
Return to Servoy Headless Client
Users browsing this forum: No registered users and 5 guests