Babu Raj K R

Greenhorn
+ Follow
since Jul 17, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Babu Raj K R

Hi,
I would like to create a table like following


How it can be achieved in jsf or tomahawk data table
12 years ago
JSF
1) I had made a custom component -- TimeField --> 3 combobox with hour, minute and seconds
2) it is working fine, but when enabling a4j support event(selecting a combo with status details, i need to switch its visibility) for rendering its not working.
3) Actually inside reRendering its not calling the bean setter methods.
4) If i am replacing this component with h:inputtext..the its working fine

What is wrong with me .. do i need to do anything more for enabling a4j
13 years ago
JSF
Hi. Tim

Thank you very much,

yes we need to rerender only the container.....

Now i will come back to you for help in making composite components ie;
i need a time field which contain 3 combobox one with hours with 00-24 and another with minutes with 00-59 and another same with 00-59 for seconds.
first let me will make a try
13 years ago
JSF
Hi Tim,
I deleted every thing and started again. Now the method is calling but component is not viewing. I made the action as void ie


One interesting thing i found is after changing the combo, if i am pressing the F5 button then the component is viewing. So i put everything inside a panel group and rerendered that group id too. Now its coming


13 years ago
JSF

Tim Holloway wrote:Is isOneId() declared like so?


Usually when a method isn't being invoked, there's a problem with its signature that keeps JSF from finding the method.



Hi Tim,

Exactly same.

13 years ago
JSF
Hi Tim,

I had made a test page for doing the same, but failed. I had tried what you explained as

and also with the following code

The isOneId() method of bean is not calling.( i had made a log inside that method).
Whether im doing anything wrong. Please quote me if anything wrong with me


13 years ago
JSF
1) I have one combobox --> with values 1, 2, 3
2) If i am selecting 1, one textfield need to be shown
3) If i am selecting 2, one calendar need to be shown
4) If i am selecting 3, 2 textfields need to be shown

How it can be achived using JSF/Richfaces package
13 years ago
JSF
Hi,

1) I have a text field, one button and a select one menu.
2) Its actually a search option, user will enter some text inside text field and click button, then those data will be loaded to the select one menu.
3) Also i have some text fields with attribute required="true".
4) Actually this is an add/edit organization form.
5) User can create new organization or search and edit existing organization.
6) But now what is happening is search button is a command button, so when i click search button the validation of the text field is happening and no action is going to the backing bean.
7) So what i required is when i click on the search button, no validation should be called, but action need to go to the backing bean..
8) please provide me a solution.
9) please see the source code attached here

13 years ago
JSF

Allen Sylvester wrote:the following is maybe what you need.

a. set the action attribute of the button to a logical outcome name
b. set the value attribute of the text field to a bean property using a method expression like value="#{user.input}"
c. within the select one menu in the outcome web page, use the bean property to display the value like value="#{user.input}"
d. within faces-config.xml, add a navigation rule to map the above logical outcome name to actual web page
ex: <navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/welcome.xhtml</to-view-id>
</navigation-case>
</navigation-rule>

This rule states that the success outcome navigates to /welcome.xhtml if it occured inside /index.xhtml. I think the <to-view-id> can be same as <from-view-id>, if your select-one menu is in the same page as the text-field. Initially, a blank may be displayed.



Thanks a lot it worked

How can we achieve it using ajax... its actually a search operation,
1) inside the text we will enter some text then click on the search button
2) The details will be loaded into the select item
3) Can we achieved it using ajax .. so that the full page request can be avoided
13 years ago
JSF
1) i have a text field, a button and a select one menu
2) when i type some thing in the text field and click on the button, the details need to be loaded to a select one menu
3) How can it be achieved
13 years ago
JSF

Tim Holloway wrote:That sounds like a somewhat different problem.

Because of the immediacy of the HTTP request/response paradigm, a user cannot (reliably) hold onto a database connection or transaction for an extended period of time. However, in the case of a workflow consisting of multiple views (and extended transaction), you may have to do one of 3 things:

1. Break the transaction down into separately managed parts.

2. Lock the affected resources for the life of the extended transaction.

3. Ignore any other actors and proceed onwards, letting them handle the consequences.

Solution 2 is the least common, since it can lead to deadlocks. Solution 3 has the drawback that unless you're careful, the consequences don't get handled properly.

If you're using a sufficiently powerful database and an extended transaction driver/environment, some or all of the issues involved in extended transactions may be automatically handled for you. One of the things you can do if that isn't enough, or isn't an option is to provide your own interlocks as well.

You can set up a hashtable at application scope where the keys are user IDs and make entries into it (using synchronized resources). And/or you can set up a similar resource access control facility if you're more interested in limiting specific resources instead of users. Things that can help are:

A) A servlet filter. If you're using container-managed security, the HttpServletRequest userId will contain the userID (or null, if the user isn't logged in).

B) A session listener. This allows you to remove a user from the control tables when they're logged out (whether explicitly or when the session times out).




Thanks Tim

I had made it... i will explain you, if any defect or correction please let me know

I have one filter and a session listener..
Filter --> For any request we need to check whether the user is logged in or not, if not logged in we will redirect him to the login page
Listener --> For identifying destroyed sessions

I have 2 ArrayList
1) For keeping active session details
2) For keeping inactive session details
Here i am keeping one pojo for keeping session details, with variables are loginname, sessionid, loginid etc

When the user is logging in i will check whether the same loginname is present in the active list. if yes then that session details will be added to the inactive list and removed from active list and the new session details will be added to the active list.

When a hit comes from the user i will check whether the session details is in the inactive list, if yes then call session.invalidate(). since its in my control we can do anything in that part

When the session is destroyed then remove the session details from the active list

A class is mainataining for this purpose .. both array lists are static...sessionAdding, sessionRemoving, sessionInvalidating methods are synchronized(need to think of using vector,but whether synchronized will really make problem, say if 50000 users are logging in)

Performance wise we need to check how good is this approch, since for every request, filter is calling..

Please update me if this has any problem...
13 years ago
JSF

Tim Holloway wrote:Welcome to the JavaRanch, Babu. We'd prefer that you use your actual last name instead of just an initial letter, though.

J2EE does not maintain a continuous connection between client and server (actually, no HTTP-based system does). So you can't sever that (non-existent) connection to force a logout.

The only way to log out is to discard your security context, which generally means to destroy your HTTPSession object.

Probably your best bet would be to keep a list of all logged-in users, and when an attempt is made to login a user ID that's already listed as logged in, you'd have to set some sort of indicator that causes the next request from the old location to be redirected to a logout process. Only the server or the logged-in user can log out the user, no other user can do so (safely and portably, anyway!). So you can't do an immediate logout, only a scheduled one.

In actual practice, it's more common to reject the second login instead of forcibly terminating the first login, since there may be work in progress that should be saved over on the original user login. Some systems have been set up to force out an existing login, but they normally ask permission first, so that there will be an option to save whatever that work in progress was.





What i thought is what you explained...but my question is .. a you said as BEST BET ...how to keep the users who is already logged in .. with out using database connectivity ie; when a user is logged in we are updating the status and some more details in the db.. for each login we cant check whether how many users are logged in .. which is not a best practice.. so what i m thinking is to do something in the session base..please update....
13 years ago
JSF
I have one login page which is built with JSF <---> Spring <----> PostgreSQL
If a user is logged in from 2 different browsers(with same user name) then the first user need to be logged out to the login page if he is doing any requests...
how this can be achieved ...
13 years ago
JSF