SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

231 lines
6.1 KiB

<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %>
<html>
<head>
<%
if (request.getCharacterEncoding() == null)
request.setCharacterEncoding("UTF-8");
Object userobject=request.getSession().getAttribute("UserID");
String userid;
String filter="";
String sql="";
if(userobject == null)
{
%>
<jsp:forward page="/edit/not_authenticated.htm"/>
<%
}
else
userid=userobject.toString();
Object mandantobject=request.getSession().getAttribute("MandantenID");
String mandantenid="";
if(mandantobject != null)
mandantenid=mandantobject.toString();
//der superx-Default-Mandant ist bei dbforms ein Leerstring
if(mandantenid.equals("default"))
mandantenid="";
String custom_css=""; //TODO
String tid = request.getParameter("tid");
String fname = request.getParameter("Feldname");
String previousValue = request.getParameter("previousValue");
String zeilenanzahl = request.getParameter("zeilenanzahl");
String params = request.getParameter("params");
String callurl="../../servlet/SuperXmlMaske?tid="+tid+"&getJSON_"+fname+"=xxxxxx-xxxxxx@";
callurl+=params;
%>
<%@ include file="../../htmlhead_dialoge.inc" %>
<title>Auswahl <%=fname %></title>
</head>
<style>
/*.cell {
position: sticky;
top: 0;
z-index: 10;
}
.label {
font-size: 14px; }
.input-container {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.input-container > .label {
margin-bottom: 0.25rem;
@media (min-width: 768px) {
.input-container {
flex-direction: row;
align-items: center;
}
.input-container > .label {
margin-bottom: 0;
margin-right: 1rem;
}
}*/
</style>
<script type="text/javascript" language="javascript">
var comboContent;
var fname="<%= fname %>";
//var previousValue="<%= previousValue %>";
var zeilenanzahl="<%= zeilenanzahl %>";
var referrerWindow=window.opener;
var referrerDocument=referrerWindow.document;
var referrerForm=referrerDocument.forms[0];
var previousValue=referrerForm.elements[fname].value;
var previousValuesArray=ndMaskDialogPreviousValueToArray(previousValue);
var previousValuesCount=0;
if(previousValuesArray)
previousValuesCount=previousValuesArray.length;
function showCombo(url,searchstring)
{
var ret;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
comboContent= purgeval(this.responseText);
console.log(comboContent);
renderCombo(comboContent,searchstring);
}
};
xhttp.open("GET", url, true);
xhttp.send();
}
function renderCombo(content,searchstring)
{
var targetDiv=document.getElementById("comboDiv");
//targetDiv.innerHTML=JSON.stringify(content);
var zs="<ul style='list-style-type:none;'> ";
if(content && content.nodes && content.nodes.length >0)
{
for(var j=0;j < content.nodes.length;j++)
{
var node=content.nodes[j];
if(searchstring=="" || node.title.indexOf(searchstring)>-1)
{
if(node.objectId !="")
{
var checkedString="";
for(var i=0;i < previousValuesCount;i++)
{
if(previousValuesArray[i]==node.objectId)
checkedString="checked ";
}
var fldName="inp"+node.objectId;
var fldId="inp"+node.objectId;
var fldType="checkbox";
if(zeilenanzahl==1)
{
fldName=fname;
fldType="radio";
}
zs += "<li><input type='"+fldType+"' "+checkedString+ " name='"+fldName+ "' id='"+fldId+ "' value='"+node.objectId +"' />&nbsp;";
zs +="<label for='"+fldId+"' id='label"+node.objectId +"'>"+node.title+"</label></li>\n";
}
}
}
}
zs +="</ul>";
targetDiv.innerHTML=zs;
}
</script>
<body onload="showCombo('<%=callurl %>','')">
<form name="selection" onsubmit="return false;">
<div id="nd_navi_top" style="margin-bottom:3rem">
<nav class="navbar is-fixed-top" role="navigation" ><!--aria-label="main navigation"-->
<div class="navbar-brand">
<div class="navbar-item">
<p><strong>Auswahl <%=fname %></strong></p>
</div>
<div class="navbar-item">
<div class='input-container'>
<div class='field has-addons'><div class='control'>
<input id='comboSuche' class='input is-small is-active' type='text' placeholder='Suche' onBlur='renderCombo(comboContent,this.value);return false;'/>
</div><div class='control'><button class='button is-small is-rounded' onClick="renderCombo(comboContent,document.getElementById('comboSuche').value);return false;">
<span class='icon' aria-hidden='true' alt='Suche' title='Suche'><img src='../../images/search_blue.svg'/></span></button>
</div></div>
</div>
</div>
</div>
<div class="navbar-end"><span class="navbar-end">
<div class="navbar-item is-hoverable">
<div class="buttons">
<p class="submit_button">
<button class="button" type="submit">
<a onclick="ndMaskDialogUebernehmen(document.forms['selection'],referrerForm)">Übernehmen</a>
</button>
</p>
</div>
</div>
<div class="navbar-item is-hoverable">
<div class="buttons">
<p class="reset_button">
<button class="button">
<a onclick="ndMaskDialogLeeren(document.forms['selection'],referrerForm)">Leeren</a>
</button>
</p>
</div>
</div>
<div class="navbar-item is-hoverable">
<div class="buttons">
<p class="close_button">
<button class="button">
<span class="icon is-small">
<a onclick="window.close()">
<img src="../../images/close.svg" title="Schließen" aria-label="Schließen" /></a>
</span>
</button>
</p>
</div>
</div>
</span>
</div>
</nav>
</div>
<% if(zeilenanzahl!=null && !zeilenanzahl.equals("1"))
{
%>
<div class="input-container"> <!--style="padding-top:1em;"-->
<div class="buttons">
<input type="checkbox" name="metaCheckox" value="" style="margin-left:1.5rem" onclick="ndMaskDialogToggleAllCheckboxes(document.forms['selection'],this)" />&#160; alle markieren
</div>
</div>
<%
}
%>
<div class="input-container"> <!--style="padding-top:1em;"-->
<div id="comboDiv" class="comboDiv">keine Auswahl m&ouml;glich
</div>
</div>
</form>
</body>
</html>