Skip to main content

Posts

Showing posts with the label jsf-2.0

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

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; } }

I can call a no longer existing JS function but I can"t call new JS functions from my view

I have a problem regarding to a JavaScript function. I used to have a JS function located in a .js file which is also located in my project's NetBeans directory. I used to invoke that function from a view but later on I decided to change that function and add some new features to that function and call that new function from my view but it worked as in its past version and later on I changed that function's name which officialy means a function with the previous name was totally destroyed and this time I invoke my JS function from its new name and nothing worked. The funny thing is that, I again called that function with its previous name (again, it doesn't exists actually), it works as its past version although I have totally changed that function's name and officially a function with that name no longer exists in my file. What do you fellows think I should do? Yours ideas and helps are greatly appreciated...