facelets

How to reference #{cc.clientId} in ajax update/process/render/execute?

有些话、适合烂在心里 提交于 2019-11-29 11:10:48
I don't know how to reference descendant components of composite component in update or process (alias render or execute ). I have this composite component resources/components/crud.xhtml : <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsf/composite"> <c:interface> <c:attribute name="controller" required="true" /> <c:facet name="fields" required="true"/> </c:interface> <c:implementation> <p:dataTable id="table"

Integrating JSTL With Facelets

∥☆過路亽.° 提交于 2019-11-29 11:10:12
I am considering using Facelets and JSTL in the same web project. Are there any issues in integrating these ? BalusC Facelets has cloned a limited set of "good old" JSTL tags and included in the Facelets library. They are all described here . In other words: not all JSTL tags/functions are supported in Facelets. If there's any original JSTL tag which you would like to use, but isn't made available by Facelets, then you'll head in another corner for the solution. The jobs which can be done by the JSTL sql and xml taglibs doesn't belong in the view, but rather in the model/business logic. The

In JSF what is the shortest way to output List<SomeObj> as comma separated list of “name” properties of SomeObj

旧时模样 提交于 2019-11-29 09:18:48
I have a question about outputing a list of objects as a comma separated list in JSF. Let's say: public class SomeObj { private String name; ... constructors, getters and setters ... } and List<SomeObj>: List<SomeObj> lst = new ArrayList<SomeObj>(); lst.add(new SomeObj("NameA")); lst.add(new SomeObj("NameB")); lst.add(new SomeObj("NameC")); to output it as a listbox I can use this code: <h:selectManyListbox id="id1" value="#{listHolder.selectedList}"> <s:selectItems value="#{listHolder.lst}" var="someObj" label="#{someObj.name}"/> <s:convertEntity /> </h:selectManyListbox> But what is the

JSF - Get the SessionScoped Bean instance

时间秒杀一切 提交于 2019-11-29 09:18:29
问题 I have this configuration on my web application. 2 beans : 1° Bean - It checks the login; @ManagedBean(name="login") @SessionScoped public class Login { private String nickname; private String password; private boolean isLogged; public String getNickname() { return nickname; } public void setNickname(String newValue) { nickname=newValue; } public String getPassword() { return password; } public void setPassword(String newValue) { password=newValue; } public void checkLogin() { ... i check on

Datatable inside programatically added composite component

让人想犯罪 __ 提交于 2019-11-29 08:52:36
Referring to my earlier question ( Programmatically create and add composite component in backing bean ) I have succesfully able to add composite components from backing bean. Now I have a new problem as composite component with lazy datatable in it does not call load() method at all. There was bug report about this ( https://code.google.com/p/primefaces/issues/detail?id=3258 ) but that is marked to be related to PF3.0.RC1 and I have no clue if it is fixed for version 3.5 I am using. I am using the exactly same code BalusC mentioned with possibility to add value expressions to the composite

Creating an “Edit my Item”-page in Java Server Faces with Facelets

谁说我不能喝 提交于 2019-11-29 07:56:39
Let's say that you have the following Facelet ( Using Facelets 1.1.12 ): edit_item.xhtml which i access with edit_item.jsf Now i have another page sending me to edit_item.jsf with the GET-paremeter ID the uri looks like this: http://mysite.com/edit_item.jsf?ID=200 How do you access a Bean and fetch the Information, and display this on the requesting page with JSF and Facelets? Is there a way to run a bean when a page loads? You can use the faces-config.xml configuration to inject the ID from the param map. For this simple bean: public class BeanWithId implements Serializable { private String

<h:outputScript> target problem when using templates

一个人想着一个人 提交于 2019-11-29 07:29:29
I have a question about integrating jquery library with JSF 2.0 when using <h:outputScript library="/common/js" name="jquery-1.5.1.min.js" target="head" /> , i should include <h:head> tag also in my xhtml file. so script is rendered at head. but i have a template.xhtml that contains <h:head>,<h:body> parts. How can i make target="head" /> for my page that derives from this template ui:composition="template.xhtml" ? target=form> didn't work either. my template: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD

How to escape '$' and '#' in Facelets/EL?

假如想象 提交于 2019-11-29 07:21:19
I'm using Java Facelets and jQuery, however the expression $('...') in jQuery conflicts with EL expression, how do I escape the jQuery's one? I'd like to escape a large chunk of Javascript, too. ANSWERED To convert the existing JSP to Facelets xhtml, it's convenient to just wrap the existing javascript by <![CDATA[ ... ]]> . However, the output scripts for <script> are wrapped by <!-- --> comment, which conflicts with CDATA section: <script><![CDATA[ scripts... ]]></script> => <script><!-- <![CDATA[ scripts... ]]> --></script> To resolve this problem, you should also comment out the CDATA:

JSF Facelets how to include external html?

喜夏-厌秋 提交于 2019-11-29 07:17:49
I have an app that i'm developing and my company has a header banner that is required to be on all pages. We have about 6 different versions floating around my team of that header banner and I now want to make it so that I just include the banner from the source into my app so that if they update the source of the banner, my app's version of the banner is automatically updated as well. using <ui:include src="http://mycompany.com/banner.html" /> causes the error The markup in the document following the root element must be well-formed. . How can i include this banner even if it's not well

Whats the correct way to create multiple instances of managed beans in JSF 2.0

两盒软妹~` 提交于 2019-11-29 07:02:58
If I want to create more than one instance of managed bean in JSF 2.0, under different names in the same scope, how should I proceed? Ideally, I want the equivilant to (for example): @ManagedBeans({name="myManagedBean1",name="myManagedBean2"}) @RequestScoped public class MyManagedBean { } Thanks .. You can't. It technically also doesn't make much sense. You're probably looking for a solution in the wrong direction for the particular functional requirement. Your best bet is to have a parent bean and have those "multiple beans" as children. @ManagedBean @RequestScoped public class Parent {