DKARS MAGAZINE
BKN430av5sm
BKN430av5sm
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
String rstTX=request.getParameter("rstTX");<br />
if(rstTX==null) rstTX="";<br />
qsoi.put("rstTX", rstTX); // eg. 599<br />
String rstRX=request.getParameter("rstRX");<br />
if(rstRX==null) rstRX="";<br />
qsoi.put("rstRX", rstRX); // eg. 599<br />
String name=request.getParameter("name");<br />
if(name==null) name="";<br />
qsoi.put("name", name); // eg. Peter<br />
String qth=request.getParameter("QTH");<br />
if(qth==null) qth="";<br />
qsoi.put("qth", qth); // eg. Kralendijk<br />
String loc=request.getParameter("loc");<br />
if(loc==null) loc="";<br />
qsoi.put("loc", loc); // eg. FK52UD<br />
String dist=request.getParameter("dist");<br />
if(dist==null) dist="";<br />
qsoi.put("dist", dist); // eg. 8068<br />
String dxcc=request.getParameter("dxcc");<br />
if(dxcc==null) dxcc="";<br />
qsoi.put("dxcc", dxcc); // eg. Bonaire<br />
Code sample 17<br />
The next search for ‘freq’ brings us into the list:<br />
Search two<br />
out.write(""+getFreq()+"\n");<br />
This is where the list of QSO’s are displayed, using Java functions<br />
to obtain the actual values, so we have to create those as well.<br />
Add to this the following:<br />
out.write("" +getRstTX()+"\n");<br />
out.write("" +getRstRX()+"\n");<br />
out.write(""+getName()+"\n");<br />
out.write("" +getQTH() +"\n");<br />
out.write("" +getLoc() +"\n");<br />
out.write(""+getDist()+"\n");<br />
Code sample 20<br />
The class names are the same as for the headers, so it should<br />
line up nicely. The ‘out.write()’ is necessary because this is inside<br />
a java section, rather than straight HTML. Java generates the<br />
HTML and writes it out.<br />
Further with the search, we come to the section:<br />
Search five<br />
.freq { width:50px;}<br />
<br />
For this we have to think carefully how big each field should be.<br />
It should all fit on the window, so they can’t be too big.<br />
Here are some reasonable values, but you could experiment a<br />
bit with different values. Note that there is just one entry for rst,<br />
as both RX and TX will be the same width.<br />
Add the following:<br />
.rst { width:40px;}<br />
.name { width:80px;}<br />
.qth { width:100px;}<br />
.loc { width:60px;}<br />
.dist { width:60px;}<br />
.dxcc { width:100px;}<br />
Code sample 18<br />
Next search: in the of the table we find:<br />
Search three<br />
This is where the new inputs take place.<br />
<br />
<br />
<br />
<br />
<br />
<br />
Code sample 21<br />
Later we will create a distance calculator for the locator which<br />
wants it to be in uppercase, so just like with the callsign we use<br />
the JavaScript event ‘onblur’ (mouse moving out of this field) to<br />
call the toUpper() function and make sure the locator is uppercased.<br />
The next search brings us into the Java-only section:<br />
Search six (the final search!)<br />
Freq<br />
String getFreq() { return onerecord.get("freq"); }<br />
The ‘class’ is the name we set in the CSS above, so that all becomes:<br />
rstTX<br />
rstRX<br />
Name<br />
QTH<br />
Locator<br />
Dist<br />
DXCC<br />
Next in the search:<br />
Search four<br />
Code sample 19<br />
Here we set the functions that we can call from within the HTML<br />
table to set the QSO data. They return the values found in the<br />
XML database.<br />
String getRstRX() { return onerecord.get("rstTX"); }<br />
String getRstTX() { return onerecord.get("rstRX"); }<br />
String getQTH() { return onerecord.get("name"); }<br />
String getName() { return onerecord.get("qth"); }<br />
String getLoc() { return onerecord.get("loc"); }<br />
String getDist() { return onerecord.get("dist"); }<br />
String getDxcc() { return onerecord.get("dxcc"); }<br />
Code sample 22<br />
<strong>DKARS</strong> Magazine, editie 31 -26- Maart 2017