|
just another regularban.info web blog |
| MEMBERS: | Passing Parameters In A Data Table Using JSF
Some working knowledge of J2EE or JSF is assumed for this article. Like some of you I've been frustrated with this technology known as JSF or Java Server Faces. There are several different flavors out there that are built on the shoulders of JSF. For instance Oracle's ADF (Application Development Framework). Oracle ADF Faces Components is a set of over a 100 JSF components that let you build a richer user interface for your Java EE applications. Oracle ADF Faces also includes many of the framework features most needed by JSF developers today. That is great, and in many ways it will make life easier to develop in a JSF environment. Some items you will find available in these "add on" packages have a real benefit. For instance, as of the date of this article, I was very surprised that a File Upload is a feature still not implemented in JSF in respect to using natural jsf tags. There are ways to accomplish this task in JSF but they are not native JSF approaches. The process is a "no brainer" in just about every other framework available today, including asp.net. Another simple task (I thought) was having a data table present the results of a query in an editable format. Possibly to update a user record or shopping cart. After working in other technologies it was very efficient to return a result set to a data table object and let that object take care of some of the trivial behaviors and characteristics of the table itself. When I started exploring JSF I was frequently and at every turn becoming more and more frustrated in trying to duplicate some of the most basic of processes similar to managing records through data tables. There are not a whole lot of resources out there yet on JSF although it is growing steadily, and I found that all too often the resources that I was finding on the internet either didn't apply to the more simple tasks or the information was just completely wrong. One example of that was that it was stated in one article I read that you cannot use command buttons inside of a JSF data table. The recommendation was to use JSF hyperlinks instead when trying to perform an action from a data table due to a bug in the framework that prevented command button actions to fire if the button resided inside of a data table. At first I thought "you've got to be kidding me"! Then I remembered that I've been finding a fair amount of "bogus" information in regards to JSF development so I decided to do further research and discovered that information to be less than accurate as well. I simply had to find a way to populate a data table through a result set and get a command button to fire an action and pass all of the data in the data table to the backing bean to update the record. Multiple command buttons would exist as well as hidden fields pertaining to id numbers and so forth. Pretty basic stuff and we've all done it before with relative ease. It turned out that the solution was in fact a simple one. "Binding". You've heard about it and read about it. But this approach was something a little different as far as I could find. Many of the blogs and articles that I read dealt with passing the values as parameters and following the steps to define the parameters in faces.config files etc., then retrieving the parameters in a backing bean. Processing the passed data required another set of procedures to utilize mapping to each of the field parameters passed and then processing could begin. That seemed like a whole heck of a lot to me just to retrieve form data. Then it occurred to me that I should be able to "bind" a text field component on a page to a backing bean. Once it is bound then all I have to do is extract the data. And that's all there is to it. My query returned results and pre-populated a data table including text fields with the values of the query pre-populated in the text fields. Each one of those text fields was bound to a "HtmlInputText" type in my backing bean. It was not a String type like other approaches define. Doing that does require you to map parameters and populate that String variable through your set methods once the form is submitted. What I found is that if I bind my text field to a property of text field type that it solved my problem of passing values from a data table, and I didn't have to define parameter fields anywhere in any xml file. Now that I had that figured that out I needed to figure out how to get the value of that property that I've bound my form field to, well why not getValue()? I personally hadn't seen any examples online or in books for retrieving the value from a form binding it to the type of form element it was and simply use the getValue() to pull out the value of the object. Used like this getParameterFromForm().getValue(). Let me clarify that I am NOT saying that trying this approach isn't documented anywhere, I find it hard to believe that I've had some stroke of genius that no one has had before in the world of java, especially since I'm coming from .NET and ColdFusion. After doing that I no longer had any problems passing form data to my backing bean. I was able to dynamically populate data tables with any number of records including any number of command buttons within that data table and I didn't have to concern myself with remembering to define parameters in any other areas of the application. So put simply you can bind your form fields to properties of the same type in your backing bean, and then extract the value of that object using getValue() if you prefer over utilizing parameter string mapping and similar approaches for processing form data. I found it to be easier and less time consuming which has costs associated to it as well.
Popular Free CMS For Managing Your Website
For better managing your custom design website, there are two types of Content Management Systems that you can choose from: the paid CMS and the open source CMS that you can have for free. There isn't necessarily any best CMS in the online world today, there are only popular Content Management Systems. Here are some of them:
Drupal would seem to be one of the more advanced open source CMS available for download today. Being open source, thousands of people contribute to its development, and you will find no trouble at all finding a web programmer who knows Drupal, or finding a community of programmers who can troubleshoot your Drupal CMS just in case.
Mambo is another popular open source CMS that is free for downloading and extremely easy to set up. Its main edge is that its system is scalable and you can actually incorporate it into the whole spectrum of custom web site design - from the really simple sites to the large company-owned sites. You can use Mambo to manage your advertisements or syndicate your content, among other things.
Typo 3 is another of those open source systems, although it is designed more for enterprise-level applications like corporate intranet. It addresses issues like branding, version control and maintaining templates in an application. In choosing which content management system to incorporate to your website, regardless if it's free or open source, one of the key things to keep consider are your custom web design needs, and nothing else.
Creating Your Small Business Website - The Simple Truth
Your Small Business Website doesn't have to be a challenge. You'll be able to get it up and running without a professional web-designer, you'll be able to describe you're unique value proposition, and you'll have an offer waiting to bring in business that already believes your solution is the correct one for them. One of the biggest myths about creating a website is that you have to use a web-designer. Designers can bring a great service, but your goal is to make information available and to interest clients in your products and services. To leverage this, you should look for a templated site. Simply put, that means you pick out a predesigned website and make a few customizations that are appropriate for your business. Usually you have hundreds of choices from which to choose. Then you add your images, upload your logo; and more importantly use your voice to communicate. Quick and dirty in the world of websites can be worth more than you ever thought. Give them a reason to pick your business over the competition. Price isn't the only comparison people are looking for. And sometimes you don't want to compete on price-it limits your audience. Do some research on your clients. How do they search for your product or service? Are you saving people time and stress? Could your value be in the way you integrate with something they are already doing? Formulate your 'sweet spot' in the industry and broadcast it. This is the one piece of information that you can't afford to not include on your website. Make it the central message and use your features and benefits to back it up. State your offer! You've got their attention now make them an offer. So often a company puts so much energy and effort into their website, but they forget to ask for the sale. Whether you are selling products or services, you must give them explicit instructions about their next step. Should they sign up for a newsletter? Download a report? Call for an appointment? Customers love simple directions for the next step. Present your features and benefits and then drive them into a sale. Otherwise you're leaving money on the table. So you've made the offer. They identify with the features and benefits, but how do they know that this is really for them? You need to offer proof. This could be a video on youtube demonstrating the actual benefit or perhaps testimonials from your customers. This is big because you've led them down the path of searching and research. Make sure they know that they have chosen correctly. You ease their mind and add third-party credibility to your site's visitors by including statements from like-minded customers. Many times small business owners are fearful of their website. They don't know what it requires to set up a website or what it needs to include. Taking action can be as simple as finding an easily editable templated site that you can quickly customize, broadcasting your unique value statement, asking for the sale, and providing credibility from others. Erase the fear and profit from your small business website.
|
* About Archives
Categories:
Last Updated: |
| regularban.info
is proudly powered by WordPress MU running
on regularban.info.
Create a new blog and join in the fun! Entries (RSS) and Comments (RSS). |