jsf

How to stop page refresh when hit enter button from rich:inputNumberSpinner field?

Hi, I use rich:inputNumberSpinner tag. The problem is : I set cursor focus to inside of rich:inputNumberSpinner field, then i hit the enter button from my keyboard, that time page will be automatically refresh. But i don't need page refresh when i hit the enter button from my keyboard. The code : spinnerTagTest.jsp <%@page...

JSF commandButton URL parameters

Hi, I would like to make a button which navigates to a different URL and pass some request parameters through in the URL. The outputLink works but I would like a button, the commandButton looks good but I can pass parameters. Is there a solution? Thanks, Dwayne ...

Facelets charset problem

Hi! In my earlier post there was a problem with JSF charset handling, but also the other part of the problem was MySQL connection parameters for inserting data into db. The problem was solved. But, I migrated the same application from JSP to facelets and the same problem happened again. Characters from input fields are replaced when in...

Remove Foobar.xhtml from URL with JSF

I have written a facelets web application using tomcat as a application server. My program has a foobar.xhtml and the URL to it is: http://localhost:8080/Myapplication/foobar.faces Can I change something in my application so that a link to: http://localhost:8080/Myapplication/ ..will actually render my application on http://localhost...

Empty t:dataTable might be rendering invalid HTML?

I use Tomahawk 1.1.8 and I'm trying to build/render a dataTable even if it's empty. (rendered="true" as requirement) Considering our Bean provides an empty list (no rows to be displayed by t:dataTable). Why does Tomahawks' t:dataTable just render following "invalid" HTML even if we have a header providing more than one column: <tbody><...

JSF Facelets: Sometimes I see the URL is .jsf and sometimes .xhtml. Why?

Been try to learn JSF, and sometimes I see the URL is .jsf and sometimes is .xhtml. Can sometimes fill my knowledge, please? When I create a JSF using Facelet, the file extension is .xhtml, so where does .jsf URL extension come from? ...

JSF Pass parameter to another page

In JSF how do you pass a parameter from one page to another without using managed beans? e.g. <h:dataTable value="#{myObjects}" var="object"> <h:column> <h:commandButton value="View Object" action="view-object"/> </h:column> </h:dataTable> I want to pass the object ...

JAXB boolean handling oddities and JSF

There is a known bug in JAXB: https://jaxb.dev.java.net/issues/show_bug.cgi?id=733 JAXB does not properly generate boolean field getters and setters, this bug is left unfixed for backwards compatibility. A JAXB plugin exists and will ensure that the following getters and setters for boolean fields are generated: setXXX(Boolean value...

JSF runtime pagename passing

Hi I have an include page which is a navigation menu. When i click on those menu i want to refresh the content area of layout with a certain page. How can i pass the page name into a JSF page using include tag I dont want to switch to facelets and also i tried using $ and calling the backing bean method. It ...

Getting ClassCastException with JSF 1.2 Custom Component and BEA 10.3

Im getting a ClassCastException if i use Attributes in my Custom Headline Tag. Without Attributes rendering works fine. Calling <t:headline value="test" /> gives a ClassCastException even before a Method in my HeadlineComponent or HeadlineTag-Class is called. <t:headline /> works fine. I'm using MyFaces-1.2, on BEA 10.3 default.jsp ...

Auto-create ManagedBean problem

I need to instanciate a ManagedBean manually in jsp code. I used the following code : FacesContext context = FacesContext.getCurrentInstance(); ActorBean bean = (ActorBean) context.getApplication().createValueBinding("#{actorBean}").getValue(context); response.getWriter().print(bean.getChaine()); but I still get a NullPointerExce...

Code picks up value from selectOneMenu and selectBooleanCheckbox, even though it is not rendered

I've got code the following code in my .xhtml <t:panelGroup rendered="false"> <t:selectOneMenu id="id" value="#{row.someValue}" displayValueOnly="#{form.readState}"> <f:selectItems value="#{row.listOfValues}"/> </t:selectOneMenu> </t:panelGroup> The listOfValues is set in a form populator, and is thus present in the form o...

rich suggestions - why input is null? (seam framework)

Hi, I'm trying to build a rich suggestions and i do not understand WHY the input value is null... I mean, why inputText value is not taken when i enter something. The .xhtml code: <h:inputText value="#{suggestion.input}" id="text"> </h:inputText> <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]" sugge...

How to include and evaluate xhtml content represented as a String into a page using JSF?

Hi! Im using JSF 1.2 and need to include xhtml content represented as a String in a bean. So, how can I get the content from a bean in xhtml but represented as a String and render it on the page? Here is an example: myPage.xhml ... xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://ri...

Rich text editor for JSF 2

Hi, I searched around for a basic WYSIWYG rich text editor that I can use in a JSF 2 (VDL) application, but found nothing satisfactory.. in the sense that: The editor is very extensive, and not configurable (like PrimeFaces) The editor doesn't work with VDL (like RichFaces) Multiple instances of the editor cannot be used on the same p...

how to use JSF 1.2 and JPA in Netbeans ?

Hello... I'm trying to use JPA to connect my JSF components to database but the problem is that I can't figure out how to get this all combination works.I have done entity classes from database, also create persistence.xml file and now I don't know where to go!! I don't know how to use entity manager and entity manager factory. Is ther...

Can a List<> be casted to a DataModel

I'm trying to do the following: public String createByMarcas() { items = (DataModel) ejbFacade.findByMarcas(current.getIdMarca().getId()); updateCurrentItem(); return "List"; } public List<Modelos> findByMarcas(int idMarca){ return em.createQuery("SELECT id, descripcion FROM Modelos WHERE id_marca ="+idMarca+"").getResu...

Using OpenSessionInViewInterceptor with Hibernate and JSF 2

I'm building an application in Hibernate, Spring and JSF2 using only annotations. How can I take advantage of OpenSessionInViewInterceptor found in Spring to catch any hibernate session that might open within a bean? I'm trying to elegantly solve the common “failed to lazily initialize a collection of role: your.Class.assocation no se...

JSF ui:repeat and f:ajax giving wrong value for h:inputText after rerender.

I have a list of questions and I can display them ok using a ui:repeat, but after clicking the Edit button the rerendered inputText is given the wrong question.id. For some reason, if you click Edit on the first item, the inputText value assigned is that of the second item in the list, even though other outputs (other than the h:inputTex...

JSON array and JSF

I'm working with JSF and EXT js. I have a JSONArray created in the server-side and I want to pass it to client-side. I used to get the array and put it in javascript var. But this tag adds a html tag (span) which make an error in javascript var. This is the code I wrote: var data1 = <h:outputFormat value="#{actorBean.newactors}" /> ...