jsf-2

How to attach ajax event to composite component?

点点圈 提交于 2019-12-19 02:06:45
问题 I have the following composite component (<v2:inputText2>) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"> <!-- INTERFACE --> <composite:interface> <composite:attribute name="baseId" required="true" />

a4j:support tag not found using JSF 2

旧城冷巷雨未停 提交于 2019-12-19 02:06:31
问题 just trying to integrate this commandLink <a4j:commandLink reRender="results-view" actionListener="#{myaction}" oncomplete="return false;" value="#{msg1.advanced_search}"> <a4j:support event="onclick"> <f:setPropertyActionListener value="./page.xhtml" target="#{changeViews['new-view'].value}" /> </a4j:support> </a4j:commandLink> On an applicacion which is using JSF2. If I leave it, I get this error Tag Library supports namespace: http://richfaces.org/a4j, but no tag was defined for name:

No session generation in jsf

谁说我不能喝 提交于 2019-12-18 21:31:08
问题 In JSP, there is an attribute session used for disable autogeneration session in a request. <%@page contentType="text/html" pageEncoding="UTF-8" session="false" %> Is there any way to do same in JSF2? Thanks Why? Because we have a public register form page as a default page in an application. It is a very simple form and session is created everytime people (or robots, etc.) request main page. ManagedBean is RequestScope, but JSF create one session in first navegation request. 回答1: Just don't

p:dataTable selections are lost after paginating a LazyDataModel

倾然丶 夕夏残阳落幕 提交于 2019-12-18 18:51:40
问题 My problem is that after I've selected a few items on the 1st page, if I paginate to another page and come back, my initial selections are not shown. I've tried to implement the SelectableDataModel as well as using the rowKey attribute but the problem persists. This is my test bean: @ManagedBean @ViewScoped public class MrBean { private List<Item> chosenItems; private LazyDataModel lazyModel; @PostConstruct public void prepareTest() { this.lazyModel = new LazyItemDataModel(); } public void

<h:dataTable value=#{myBean.xxx}>: getXxx() get called so many times, why?

隐身守侯 提交于 2019-12-18 18:10:23
问题 Simple piece of code about dataTable . CentralFeed is SessionScoped Bean, and PostComment is RequestScoped Bean <h:form id="table"> <h:dataTable value="#{CentralFeed.profileComments}" var="item"> <h:column> <h:outputText value="#{item.comment}"/><br/> <h:inputTextarea value="#{item.newComment}" rows="2"/><br/> <h:commandButton value="Post" action="#{PostComment.postReply(item)}" /> </h:column> </h:dataTable> </h:form> inside CentralFeed.java private List<NewsFeed> profileComments = null;

<h:dataTable value=#{myBean.xxx}>: getXxx() get called so many times, why?

馋奶兔 提交于 2019-12-18 18:10:10
问题 Simple piece of code about dataTable . CentralFeed is SessionScoped Bean, and PostComment is RequestScoped Bean <h:form id="table"> <h:dataTable value="#{CentralFeed.profileComments}" var="item"> <h:column> <h:outputText value="#{item.comment}"/><br/> <h:inputTextarea value="#{item.newComment}" rows="2"/><br/> <h:commandButton value="Post" action="#{PostComment.postReply(item)}" /> </h:column> </h:dataTable> </h:form> inside CentralFeed.java private List<NewsFeed> profileComments = null;

JSF2 with GAE and ViewScoped ManagedBean

淺唱寂寞╮ 提交于 2019-12-18 17:27:16
问题 I managed to get a prototype with JSF2 get working at Googles AppEngine following this tutorial. Now I have some odd behavior with a ViewScoped ManagedBean: @ManagedBean @ViewScoped public class TestBean implements Serializable { private String text; //getter/setter private List<String> texts; //getter @PostConstruct public void init() { texts = new ArrayList<String>(); texts.add("Test"); text = new String(); } public void save(ActionEvent ae) { texts.add(text); text = new String(); } } This

Can CDI managed beans and JSF managed beans talk to each other?

烂漫一生 提交于 2019-12-18 16:57:41
问题 I have a Tomcat 6 JSF web application that I'd like to set up with CDI beans. I will have to convert the project to CDI gradually though. My question is: can CDI beans and traditional JSF managed beans be injected into each other? Thanks. 回答1: All JSF managed beans (JMB) either are CDI managed beans (CMB) automatically, or can be recognized as such using the beans.xml marker file. (The requirements of a CMB are set very low and basically just dictate the existence of a non-parameter

gzip compression for jsf stuff

跟風遠走 提交于 2019-12-18 16:51:24
问题 I have an jsf application (mojarra 2.1.8, primefaces 3.3) running on tomcat 6. While analyzing the page in firebug with google page-speed, I realized I could optimize some stuff by gzip-compression. Compressing the following resources with gzip could reduce their transfer size by 371,1KiB (74% reduction). Compressing http://localhost:8080/someApp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces could save 72,5KiB (74% reduction). Compressing http://localhost:8080/someApp/javax.faces

JSF Action vs Outcome Attribute

我的梦境 提交于 2019-12-18 16:50:03
问题 I'm new to JSF and am trying to understand what the difference is between the action vs the outcome attributes? This is not the difference between buttons and command buttons, but between outcome vs action attributes on the same button tag. For instance, I can have: <h:button value="Go" outcome="<value>" /> or <h:button value="Go" action="<value>" /> I'm not sure when to use which one. Also, does it make a difference if <value> is <#{bean.methodThatReturnsStringInNavigationRule}> or <string