jsf-2

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

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

How to align JSF components to center

霸气de小男生 提交于 2020-01-10 08:28:09
问题 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

How to preset the value of p:fileUpload

非 Y 不嫁゛ 提交于 2020-01-10 05:46:09
问题 I am using <p:fileUpload> component. Is it possible to preselect and show the selected file in field before the browse button? I am using Mojarra 2.0.3, PrimeFaces 2.2 RC2, GlassFish 3. 回答1: No, if this was possible, this would have been a huge security hole. You would then in theory be able to let the selected file point to C:/path/to/passwords.txt and then use JavaScript to submit the form and so silently get a file with sensitive data from the client without its permission. See also: How

How to ajax-update the p:dataTable from inside the p:dataTable itself?

廉价感情. 提交于 2020-01-10 04:04:45
问题 <h:form id="formId"> <p:wizard id="wizardId"> <p:tab id="tabId"> <p:dataTable id="tableId"> <p:column> <h:commandLink value="remove" update=""/> </p:column> </p:dataTable> </p:tab> </p:wizard> </h:form> I need to update only the <p:dataTable> without the entire form. I tried using @form , @parent , :formId:wizardId:tabId:tableId , but none of them are working as I want. When I use @form , it is checking for validation which I don't need to do. How can I achieve this? 回答1: First of all, this

Dynamic adding text fields in JSF [duplicate]

荒凉一梦 提交于 2020-01-10 02:21:05
问题 This question already has answers here : How to dynamically add JSF components (3 answers) Closed 4 years ago . I have a screen with inputText, beside it there's a (+) button, when the user should press that button the form should add another extra inputText beside it (or below, whatever) Here's the code: <table> <tr> <td> <p:inputText value="#{controller.x}" /> <img src="../images/ico_plus.png" /> </td> </tr> </table> in Controller.java: private String x; public String getX(){return x}

Include dynamic content containing JSF tags/components from stream

╄→尐↘猪︶ㄣ 提交于 2020-01-09 03:52:05
问题 I am working on an application where I would like to include dynamic XHTML content from a stream. To handle this I wrote a taghandler extension which dumps the dynamic XHTML content to output component as UIOutput htmlChild = (UIOutput) ctx.getFacesContext().getApplication().createComponent(UIOutput.COMPONENT_TYPE); htmlChild.setValue(new String(outputStream.toByteArray(), "utf-8")); This works fine for XHTML content which has no JSF tags. If I have JSF tags in my dynamic XHTML content like

What is the usefulness of statelessness in JSF?

▼魔方 西西 提交于 2020-01-08 14:28:29
问题 According to this blog JSF is going stateless . Isn't the whole point of using JSF is that it makes saving and restoring state a chore . What is the point of JSF becoming stateless ? Can you please provide an example where this can be useful . 回答1: First of all, I would like to clarify that JSF isn't exactly "going stateless" at its whole own. JSF just adds a new feature enabling the developers to create stateless views/forms on demand. State saving is particularly helpful in dynamically

What is the usefulness of statelessness in JSF?

让人想犯罪 __ 提交于 2020-01-08 14:27:25
问题 According to this blog JSF is going stateless . Isn't the whole point of using JSF is that it makes saving and restoring state a chore . What is the point of JSF becoming stateless ? Can you please provide an example where this can be useful . 回答1: First of all, I would like to clarify that JSF isn't exactly "going stateless" at its whole own. JSF just adds a new feature enabling the developers to create stateless views/forms on demand. State saving is particularly helpful in dynamically