|
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.
The Best Website Counter
As the Internet continues to grow in popularity and billion of users access it a day endlessly surfing one website to another, a relatively small but significant percentage of those people are creating their very own websites. Statistically, there is an average of one hundred thousand new websites per day. With so many websites being created per day and so many more potential visitors to attract, to know just how many visitors your website is pulling is important to know for any webmaster. That's where a good performing, reliable and dependable website counter comes into play. No one wants to be given bad information and having a website counter that generates inaccurate data will do just that. So which website counters are reliable? Which ones are dependable and trustworthy? Well now that you know that not every website counter is worth placing on your website, to find a good one you must look the company or the organization that created the website counter. There are many website counters that are created by no name, incredible people, companies and organizations. Just because those people offer a website counter for free, does not mean that it is reliable. It could be just free junk. Look at the website, the company, the people who are offering the website counter and make a judgment call on whether it is wise to use their website counter. A free website counter should not automatically make you want to use it. So what is the best website counter? One of the most reliable and most trustworthy website counters available so far is the Google Analytics service. Google Analytics is the best website counter because it is very reliable, dependable and trustworthy. It will give you accurate data and it is very user friendly. Its no coincidence that Google Analytics is owned and operated by Google incorporated. If you didn't know, Google is a search engine and so much more. Google is one of the most wealthiest and credible corporations on the planet Earth. With billions of dollars rushing into their wallets per year, Google is a massive empire with worldwide respect. So with so much at stake, will Google risk their respect by creating an average service such as Google Analytics? No, if they are going to create a service available for the general public, then they are going to give it their best. With billions at their disposal and endless resources, Google is more than capable of creating an amazing service. Google Analytics is also so much more than a mere website counter, capable is of giving you various stats at a click of a mouse. How long on average are your visitors staying on your website? Don't know? Google Analytics can tell you that a so much more. In fact with so much information, Google Analytics can get slightly confusing. But with a dedicated support team just waiting for your questions, Google Analytics quickly propels itself into a legendary service. Also with full video tutorials like GlyticVideos, anyone can master the Google Analytics service overnight. Ah and I almost forgot, did you know that Google Analytics is 100% absolutely free? But to be able to fully use Google Analytics you have to master the service. That's where GlyticVideos comes in. After that, all I can say is, checkmate.
How To Monetize Websites - 3 Most Popular Income For Webmaster
There are many ways to monetize websites for multiple income streams. And this article is just about that. Read on to discover 3 most popular ways to monetize websites made available to you for free. Google AdSense Google AdSense is the most popular among all webmasters since it is the easiest monetization plan available online. All you have to do is just add the AdSense code in your web pages to let Google decides what the best possible ad for that particular page is. By the end of the month, you will be paid according to how many clicks you got and how much the advertisers are willing to pay for each click. The only downside is its earnings potential can be so low since it is at the end of the advertising value chain. But what you can do is continue building more contents (at least 150 web pages) based on your keyword research, optimize each page for specific keywords and market it to the whole wide world. By doing so, you can get maximum SEO benefits and make your visitors keep on coming (and eventually, keep on clicking to your AdSense ads) Affiliate Program By joining affiliate programs or through some sort of affiliate networks, you can have the opportunity to sell others' products and earn commissions for each sale. It is just like helping others to sell their products and get paid for your marketing effort. And the major benefits of selling affiliate products are:
So basically, you are leveraging on others' product to make money online. However, be careful and curious if the affiliate networks are charging you money since most of them appear to be kind of get-rich-quick scam. Nevertheless, you can start with established affiliate network such as Clickbank and LinkShare. Sponsored Links Sponsored links are sites that pay for placement in web space, which in this case can be in one (or all) of your web pages. The advertisers are willing to pay for such placement mainly to attract traffic from your website visitors. Depending on the number of visitors, you can charge them a once-off payment or recurring monthly fee. Either ways, you can monetize your website the easily. In fact, this can be great income sources if your website enjoys high Page Rank (PR) of 3 and above. However, be very careful not to be penalized by Google. If you do, your website can be dropped from Google index since they hate webmasters who sell text links in their website for PR trade. What you can do is to keep your text link ads relevant to your website theme as much as possible so that Google do not find it too obvious. Therefore, choose a website builder that can cater all of the monetization plans. After all, you don't want to limit your earnings potential due to software inflexibility, do you? After using SiteBuildIt for few years, I found that it has the capability to monetize website seamlessly.
|
* 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). |