jsf-2

Change item of p:selectOneMenu using jQuery

三世轮回 提交于 2020-01-03 04:30:09
问题 I have a PrimeFaces 5.1 <p:selectOneMenu> that generates in DOM the following select: <select id="WorkSpace:test:selectYear_input" name="WorkSpace:test:selectYear_input" tabindex="-1"> <option value="" selected="selected">-- Year --</option> <option value="2015">2015</option> <option value="2014">2014</option> <option value="2013">2013</option> <option value="2012">2012</option> <option value="2011">2011</option> <option value="2010">2010</option> <option value="2009">2009</option> </select>

Pass a value from h:outputLink to JSF after onclick event

若如初见. 提交于 2020-01-03 04:19:25
问题 I need to pass an integer to a JSF backing bean after onclick event on h:outputLink . Important : I cannot use f:param to pass value as request parameters to the naviagating page as I am preventing default onclick behaviour of h:outputlink. The control instead of navigating to page defined by href attribute, goes to a javascript function . Using Primefaces 3.0M3 snapshot with JSF 2.0 My code follows: <h:outputLink id="#{item.id}" value="/itemDetails.xhtml" class="itemLink" > #{item.name} </h

How to implement JQuery confirm dialog with JSF

大兔子大兔子 提交于 2020-01-03 04:18:11
问题 I want to use JQuery dialog when I press a button into JSF page in order to confirm action execution(in my case to confirm the deletion of rows). I found this JQuery code working perfectly: <html> <head> <title>jQuery UI Example Page</title> <link type="text/css" href="css/custom-theme/jquery-ui-1.8.18.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script> <script

Which scope to use for a series of pages, each dependent on the previous page?

南笙酒味 提交于 2020-01-03 03:06:06
问题 Currently I have four pages that are each backed by their own RequestScoped managed bean. An example of this would be the following... backing search.xhtml @RequestScoped SearchBean backing result.xhtml @RequestScoped ResultBean backing detail.xhtml @RequestScoped DetailBean backing action.xhtml @RequestScoped ActionBean In each page (except for the search page), I inject the bean from the previous page to access the input parameters. For instance... @RequestScoped public class Result {

row selection on selection checkbox datatable primefaces

▼魔方 西西 提交于 2020-01-03 03:00:30
问题 we need to fire ajax event on row selection on toggle of checkbox..i tried to find example but they are only doing row selection on click of p:command button.we are using primefaces 2.2 Code <p:dataTable id="insList" var="insured" value="#{policyHandler.insuredList}" paginator="true" rows="#{label.insuredList_defaultNumberOfRows}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="#

JSF2.0 ResourceBundle needs to be reloaded without server restart

China☆狼群 提交于 2020-01-03 02:29:11
问题 We are using JSF2.0 with JDK1.6 and Tomcat6.1 We have a requirement to update the property file values (loaded by JSF resource bundle) without restarting the server so that the live web sessions won't be stopped. Is it possible with JDK1.6 , i tried the below clearCache code but it didn't work. ResourceBundle bundle = ResourceBundle.getBundle("Label"); String s = bundle.getString("profile.firstName"); out.println("Value before: %"+ s); ResourceBundle.clearCache(Thread.currentThread()

JSF field highlighting with ajax posts?

北慕城南 提交于 2020-01-03 01:51:16
问题 I'm building on BalusC's solution to highlight and focus fields in JSF. My plan is to output a JSON array with ids and then have a method be called which will process this array. This works fine when I don't use <f:ajax/> Here is my phase listener solution: public void beforePhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); List<String> highlightFields = new ArrayList<String>(); Iterator<String> highlightFieldsItr = facesContext .getClientIdsWithMessages(); while

JSF 2 OpenJPA 2 Glassfish 3.1 WEB9031 Error

痴心易碎 提交于 2020-01-03 01:46:14
问题 I got this error which according to Apache Support is an issue relating with Glassfish rather than OpenJPA: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped The stacktrace is: Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped at

How to render a component outside datatable by ajax?

我们两清 提交于 2020-01-02 23:22:10
问题 I have a <h:dataTable> with a <h:commandLink> in a column and a <h:outputext> outside the <h:dataTable> which I need to render by the command link. <h:form> <h:dataTable value="#{userControl.lista}" var="c"> <h:column> <f:facet name="header" > <h:outputText styleClass="leftColumn" value="Nombre"/> </f:facet> #{c.nombre} </h:column> <h:column> <f:facet name="header" > Usuario </f:facet> <h:commandLink actionListener="#{userControl.setAdmin_user(c.user)}" value="#{c.user}"> <f:ajax render=

Multiple select with checkbox from dropdown in PrimeFaces

不想你离开。 提交于 2020-01-02 20:19:13
问题 In PrimeFaces, can we choose multiple elements from drop down list with the help of checkbox? If my drop down is showing 5 elements, can I choose more than 1 element from the list? I know in primeFaces we have <p:selectOneMenu> which will allow me to choose one element, but do we have something like <p:selectMultipleMenu> ? I was trying to find it out but not able to find something. Can you please let me know whether this is possible or not? 回答1: There is <p:selectCheckboxMenu /> and it seems