jsf-2.2

@NotNull Bean Validation ignored for viewParam

可紊 提交于 2019-12-06 16:22:21
Problem I'm trying to validate a mandatory GET request parameter. In the view I've added a corresponding viewParam tag. <f:metadata> <f:viewParam name="customerId" value="#{customerDetailBean.customerId}"/> </f:metadata> And my CDI bean looks like this @Model public class CustomerDetailBean { @NotNull private Integer customerId; public Integer getCustomerId() { return customerId; } public void setCustomerId(Integer customerId) { this.customerId = customerId; } } When I use the following request, validation works fine and the expected validation message is displayed. http://localhost:8080

BarChart Graphic in PrimeFaces are not Displayed JSF 2.2

我与影子孤独终老i 提交于 2019-12-06 15:24:57
问题 i am using primefaces 4.0 and i am trying to do a Bar-chart, the code compile without error but the chart is not showing in the generate page. Managed Bean: package per.vmonsanto.controladores; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import org.primefaces.model.chart.CartesianChartModel; import org.primefaces.model.chart.ChartSeries; @ManagedBean @SessionScoped public class DashBoardBean { private CartesianChartModel categoryModel; /** * Creates a new

JSF navigation rule doesn't work on form submit [duplicate]

限于喜欢 提交于 2019-12-06 14:15:59
This question already has an answer here : JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output (1 answer) Closed 4 years ago . I'm trying to make a very simple couple of HTML pages with JSF, to search for something in a database, but for some reason, when I hit the submit button, nothing happens. The text input goes empty and nothing else happen. It should go to another page displaying the results. Here are my files : index.html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsf="http://xmlns.jcp.org/jsf"> <head> <meta charset=

How does different phases of JSF lifecycle behave in a stateless view containing a form

情到浓时终转凉″ 提交于 2019-12-06 10:57:24
If I have a stateless view in JSF containing a form. How does the different phases will behave when I filled out the form and submit it? since the state of the view is not stored anywhere, how does the phases "appy request values", "update model" etc. will work now? BalusC All phases of the JSF lifecycle will continue to run. Only the restore view and render response phases will behave a bit differently. The restore view phase will now only build the view, but not restore its state. The render response phase will now only render the view, but not save its state. That's basically it. All other

Validating dimensions of an uploaded image in file upload listener in PrimeFaces

扶醉桌前 提交于 2019-12-06 10:23:02
I'm uploading images using <p:fileUpload> as follows. <p:outputLabel for="txtCatImage" value="#{messages['category.image']}"/> <p:fileUpload id="txtCatImage" mode="advanced" dragDropSupport="true" required="true" sizeLimit="1000000" fileLimit="1" multiple="false" cancelLabel="#{messages['fileupolad.cancelLabel']}" label="#{messages['fileupolad.label']}" uploadLabel="#{messages['fileupolad.uploadLabel']}" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" invalidFileMessage="#{messages['fileupolad.invalidFileMessage']}" invalidSizeMessage="#{messages['fileupolad.invalidSizeMessage']}" fileLimitMessage="#

How to use JSF's pass-through attributes with f:selectItems

会有一股神秘感。 提交于 2019-12-06 08:04:52
I use h:selectOneMenu and f:selectItems and want to add title attribute to HTML's option tag. It works fine with a static value: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://xmlns.jcp.org/jsf/passthrough"> //... body / form <h:selectOneMenu id="select-opts" value="#{bean.option}"> <f:selectItems value="#{bean.allOptions}" var="option" itemLabel="#{option.name}" p:title="static value" /> </h:selectOneMenu> //... The same title="static value" is added to each option . But if I try p:title="#{option

Display a formatted text / message on p:confirmDialog

不打扰是莪最后的温柔 提交于 2019-12-06 07:52:55
问题 When a row in <p:dataTable> is right-clicked, <p:contextMenu> appears with a delete option. When this option is clicked, <p:confirmDialog> appears with two buttons Yes and No - a conformation warning about deleting the current row as follows. <p:contextMenu for="dataTable"> <p:menuitem oncomplete="confirmDelete.show()" value="Delete" update="confirmDialog" process="@this dataTable" actionListener="#{testManagedBean.deleteActionListener}" icon="ui-icon-close" ajax="true"/> </p:contextMenu> <p

selectBooleanCheckbox value doesn't set properly inside ui:repeat

拥有回忆 提交于 2019-12-06 06:16:21
i have a ui repeat on a composite as follows: -the ui repeat: <ui:repeat var="award" value="#{myBean.awards}" varStatus="status"> <mycomp:Award id="awardComp" value="#{award}" index="#{status.index}"></mycomp:Award> </ui:repeat> -the composite <h:panelGroup id="cashRow" layout="block" style="height:30px"> <label id="anniversaryAwardCash" class="admin checkbox" style="float: left; clear: both; margin-top: 10px; width: 100px;"> <h:selectBooleanCheckbox value="#{cc.attrs.value.cash}" style="margin-right:2px;" id="isanniversaryAwardCash" > <f:ajax event="click" render="cashRow" /> </h

Using bootstrap 3 glypicons with webjars and jsf2.2

一个人想着一个人 提交于 2019-12-06 06:13:17
问题 I'm trying to make a simple page with bootstrap and glypicons in jsf 2.2. I've included webjar's bootstrap dependency (and opening the jar I can see the fonts file are present). When deploying the app to wildfly, bootstrap css works correctly, but icons shown are horrible (like a default font or something). Looking at the network tab in the browser, I only see 404 errors: http://localhost:8080/proto/javax.faces.resource/bootstrap/3.1.1/fonts/glyphicons-halflings-regular.woff 404 http:/

How to display Parent and Child ( two different objects ) in treetable primefaces?

不问归期 提交于 2019-12-06 06:09:33
I am using Treetable component to display parent and child objects. I can able to display the parent content by using this tutorial. In my case, I am using two different objects to display the contents in the TreeTable component. Those objects are following. University Detail - It is my parent Object. It contains (Id and Name of each university) as well as child colleges. College Detail - It is my child Object. It contains (Id and Name) of each college. UniversityDetail Class public class UniversityDetail implements Serializable { /** * serialVersionUID - */ private static final long