jsf

JSF / primefaces eventing in diagram elements

孤街醉人 提交于 2021-02-08 06:14:15
问题 i need to access the data object of an org.primefaces.model.diagram.Element in a managedBean on click of this very element. I am using primefaces 5.2. I tried multiple ways to establish this, but none did work so far. Here is one approach: xhtml: the idea is, to pass the element through a commandLink action attribute (which works fine for e.g. data tables): <fl:composition template="/WEB-INF/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:fl=

Convert h:selectBooleanCheckbox value between boolean and String

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 20:44:46
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Convert h:selectBooleanCheckbox value between boolean and String

有些话、适合烂在心里 提交于 2021-02-07 20:39:14
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Convert h:selectBooleanCheckbox value between boolean and String

徘徊边缘 提交于 2021-02-07 20:38:16
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Primefaces calendar does not readjust its position on window rotation

坚强是说给别人听的谎言 提交于 2021-02-07 14:16:37
问题 I am struggling with a primefaces calendar problem on a webpage rendered on a mobile device (tablet). It seems that the css values calculated by primefaces to show the popup calendar are not recalculated on window rotation (you need to click on it again to recalculate). Here is an example: I have my webpage displayed in portrait mode. I clicked the calendar icon and the position of the popup is good: (notice the css with left: 719.406px, calculated by primefaces). Everything OK so far. Now I

Scrolling to anchor or page bottom after JSF form validation fail

泪湿孤枕 提交于 2021-02-07 09:30:46
问题 I have a contact form at the bottom of a page with required and validated form fields. If validation fails, how can I get the scroll position back to the bottom of the page? I want this page to work with Javascript disabled, so no AJAX solutions. I have something like this: <a id="contact"></a> <h:form id="cform"> <h5>Contact!</h5> <h:outputLabel for="name">Name: <h:message id="nameMsg" for="name" /> </h:outputLabel> <h:inputText id="name" value="#{bean.name}" required="true" requiredMessage=

Update a component in parent window from a dialog of PrimeFaces Dialog Framework

倖福魔咒の 提交于 2021-02-07 07:56:11
问题 I am using PF dialog framework to open a dialog. public void addSpecFeatures(){ genericFeatures = new GenericFeatures(); Map<String,Object> options = new HashMap<String, Object>(); options.put("resizable", false); options.put("draggable", false); options.put("modal", true); options.put("widgetVar", "featureDialog"); RequestContext.getCurrentInstance().openDialog("PAGEName", options, null); } From the dialog I would like to update a component in the parent page. So, I tried below code public

Update a component in parent window from a dialog of PrimeFaces Dialog Framework

南楼画角 提交于 2021-02-07 07:55:57
问题 I am using PF dialog framework to open a dialog. public void addSpecFeatures(){ genericFeatures = new GenericFeatures(); Map<String,Object> options = new HashMap<String, Object>(); options.put("resizable", false); options.put("draggable", false); options.put("modal", true); options.put("widgetVar", "featureDialog"); RequestContext.getCurrentInstance().openDialog("PAGEName", options, null); } From the dialog I would like to update a component in the parent page. So, I tried below code public

How to start special init event in a backing bean before JSF page loads?

僤鯓⒐⒋嵵緔 提交于 2021-02-07 04:04:38
问题 PF 3.5.10, Mojarra 2.1.21, Omnifaces 1.5 How to call special init()-method of some (CDI)SessionScoped bean before I load a .xhtml JSF page ? Now I call init() if user select the page from site menu (with p:menutitem ). But what to do if the user use browser address line to type url directly? Edit: my.xhtml : <ui:define template="/mytemp.xhtml"> <f:event type="preRenderView" listener="#{mybean.init()}" /> <h:form> <p:commandButton update="@form" ... /> </h:form> </ui:define> If I do it that

How to start special init event in a backing bean before JSF page loads?

不打扰是莪最后的温柔 提交于 2021-02-07 04:01:58
问题 PF 3.5.10, Mojarra 2.1.21, Omnifaces 1.5 How to call special init()-method of some (CDI)SessionScoped bean before I load a .xhtml JSF page ? Now I call init() if user select the page from site menu (with p:menutitem ). But what to do if the user use browser address line to type url directly? Edit: my.xhtml : <ui:define template="/mytemp.xhtml"> <f:event type="preRenderView" listener="#{mybean.init()}" /> <h:form> <p:commandButton update="@form" ... /> </h:form> </ui:define> If I do it that