|
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.
ABC's of Web Development
Here are the simple ABC's of web development. A. Graphics Graphics is very essential in web development because this is what visitors gauze your site if it is worthy of their time. So what really makes a graphic to be effective? First, the graphic should be small. Consider using images that are 10 to 12 KB per image because if you will use larger images, it will slow down your site. Visitors to your site will likely to leave if your site takes too long to display so it is better that you use images that are attractive and easy to load. Second, when it comes to graphics, you have to use images that have direct relation to your site. You would not display an image of Hollywood artist to promote the product you are selling, as this will cause confusion to your visitors. Lastly, blinking graphics are not ideal in web development because blinking objects are really annoying and distract readers. More often readers leave web sites with excessive flash or blinking objects most especially when these objects hinder them from reading the whole web page. B. Advertising Advertising is lifeline of web sites and you have to handle them effectively to ensure success of your site. When in comes to advertising, you have to remember two things, the number of ads and how related it is to your site. The number of ads should be just enough to give room to other contents of your site. If they are overlapping contents of your site, then maybe that is why your site lags behind in web searches. Next, you should only post ads that related to products or services offered. If they are related, your readers will likely to open the links to your ads but if they are not related the ads might not be opened. In the end ads generate income but if they are driving your visitors away, then maybe its time to remove some of your ads and just stick the ones that are related to the content of your site. C. Web Content Content is also another essential factor in success of your site. It will be better if you have articles that your visitors can read on a daily or almost weekly basis. Informative content will likely to increase your visitors as they will bookmark your site and then send your links to other friends and family members to invite them to visit your site as well. But for others to recommend your site, you really have to offer not just ads or graphics but rich and informative content. For example, you are selling a product, it will be better if the site not just offer the products but also give tips on "how to-" like how to choose, how to use and where to buy. Meanwhile, if you are maintaining a web blog, make sure that the site is readable and the topics being discussed are really interesting.
First Steps To Website Internationalization - Glossary
Making your web site easy for international visitors to understand is what website internationalization is all about. There are times when differences in vocabulary may crop up. This can even happen across different industries in the same country. One of the ways you can help your readers is to start a Glossary. In your glossary you can list industry specific words and all words you use commonly where others may not have the exact same understanding. If you explain a process in your communication, think of including verbs in your glossary. The key to making your glossary work for you is to strive for accuracy, clarity, and ease of understanding. Accuracy In some cases a lack of accuracy can have devastating effects.
Clarity A glossary's aim is to give a clear meaning to the words you use. Keep your explanations as clear as possible. If they only lead to further misunderstandings or do not answer the readers questions, you would be better off without one. Ease Of Understanding Keep your glossary very easy read and people will enjoy reading it. Pay attention to the general appearance of the glossary as a whole as well as the individual explanations. An Added Value After ready through a well done glossary, the reader may well come away feeling appreciative of the easy to read informative experience. It is a wonderful touch of thoughtfulness to your international visitors. Non-native English speakers will greatly appreciate its value. Prepares For Translation A glossary is highly recommended in certain industries where specific vocabulary requires expert translations. In some instances some people feel they can take a dictionary out and provide translations of key vocabulary in languages other than their mother-tongue. This can lead to further misunderstandings. A glossary well done is far better than taking on translation skills when you do not have them. However, your glossary will be of significant value to a professional translator once you decide to offer multilingual services. Glossaries are also appreciated in non-technical areas too. Cultural habits differ. People can use vocabulary differently. Glossaries provide insight into how you communicate and provide a base for cross-cultural dialogue.
|
* 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). |
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor
blackhatseotoolsmentor