penile cancer symptom

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.

Ben Cortese is a developer and business analyst for the financial industry.

Copyright 2008. Article can be reprinted as long as author credits are given and content remains unchanged and intact.

 


Entrepreneurs - Who Gets to Keep the Website After You Divorce Your Webmaster?

Attention all business owners! Do you know the answer to this question: Who gets to keep the website after you divorce your webmaster?

Just like in a marriage, it all depends on the pre-nuptial agreement (contract). Do you have one?

My personal disclaimer: Some of this information may be about legal issues; however this article is not intended as a substitute for legal advice. I am not an attorney nor do I play one on webTV therefore you should consult with an attorney familiar with the laws concerning internet and intellectual property.

Ok, now on with the story, the short version. . .

Here's the situation, for whatever reason the client decided not to pay their annual bill for web hosting services. Even though there were several attempts to reach the client the bill went unpaid for more than 90 days. As a result, the hosting was cancelled and the site was removed from the server.

Several months later the client sent this exact message: "you have my website and I need you to let me know how to get it back, like I said before I paid you money to build it so....? that money had nothing to do with hosting or anything".

Just because you paid for the development of your website does not mean you own it. There are Intellectual Property laws designed to protect the creator and to encourage the creator to create. If you hired a company they own the software development and website design produced by its employees. If you hired an independent contractor you must obtain a written "assignment" of the copyright in the commissioned work from them.

Most business owners unknowingly give their webmaster complete control over their business website. Even if you don't have a pre-nuptial agreement (contract) or own your website you can still maintain some control. While you and your webmaster are honeymooning be sure you can document the answer to these questions:

1. What software was used to develop the website?

  • Exact name
  • Version
  • Software website

2. How to access the code?

3. Where is the code located on the server?

4. How to change the content?

  • Graphics
  • Text

5. How to create a weekly back up?

6. How to grant access to additional users?

7. How to obtain the master copies of your website design?

As a business owner, how many people realize their webmaster is like their spouse? Voluntarily joined for life (or until divorce), not many! Just like in marriage a prenuptial agreement (contract) is a practical solution to dealing with the risks and problematic topic of who gets to keep the website after your divorce.

Tonya R. Taylor, is an entrepreneur, consultant and publisher of "Fake It Friday" a FREE weekly e-newsletter for frustrated small business owners who want helpful technology tips that will save time and money. You'll get insider secrets that will propel your business to the next level! Make a change in your business TODAY sign up for the newsletter NOW at http://www.FakeitUntilYouMakeit.com

Tonya R. Taylor - EzineArticles Expert Author

 


Your CSS Code is Slowing Down Your Website - How To Optimize for Speed

Did you know that your css code could be slowing down your website? Did you also know that there is a free solution out there that can help you optimize or reformat your css code for speed and readability? This article is going to explain the benefits of optimizing your css code and the reasons why all web designers should be doing it. First we need to take into account the 2 reasons why you would want to reformat your css: readability and optimization.

Readability

Having nicely formatted css that easily readable is very helpful when you are developing a site. Most of us (me included) can get pretty sloppy when in a hurry to develop code, and a formatter can really help out to make it more readable.

On development teams where both Macs and PCs are used, sometimes line breaks are not read correctly across platforms and your css can end up all on one line. A formatter can help get your code looking pretty again.

Optimization

The opposite of readability is optimization. One problem with CSS is that it can get pretty file-size heavy when designing with it - especially on complex layouts. Optimizing your CSS will strip out all unnecessary characters and leave your CSS lean and mean.

Optimizing css is great to do once you've finished your site and don't plan to work on the design very much anymore.

The css formatter is a great tool because it can do both! You can format for readability while you are designing, optimize when you go live, and reformat it for readability if you ever need to work on it again. It's really a 'win win' thing to do.

Do you want to speed up your website? Format your css for free using the CSS Formatter and Optimizer...

DEVTRENCH is a Web Development Blog written for web designers and programmers who need need up to date tips and tricks on how to create great websites.

 


Pages 
* About

Archives
    * February 2008
    * January 2008

Categories:
* Uncategorized

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).