이제 OminiFaces의 'o : methodParam'이 다음과 같이 작동합니다. 다른 방법을 사용하려면 어떻게해야합니까? 내가 뭘 놓치고 있는지 모르겠다. Seam
을 사용하지 않고 <h:commandButton>
및 <a4j:jsFunction>
과 작동 할 수 있습니다. Seam
을 사용하면 <a4j:jsFunction>
과 작동하지 않습니다.Ominifaces EL 문자열 전달
개발 Eviroment는 RichFaces 4. Seam 2.3 OminiFaces 1.2 JBoss 7.1.1
@Name("DataTableBacking")
public class DataTableBacking {
Department[] items = {new Department("AAA", "AAA"), new Department("BBB", "BBB"), new Department("CCC", "CCC")};
public Department[] getItems() {
return items;
}
public void action(Department action) {
System.out.println("Action called with:" + action.getName());
}
}
datatable.xhtml
태그 lib에<h:html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:richm="http://developmentTutorials.com/java">
<h:body>
<h:form>
<h1>Data Table</h1>
<rich:dataTable id="departmentTable" value="#{DataTableBacking.items}" var="dep" style="width:100%">
<rich:column style="width:100px;text-align:center;">
#{dep.name}
<richm:confirmLink actionBeanMethod="#{DataTableBacking.action(dep)}" render="departmentTable"/>
</rich:column>
</rich:dataTable>
</h:form>
</h:body>
</h:html>
, confirmation.xml 내가 완전히 확실하지 않다
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions"
xmlns:ui="http://java.sun.com/jsf/facelets">
<o:methodParam name="methodParam" value="#{actionBeanMethod}" />
<a4j:commandLink value="delete" onclick="#{rich:component('confirmation')}.show();return false" />
<h:commandButton value="direct" action="#{methodParam}" />
<a4j:jsFunction name="submit" action="#{methodParam}" render="#{render}" />
<rich:popupPanel id="confirmation" width="250" height="150">
<f:facet name="header">Confirmation</f:facet>
<h:panelGrid>
<h:panelGrid columns="1">
<h:outputText value="Are you sure?" style="FONT-SIZE: large;" />
</h:panelGrid>
<h:panelGroup>
<input type="button" value="OK" onclick="#{rich:component('confirmation')}.hide(); submit(); return false" />
<input type="button" value="Cancel" onclick="#{rich:component('confirmation')}.hide(); return false" />
</h:panelGroup>
</h:panelGrid>
</rich:popupPanel>
</ui:composition>
확인하려면 뷰 범위의'# {ManageDepartmentAction} '이고 순수 getter 인 getDepartmentList()입니까? – BalusC
'ManageDepartmentAction'는 JBoss Seam의 'Conversation' 범위입니다. 'getDepartmentList()'는 순수한 getter 메소드입니다. 'departmentList'는 이미 Bean 초기 상태'(@Begin을 사용하여)'에서 DB로부터 검색합니다. 'getDepartmentList()'메소드는 단지'departmentList'를 리턴합니다. – CycDemo
JSF에서 @ManagedBean으로 "@Named"("@Name is typo?")를 변경하면 어떻게됩니까? 두 가지 주석이 있음을주의하십시오.이 경우 javax.faces가 필요합니다. –