primefaces

Primefaces selectonemenu displaying data outside the input [duplicate]

柔情痞子 提交于 2020-01-11 13:28:13
问题 This question already has answers here : One or more resources has the target of 'head' but not 'head' component has been defined within the view (2 answers) Closed 3 years ago . I'm new to web programming and I manage to make work the proper connections so the dropdown DOES populate; I'm using Eclipse, latest JDK, Wildfly 10 server, MySQL server 5.7, Primefaces 5.3, Javax.faces 2.2. This is the page: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999

Multiple events in the same p:ajax in PrimeFaces

六眼飞鱼酱① 提交于 2020-01-11 08:27:09
问题 Is it possible to have multiple events in the same p:ajax ? Something like this: <p:ajax event="firstEvent,secondEvent..." listener="doSomething();" /> 回答1: I know it's later but I found and way to do this, You only need to put N tags of p:ajax, i.e: <p:calendar id="startDate" value="#{bean.date}" pattern="dd.MM.yyyy" validator="#{bean.checkDate}"> <p:ajax update="dialog:endDate" event="dateSelect" /> <p:ajax update="dialog:endDate" event="keyup" /> </p:calendar> 回答2: Faced with the same

Get the Index of the Node in a Primefaces Tree

≡放荡痞女 提交于 2020-01-11 04:21:05
问题 I am using a Primefaces Tree which has a following structure : Node 1 Node 1.1 Node 1.2 Node 1.3 Now, I want to add a node in between Node 1.1 and Node 1.2. I can do that by using "add(int index, TreeNode element)" method. But for that I must know the index of Node 1.1. Is there any way to get the index of a Node by it's name or by any other means? 回答1: This is another example which present a easy way to add now node below specific node. XHTML <h:form> <p:tree value="#{treeBasicView.root}" id

Primefaces p:inplace: How to more elegantly propagate the EL expression for entity to merge

只愿长相守 提交于 2020-01-11 04:11:05
问题 I would like to share the following powerful "hack" for getting at an entity whose value as been edited using p:inplace. My question is about how to achieve this more elegantly using other existing attributes of p:inplace or otherwise. The trick is adapted from a suggestion by BalusC on Stackoverflow: JSF (and PrimeFaces) How to pass parameter to a method in ManagedBean The question there involves getting at an Employee object that has a p:inplace edited #{emp.firstName}: <h:outputText value=

No access to nested property in managed bean within p:columns

自作多情 提交于 2020-01-11 02:10:12
问题 I have following two simple POJOs: class Person { String name Address address; //and of course the getter/setter for the attributes } class Address { String city; //also getter/setter for this attribute } And a backing bean: @ManagedBean @RequestScoped class PersonController { private List persons; private List<String> columns = Arrays.toList("name", "address.city"); //of course getter/setter } Now I want to create a dataTable. <p:dataTable var="person" value="#{personController.persons}"

Invoking a JavaScript function from oncomplete handler of p:remoteCommand - simulating the same using some JavaScript code

偶尔善良 提交于 2020-01-11 01:46:28
问题 Caution : Although this question covers long textual information with a mess of Java code snippets, it is merely targeted to JavaScript/jQuery and a bit of PrimeFaces stuff (just <p:remoteCommand>) as mentioned in the introductory part in the beginning. I am receiving a JSON message from WebSockets (Java EE 7 / JSR 356 WebSocket API) as follows. if (window.WebSocket) { var ws = new WebSocket("wss://localhost:8181/ContextPath/AdminPush"); ws.onmessage = function (event) { jsonMsg=event.data;

Trigger/activate the RowEditor from bean for a primefaces In-Cell editing enabled p:dataTable

最后都变了- 提交于 2020-01-10 18:58:54
问题 I have a primefaces p:dataTable with InCell editing enabled and want to trigger/activate the RowEditor for the newly added row. Excerpt of XHTML <p:commandButton id="btnAddEntry" value="Add new row" actionListener="#{myBean.addNewCar}" ... update="carTable growl" process="@this carTable ..."/> <p:dataTable id="carTable" var="car" value="#{myBean.cars}" ... editable="true"> <p:column ...> <p:cellEditor> ... </p:cellEditor> </p:column> ... <p:column ...> <p:rowEditor /> </p:column> ... </p

Trigger/activate the RowEditor from bean for a primefaces In-Cell editing enabled p:dataTable

℡╲_俬逩灬. 提交于 2020-01-10 18:58:49
问题 I have a primefaces p:dataTable with InCell editing enabled and want to trigger/activate the RowEditor for the newly added row. Excerpt of XHTML <p:commandButton id="btnAddEntry" value="Add new row" actionListener="#{myBean.addNewCar}" ... update="carTable growl" process="@this carTable ..."/> <p:dataTable id="carTable" var="car" value="#{myBean.cars}" ... editable="true"> <p:column ...> <p:cellEditor> ... </p:cellEditor> </p:column> ... <p:column ...> <p:rowEditor /> </p:column> ... </p

Why to add process=“@this” explicitly to p:commandButton to get action invoked?

我与影子孤独终老i 提交于 2020-01-10 10:35:06
问题 I know that we need to add explicitly process="@this" to get the p:commandbutton action get invoked and I also know that process attribute defaults to @form in primefaces. Since process is defaulted to @form shouldn't the button also get processed along with the other elements in the form and its action should get invoked. Can anyone explain the exact reason behind this? 回答1: Process @form mean the current form of the commandLink/Button Process @this mean the current component of the

How to align JSF components to center

怎甘沉沦 提交于 2020-01-10 08:28:38
问题 In my JSF 2 - Primefaces 3 web application, I am using <p:panelGrid> and <p:panel> . I have multiple components inside them which are left justified. I need to all to be center align. How can we do this I tried to use div but it does not work. 回答1: Look at the generated HTML output and alter CSS accordingly. If the HTML element which you'd like to center is a block element ( <div> , <p> , <form> , <table> , etc, or forced by display: block; ), then you first need to give it a known width and