jsf-2

Primefaces datatable onEdit() edits the wrong entry if an entry has been added before refreshing the view

风格不统一 提交于 2019-12-25 06:13:11
问题 i've got a question concerning Primefaces (version 5.0) and their datatable. If I have a p:datatable and I want to edit a cell or row (doesn't matter - behaviour is the same in that case) AND someone added a new entry to that database, I edit the new entry instead of the old. Well. Here are some code-snippets: my index.xhtml: <h:form id="viewChanges"> <p:dataTable id="changeTable" widgetVar="changeTable" value="#{changeController.list}" var="item" selection="#{changeController

Unable to show faces message on xhtml page

不羁岁月 提交于 2019-12-25 05:34:16
问题 I am unable to show faces messages using facesMessage Bean code : if(condition){ FacesContext fc=FacesContext.getCurrentInstance(); fc.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL,"Rounding Rule Saved","R Saved")); } View code : <p:messages autoUpdate="true" showDetail="true" globalOnly="true" id="msgId"/> But I am not getting messages, what am I doing wrong? EDIT: My project flow is : User click on edit button on view page Redirect to edit page After submitting return to

css expression not work for primefaces

て烟熏妆下的殇ゞ 提交于 2019-12-25 05:27:08
问题 Below code not work, but it's work fine for jsf1.2. Now the framework is jsf2.0 and primefaces 3.2 <p:inputText id="pInputText4" disabled="true" value="This is Input Text" style="color: expression((this.disabled==true)?'#0f0':'#f00');"/> I have another question that why <p:selectOneMenu id="roleId" value="#{accessPage.roleId}" required="true"> <f:selectItem itemLabel="#{msg['label.common.selecthere']}" itemValue="#{null}" /> <f:selectItems var="code" value="#{accessPage.roleIdList}" itemLabel

cast error with addCallbackParam in primefaces

社会主义新天地 提交于 2019-12-25 05:25:38
问题 Using the requestContext demo example in my system http://www.primefaces.org/showcase-labs/ui/requestContext.jsf I am getting the following error Caused by: java.lang.ClassCastException: org.primefaces.context.DefaultRequestContext cannot be cast to org.primefaces.context.RequestContext at org.primefaces.context.RequestContext.getCurrentInstance(RequestContext.java:38) [primefaces-3.4.1.jar:] the error occur when the java command running RequestContext context = RequestContext

jsf clearing the form

只愿长相守 提交于 2019-12-25 05:25:16
问题 I need help. I'm new to JSF and im using JSF2 and richfaces in my project. I want to clear the form for which I'm using <f:ajax render="@form"/> in refresh button. I have an ADD button on that screen which adds one record and I hit refresh then it's going to the default page. But when I once again go to enter a record then those values which I entered earlier remain in the form fields. Can anyone please help me out with this issue? 回答1: Assuming that you mean the browser's refresh button when

primeFaces fails to upload file to db

杀马特。学长 韩版系。学妹 提交于 2019-12-25 05:22:46
问题 I am trying to upload a file (picture) which is part of a Product object to a database. The file upload is successful according to the jsf confirmation. However, when persisting Product the persistence is completed successfully without the picture. The server is not returning any stack. This is my form (simplified): <h:form enctype="multipart/form-data"> <h1><h:outputText value="Create New Product"/></h1> <h:panelGrid columns="2"> <h:outputLabel value="Name:" for="name" /> <h:inputText id=

MouseOver in JSF datatable

让人想犯罪 __ 提交于 2019-12-25 05:20:12
问题 I need some help on including a mouseover event for a datatable column in JSF. Can you please let me know how to include a popup list on mouseover a jsf column. Below is the code corresponding to my JSF column. <p:column style="text-align: left;" styleClass="foo" rendered="#{demandBean.screeRenderVo.adjustedRenderer}" > <f:facet name="header"> <h:outputText id="AdjustedID" value="#{demandBean.dmdScreenLabelVO.adjustedValue}"/> </f:facet> <h:inputText id="AdjustedValueID" value="#{car

How to render an element whose id is automatically generated in JSF?

微笑、不失礼 提交于 2019-12-25 05:12:07
问题 I have primefaces'datatable placed on primefaces tabView.. I m using filtering on it. As new values are updated in the grid, I want to re-render the filters. The filter id is generated as: tabViewId:ActiveTabIndex:DatatableID:ColumnName_filter. On value change of input text, I want to re-render the filter. <p:column width="40"> <h:inputText id="vendorInputTxt" value="#{articlePromo.proveedor}" styleClass="inputTextStyle"> <f:ajax event="change" render=":categoryTabView:0:promotionDetail

change color of inputtext at row level on selectOneMenu(Dropdown) change in Datatable

核能气质少年 提交于 2019-12-25 05:06:52
问题 I am using primefaces(v.3.0) datatable in my application. In Datatable there are two columns , one column is inputtext and other is SelectOneMenu(dropdown). Now I want to change inputtext color with some cases like.. 1.if SelectOneMenu value get selected as "Single" input textbox color will be "green" for that particular pID only. 2.if SelectOneMenu value get selected as "Married" input textbox color will be "red" for that particular pID only. 3.if SelectOneMenu value get selected as

jsf-2.0 how to pass a value from one class to another

末鹿安然 提交于 2019-12-25 05:05:26
问题 I have one extended Data Table in payeeSearch.xhtml displayed as - 1) After clicking on show particulars , it should navigate to a different view and display a new table based on the result achieved by one of the column's value of the selected row (In figure, it is IN303285... ) 2) I have written code for navigating to the next view as - <rich:contextMenu attached="false" id="menu" submitMode="ajax"> <rich:menuItem ajaxSingle="true" value="Show Particulars" action="payeeParticulars.xhtml">