Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Java [игнор отключен] [закрыт для гостей] / RichFaces расположение h:form / 2 сообщений из 2, страница 1 из 1
05.03.2012, 12:05:40
    #37691328
sjinks
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
RichFaces расположение h:form
Имеем такую ошибку:
авторThe form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form>

После которой замораживается форма и переход по кнопкам невозможен. На сколько я понимаю, дело в неправильном расположении элемента формы (h:form). Вот страница:

Код: java
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.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
	
   	<f:view>     
	<h:head>
		<title>Costs control system \\ Отчет по выбранному филиалу</title>
	</h:head> 
		<h:body>
				<table>
					<tr>
						<td>
							<h:commandButton action="index.xhtml" value="Главная"/>
							<h:commandButton value="Ввод платежей">
								<rich:componentControl target="popup" operation="show"/>
							</h:commandButton>
							
							
							<rich:popupPanel id="popup" modal="true" onmaskclick="#{rich:component('popup')}.hide()" autosized="true">
								 <f:facet name="header">
           							 <h:outputText value="Costs control system // Ввод платежей" />
       							 </f:facet>
        						 <f:facet name="controls">
            								<h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); window.location.reload(true); return false;">X</h:outputLink>
        						 </f:facet>
						         <p align="center">#{addExpensesController.selectedOffice}</p>
						         <h:form>
						         <table>
							     	<tr>
										<td>
											<h:selectOneMenu value="#{addExpensesController.selectedExpense}">
												<f:selectItems value="#{addExpensesController.expensesList}"/>
											</h:selectOneMenu>
										</td>
										<td>
											<h:inputText value="#{addExpensesController.expenseAmount}" required="true"/>
										</td>
									</tr>
									<tr>
										<td colspan="2">
											<h:inputTextarea rows="10" cols="35" value="#{addExpensesController.expenseDescription}"/>
										</td>
									</tr>
									<tr>
										<td>
											<h:commandButton value="Сохранить" action="#{addExpensesController.saveExp()}"/>
										</td>
									</tr>
						         </table>
						         </h:form>
							</rich:popupPanel>
						</td>
					</tr>
				</table>
				<table align="center">
					<tr>
						<td>
							<h:dataTable border="1" value="#{reportTableController.reports}" var="report">
								<f:facet name="caption"><h3>#{reportTableController.selectedOffice}</h3></f:facet>
								<h:column>
									<f:facet name="header">
										<h:outputText value="Затраты"/>
									</f:facet>
									<h:outputText value="#{report.expName}"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<h:outputText value="Описание"/>
									</f:facet>
									<h:outputText value="#{report.expDesc}"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<h:outputText value="Сумма"/>
									</f:facet>
									<h:outputText value="#{report.expAmount}"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<h:outputText value="Дата"/>	
									</f:facet>
									<h:outputText value="#{report.expDate}"/>
								</h:column>
								<f:facet name="footer"><b>Итого: <h:outputText value="#{reportTableController.summaryAmount}"/></b></f:facet>
							</h:dataTable>
						</td>
					</tr>
				</table>
		</h:body>
		</f:view>
</ui:composition>
...
Рейтинг: 0 / 0
05.03.2012, 15:09:39
    #37691702
забыл ник
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
RichFaces расположение h:form
Насколько я понимаю, тут проблема в другом, твоя форма в попапе - с ней все ок. Тебе нужно добавить другие формы на страницу, поэтому и ругается. Если говорить коротко то все h:inputText и h:commandButton должны находиться в своей фрме, это же основы HTML
...
Рейтинг: 0 / 0
Форумы / Java [игнор отключен] [закрыт для гостей] / RichFaces расположение h:form / 2 сообщений из 2, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]