jsf-2

f:ajax within ui:repeat, unknown id for the component [duplicate]

这一生的挚爱 提交于 2019-12-30 01:24:06
问题 This question already has answers here : How to find out client ID of component for ajax update/render? Cannot find component with expression “foo” referenced from “bar” (5 answers) Closed 3 years ago . When I try to render a panelGroup by an ajax call, it gives unknown id. <h:form id="form1" prependId=false> <h:panelGroup id="panel1"> <h:dataTable/> <ui:repeat value="#{bean.page}" var="page"> <h:commandLink value="#{page}"> <f:ajax execute="@form" render="panel1" listener="#{bean.page}" /> <

In JSF - Getting the Client's Locale (To Display time in browser's timezone)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-30 01:08:08
问题 I'm writing a webapp in JSF 2.0 that displays Timestamps as part of the information to the user. I would like the user to see the timestamps localized to their location (browser's locale). So far, whatever I did, the timestamps would always appear localized to the timezone of the server. I tried getting the locale with these methods: Locale browserLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); or Locale browserLocale = FacesContext.getCurrentInstance()

JSF 2 localization (managed bean)

我是研究僧i 提交于 2019-12-29 15:02:11
问题 I have a properties file for localization: foo=Bar title=Widget Application This is tied in as a resource-bundle in the faces-config: <resource-bundle> <base-name>com.example.messages.messages</base-name> <var>msgs</var> </resource-bundle> I can access this just fine in the facelets view using EL: <title>#{msgs.title}</title> However, if there are things like SQLExceptions, I need to be able to write messages from the managed bean. This is all working also: FacesMessage message = new

JSF 2 localization (managed bean)

天大地大妈咪最大 提交于 2019-12-29 15:02:08
问题 I have a properties file for localization: foo=Bar title=Widget Application This is tied in as a resource-bundle in the faces-config: <resource-bundle> <base-name>com.example.messages.messages</base-name> <var>msgs</var> </resource-bundle> I can access this just fine in the facelets view using EL: <title>#{msgs.title}</title> However, if there are things like SQLExceptions, I need to be able to write messages from the managed bean. This is all working also: FacesMessage message = new

Managed bean is not constructed

我怕爱的太早我们不能终老 提交于 2019-12-29 09:27:10
问题 My JSF managed bean is not constructed when I hit the page. This is my facelet: <h:dataTable value="#{productsBean.producten}" var="product"> <h:column>#{product.description}</h:column> <h:column>#{product.price}</h:column> <h:column>#{product.categoryName}</h:column> <h:column> <h:link value="Edit" outcome="/products/edit"> <f:param name="id" value="#{product.product_id}"/> </h:link> </h:column> </h:dataTable> This is my ProductsBean: @ManagedBean(eager=true) @RequestScoped public class

Change composite-component's namespace

会有一股神秘感。 提交于 2019-12-29 09:18:10
问题 I have a small library (JAR) containing some custom JSF-components. Some of them are composite-components which are completely (or partly) implemented in XHTML files which reside under META-INF/resources/my-components . To use these components from other XHTML-files I have to use the XML-namespace http://xmlns.jcp.org/jsf/composite/my-components . Other related components in this library are implemented as POJOs using @FacesComponent (and @FacesRenderer ). To use these components, I have to

p:commandButton not working inside c:forEach [duplicate]

烂漫一生 提交于 2019-12-29 08:17:05
问题 This question already has answers here : commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated (12 answers) Closed 4 years ago . i am trying to use p:commandButton inside c:forEach tag but this commandButton not invoked: <c:forEach items="#{carnetOrdreBean.selectedOrdreList}" var="ordre"> <p:commandButton action="#{carnetOrdreBean.annulerOrdreChoisi}" value="Annuler" rendered="#{ordre.voirAnnulerOuNon}"> <f:setPropertyActionListener value="#{ordre}"

java.lang.NoClassDefFoundError: javax/el/ELResolver when running SimpleHelloByEnteringName JSF example

╄→гoц情女王★ 提交于 2019-12-29 08:09:58
问题 I am new to JSF. I am using Tomcat 7.0.14 and trying to run SimpleHelloByEnteringName example but getting following errors in startup and at runtime Startup Console message: INFO: Deploying web application directory SimpleHelloByEnteringName Jun 15, 2011 7:35:42 AM com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.0.3 (FCS b03) for context '/SimpleHelloByEnteringName' Jun 15, 2011 7:35:43 AM com.sun.faces.spi.InjectionProviderFactory createInstance INFO:

Using inputText inside ui:repeat to update ArrayList of values is not working [duplicate]

你离开我真会死。 提交于 2019-12-29 08:05:41
问题 This question already has an answer here : Using <ui:repeat><h:inputText> on a List<String> doesn't update model values (1 answer) Closed 3 years ago . As referring to Post's title., I'm trying to update the values of ArrayList from h:inputText inside ui:repeat , which is not working. Please see the following mock up for further understanding: I have a POJO class as follows: public class User implements Serializable{ private String name; private List<String> emails; public User(String name,

PrimeFaces' oncomplete attribute in JSF <h:commandButton>

早过忘川 提交于 2019-12-29 07:56:23
问题 I didn't find an oncomplete attribute available in some tags in PrimeFaces within a standard JSF <h:commandButton> . How can I get oncomplete-like functionality while using <h:commandButton> ? 回答1: Since primefaces oncomplete is equivalent to plain JSF success event (for more details take a look at this answer comments , you should use the success event in the following way: Inline solution <h:commandButton id="someId" action="#{myBean.myAction}"> <f:ajax onevent="function(data) { if (data