jsf-2

Wrong selected option for selectOneMenu with POJOs and Converter

牧云@^-^@ 提交于 2019-12-13 09:25:52
问题 in our company we're hitting a serious problem which we think is a serious design flaw of the JSF spec, if it is the normal behavior. This is our usecase: SelectOneMenu (standard JSF or primefaces, doesn't matter, same behavior) SelectItems with a database entity as it's value and a string as the label A converter (via attribute on the selectOneMenu) which translates the entity to its ID (getAsString) and from the ID to the entity (getAsObject) Everything works as expected as long as the

Possible to pass `p:inputText` parameters via `f:param`? [closed]

你说的曾经没有我的故事 提交于 2019-12-13 09:08:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . It seems to me that p:inputText does not support sending parameters via f:param . Is this true? If yes, how could I pass the parameters? In more details I have a list of inputText fields generated via: <p

How to convert byte array to image [duplicate]

橙三吉。 提交于 2019-12-13 08:55:20
问题 This question already has answers here : Show image as byte[] from database as graphic image in JSF page (2 answers) Closed 2 years ago . I have a SQL database that contains images stored as a byte array. I have done some searching and have not found much on how to convert these into a useable Image type for a JSF page. Any help would be greatly appreciated! Thanks in advance! (using JSF 2.0) 回答1: Just a create a controller that output the right media type (image/*) and output the bytes.

Update select one menu from another page [duplicate]

守給你的承諾、 提交于 2019-12-13 08:49:34
问题 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 4 years ago . I need to update a select menu of one another JSF page. I've tried all ways and always occurs the component not found error This my xhtml page: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

Cannot create a session after the response has been committed…Why? [duplicate]

南笙酒味 提交于 2019-12-13 08:12:33
问题 This question already has answers here : Adding <h:form> causes java.lang.IllegalStateException: Cannot create a session after the response has been committed (5 answers) Closed 6 years ago . <?xml version='1.0' encoding='UTF-8' ?> Facelet Title <f:facet name="header">Books And Authors....</f:facet> <h:panelGrid columns="2" rules="cols"> <h:panelGrid id="pan1" columns="2"> <h:outputText value="Select Author"/> <p:selectOneMenu value="#{bean.selectedAuthor}" converter="authorConverter"> <f

primefaces GMmap inside a dialog not rendering

和自甴很熟 提交于 2019-12-13 08:01:30
问题 I want to open a Gmap inside my jsf page, i tried these sample but it didn't work: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </h:head> <body> <ui:composition template="/WEB-INF/template/template.xhtml"> <ui:define name="content"> <p

Transfer and trigger javascript code by ajax call with jsf

戏子无情 提交于 2019-12-13 07:37:58
问题 I have some jsf-code with a tag that is re-rendered by an ajax call. It contains something like <h:outputScript>alert("Gotcha")</h:outputScript> but this is only executed on first load, not on an ajax induced partial render. This is but a minimal example, what I'm really trying to do is to trigger some server-generated javascript right after the ajax-call has returned, something like <h:outputScript>#{scriptBean.getScript()}</h:outputScript> I've seen calling .trigger("click") that is in

Primefaces 5 <p: calendar> does not display the option to select time

前提是你 提交于 2019-12-13 07:35:12
问题 Need to use the component p:calendar with the option to select the date and time (hours, minutes and seconds). The problem is that the option to select the time is not displayed, only the option to select the date. I am using the following pattern "dd/MM/yyyy HH:mm:ss". According to primefaces showcase no additional attribute is required for display of schedule options, only define the pattern. <p:calendar pattern="dd/MM/yyyy HH:mm:ss" value="#{calendarMB.date}" timeZone="GMT-3" /> Managed

Primefaces Calendar not rendered

被刻印的时光 ゝ 提交于 2019-12-13 07:10:57
问题 I'm trying to create a primefaces panel from backend. This is what I've written - Calendar calendar = new Calendar(); String expression = "#{calendarBean.date1}"; boolean _showButtonPanel = true; calendar.setValue(expression); calendar.setShowButtonPanel(_showButtonPanel ); Panel.getChildren().add(calendar); But i'm able to retrieve only a textbox without the "calendar.setValue(expression);" but with the line it throws an exception - com.sun.faces.context.PartialViewContextImpl

How to add JS effects on rendering AJAX parts in JSF2?

旧时模样 提交于 2019-12-13 06:55:54
问题 In JSF2, I can update part of view by AJAX. I assume part of components tree is just generated/updated on server, rendered to HTML and this HTML is sent to client. Then inserted into DOM where appropriate. This works, but I wonder if I could add some jQuery (or other JS) effect when I want this new HTML part to appear? What if I want it e.g. to fade in? Can I do this? How? 回答1: It's easy if you use Primefaces: http://www.primefaces.org/showcase/ui/effects.jsf Otherwise you could use the