jsf-2

Display values in drill-down SelectOneMenus (Parent-Child)

无人久伴 提交于 2019-12-25 05:02:07
问题 I have irritating problem when I populate a drill-down selection of two selectOneMenu . The first menu is Sector which controls the other one Categorty . I load the selection for the Category depending on Sector and all of this is working fine. But when I edit a business object that has a Category (has one) Sector attached to it. The Category doesn't get display when first loading the edit.xhtml page. I know the value is correct in the SessionScoped backing bean. If I select another Sector

application scoped bean's view is not updated

。_饼干妹妹 提交于 2019-12-25 04:55:44
问题 I have a variable inside an application scoped bean. A user can trigger an update of this variable through a method call. Now the problem is that the user doesn't get an updated view of this variable after refreshing the jsf page. If have tested if the variable is updated properly and it is, so the method for updating is working correctly. Are variables inside an application scoped bean declared as final or what is the problem here? 回答1: That can happen if you used the wrong combination of

Redirect to page using JSF PhaseListener

让人想犯罪 __ 提交于 2019-12-25 04:55:29
问题 Scenario 1: If the friendlyURL is '/requestform/servicerequest' and requestProcessorBean.userRequestVO == null then invalidate the session and redirect to '/web/pds/login' page.. Scenario 2: If the If the friendlyURL is '/requestform/servicerequest' and requestProcessorBean.userRequestVO != null then redirect to 'serviceRequest.xhtml' page. I want to know how I can Scenario 1 implement using JSF Phase Listener. I have implemented Scenario 1 as follows: requestForm.xhtml: <?xml version="1.0"

jsf: redirecting from bean on primefaces ajax event

会有一股神秘感。 提交于 2019-12-25 04:48:16
问题 I have this selectable PrimeFaces Tree with an Ajax listener on selection in my index.xhtml: <p:tree value="#{seccionesArbolView.root}" var="node" selectionMode="single" > <p:treeNode> <h:outputText value="#{node.nombre}" /> </p:treeNode> <p:ajax event="select" listener="#{seccionesArbolView.onNodeSelect}"></p:ajax> </p:tree> The listener method is on a session scoped named bean, and should redirect to another page (grupal.xhtml) with some GET parameters. I tried this: public String

How to open new page on node click

霸气de小男生 提交于 2019-12-25 04:46:12
问题 I have a simple example of p:tree . <p:tree id="tree" styleClass="treeskin" value="#{TreeViewController.root}" var="node" dynamic="true" animate="true" selectionMode="single" selection="#{TreeViewController.selectedNode}" highlight="true"> <p:ajax event="select" listener="#{TreeViewController.onNodeSelect}" update=":treeform:outputComponent"/> <p:ajax event="expand" listener="#{TreeViewController.onNodeExpand}" /> <p:ajax event="collapse" listener="#{TreeViewController.onNodeCollapse}" /> <p

p:datatable with selectionMode as multiple

早过忘川 提交于 2019-12-25 04:42:57
问题 As per the primefaces document the selection should be a array. In the below code bean.selectedUsers is defined as "HasUsersVO[] selectedUsers" but the value of datatable is List. I am getting cast error as pasted at the bottom when i click the OK button after the datatable got filled. <p:dataTable id="userListTable" value="#{bean.peopleVOList}" var="user" rowClasses="odd even" selection="#{bean.selectedUsers}" rowKey="#{user.userGuid}" <p:column selectionMode="multiple" style="width:18px"> <

JSF - Custom Tags - Dynamic values disappear after refresh

左心房为你撑大大i 提交于 2019-12-25 04:26:53
问题 I've followed this tutorial for implementing a marquee-tag in JSF 2.1 and succeeded partly. As this tag does NOT support dynamic data, e.g. #{bean.var} as a value, I've decided to do it dirty inside the component. However, after reloading my page, the value disappears. The tag is still there, but the content is gone. Could you show me how to implement is correctly, that I can use my dynamic value inside the value-attribute ? Or would you point me into the right direction which code is causing

JSF 2: view-scoped bean created one time per h:form?

浪子不回头ぞ 提交于 2019-12-25 04:16:10
问题 I'm referring to an answer here: Why can't I get ViewScope to work? Throws errors every time I didn't read view scope properly. You can only have one form per page. The bean is created multiple times if you have more than one form. I can't confirm this. Can anybody please deny it? (if the quote above does apply, where's the appropriate reference for this?) Thanks 回答1: That is nonsense. OP's problem is caused by something else which has been reported as issue 2215. 来源: https://stackoverflow

How to customize the terminal component in Primefaces 2.2.1 for JSF2?

痞子三分冷 提交于 2019-12-25 03:57:09
问题 Hi guys I'd like to ask if there is a way to customize the terminal component in primefaces 2.2.1 ? Id like to change the default prompt which is "prime $" into something else. Also what are the other options for the "cursor" aside from "pointer". Other customization tips regarding the terminal component will be very much appreciated. Thanks in advance. 回答1: change the default prompt which is "prime $" into something else. Read the User Guide or use the IDE autocompletion to see all available

PrimeFaces dialog not working in Chrome browser

谁说我不能喝 提交于 2019-12-25 03:50:17
问题 As you can see I am trying to display a dialog box on click on the command link, the dialog is displayed in IE and Firefox, but not in Google Chrome v23, please suggest. <h:form id="myForm"> <p:tabView id="tabView"> <p:tab id="tab1" title="Tab 1"> <h:panelGrid columns="1" cellpadding="10"> <h:dataTable value="#{testBean.dataList}" var="data"> <h:column> <h:outputText value="#{data}" /> </h:column> <h:column> <p:commandLink action="#{testBean.loadCommentHistory(data)}" update=":myForm:tabView