jsf-2

JSF page - Why no validations yet process attribute required?

妖精的绣舞 提交于 2019-12-13 22:22:36
问题 The command button's actionListener event of the following JSF based xhtml page does not work. I do not have any validations on the page. The event only works when I add attribute process="@this" to button tag. As there are no validations, so I do not even get any validation error. But with process attribute I get success message returned by java side handler method. So I am kind of stuck without unwanted process attribute. <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-

A way to easily check if an element was rendered in jsf2

£可爱£侵袭症+ 提交于 2019-12-13 21:55:52
问题 I have a button that is supposed to close a modal panel and render several elements. Is there an easy way to check if an element was rendered after the button was pressed? example button: <a4j:commandButton onclick="#{rich:component('modal')}.hide();" style="background-repeat:no-repeat;width:18px;height:18px;" image="includes/images/close.gif" render=":id1 :id2"> <f:setPropertyActionListener target="#{Controller.attribute}" value="false" /> </a4j:commandButton> 回答1: I have another button that

Primefaces data for data table is getting confused

冷暖自知 提交于 2019-12-13 21:38:08
问题 Sorry for the title but I have to explain what I want to do and what isn't working. My web ui with JSF 2.2.10 and primefaces 5.2.6 shows a search mask and search results upon a model. Each search instance is shown as a tab in a tabView . When a tab is clicked, its corresponding search instance is shown under the tabView in a dataTable . A search instance is created upon a search template, so different search instances can have different input fields and different result fields (which are the

Conditional column rendering

风格不统一 提交于 2019-12-13 20:58:49
问题 I'm working with jsf 2.0. I have this datatable <h:dataTable value="#{agreement.licenseProducts}" var="licenseProduct" styleClass="pnx-table pnx-table-bdr pnx-table-unstyled mp-license-info"> <h:column> <f:facet name="header"> <h:outputText value="Product" /> </f:facet> <h:outputText value="#{licenseProduct.description}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Serial Number" /> </f:facet> <h:outputText value="#{licenseProduct.serialNumber}" /> </h:column> <h

JavaScript composite component nested forms

纵然是瞬间 提交于 2019-12-13 20:54:24
问题 I have a simple composite component, which is nested in some form etc. I would like to bind the click event for all radio buttons in the <h:selectOneRadio> of this composite component. I am trying to bind this event by name property of inputs which will be created after <h:selectOneRadio id> . Unfortunetly it is nested, so this code doesn't work, because the generated radio button ID is like: "form:someid:someid:someid etc ect." Composite component code: <cc:implementation> <..some forms etc.

calling bean method on image onClick event [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-13 20:37:52
问题 This question already has an answer here : How to call JSF backing bean method only when onclick/oncomplete/on… event occurs and not on page load (1 answer) Closed 2 years ago . I have image and would like to call a method that is store in bean. I was thinking of <h:graphicImage value="DisplayImage?id=1&stuff=photo&mainID=main" onclick=" alert('clicked me 1'); #{PersonalInformationDataBean.doSaveImage()}; alert('clicked me 2'); " styleClass="modal"/> I was expecting #

Generating Own Session Id in JSF

回眸只為那壹抹淺笑 提交于 2019-12-13 20:32:39
问题 I have a web application in which we use JSF framework. I have been diving deep into the security part for web application and hence I was looking to generate my own unique session ID(using encryption algorithm and assign it to every new session which gets created once user logs in. Can anyone please guide me on how to set manual generated session id in session and ensure with each request that session id is transmitted. Thanks. 回答1: I really doubt you'll generate session IDs that are more

JavaScript click function not triggering JSF action method immediately on IE

↘锁芯ラ 提交于 2019-12-13 20:17:17
问题 I've recognized that when a click is done via JavaScript it won't trigger the action method immediately on IE, instead the browser wait's until the code has gone through the function where click is made and after that triggers the action method. On Chrome the action method is triggered immediately when the click is done. Here is an example xhtml code: <h:form> <ace:pushButton id="button1" action="#{someBean.someFunction1}" label="Button1" /> </h:form> <h:form> <ace:pushButton id="button2"

Default value for h:inputText

谁说我不能喝 提交于 2019-12-13 19:56:12
问题 Imagine a text box, bound to a ManagedBean: <h:inputText id="name" value="#{mb.name}"/> I would like to default the field to a value. I know I can set the value in the ManagedBean at construction time, but that doesn't work for me as I use the same ManagedBean as a backing bean in different xhtml pages. And I don't want the 'name' field to be initialized in all those pages. Can somebody suggest a strategy? Or am I missing something essential? Thank you very much! J. 回答1: you can fill the

Defer primefaces.js loading [duplicate]

半世苍凉 提交于 2019-12-13 19:14:59
问题 This question already has answers here : Defer loading and parsing of PrimeFaces JavaScript files (2 answers) Closed 4 years ago . The google pagespeed is indicating that loading primefaces.js is slowing down my page: From the pagespeed report: Defer parsing of JavaScript By minimizing the amount of JavaScript needed to render the page, and deferring parsing of unneeded JavaScript until it needs to be executed, you can reduce the initial load time of your page. Suggestions for this page 284