jsf-2.2

Pass an object between @ViewScoped beans without using GET params

筅森魡賤 提交于 2019-12-27 10:29:20
问题 I have a browse.xhtml where I browse a list of cars and I want to view the details of the car in details.xhtml when a "View more" button is pressed. Their backing beans are @ViewScoped and are called BrowseBean and DetailsBean , respectively. Now, I wouldn't like the user/client to see the car ID in the URL, so I would like to avoid using GET params, as presented here and here. Is there any way to achieve this? I'm using Mojarra 2.2.8 with PrimeFaces 5 and OmniFaces 1.8.1. 回答1: Depends on

JSF-2 Select/Unselect all the list of checkboxes with single checkbox

别等时光非礼了梦想. 提交于 2019-12-25 19:56:12
问题 I have list of check boxes inside rich:dataTable and I want to check all the boxes at once with a single check box from header column. <rich:column id="includeInWHMapping" > <f:facet name="header"> <h:selectBooleanCheckbox value="#{checkallbox.selectAll}"> <f:ajax actionListener="#{checkallbox.selectAllBox}" render="selectedForWHProcess" /> </h:selectBooleanCheckbox> </f:facet> <h:selectBooleanCheckbox id="selectedForWHProcess" value="#{checkallbox.checked[data]}"> <f:ajax actionListener="#

how i get clicked CommandLink id in Controller in JSF?

时光总嘲笑我的痴心妄想 提交于 2019-12-25 06:28:35
问题 <ui:repeat value="#{prodCtr.paginator.model}" var="o"> <h:form> <h:commandLink id="#{o.id}" action="ModelInfo.xhtml" actionListener="#{prodCtr.listener}"> <h:panelGrid columns="1" style="border: #ffffff"> <img src="resources/images/#{o.id}.jpg" style="width: 100px;height: 100px"/> <h:outputLabel value="#{o.price} YTL" style="font-size: 12px;font-family: Georgia, Serif;color: #ff3300" /> <h:commandButton value="Sifaris et" class="button"/> </h:panelGrid> </h:commandLink> </h:form> </ui:repeat>

PrimeFaces update single row of datatable from dialogue

回眸只為那壹抹淺笑 提交于 2019-12-25 04:57:21
问题 I have a requirement where I am using rowExpension inside a datatable. which opens another datatable(sub table). Below sub table I have one edit button. upon clicking edit it opens model dialogue and once I click save it closes the dialogue but I am not able to find a way to update that particular sub table. Below is the code snippet of subtable & dialogue. Can anybody suggest me a way to update the particular subtable for which the edit button is clicked. <p:rowExpansion id="partyRows"> <p

java.lang.NoSuchMethodError: javax.faces.component.UIComponent.getPassThroughAttributes(Z)Ljava/util/Map; after migrating to JSF 2.2

孤街浪徒 提交于 2019-12-25 03:41:13
问题 I am getting the below exception after migrating to JSF 2.2. Specifically, I'm upgrading Mojarra 2.1.17 to Mojarra 2.2.8. java.lang.NoSuchMethodError: javax.faces.component.UIComponent.getPassThroughAttributes(Z)Ljava/util/Map; at org.primefaces.renderkit.RendererUtils.renderPassThroughAttributes(RendererUtils.java:79) at org.primefaces.renderkit.CoreRenderer.renderDynamicPassThruAttributes(CoreRenderer.java:119) at org.primefaces.renderkit.CoreRenderer.renderPassThruAttributes(CoreRenderer

(netbeans) jsf page not auto changing in browser

匆匆过客 提交于 2019-12-25 02:02:08
问题 i have weird issue when building jsf application in netbeans. when i run index.xhtml and then i change some text inside that file and save,the file won't get update on the browser. the browser still have the old page. i also try to clean and build again (without shutting down tomcat) and the result still not updated. but when i stop tomcat and run the application again,the update will show. i build it with maven project structure. i use Netbeans 7.4, primefaces 4.0,JSF 2.2.5 i already tried

Primefaces orderlist custom converter submitting wrong string representation on ajax post back

此生再无相见时 提交于 2019-12-24 23:26:33
问题 I need to reshuffle the order of some data models in a list, so I use Primefaces orderlist. The facelet is: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form id="main-form"> <p:panelGrid id="grid" columns="3"> <p:outputLabel value="Name" for="label"/> <p:inputText id="label" value="#{sampleBean.obj.name}" /> <p:message for=

When a form is handled in JSF, does it all happen in one thread?

本小妞迷上赌 提交于 2019-12-24 22:09:09
问题 Say I have this piece of code <p:dataTable styleClass="scheduleTable" value="#{todaySchedule.hours}" var="hour"> <p:column headerText="Hour" styleClass="hourColumn" > #{hour.time} </p:column> </p:dataTable> and in a class called todaySchedule, have a method public List<Hour> getHours() { final List<Hour> hours = IntStream.range(0, Hour.TIME.values().length) .mapToObj($ -> new Hour()).collect(Collectors.toList()); for (int i = 0; i < 5; i++) { hours.get(i).setHour(1); } return hours; } and

unable to load resource (icons) using .css file for JSF page [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 20:32:31
问题 This question already has answers here : How to use Font Awesome 4.x CSS file with JSF? Browser can't find font files (5 answers) Closed 3 years ago . This is my icon.css file. @font-face { font-family: 'icomoon'; src:url("#resource{['css/fonts/icomoon.eot']}"); src:url("#resource{['css/fonts/icomoon.eot?#iefix']}") format('embedded-opentype'), url("#resource{['css/fonts/icomoon.woff']}") format('woff'), url("#resource{['css/fonts/icomoon.ttf']}") format('truetype'), url("#resource{['css

submitForm() not defined for myfaces.JSF_JS_MODE 'minimal-modern'

妖精的绣舞 提交于 2019-12-24 15:36:49
问题 I tried to set up a simple JSF 2.2 application using MyFaces 2.2.8. Since MyFaces has some context parameters that I never used before, I tried to get familiar with those. So I got to use org.apache.myfaces.JSF_JS_MODE for the first time and ran into problems with h:commandLink . The commandLink is trying to call myfaces.oam.submitForm() which is not defined if I set the mode to minimal-modern . If I set the mode to minimal or normal it works. From reading some internet articles I assume this