Hi Anil,
It is hard to determine what the problem is. Some things are missing:
1. You didn't tell exactly what you want to happen and why the current behavior is wrong.
2. You didn't provide any details about your beans.
If you want people to help you solving this problem, the best thing to do is to create a really small example application that just reproduces your problem and ask someone to look at it.
However, I doubt if
you should want to solve this problem. What I see in your code is that you are doing a lot of work yourself. You are writing JavaScript to create popups and to do some sort of validation. And you write your own HTML tags. The main idea behind a component based framework such as JSF is to let the components do the hard work for you. That way you as a
Java EE developer don't have to know all sorts of details about client side view technologies such as HTML, CSS and JavaScript.
That said, the standard JSF components are bare bones. They're just provided as a starting point. JSF was designed with the idea in mind that third parties could create more versatile component sets, and that idea seems to work pretty well, given the large amount of commercial and open source JSF component sets available nowadays. So whenever you encounter a UI specification, you shouldn't ask yourself what HTML, JavaScript and CSS is needed to realize it. Instead you should start looking for one or more JSF components that implement the needed functionality.
So, how can we implement your popup without the need to write HTML and JavaScript? One possibility is to use
Apache MyFaces Trinidad's
dialog framework. The dialog framework gives you the opportunity to create popups without writing JavaScript or HTML code. You just use the right Trinidad components and create the right navigation cases. The dialog framework also offers easy to use solutions to return values from the dialog to the main page. The provided links point to some basic documentation. The dialog framework is also covered in the
Advanced Trinidad chapter of the
Apache MyFaces 1.2 Web Application Development book.
I hope this will help you to get the most out of JSF and MyFaces.
Best regards,
Bart