|
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.
Learning to Build Websites The Easy Way
Most beginners get screwed up when it comes to website building. Often than not, this is what exactly holding them back to make money online. If you are one of them, let me tell you one thing for sure; building websites is not as difficult as what you might think. Well, I am not saying that it is just a piece of cake either, but learning to build websites worth the investment and effort. This article is about that, learning to build websites the easy way; much easier than you might ever think before... Easy Website Theme Everyone knows something about anything, including you. This can be your passion, hobby or experience from the job. You will get nothing if you keep that knowledge for yourself and even if you share them in the offline world. However, internet can be totally different. You can get paid for your knowledge sharing through various monetization plans. It works for me and will work for you too. But then you might ask, If building website is that easy, why most fails building a successful website? The answer is simply because, they fail to recognize and act upon the significant difference between offline and online trade. In the Internet, people look for information through Search Engine (SE) and web pages that ranked in the first page will benefit the most. Therefore, it is critical for you to optimize your web pages for certain targeted keywords so that you can rank high in the SE Ranking Position (SERP). Easy Web Building Tool You can build your website with other free website building software. Wordpress and Blogger are probably the most popular free web building tool available in the Internet. However, both offer less flexibility and professional looks since they are geared towards personal blog or online diary than for business ventures. Nevertheless, you can use both to get some feel of how to build a great website. In my opinion, you should consider buying advanced website builder if you are serious about making money online. These softwares offer additional features compared to free tools such as flexible web editing and built in SE Optimization (SEO) tools. The initial investment can be easily recovered by the earnings potential you will be getting. I prefer Site Build It as my web building tool. Easy Traffic Generation Traffic is the one that will determine your success. Although the more traffic is better, nothing can beat the targeted one ever. Therefore, keep your marketing campaign to the most reliable and targeted sources so that you can enjoy very high conversion rate (percentage of visitors that turn to customers). Article marketing is free and among the most effective Internet marketing campaign. Since you are the master or the so called "guru" in your field, writing a good article should not a big deal at all. Keep on writing great contents to attract more traffic. Best of all, it works forever. Part from that, you can connect your website with others through some social networking. Networking builds relationship and trust, which then makes your monetization effort much easier.
Web Developer Suite - Master PHP, ASP or CF Dreamweaver Websites With These WebAssist Extensions
Millions of web designers and developers have chosen Adobe Dreamweaver as their software of choice for website creation. Even with the incredible amount of built-in functionality that comes standard with Dreamweaver, there are many web applications that require a vast amount of hand coding to implement. Web Developer Suite from WebAssist is a Dreamweaver extension bundle that helps eliminate hand coding and opens up a vast dynamic frontier for the average Dreamweaver user. Web Developer Suite consists of the following individual WebAssist Dreamweaver extensions:
Each extension is installed individually within the Dreamweaver extension manager, and is accessed via the WebAssist toolbar added to Dreamweaver. The real value of the Web Developer Suite lies in the ability to code advanced website function in a fraction of the time it would take to hand code. Each extension operates from a wizard-like interface that clearly walks you through the steps needed to configure your task. DataAssist creates complete database administration page sets with a few clicks of the mouse. Automatically generate web pages that add, delete, update, view or search your database. If you use Dreamweaver templates, DataAssist allows you to use your site template when generating pages. The resulting pages flow seamlessly into your website and are fully customizable via CSS. SecurityAssist generates all the pages and code needed to create secure user registration and log in pages for your site. It teams up with Cookies Toolkit to utilize cookies and session variables to prevent unauthorized access to any pages you wish to restrict on your website. If you need a Dreamweaver extension to control digital file upload and download, Digital File Pro is the extension of choice. Through a wizard-like interface, you can easily enable database file upload and download through your website. It's an excellent tool for webmasters who provide digital files such as MP3s, e-books, PDFs, images, photos, videos and any other type of downloadable file format. Web Developer Suite also includes Universal Email, which is an extremely handy extension for emailing form input from your website. Universal Email even operates without a database, so it makes a great tool for emailing website contact form submissions. Emails can be formatted as text or HTML, and Universal Email includes a WYSIWYG HTML editor for creating your HTML email messages. Pro Maps for Google inserts static or dynamic Google maps into your website. Addresses can be entered manually, from a file or even from your database recordset. The Google map API is fully configurable, with custom pointers, map controls and size. It's an excellent extension for inserting maps into dynamic websites. Web Developer Suite also includes Validation Toolkit, which is WebAssist's form validation extension. Validate your form input client-side or server-side with a wide assortment of validation rules. By controlling form data input on your website, you can help reduce spam submissions and protect the integrity of your data. The final Dreamweaver extension included in the Web Developer Suite is WebAssist's WYSIWYG form field text editor, iRite. Based on the popular FCKeditor, iRite allows you to insert a text editor in a Dreamweaver form for inputting valid XHTML code without needing any knowledge of HTML. iRite is a great extension for developing custom content management systems or just a simple way for clients to keep their own websites updated. Web Developer Suite from WebAssist is an excellent addition to anyone's Dreamweaver toolbox. The cost of Web Developer Suite is a steal for the enormous amount of website function that is packaged in the bundle. Web designers can offer much greater website functionality to their clients and recoup the cost of the extensions in one project. There is no restriction on the number of sites you can build with Web Developer Suite, and no restrictive "per site" licensing. For web designers looking to push their websites to a new level, WebAssist Web Developer Suite is a must-have Dreamweaver add-on.
|
* 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). |