質問編集履歴

1

コードを追加いたしました。

2015/08/02 23:13

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -7,3 +7,109 @@
7
7
  今現在表示の切替はrenderedでヘッダに指定したテキストが入れば表示するという形をとっております。
8
8
 
9
9
  コードは都合上現在書けない状況なので後ほど追記いたしますが、もしこの説明のみで原因のわかる方がいらっしゃいましたらご回答の方よろしくお願いいたします。
10
+
11
+
12
+
13
+ ```mainMenu.xhtml
14
+
15
+ <h:form id="mainForm">
16
+
17
+ <p:layout id="layout" fillPage="true"/>
18
+
19
+ <p:layoutUnit position="north" size="120">
20
+
21
+ <h:outputText value="タイトル"/>
22
+
23
+ </p:layoutUnit>
24
+
25
+ <p:layoutUnit position="south" size="50"/>
26
+
27
+ <p:layoutUnit position="west" size="250">
28
+
29
+ <p:commandButton value="#{dictionary.conversion('スケジュール')}"
30
+
31
+ action="#{menuController.updateCen}" update=":mainForm:layout"/>
32
+
33
+ </p:layoutUnit>
34
+
35
+ <p:layoutUnit position="east" size="250"/>
36
+
37
+ <p:layoutUnit position="center">
38
+
39
+ <p:schedule rendered="#{menuController.text='スケジュール'}"
40
+
41
+ view="basicWeek" timeZone="GMT+2">
42
+
43
+ <f:facet name="header">
44
+
45
+ <h:outputText value="#{menuController.text}"/>
46
+
47
+ </f:facet>
48
+
49
+ </p:schedule>
50
+
51
+ </p:layoutUnit>
52
+
53
+ コード
54
+
55
+ ```
56
+
57
+ ```menuController.java
58
+
59
+ import java.io.Serializable;
60
+
61
+ import javax.enterprize.context.SessionScoped;
62
+
63
+ import javax.inject.Named;
64
+
65
+
66
+
67
+ @Named
68
+
69
+ @SessionScoped
70
+
71
+ public class MenuController implements Serializable {
72
+
73
+ private static final long serialVersionUID = .............;
74
+
75
+ private String text = null;
76
+
77
+ public String getText() {
78
+
79
+ return text;
80
+
81
+ }
82
+
83
+ public void setText(String text) {
84
+
85
+ this.text = text;
86
+
87
+ }
88
+
89
+ public String updateCen() {
90
+
91
+ try {
92
+
93
+ if(text != "スケジュール") {
94
+
95
+ text = "スケジュール";
96
+
97
+ } else if(text == "スケジュール") {
98
+
99
+ text = null;
100
+
101
+ }
102
+
103
+ } catch(NumberFormatException e) {
104
+
105
+ text = "Invalid Data";
106
+
107
+ }
108
+
109
+ return "";
110
+
111
+ }
112
+
113
+ コード
114
+
115
+ ```