jsf-2

Jsf ui:repeat size doesn't gets java bean value

核能气质少年 提交于 2019-12-11 10:42:03
问题 JSF 2.0's ui:repeat tag gets the value of java bean(arraylist) as it's value property but size property doesn't. I am using the ui repeat inside of a datatable which shows statuses iteratively and ui repeat shows comments for each status. I am giving the size property of ui repeat from a java class because each status has a different number of comments. Therefore size should be decided dynamically. Here is the summary of what i've done. Model classes: @ManagedBean @RequestScoped public class

primefaces datatable not displaying anything

自闭症网瘾萝莉.ら 提交于 2019-12-11 10:35:18
问题 I'm using primefaces datatable component, but it doesnt show anything when I load the page. It is all white. This is my code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">

JSF composite component childrens

最后都变了- 提交于 2019-12-11 10:31:52
问题 Is there any way using EL to retrieve a children list so i can iterate through it with <ul> <ui:repeat value="#{Magic El expression}" var="children" > <li> <p> #{children.title} *</p> </li> </ui:repeat> </ul> <div> <cc:insertChildren /> </div> * perhaps #{children.attrs.title} I don't know? What I'm trying to do here is create a Tab composite component. I know libraries such as primefaces offer tabview etc. Yet I need to create my own because of extended jquery functionality. Plus I'm working

navigation between jsf pages within one portlet on WebSphere Portal 8.0

孤街浪徒 提交于 2019-12-11 10:24:38
问题 I'm working on WebSphere Portal 8.0 and I am trying to make portlet with few faces. Can anyone share with me how can I make a simple link to other JSF site within one portlet? I mean, I was trying to use this, but it doesn't work: <h:outputLink value="page2.xhtml"> <h:outputText value="take me to the page2" /> </h:outputLink> I'm redirected to the misterious link but I would like to stay on the same site but change face in this single portlet. 回答1: I have got answer. If you want use GET, use

jsf- validator with parameters from input

狂风中的少年 提交于 2019-12-11 10:23:37
问题 here a part of my .xhtml page: <h:inputText id="kartNumIn" value="#{controller.mitarbeiter.kartenNummer}"> <f:attribute name="foo" value="controller.mitarbeiter.id" /> <f:validator validatorId="kartVal" binding="#{kartVal}" disabled="#{!controller.noUpdate}"/> </h:inputText> here my validate-method(): @Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { int id=(Integer) component.getAttributes().get("foo"); //always 0 int temp =

Migrating from JSF1.2 to JSF2.0: What to do with JSTL?

此生再无相见时 提交于 2019-12-11 10:05:41
问题 we are going to migrate our JSF 1.2 project to JSF 2. We are already using facelets (not JSPs) as our presentation technology. We are using lot of JSTL -> "xmlns:c="http://java.sun.com/jstl/core" We are using lot of <c:if> statements. I know that JSF2 brings rendered attribute, which should also evaluate boolean expressions. Should I bother rewriting stuff to new rendered attribute or is it ok to continue using JSTL in JSF2? 回答1: JSTL works the same way in JSF2 as it worked in JSF1. The

Using Facelets as <error-page><location> causes IllegalStateException: getWriter() has already been called for this response

狂风中的少年 提交于 2019-12-11 10:03:21
问题 I'm trying to setup the Omniface's FaceExceptionFilter on my Glassfish 4.0 server, using Mojarra 2.2.8, Primefaces 4.0 and Omnifaces 1.8.1. The filters and error pages in web.xml are defined as follow: <filter> <filter-name>facesExceptionFilter</filter-name> <filter-class>org.omnifaces.filter.FacesExceptionFilter</filter-class> </filter> <filter-mapping> <filter-name>facesExceptionFilter</filter-name> <servlet-name>Faces Servlet</servlet-name> </filter-mapping> <filter> <filter-name

Validation with an EJB service call, possible with JSF validator or JSR303 bean validation?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 09:48:11
问题 i want to validate my username using a select. if the username already is present in the database, validation fails. i found some annotations for primefaces like this for example: @Size(min=2,max=5) private String name; i didnt found a annotation solution for something like this: try { dao.findUserByUserName(userName); message = new FacesMessage ("Invalid username!", "Username Validation Error"); message.setDetail("Username already exists!"); message.setSeverity(FacesMessage.SEVERITY_ERROR);

Uncaught TypeError: Cannot call method 'remove' of null in primefaces.js?ln=primefaces

冷暖自知 提交于 2019-12-11 09:44:40
问题 I'm trying to display a single selection treeview where you're supposed to select which folder a new item will go under with Primefaces 3.3.1/JSF 2.0. So far, I have populated the tree with folders and subfolders: But, when I try to select a folder: nothing happens. My .xhtml page looks like this: <h:form id="createSiteForm"> <label>Under vilken mapp ska sidan ligga under: </label><br /> <p:tree id="treeSingle" value="#{siteBean.root}" var="node" selectionMode="single" selection="#{siteBean

Why tree ajax events in primefaces don't work when bean scope is request?

99封情书 提交于 2019-12-11 09:42:05
问题 My xhtml code is: <p:tree id="attachTree" style="width: 100%;" value="#{detailsTaskBacking.attachRootNode}" selectionMode="single" selection="#{detailsTaskBacking.selectedNode}" var="node"> <p:ajax event="select" async="false" update=":roteiroAttachTab:formAttachForm:mediaPdf" listener="#{detailsTaskBacking.onNodeSelect}"/> <p:treeNode expandedIcon="ui-icon-folder-open" collapsedIcon="ui-icon-folder-collapsed"> <h:outputText value="#{text['tasksbacking.tabAttach']}"/> </p:treeNode> <p