jsf-2

How to set the alt attribute for h:graphicImage?

最后都变了- 提交于 2019-12-11 17:54:21
问题 I define a image in my JSF application: <h:graphicImage library="myPath" name="myImg"/> As result my HTML output: <img src="bla-bla-bla" alt="" /> It works properly but I have a question. How to set the attribute alt for HTML tag img in this case? For example <h:graphicImage library="myPath" name="myImg" alt="myText"/> doesn't work... 来源: https://stackoverflow.com/questions/10897493/how-to-set-the-alt-attribute-for-hgraphicimage

lose view page parameter

≯℡__Kan透↙ 提交于 2019-12-11 17:53:45
问题 i have page my.xhtml: <f:metadata> <f:viewParam name="id"/> </f:metadata> ... <h:form> Current id is: "#{id}" <h:commandButton action="#{bean.doSomething}" value="Do some logic.."> <f:param name="id" value="#{id}"/> </h:commandButton> </h:form> and Bean.java: @ManagedBean @ViewScoped public class Bean { .... public void doSomething(){ //do some logick, don't use id parameter } } When I get to page first time with id=10 I can see on page Current id is: "10". . When I click on button page is

Primefaces datatable onRowSelect method causing nullpointer exception

吃可爱长大的小学妹 提交于 2019-12-11 17:47:08
问题 I am using Hibernate 4, Spring 3 and JSF 2.0 with Weblogic 10.3.6 as server. I am loading my datatable using lazy loading. JSF Page <p:dataTable id="dataTable" var="req" lazy="true" value="#{emp.lazyModel}" paginator="true" rows="10" selection="#{emp.selectedRequest}" selectionMode="single"> <p:ajax event="rowSelect" listener="#{emp.onRowSelect}" /> When I select a row in a datatable I am getting null pointer exception in onRowSelect method. ManagedBean public void onRowSelect(SelectEvent

commandButton issue in JSF

丶灬走出姿态 提交于 2019-12-11 17:39:51
问题 Brief intro about my requirement. I have an empty JSF dataTable. Now, when I click on a button, it should fill the empty datatable with data. <h:commandButton value="Search" action="#{myBean.searchresults}" /> Problem: When I click on the button, it populates the data to the dataTable but instantly shows me the same page when I load my application first time (refresh the page). I want the page to not refresh itself and show the populated data. I am stuck in this issue for the last 2 days.

When a (non-web, non JSF) event invoke, need to update data on the browser

China☆狼群 提交于 2019-12-11 17:37:48
问题 currently I am using javaEE7 and I have a scenario as follow. Inside my JSF webapp, I have an event listener (not JSF event) that when an event invoke, do something, then update these information to browser of my web app. I have a ApplicationScoped bean with eager=true , that init an event listener in init @PostConstruct. My event listener (not a JSF event listener) look as follow public class AMIEventListener extends AbstractManagerEventListener { public void init(){ //handle connection to

Is there a way to inject HttpSession with Spring in JSF application?

☆樱花仙子☆ 提交于 2019-12-11 16:49:30
问题 I have a web application written in JSF2 that uses Spring. I need to create a bean that is a wrapper of JSF HTTP session and use it internally. It seems logical to me to inject the HttpSession object into that bean's definition and to scope the bean to the session. However I could not find a way to define the injection in the context.xml file. Is it possible to do this, could it backfire and is there a better way? All I want is to have the current session inside that bean. If there is a

Highlight row of JSF datatable

时光怂恿深爱的人放手 提交于 2019-12-11 16:48:13
问题 I want to highlight row into JSF table when the mouse pointer is on the row. I found this tutorial. I tried to implement the example here: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> <ui

Primefaces tooltip displaying bottom of the page?

假如想象 提交于 2019-12-11 16:31:54
问题 primefaces tooltip displaying bottom of the page.. when i mouse ohover on tooltip message displaying bottom of the page. primefaces tooltip displaying bottom of the page.. when i mouse ohover on tooltip message displaying bottom of the page. here is my code and image link.. http://postimg.org/image/k9maot5gl/ <!DOCTYPE html> <h: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:f="http://java.sun.com/jsf/core"

p:growl doesn't work after JSF page forward, but works with page redirect

夙愿已清 提交于 2019-12-11 16:08:12
问题 I have created a small JSF web project with primefaces 4.0. I use a basic template, which contains the header and footer. In the header there is a button which shows a growl message (p:growl element) when he gets pressed. In the project there are following files: index.xhtml: Contains two buttons, which redirects/forwards to another page All other pages uses the basic template (include header and footer). If I press the button on the redirect.xhtml page everything is okay and the message is

CDI session bean initialization

▼魔方 西西 提交于 2019-12-11 15:49:49
问题 I have two beans: @Named @SessionScoped public class Session implements Serializable { private String temp; +getter, setter } @Named @RequestScoped public class Test { @Inject private Session s; @PostConstruct public void init() { this.sth = s.getTemp(); //here is exception } } When I try to fetch in init same value from session I get NullPointerException. What am I doing wrong? Server is JBoss eap 6.0, JSF v2.1. Thanks in advance Edit: I investigated that problem appears only when I have