jsf 2 - Package JSF Composite Component into JAR

When attempting to bundle our composite components into a jar and include as a dependency in another project, I followed the following answer.This works for everything except the composite component implementation. The folder structure for our common project is shown below:CommonWebProject |-- META-INF | |-- resources | | `-- common | | |-- css | | | ... | | |-- js | | | ... | | |-- components | | | `-- comment.xhtml | | |-- templates | | |...Read more

jsf - My own primefaces p:commanButton icon

I cannot use my own icon for a primefaces p:commandButton. My code is: <p:commandButton value="Cancel" action="#{userBb.cancel()}" icon="ui-icon-myCancel" /> css is:.ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important;}Structure of folders is ordinary: /resources/images/cancel_16.pngAs a result i get: When I try:.ui-state-default .ui-icon .ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important;}I get:When I look at firebug report, there is section span<span class="ui-button-icon-left...Read more

jsf - How do I force a Primefaces calendar to update after a change Ajax event validates the new value?

I'm modifying a page with two Calendar components, to select a start date and an end date. I'm supposed to make them check that the start date is before the end date whenever you modify either of them; if the start is set after the end or viceversa, the code changes the end date to the maximum date and pops a warning.The event listeners run correctly, but the end date calendar fails to update to reflect the new value; it's not that it updates before the listener changes the value ─it fails to update at all.The project runs on Primefaces 5.3 and...Read more

How to send form input values and invoke a method in JSF bean

I am building a JSF application. I defined the GUI and did the select statements query the database using select.Now I must do the insert statements, but I don't know how to read the value of a JSF input component like <h:inputText> and send it to my bean which performs the insert.Should <h:inputText> value be mapped through faces-config.xml, so I can have it in my Java code?...Read more

How to navigate in JSF? How to make URL reflect current page (and not previous one)

I am currently learning JSF and was rather amazed and puzzled when I realized that whenever we use <h:form>, the standard behavior of JSF is to always show me the URL of the previous page in the browser, as opposed to the URL of the current page. I understand that this has to do with the way JSF always posts a form to the same page and then just renders whatever page the controller gives it back to the browser which doesn't know the page location has changed.It seems like JSF has been around for long enough that there must be a clean, sol...Read more

jsf 2 - Retaining GET request query string parameters on JSF form submit

I have 3 pages:main.xhtmlagreement.xhtmlgenerated.xhtmlThe agreement.xhtml needs two parameters to load correctly: serviceId and site. So, a normal url looks like this: /app/agreement.xhtml?site=US&serviceId=AABBCC. I have this button on agreement.xhtml<h:form> <h:commandButton value="Generate License File" action="#{agreement.generateMethod}" /> </h:form>The @RequestScoped bean #{agreement} has this method:public String generateMethod(){ ....... return "generated";}I need that, on click, the generateMethod() met...Read more

primefaces - Invoke Navigation and FileDownload in JSF without JS

Im currently looking for a solution to invoke a pagenavigation from "foo.xhtml" to "bar.xhtml" and starting a download dialogue at the same time. I already implemented a solution which worked on my test tomcat, but the JavaScript got cut out on the targetplatform, a WAS 8.0.0.9.<c:if test="#{Bean.downloadPreconditions()}"> <!-- checks a simple boolean variable which gets set to 'true' after all informations for the download are set--> <script> window.onload = function() { document.getEl...Read more

jsf - Creating master-detail pages for entities, how to link them and which bean scope to choose

I have started learning JSF, but sadly most tutorials out there present only a log in or a register section.Can you point me to some more in depth examples? One thing I'm interested in is a page presenting a list of products. I'm on page home and I press on page products so that I can see the latest products added. And every time I visit the page, the product list will be created from the latest entries in the database. How can I handle this?One way to solve this would be to create a session scoped managed bean in which I would place different ...Read more

jsf - SimpleJSFNavigationHandler cannot be cast to javax.faces.application.ConfigurableNavigationHandler

I'm migrating a JSF 1.2 project to JSF 2 and PrimeFaces 6 with Ultima layout.When using Ultima layout, I get the below exception: SimpleJSFNavigationHandler cannot be cast to javax.faces.application.ConfigurableNavigationHandler.How to fix it?Below is the SimpleJSFNavigationHandler.import java.io.IOException;import javax.faces.FacesException;import javax.faces.application.NavigationHandler;import javax.faces.application.ViewHandler;import javax.faces.component.UIViewRoot;import javax.faces.context.ExternalContext;import javax.faces.context.Fac...Read more

JSF Unable to find matching navigation case with from-view-id '/index.xhtml' for action

When I call a managed bean action like this@ManagedBean(name="method")public class Meth { public String vamos(){ return "vamos"; }}from a JSF file like this<h:form> <h:commandButton action="#{method.vamos()}" value="vamos!"/></h:form>I get the below error message: Unable to find matching navigation case with from-view-id '/index.xhtml' for action '#{method.vamos()}' with outcome 'vamos'.I looked up and there are different questions with my same issue but they have different solutions....Read more

jsf - if warning message displayed onclick of Button, then updated search result list not displaying

When I click on search button, it will display search results based on conditions we entered or in total, so that time if search results are more than 100 it will display a warning message and will update search results based on conditions we entered.MyForm.javapublic String findList() { try { vwList = null; String ret = "self"; rendered = false; long count = myEntryListService.findHistMasterCount(entryJyokenVO,formMode); System.out.println("count: " + count); if (count > CommonConst.MAX_ROW) { ...Read more

JSF Flow - Implicit navigation doesn't work

I am getting started with JSF Flow. I am doing as stated in this tutorial http://courses.coreservlets.com/Course-Materials/pdf/jsf/jsf2/JSF-2.2-Faces-Flow-1.pdf, pages 6-12.Implicit navigation doesn't work for me, as in the tutorial.When I navigate to index.xhtml, then click commandButton to sampleFlow, I get nullPointerException. After hiting refresh/F5, my flowpage gets loaded. Then I can use Page-A and Page-B links.But whenever I would like to navigate out of the flow, using index, sampleFlow-return, i get the same stack.Glassfish LogFATAL: ...Read more