Amlan Karmakar

Greenhorn
+ Follow
since Sep 20, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Amlan Karmakar

Basically I am trying to do a search of the users on my social network project using autocomplete of primefaces. The problem that I am facing is that whenever a new user signs up, the autocomplete is sometimes showing the new user in the suggestion and sometimes its not showing. Normally during first time a user signs up the autocomplete showing the user's name in the suggestion but the second when another user signs up ,his name is not showing in the suggestion. I think userDB is not getting updated. But whenever I redeploy the project everything is working fine. The name of the user is showing in the autocomplete.



1)xhtml





2) User Converter




3) Serach Bean

11 years ago
JSF
Thanks for the explanation. Now I am able to solve my problem. Thanks a lot.
12 years ago
JSF

Volodymyr Levytskyi wrote:Hello!

If you want not to reload your page when command link is clicked and form is submitted (chatBean.refresh is executed) you can use AJAX<f:ajax execute='id1,id2' render='id1,id4'/>.
But if you simply need to hide your div via javascript without executing chatBean.refresh method, you should add 'return false'. Consider this link:

To disable page reloading when javascript is executed you should add 'return false'. It must work!




Since I am new to JSF, so it would be helpful if you tell me how I should use the for my code.
12 years ago
JSF
I am trying to display the `chatBean.selectedUser` in the dynamic div that is generated by the javascript when the h:commandLink is clicked. The problem that I am facing is the that the page is refreshed whenever I click the commandLink button due to `action=#{chatBean.refresh}`, so the dynamic div gets reset and I am unable to create the dynamic divs. I need to submit the form to update the selectedUser property, but the form submit resets the page.

1)Here is the xhtml page


2) Here is the chatBean



3) Here is the user entity class

12 years ago
JSF
What I am trying to do is that I am taking timeMillis property that stores time in millisecond(that I got my using `system.currentTimeMillis`) and convert it to equivalent days,hours,mins and seconds after substracting it from the current time.The main problem is that whenever the converter `timeConverter`
is called only getAsString function is invoked , getAsObject is not invoked. I have registered the timeConverter in facesconfig.xml


1)Here is the part of my xhtml file which causing the converter to not run properly.



2)Here is the timeConverter class that I have written.


12 years ago
JSF

chets patel wrote:Get result.listIterator() outside while loop both in while condition and in first statement of while loop.



Thanks it solves my problem
12 years ago
JSF
Whenever I am calling the getFriendList function from the xhtml page I am getting an exception. The page keeps on loading and after that I stop the browser. I get the given stackstrace. Its is telling me that there is an error at line no.78 friends.add(friend); . I think there is something wrong with my syntax. It would be helpful if someone point the error.


1)Here is my FriendBean it is request scoped.





2)Here is the exception that I am getting.

12 years ago
JSF
Could you please give me an example on how to use the DataModel for obtaining the statusId, Actually I am new to JSF so I don't how the dataModel works
12 years ago
JSF
I am having the exact same problem when I am using dataTable instead of ui:repeat. The problem is that multiple commandLink are possibly getting fired. If I am using dataTable ,suppose there is an inputText and a commandLink inside the datatable and it is repeated four times. So whenever I click the first commandLink associated with the inputText , I get exception four times,comment cannot be null. So I am assuming the commandLink is fired four times. But if I click on the fourth commandLink everything is working fine, the comment field is getting inserted in the database.
12 years ago
JSF
I am trying to comment on status that is retrieved from the database. Whenever I am submitting the comment for specific status I am getting the exception.I have used <ui:repeat> to repeat the commandButtons. I don't know if the commandButton can be put inside <ui:repeat> or not. It would be really helpful if somebody could point out my mistake.Actually what is happening is that whenever I am trying to insert data into the database using '<h:inputText>' other commandButtons created due to using '<ui:repeat>' is possibly getting fired. I have inputText and commandButton inside the ui:repeat tag. So, some of inputText are supposed to be empty because I am selecting one inputText and clicking the corresponding commandButton

1) Here is my xhtml



2)Here is statusBean




3)Here is the comment entity class




4) Here is stacktrace that I am getting

12 years ago
JSF