jsf-2

Concatenating strings within EL expression defined in an attribute of a facelets tag

让人想犯罪 __ 提交于 2019-12-17 17:50:11
问题 I need to write an EL expression for an attribute which goes something like this: #{cc.attrs.appreciatedByCurrentUser ? (cc.attrs.count +'<br/>'+ (cc.attrs.count-1)) : ((cc.attrs.count+1) +'<br/>'+ cc.attrs.count)} Now the problem is that this gives an error as strings cannot be concatenated, the way I am doing it. So how can I rectify this? I'm using JSF 2.0 with facelets. EDIT : I'm resolving the issue using the following inline javascript <script type="text/javascript"> var count=#{cc

How to use jQuery with JSF 2.0

断了今生、忘了曾经 提交于 2019-12-17 17:36:41
问题 I am learning jQuery. I want to use jQuery inside my jsf 2.0 application. Like i have html file, in which i am using jQuery like this <head> <title>The Devil's Dictionary</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="css/06.css" type="text/css" /> <script type="text/javascript" src="js/jquery-1.7.1.js"></script> <script type="text/javascript" src="js/06.js"></script> </head> I simply downloaded the jquery-1.7.1.js file form jQuery

Why does an image in graphicImage not load fully (PrimeFaces mobile)?

不问归期 提交于 2019-12-17 16:54:18
问题 I have an application, which uses PrimeFaces Mobile to display images. Sometimes, but not always, the image is not displayed fully - only the top part. The XHTML code of the page with that image looks like this: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:pm="http://primefaces.org/mobile"> <f:view renderKitId="PRIMEFACES_MOBILE"/> <h:head> </h:head> <f:event

is meta http-equiv value cache control is not supported?

血红的双手。 提交于 2019-12-17 16:49:16
问题 i have this code here on a page: <!-- no cache headers --> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <!-- end no cache headers --> when i go to other page and hit back button of browser (back to the page where this code written), it is still had the cache state of the page. option is, to add PhaseListener but they told me that adding PhaseListener is an additional

JSF 2 Custom components having Expression Language for attribute value don't trigger the attribute setter

落花浮王杯 提交于 2019-12-17 16:45:31
问题 I have build a custom component in JSF 2.0 The tag looks like this: <x:myTag id="1" name="AAA" /> The corresponding java class: @FacesComponent("a.b.c.MyTag") public class UIMyTag extends UIInput { private String name; private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name =

Validator skipped when input is removed in client – is this as per JSF specification?

依然范特西╮ 提交于 2019-12-17 16:22:39
问题 I have a page with an input text component marked as required="true" and having a custom Validator in server side. Now as a client, I submit the page without the HTML element rendered by that component (this can be easily achieved by removing the element from the DOM tree using browser's builtin DOM element inspector). The form is successfully submitted, without the server side validation of this required component. Is this as per JSF specification? Is there a way to specify that the

How (and when?) to remove a Session scoped bean in JSF 2.0

蓝咒 提交于 2019-12-17 15:59:09
问题 Background: I have a JSF 2.0 application using MyFaces. Using this application, the users will create a complex "Widget" by going through a number of different JSF pages. I am storing the managed bean in the session scope, and the properties get filled in as the user goes through each page. Once they are done assembling the "widget", they would then want to create a brand new "widget" and repeat the process. My question is, how do I completely (and safely) remove the managed bean from the

Can JSF 2.0 be used with Websphere application server version 7.x

江枫思渺然 提交于 2019-12-17 15:57:13
问题 Can JSF 2.0 be used with WebSphere Application Server version 7.x? If so, how? 回答1: The WebSphere Infocenter indicates that the right way to change to an alternative JSF implementation is to create a WebSphere Shared Library with the isolated classloader option enabled. Any modules that need JSF 2 would be associated with the new shared library, and then the application would start with JSF 2 instead of JSF 1.2. It is also necessary to have fix pack 7.0.0.19 or later installed. 回答2: Websphere

Initialize a composite component based on the provided attributes

一个人想着一个人 提交于 2019-12-17 15:51:36
问题 I'm writing my custom table composite component with Mojarra JSF. I'm also trying to bind that composite to a backing component. The aim is to be able to specify the number of elements the table has in a composite attribute, later on the bound backing component will autogenerate the elements itself before view gets rendered. I've this sample code: Main page: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:comp=

@PostConstruct method called twice for the same request

 ̄綄美尐妖づ 提交于 2019-12-17 15:46:11
问题 I'm using JSF 2.0 with GlassFish 3.0. I have the following Managed Bean: @ManagedBean @RequestScoped public class OverviewController{ private List<Event> eventList; @PostConstruct public void init(){ System.out.println("=> OverviewController - init() - enter"); System.out.println("=< OverviewController - init() - exit"); } } From the the overview.xhtml file I'm calling different attributes or methods from my OverviewController. <ui:repeat var="event" value="#{overviewController.eventList}"> .