jsf-2

How to conditionally render or style a row of primefaces dataTable?

好久不见. 提交于 2020-01-04 05:30:10
问题 Inside my p:dataTable , I am trying to render only the rows I need. Code: <h:form id="f"> <p:dataTable var="order" value="#{mbOrderController.ordersList}"> <f:facet name="header">#{msg.orders}</f:facet> <p:column sortBy="#{order.orderNr}" headerText="#{msg.order_number}"> <p:outputLabel value="#{order.orderNr}" rendered="#{order.type.label == 'Shoes'}" /> </p:column> <p:column sortBy="#{order.date}" headerText="#{msg.date}"> <p:outputLabel value="#{order.date}"> <f:convertDateTime pattern="dd

How to reset dropdown on primefaces commandButton reset type

[亡魂溺海] 提交于 2020-01-04 05:21:10
问题 How to reset the value of p:selectOneMenu on pressing p:commandButton on type reset. The code i have is as follows <h:form id="form"> <p:panelGrid columns="2" cellspacing="10" > <f:facet name="header">Login</f:facet> <p:outputLabel value="Username" /> <p:inputText value="#{user.username}" /> <p:outputLabel value="Password" /> <p:password value="#{user.password}"></p:password> <p:outputLabel value="Locale" /> <p:selectOneMenu > <f:selectItem itemValue="Select Country" itemLabel="Select Country

JSF generated pages and entities, selectOneMenu

一个人想着一个人 提交于 2020-01-04 05:13:18
问题 Using NetBeans, I have generated Hibernate mapping files and set of POJOs. I have also generated a set of JSF pages from entity classes (those generated POJOs). Now, I am trying to add a dropdown menu that would enable me to select one of the enitites. <h:selectOneMenu value="#{measurementController.sensor}"> <f:selectItems value="#{sensorController.itemsAvailableSelectOne}" /> </h:selectOneMenu> getItemsAvailableSelectOne() calls this method: public static SelectItem[] getSelectItems(List<?>

How to address the surrounding naming container in jsf?

限于喜欢 提交于 2020-01-04 05:08:27
问题 I have a jsf 2.0 page with a <p:dataTable> and inside this table a <p:commandButton> that should delete an item from this table with an ajax request. The deleting itself works fine, but I do not know how to identify the surrounding <p:dataTable> for the render update . <lots of naming containers> ... <p:dataTable id="dataTable" var="userItem" ... /> <p:column> <p:commandButton action="#{userController.doDelete(userItem.id)}" value="delete" update="?????"/> <!-- How to address the dateTable? -

Securing JSF applications

橙三吉。 提交于 2020-01-04 04:56:13
问题 I've been asked by a freelancer friend of mine to join him on a JSF 2.0 project, and I'm slowly picking up speed and putting the pieces together. Coming from a Windows Forms .NET world, I have a lot to learn to say the least. My major concern is with the lack of apparent consensus on how to protect a JSF application. Some methods have been proposed here on SO, including using Spring security, Seam security, custom phase listeners, or simply using the rendered="#{...}" attribute to show/hide

Primefaces download file from datatable [duplicate]

为君一笑 提交于 2020-01-04 04:40:13
问题 This question already has an answer here : How and when should I load the model from database for h:dataTable (1 answer) Closed 3 years ago . I have this weird issue with File Download option not being called from the XHTML. I am very new to JSF, so it might be something basic that I am screwing up, but any help would be appreciated. This is my XHTML <p>Files List</p> <h:form prependId="false"> <p:dataTable value="#{pc_ArchiveFiles.archiveFiles}" var="fs" paginator="true" rows="5"

Referencing CDI managed bean from Facelets error page

谁说我不能喝 提交于 2020-01-04 04:12:06
问题 I'm having a hard time trying to get a generic error-page to work in a (really simple) WAR project that uses JSF 2, Facelets and CDI. My application server is WebLogic 12c, which should support all of this out-of-the-box, but it fails to show the error page. When I deploy the exact same WAR to a Glassfish application server, it works. I'm leaning towards blaming WebLogic for being buggy in the CDI department, but could use some additional expertise to see if my approach is wrong. Here's what

can currencyconverter ignore the $ sign when not entered

我怕爱的太早我们不能终老 提交于 2020-01-04 04:05:53
问题 In a datatable, I have to validate the input as currency. When I enter the value after deleting the $ sign, the input component throws an error. <p:column> <f:facet name="header"> <p:outputLabel value="REC REVENUE" /> </f:facet> <p:inputText id="RERVN" styleClass="RERVN" value="#{segmentSetup.userSegmentTypesMap['RERVN'].segmentValues[rank].rangeMinValue}" disabled="#{!segmentSetup.userSegmentTypesMap['RERVN'].selected || (rank==fn:length(segmentSetup.ranks)) }" validator="#{segmentSetup

How are the jsf-api and jsf-impl related?

孤街醉人 提交于 2020-01-04 02:40:11
问题 For some time I am struggling to get an arquillian test case running. This test involves classes rooted in JSF classes and it ran into an ClassFormatError: Absent Code as the implementation for the javax.faces.model.DataModel could not be found. My assumption was that I need to provide my test with a JSF implementation, but the implementations I found (for example the one bundled with JBoss) do not have the javax.faces package, only com.sun , and I could find no trace of the DataModel class.

how to find id based on pagination

人盡茶涼 提交于 2020-01-03 19:39:56
问题 I am using the jQuery DataTables plugin on a JSF <h:dataTable> . In this page I have 86 records. +++++++++++++++++++++++++++++++++++++ + id + Name + Email + +++++++++++++++++++++++++++++++++++++ + 1 + Name 1 + Email 1 + + 2 + Name 2 + Email 2 + + 3 + Name 3 + Email 3 + +........ + 4 + Name 4 + Email 4 + +++++++++++++++++++++++++++++++++++++ + 1.2.3.4..... Next + +++++++++++++++++++++++++++++++++++++ Note: Per table I am showing 10 records. What my client want is add a column Views which will