Uhmmm I create a simplified version of your code and mine work perfectly. Every time I click on the row, my dialog pop up. Try to run this code on a new project and see if it worked.
Up vote 4 down vote favorite 1 share g+ share fb share tw.
Lately I am having lots of issues with primefaces components, I dot know why. I use glassfishV3.0 and my primefaces version is 2.2.1 My problem now is that I cant make the p:dialog of primefaces render when I click on a table row. I do almos exactly as it is done in their example: primefaces.org/showcase/ui/datatableComp... I think my issue has something to do with some configuration, because I am also having troubles with other primefaces components.
Can somebody give me a hand please and tell me what I am missing to be able to use primefaces components like thisone with no problems? Here is the code: THE JSF: THE Managed bean @ManagedBean @ViewScoped public class ResultsController implements Serializable{ @EJB private ISearchEJB searchEJB; private Garbage garbage; public List getAllGarbage() { List tmpGarbage = new ArrayList(); for(Garbage g :searchEJB.findAllGarbage()) { tmpGarbage. Add(g); } return tmpGarbage; } public Garbage getGarbage() { return garbage; } public void setGarbage(Garbage garbage) { this.
Garbage = garbage; } The JSF before is a composite page that I use inside this template title My web. Xml configuration Faces Servlet javax.faces.webapp. FacesServlet 1 Faces Servlet /pages/* pages/index.
Jsp Resource Servlet org.primefaces.resource. ResourceServlet Resource Servlet /primefaces_resource/* PrimeFaces FileUpload Filter org.primefaces.webapp.filter. FileUploadFilter PrimeFaces FileUpload Filter Faces Servlet In the table I above everithing works, just the sortBy function and the p:dialog doesn't work.
This is a messages that is displayed at the eclipse console when I refresh the page: SEVERE: line 1:61 no viable alternative at character ';' I don't understand what it means, I think I have some kind of configuration problem rather than a syntax error. Ill be really happy if somebody could help me fix this please. Java jsf java-ee jsf-2.0 primefaces link|improve this question edited Mar 30 '11 at 17:24 asked Mar 30 '11 at 17:15sfrj2,672948 100% accept rate.
Regarding the dialog the only difference to the primefaces showcase is the missing rowSelectListener in your code. Maybe that's a starting point for further investigations. Or try to call the dialog from outside the table with a commandLink to check if it is displayed at all.
– Matt Handy Mar 30 '11 at 18:37 Yes I can call the dialog from outside the table with a button like this: It works, but what is wrong, why it don't works when I click on a row from the table? – sfrj Mar 30 '11 at 18:46 Try to add a rowSelectListener and check if it is called. – Matt Handy Mar 30 '11 at 18:47 No it didn't work, I tried this: rowSelectListener="#{fileDialog.show()}" Are maybe some of the other options disturbing?
: selection="#{resultsController. Garbage}" selectionMode="single" update="display" rowSelectListener="#{fileDialog.show()}" – sfrj Mar 30 '11 at 18:52 Try to put the p:dialog outside the h:form of your `p:dataTable' and see if that fix it? If not I will try to recreate your issue on my computer – Thang Pham Mar 30 '11 at 19:03.
Uhmmm I create a simplified version of your code and mine work perfectly. Every time I click on the row, my dialog pop up. Try to run this code on a new project and see if it worked.
And here is my bean /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com. Test; import java.util.
ArrayList; import java.util. List; import javax.annotation. PostConstruct; import javax.faces.bean.
ManagedBean; import javax.faces.bean. ViewScoped; /** * * @author KingdomHeart */ @ManagedBean @ViewScoped public class MyBean { private List myList; private String selectedResult; public MyBean() { } @PostConstruct public void init(){ myList = new ArrayList(); myList. Add("Test1"); myList.
Add("Test2"); myList. Add("Test3"); myList. Add("Test4"); myList.
Add("Test5"); } public List getMyList() { return myList; } public void setMyList(List myList) { this. MyList = myList; } public String getSelectedResult() { return selectedResult; } public void setSelectedResult(String selectedResult) { this. SelectedResult = selectedResult; } } Update by sfrj As you see more than one of my rows are yellow, that is not suposed to be like that.
SelectionMode="single" is not working correctly. Update by Harry Here is how to convert Date type into String public String formatDate(Date date) { if (date! = null) { SimpleDateFormat sdf = new SimpleDateFormat("MMM dd yyyy"); return sdf.
Format(date); } return null; } Then your JSF would be like this h:outputText value="#{resultsController. FormatDate(garbage. UploadDate)}" /> Update 2 by sfrj Here is the brand new JSF page.
I did and yes it works fine you are right. But I don't understand why in the other project don't work, it is almost the same. Is it something making conflict?
The thing you mention about the "fileDialog.show()", how could I write a function like that in the backing bean? How can I access the dialog from it and tell it to show? – sfrj Mar 30 '11 at 20:18 I just tried this: public void onRowSelect(SelectEvent event){ garbage = (Garbage)event.getObject();} on my managed bean and I called it like this: rowSelectListener="#{resultsController.
OnRowSelect}" But doesn't seem to work :( – sfrj Mar 30 '11 at 20:32 @sfrj: It is not a good idea to keep beating on something that is not working. What I want you to do is this: now you know that my example work, so we will start from there. From my code, start putting your components into it (one component at a time though).
Each time you put a component in, redeploy and see if the dialog still show up. This way we can narrow down the problem, in the mean time, I will try to take a look at your code again. – Thang Pham Mar 30 '11 at 20:47 You are right that is what I will do Tomorrow morning.
I will create a brand new page and start to add piece by piece. Also I was just going to make an update on your post to show you a print screen comparing both. I also noticed that in mine, for some reason the option selectionMode="single" looks like doesn't work.
See the update. Anyway thank you very much I hope tomorrow morning I have more luck :) – sfrj Mar 30 '11 at 20:54 @sfrj: I noticed on p:column, you have a parser="string". I don't think p:column have that attribute.
– Thang Pham Mar 30 '11 at 21:00.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.