jsf-2

Client side validation using javascript with JSF

橙三吉。 提交于 2019-12-23 03:44:07
问题 I'm using JSF 2.0 and PrimeFaces library. I have a page with several inputs (among them there are 2 p:calendar components). I want to validate that the second date is not before the first date, but I want this validation to happen in the client, and if validation fails, then don't submit the form and display the h:message that belong to the calendars. PrimeFaces' calendar has a minDate attribute, but this just works not allowing to choose a previous date using the graphical calendar, but you

Proxy Exception while injecting spring bean into JSF bean

大兔子大兔子 提交于 2019-12-23 03:28:09
问题 I'm trying to inject spring bean into JSF bean, I'm using Spring 3.1 and JSF 2 (Mojarra 2.1.7) Without a lot of talking my configuration and code and exception listed in the following: StudentService.java: @Scope(proxyMode=ScopedProxyMode.TARGET_CLASS) public class StudentsService extends AbstractMaqraaService { @Override public Set<Class<?>> getTypes() { // TODO Auto-generated method stub return null; } public Student registerStudent(Student student) { return this.store(student); } }

Close all expanded rows inside a ui:repeat

偶尔善良 提交于 2019-12-23 03:26:34
问题 I have a ui:repeat of auction items inside a table. It is a regular html table because when you click on a Bid commandLink a row opens right under the selected auction item, and displays a bidding component. The Bid commandLink is using ajax like this: <f:ajax listener="#{bean.addBidView(lot)}" render="bidView" /> addBidView is updating a map of auctionItems and that's how the correct selected row opens up. When the user clicks on the same Bid link again, the addBidView figures it out and

method is not invoked on p:confirmDialog

眉间皱痕 提交于 2019-12-23 03:20:06
问题 i am using JSF 2.1 primefaces 3.5 i have p:datatable on every row i have edit - delete commandLink, on delete h:commandLink i have used p:confirmDialog when i click delete h:commandLink confirmDialog popup, if i press yes commandButton action method is not invoking.. but if i put p:confirmDialog code out the form method is invoking can't understand what happening <h:body> <p>hello</p> <ui:composition template="/template/mastertemplate.xhtml"> <ui:define name="content"> <f:view> <div id="main"

p:datatable selection null

十年热恋 提交于 2019-12-23 03:16:11
问题 I'm trying to use selectable datatable of primefaces 4.0, but the selected object is always null. I have tired add rowKey like here and here said, but still get null... here's my page : <p:dataTable id="appDetailTable" var="appDetail" value="#{newAppraiseBean.appDetailDataModel}" paginator="true" rows="5" paginatorPosition="bottom" selection="#{newAppraiseBean.selectedAppDetail}" rowKey="#{appDetail.appraiseDetailID}" selectionMode="single"> <p:ajax event="rowSelect" listener="#

What is the method for gracefully handling session timeout?

我的梦境 提交于 2019-12-23 03:13:05
问题 The problem: I am on some page of my application and go away for a while. Coming back and clicking on a link I get a "Unable to restore viewID" message. Same on hitting refresh. I can start a new session, but I have to manually edit the URL as follows: Active address window: http://localhost:8080/myapp/index.xhtml?windowId=e9d into http://localhost:8080/myapp/index.xhtml Then a new session is established, and the user has to log in again which is what I want. In researching how to deal with

ui:repeat using the same client id. c:foreach works fine

随声附和 提交于 2019-12-23 03:11:58
问题 I know this may have something to do with the phase each one comes in at. If I do this. <ui:repeat id="repeatChart" varStatus="loop" value="#{viewLines.jflotChartList}" var="jflotChart"> <p:panel> <jflot:chart height="300" width="925" dataModel="#{jflotChart.dataSet}" dataModel2="#{jflotChart.dataSet2}" xmin="#{jflotChart.startDateString}" xmax="#{jflotChart.endDateString}" shadeAreaStart ="#{jflotChart.shadeAreaStart}" shadeAreaEnd ="#{jflotChart.shadeAreaEnd}" lineMark="#{jflotChart

Faces Servlet not parsing .xhtml pages in jsf 2. running on tomcat 7

泪湿孤枕 提交于 2019-12-23 03:09:19
问题 I am trying to create a JSF 2.0 application in eclipse with tomcat7. The project is running successfully but the jsf html and core components are not rendered in browser. I think Faces Servlet I have configured in web.xml. Following is the web.xml file - <welcome-file-list> <welcome-file>faces/index.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> <

PrimeFaces 6.0 - InputText Ajax event + CommandButton Event Yields NULL Bean Fields

守給你的承諾、 提交于 2019-12-23 02:36:57
问题 I want to trigger a method when a text field is blurred, and so I added an Ajax onblur event to this text field, and it works. The problem I am having is with the commandButton that submits a bean with NULL fields. When I get rid of the inputText Ajax event, the form submission works as usual. The .xhtml file: ` <h:head> <title>Saisie Cotisations</title> </h:head> <h:body> <h3>Saisie Cotisation</h3> <h:form id="formulaire"> <h:panelGroup> <p:panelGrid columns="2" id="panelMenage" > <p

JSF 2.0 redirect error

对着背影说爱祢 提交于 2019-12-23 02:34:09
问题 I get an IllegalStateException when redirecting from a preRenderView event. I have worked around it by just ingoring the exception. Is there a cleaner way to achieve the same result? @Named @RequestScoped public class LogoutBean implements Serializable { public void preRenderView(ComponentSystemEvent e) { userSessionBean.logout(); FacesContext ctx = FacesContext.getCurrentInstance(); try { ctx.getApplication().getNavigationHandler().handleNavigation(ctx, null, "/pages/index?faces-redirect