...did you have the fish?!............................ No.
Joined: Nov 05, 2009
what i want to do is that by clicking on the
in the first.jsp file a datatable is consists of each one's private data (populated from database) and each row has a hyper link by clicking on that the it redirects to the personaldetail.jsp here that click person's private details are displayed.
i think that it is feasible to do using session but i can't understand how to use sent session id (by clicking hyper link) from first.jsp within personaldetail.jsp to display all of the personal data taken from database.
thanks for your help !
Joined: Oct 28, 2009
What your asking is a little complicated if you are populating the page as a list from the database.
You need to know how to transfer that result-set information to a property reference each.
E.G. a cheap trick would be first getting a query such as mysql select count(distinct) where.... then collecting the same but the required identity information to send to each property of an array
governed by the previous distinct count.
The get method each time it is referred to by page call will trigger a bean internal method to ++ increment and retrieve each array value and a final special page call at the end of the page(another method) could reset the counter value to zero for next use.
usersNameOut would contain that ++ system, but your difficulty is matching page code(markup) output iterations.
first: declare your pages with the @ directive at the pagetop threadsafe="false"
second: with you JSFsession bean, for the user (provided your not using JAAS)
name of the beans [i]actionListener method in your session bean: makePageChangeLtsn[/i]
bean call inside faces-config.xml navigation rule
The actionlistener method you write must return( alike setWhereTo(String where) ) to the property(String where; // global) that holds the navigation value property configured in navigation by the rules in faces-config.xml
When the render phase(response) occurs the bean method that calls get on the where property must be set as the outcome in the navigation rule.
name of the method returning a List of usersDetails: usersDetails
You can take the hyperlinks out and replace with a commandbutton in a form that points to an outcome PAGE in your faces-config.xml navigation.
Either way it requires iteration over values from somewhere and storing individual forms for each set of details unique identifier information.
So you would see something like:
|| Jonh Smith || =buttonDETAILS= ||
|| Alison Jones || =buttonDETAILS= ||
inside the page this would look like where the button is (.faces or what your configured trigger is):
in the detailspage use the value to query your database, you supply to that value what you need
Joined: Oct 28, 2009
What the point is in JSF is, is that when you use it, it is a complete system. If you were to use AJAX or a servletfor processing a "form" it misses the point of using it.
You send the information from the first page "that will be some type of form" and process that information.
Contract for JSFusage:
So what you are saying you will do is to take an individuals unique details and send it to the JSF , if it turns out ok with a validator on the element or it makes sense automatically(as in a commandLink) you use the unique properties of that information inside the JSF Framework system to make a decision with.
So the next page will call on the the bean and is set with a unique value from the commandLink to call the database to query using that information.
In each commandLink or commandButton form you need to supply each piece of unique identifying information to use in the query as the second page gets processed.
You don't particularly need an JSF.ActionListener you can simply get the information from the click and always refer to the navigation-rule to bring that down after obtaining the unique identifying information.
subject: To view row specific data by clicking on the row link