jsf-2

Making sure JPA commits my transaction before another service accesses the data

[亡魂溺海] 提交于 2019-12-25 03:34:22
问题 It feels so simple: I have a ViewScoped bean (JPA2 + EE6 + Seam3, if that matters) where the user of the web application can invoke a method like this: public void save() { doEntityManagerStuff(); // manipulates data in the database callRemoteWebservice(); // which is to read said data and propagate it to other systems } Unfortunately, save() starts a transaction at the opening curly bracket and doesn't commit it before the closing bracket , meaning that the new data is not available to the

Composite component with navigation using managed bean

允我心安 提交于 2019-12-25 03:28:08
问题 I created a composite component that receives a managed bean as a parameter. The composite has a submit h:commandButton that runs a method from the managed bean parameter ( #cc.attrs.mBean.action} ; signature: String action() ). Knowing about the use of the target attribute in composite:implementation if I were using a method-signature instead of a bean action: is there a way to achieve a similar behavior when using a bean method? Other reads: Unable to find matching navigation case from

JSF - ternary operator in value attribute

倖福魔咒の 提交于 2019-12-25 03:11:00
问题 Is it possible to put a ternary operator to have a condition in a "value" attribute of a JSF tag ? And moreover is it possible in a datatable tag to have something like this : <h:dataTable id="table" value="#{myBean.choice ? myBean.listOne : myBean.listTwo}" var="item" > . . . 来源: https://stackoverflow.com/questions/22382466/jsf-ternary-operator-in-value-attribute

PrimeFaces can't get boolean value from dataTable's selected row

我的未来我决定 提交于 2019-12-25 03:01:32
问题 I have PrimeFaces 3.5, JSF 2.2, Hibernate 4 web app. home.xhtml contains a tabview with nested dataTables for 3 entities (Users, Computer, Applications) and add/edit/delete buttons. Each button is supposed to call a dialog with a form and submit/cancel buttons. The problem is that I can't display correctly boolean value (licenseRequired) from selectedApplication when trying to edit it in the same way as it was set, I get the message: /pages/home.xhtml @424,149 value="#{homeBean

PrimeFaces can't get boolean value from dataTable's selected row

大憨熊 提交于 2019-12-25 03:01:32
问题 I have PrimeFaces 3.5, JSF 2.2, Hibernate 4 web app. home.xhtml contains a tabview with nested dataTables for 3 entities (Users, Computer, Applications) and add/edit/delete buttons. Each button is supposed to call a dialog with a form and submit/cancel buttons. The problem is that I can't display correctly boolean value (licenseRequired) from selectedApplication when trying to edit it in the same way as it was set, I get the message: /pages/home.xhtml @424,149 value="#{homeBean

Update component in a different window/tab without manually refreshing it

非 Y 不嫁゛ 提交于 2019-12-25 02:57:08
问题 I have different pages with different layouts, for example index.xhtml and user.xhtml, each page has it's own template. If I make a change in user.xhtml I want to update a datatable in index.xhtml. index.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://primefaces.org/ui"> <ui:composition template="/template.xhtml"> <ui:define name="body"> <h:form id=

primefaces p:ajax return value

旧街凉风 提交于 2019-12-25 02:52:39
问题 I have a JSF 2.2 app with primefaces 4.0. I have a page with some checklboxes. What I want to acomplish is that when I click on one checkbox an ajax request to be fired to my managed bean. That request will hit a method that will return a string. So i do no need to update an element, but to get back the string in js, because if i achieve that then I can return an JSON. I have this piece of code : <p:selectManyCheckbox id="queues" value="#{viewAssignUsersMB.queueIds}" layout="grid" columns="3"

primefaces p:ajax return value

ε祈祈猫儿з 提交于 2019-12-25 02:52:20
问题 I have a JSF 2.2 app with primefaces 4.0. I have a page with some checklboxes. What I want to acomplish is that when I click on one checkbox an ajax request to be fired to my managed bean. That request will hit a method that will return a string. So i do no need to update an element, but to get back the string in js, because if i achieve that then I can return an JSON. I have this piece of code : <p:selectManyCheckbox id="queues" value="#{viewAssignUsersMB.queueIds}" layout="grid" columns="3"

JSF not see my annotated Bean

徘徊边缘 提交于 2019-12-25 02:42:06
问题 I try to made simple JSF example and have several filers. I use Maven, and have stored in META-INF flolder faces-confid.xml.. In output when try to execute i see : Welcome to JSF. #{test.test} But I think it must be somthing else. Here they are: Bean file import java.io.Serializable; import javax.enterprise.context.RequestScoped; import javax.inject.Named; @Named("test") @RequestScoped public class TestBean implements Serializable{ private String test = "test"; public String getTest() {

Using f:view to override default contentType - cons?

可紊 提交于 2019-12-25 02:25:57
问题 I use a lot of jQuery plugins in my JSF 2.0 application and not all of them generate HTML which can successfully pass through the strict XHTML checks of webkit browsers. So the solution is to actually get into the plugin's code and correct it so that it generates a valid HTML, which is a very time consuming process in itself, or, wrap the contents of generated HTML in <f:view contentType="text/html"> . The latter is quite straight forward and it works. Are there any cons of using <f:view> to