Skip to main content

Posts

Showing posts with the label jsf

Fields are cleared but just when I press F5

I don't know if it is a common problem, but this strange problem is giving me some headache... I'm having an strange behavior, my application has a lot of dialogs, and when user opens one, the dialog should show default content. The problem is that I clear all bean's properties before show the dialog, but sometimes it appears that the form isn't cleared!! For example, this is one of the dialogs that are having this problem: This image show how the dialog appears the first time I open it, all fields are cleared and the second radio is selected. If I change the radio selection and enter something in the input field, the datatable immediately shows the data accordingly with the search. So, if I click in "Cancelar" (cancel in portuguese), this dialog is closed, like expected. Then I open this dialog again and: The fields store the last edition user made. I thought I wasn't clearing the bean, but if I just press F5 (refresh) the dialog is shown like i

RichFaces Column: Saving value of attribute on a row for comparisons

Hello I'm developing a Web Application using RichFaces 3. I have a rich:dataTable with individual rich:column . One of these columns has a Date value and there is this requirement where if the date is the same on consecutive rows the value has to be shown only on the first row, subsequent rows with same value will show nothing. So I need to save the date value for comparison on subsequent rows. Does anybody know how to do this with richFaces?

Why this table In-Cell editor, doesnt work?

I am trying to figure out, how the primefaces in-cell editor works. For some reason, it does not work. I just see it activating and also i can type, but the values do not change. What is missing? <?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"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:form> <p:dataTable id="allSubjects" var="subject" value="#{subjectControllerUpdate.retrieve()}" paginator="true" rows="7" > <p:column headerText="Name" sortBy="#{subject.name}" style="width:200px" > <p:cellEditor>

Target Unreachable, identifier "demoBean" resolved to null

I am developing a web application using JSF on Netbeans 7.0. I have created 2 pages: one for entering persons name and other to display that name. I am using a java bean with get and set methods. I get an error when I submit my form on first page the code. This is my first page index.xhtml to accept name: <h:form> Enter your Name : <h:inputText value="#{demoBean.name}" required="true"/> <br/> <h:commandButton value="Submit" action="welcome.xhtml"/> </h:form> This is the other page welcome.xhtml to display the name: <h:body> Hello #{demoBean.name} </h:body> This is the managed bean demoBean.java : import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean() @SessionScoped public class demoBean { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }

JSF2.0 - InputTextArea inside Dialog cannot be retrieved via Jquery during the dialog"s onShow event

I have the following dialog inside my .xhtml page. <p:dialog widgetVar="exampleDialog" onShow="fillTextArea()" > <p:tabView id="tabView"> <p:tab id="exampleTab" title="Example"> <p:inputTextarea id="someInputTextArea" autoResize="false" value="" /> </p:tab> </p:tabView> </p:dialog> The dialog is shown when a button is clicked. The fillTextArea javascript function is defined inside script tags at the head of the document. function fillTextArea() { console.log(jQuery("textarea[id='someInputTextArea']")); // logs empty array [] console.log($("[id='someInputTextArea']")); // logs empty array [] jQuery("textarea[id='someInputTextArea']").val('xxx'); // does nothing } What's the problem? Why can't I retrieve the input text area? In