<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:gmap="http://labs.jboss.com/jbossrichfaces/ui/gmap"
xmlns:a4j="http://richfaces.org/a4j">
<h:form>
<h:panelGrid columns="2" border="1">
<h:panelGroup>
<h:outputText value="wenigstens die textausgabe sollte ja klappen verdammt!"/>
</h:panelGroup>
<h:panelGroup>
<h:graphicImage value="/jsf/pics/wc_r.png" title="This is demo" width="32" height="32"/>
</h:panelGroup>
</h:panelGrid>
<rich:spacer height="100" />
<h:panelGrid columns="2" border="1">
<h:panelGroup>
<h:panelGrid columns="2" border="5">
<rich:gmap id="gm2" lat="9.5391" lng="97.9405" zoom="11" gmapVar="map2"
gmapKey="...derkeyhalt...g"
style="width:500px;height:400px" />
<!-- JScript Funktionen der Map: -->
<h:panelGroup>
Controls:<br />
<a href="javascript:void(0);" onclick="map2.hideControls();return false;">Remove</a>
<a href="javascript:void(0);" onclick="map2.showControls();return false;">Show</a>
<br /><br />
Type:<br/>
<a href="javascript:void(0);" onclick="map2.setMapType(G_NORMAL_MAP);return false;">Normal</a>
<a href="javascript:void(0);" onclick="map2.setMapType(G_SATELLITE_MAP);return false;">Satellite</a>
<a href="javascript:void(0);" onclick="map2.setMapType(G_HYBRID_MAP);return false;">Hybrid</a>
<br /><br />
Zoom:<br/>
<a href="javascript:void(0);" onclick="map2.zoomIn();return false;">Zoom ++</a>
<a href="javascript:void(0);" onclick="map2.zoomOut();return false;">Zoom --</a>
<br /><br />
<a href="javascript:void(0);" onclick="zoomIt();return false;">zoom_von_Bean</a>
<br /><br />
<a href="javascript:void(0);" onclick="initializePoints();return false;">a4j-Test</a>
<br /><br />
</h:panelGroup>
</h:panelGrid>
<script>
function zoomIt() {
map2.setZoom(#{Bean.zoom});
}
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
function setCenter(lag, lat, zoom) {
map2.setCenter(new GLatLng(lag, lat), zoom);
var ulp = new GPoint(lag,lat);
var ul = G_NORMAL_MAP.getProjection().fromPixelToLatLng(ulp,zoom);
}
</script>
<script type="text/javascript">
//<![CDATA[
function createPoints(data) {
for (var i = 0; data.length; i++) {
var point = new GLatLng(data[i].latitude, data[i].longitude);
map2.setCenter(point);
map2.setZoom(16);
map2.addOverlay(createMarkerWithIdentifier(point, data[i].beschreibung));
}
}
function createMarkerWithIdentifier(point, beschreibung) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(beschreibung);
});
return marker;
}
//]]>
</script>
<a4j:jsFunction name="initializePoints" data="#{Bean.hotels}"
oncomplete="createPoints(data)">
</a4j:jsFunction>
</h:panelGroup>
<h:panelGroup>
<rich:panel>
<f:facet name="header">
verfuegbare Hotels:
</f:facet>
Bemerkung: man darf keine speziellen Umlaute des deutschen Alphabets benutzen, welche
allesamt sprachgeschichtlich i-Laute sind, also ae, ue, oe... *NARF!*
<rich:scrollableDataTable id="uTable" value="#{Bean.hotels}" var="hotel"
frozenColCount="1" rowKeyVar="rkv"
row="25" width="300px" height="300px" sortMode="single">
<rich:column width="50">
<h:outputText value="#{hotel.name}" />
</rich:column>
<rich:column width="250">
<h:outputText value="#{hotel.adresse}" />
</rich:column>
</rich:scrollableDataTable>
</rich:panel>
</h:panelGroup>
</h:panelGrid>
<rich:spacer height="5" />
<!-- hier sollen die unterschiedlichen Bilder ja nach Propertywert
angezeigt werden
<h:graphicImage value="/jsf/pics/bar.png"/>
<h:graphicImage value="/jsf/pics/buchung.png"/> ...
-->
<a4j:commandButton action="Hotels"
style="height : 24px; width : 160px;" value="Hotels">
</a4j:commandButton>
</h:form>
</ui:composition>