• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get a confirmation box from server side

 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a scenario : The user clicks a link to retrieve records from the DB,
the system retrieves records , and shows the total number in a confirmation box.
If the user clicks 'YES' the records are displayed otherwise user is redirected to some other page.

I am new to JSF and am not sure how to do this.
If I generate 2 different screens for confirmn and data display, how will the records be kept intact in the session ... using session / response objects I guess..

If some one has any design in mind please let me know.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for now I dont know any direct implementation of it in JSF. I think in RichFaces you may find something useful.

Have a look of this.

http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=modalPanel&tab=usage
[ October 20, 2008: Message edited by: Himanshu Gupta ]
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Himanshu,
I am trying this in my application.
But I have got the exception

weblogic.management.ManagementException: - with nested exception:
[weblogic.management.DeploymentException:
Exception:weblogic.management.ApplicationException: start() failed.
Module: lms Error: weblogic.management.DeploymentException: org.ajax
4jsf.renderkit.ChameleonRenderKitFactory - with nested exception:
[java.lang.IllegalArgumentException: argument type mismatch]


do I need to add some jars ?
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Aniruddh Joshi I do0nt know about the error you specified. What I can suggest you is to deploy a sample application and try to use it in case you are intending at. If it works then do the same in your real application as in RichFaces and myFaces we encountered some integration issues. Try to help yourself with Google.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's some magic you can employ if you're using a high quality DBMS and an ORM framework, such as Hibernate. And the best thing about it is that it actually makes your code simpler!

Traditionally, one might do a database read and stuff the results into a session object. That's a problem if you have lots of data and lots of users. You'll chew up a lot of server memory in a hurry.

However, if you use an ORM, records read can be cached (and they normally are), so that shared data doesn't get repeated for each user.

Additionally, on a smart DBMS, the DBMS server itself caches the query, so instead of reading everything in and using it later, you can simply repeat the query and the server will pick up where it left off instead of having to recompile the query, set up resources, and retrieve the records. This works best when you're using Prepared Statements instead of building up SQL manually.

ORMs normally take advantage of smart DBMS's, so if you use something like Hibernate, the first page can make the initial query, which returns a collection object. You can use the size() method to find out how big the result set is. If you detach the returned collection object and store IT in the session, the next page can re-attach it and retrieve data. That's what you'd normally do instead of actually redoing the query.

Some tweaking of this process may be needed, especially if others are adding or deleting records while this is going on, since the size returned won't be accurate unless you take a "snapshot" style query where the changes are ignored.
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Tim, This sounds very helpful.
I have made basic applications using Hibernate and will explore more of it to implement this idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!