My favorites | Sign in
Project Home Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:pm="http://primefaces.org/mobile"
contentType="text/html">

<pm:page title="PrimeFaces Mobile Weather">

<!-- Main View -->
<pm:view id="main">
<pm:header title="Weather">
<f:facet name="right">
<p:button value="Settings" icon="gear" href="#settings" />
</f:facet>
</pm:header>

<pm:content>
<h:form id="mainForm">
<h:outputText value="Select City:" />
<h:selectOneMenu value="#{weatherController.city}">
<f:selectItems value="#{weatherController.cities}" />
</h:selectOneMenu>

<p:separator />

<p:commandButton value="Get Forecast" update="display" actionListener="#{weatherController.retrieveConditions}"/>

<p:outputPanel layout="block" style="text-align:center">
<h:outputText id="display" value="#{weatherController.conditions}" escape="false" />
</p:outputPanel>
</h:form>
</pm:content>
</pm:view>

<!-- Settings View -->
<pm:view id="settings">
<pm:header title="Weather">
<f:facet name="left"><p:button value="Back" icon="back" href="#main?reverse=true"/></f:facet>
</pm:header>

<pm:content>
<h:form id="settingsForm">

<h:outputText value="Select Unit:" />
<h:selectOneMenu value="#{weatherController.unit}">
<f:selectItem itemLabel="Celcius" itemValue="c" />
<f:selectItem itemLabel="Fahrenheit" itemValue="f" />
</h:selectOneMenu>

<p:separator />

<p:commandButton value="Save" actionListener="#{weatherController.saveSettings}" update=":mainForm:display"
action="pm:main"/>

</h:form>
</pm:content>
</pm:view>

</pm:page>

</f:view>

Change log

r5923 by cagatay.civici on Nov 17, 2011   Diff
Sample update
Go to: 
Project members, sign in to write a code review

Older revisions

r5887 by cagatay.civici on Nov 15, 2011   Diff
Replaced pm:commandButton with
p:commandButton.
r5864 by cagatay.civici on Nov 15, 2011   Diff
Sample update
r5806 by cagatay.civici on Oct 29, 2011   Diff
Fixed mobile samples
All revisions of this file

File info

Size: 2314 bytes, 62 lines
Powered by Google Project Hosting