Tom Fulton

Ranch Hand
+ Follow
since Mar 30, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Fulton

In your opinion, what two non-technical skills should a professional developer work on in order to be most effective in understanding and implementing software requirements?

What two tools do you find most helpful in doing so? For me, my favorite is a recording/printing white board, but I'd be interested in your preference.

Thanks!
7 years ago
I have to admit that I'm getting more and more confused about the behavior I'm seeing in <h:commandButton> vs. <h:button> components. I understand the intent: commandButton (and commandLink) submit the form, always do a POST and render as an <input type="submit">. button (and link) don't submit the form, do a GET and render as an <input type="button">.

That being said, I have a dataTable with rows that I'd like to select and perform work on. Let's say I'd like to Edit an existing row, or Delete a row. I'd like to do each of these things via a button, a request-scoped bean and view parameters. So my dataTable looks roughly like this:

This actually works reasonably well. In the target page, I have view parameters and an <f:event> for preRenderView that takes the parameter, loads up the data, and displays it on the page.
The problem occurs when I add another button to the row. If I use an <h:button>, the display of the rows gets totally hosed and nothing works. If I use an <h:commandButton>, it displays correctly, but pressing the commandButton causes it to attempt to execute the edit outcome method for that row, and throws a NullPointerException because the parameter isn't being populated.

I am beginning to suspect that I'm just trying to do something that isn't even reasonable. Specifically, I'm attempting to perform work on the server side that arguably should be done as a POST. The Edit, one could argue, is just passing a parameter, and the "page action" <f:event> is doing the work on the preRenderView. Is there a way to accomplish my goal, or should I just abandon the attempt? And why is it behaving so psychotically?
8 years ago
JSF
"You learn how to avoid mistakes from experience. Unfortunately, you only gain experience by making mistakes".

I've done the same thing a number of times, often when I am copying code and adding some functionality. I don't carefully check to see if I am duplicating something that was already happening in the copied code.
11 years ago
JSF
Also, have you used the <h:head> form of the head tag, rather than the default <head> element, on the page with the problem?
11 years ago
JSF
Can you post your page tags that are causing this?

You should be aware that there is an attribute specific to <h:messages> that is not available in the component-specific <h:message> tag: . This will display only messages that are NOT queued for a specific component. However, if you are not using this attribute, and you have component-specific messages as well, it will display both...once with the <h:message> tag, and once with the <h:messages> tag. I don't know if that's the problem, but I've had similar behavior caused by that default behavior.
11 years ago
JSF
One issue is whether you are using any of the IBM-specific components. If so, you'll need to find comparable functionality with another component library such as RichFaces. But Tim is right...moving ONTO WAS is a real pain in the neck for a number of reasons, a lot of which have to do with class loaders. You can just import your existing project into a new workspace (if you're using an Eclipse-based IDE...if not, whatever is comparable in NetBeans or IntelliJ), delete the IBM-specific configuration files in WEB-INF, and point at the appropriate libraries for your classpath. Should be relatively painless
11 years ago
JSF
Hello everyone,

I have worked with RichFaces and some other component libraries a bit less extensively (such as PrimeFaces) and am trying to get a fairly simple OpenFaces app to work. I am hoping someone can help.

I have a page that displays accounts in a selectOneListbox. Using vanilla JSF, I have the form being submitted when the user selects a different account, which re-displays the current page and shows the balance for the newly-selected account. This works fine, except that I don't want to have to submit the form. Hence: Ajax.

Here is a simplified portion of my form:
Whenever I run this, I get an IllegalStateException pointing at the selectOneListbox. I am assuming that this is caused by attempting to restore the state of this component, but for the life of me I can't see what I'm doing wrong. I've tried a number of different approaches from the OpenFaces Developer's Guide, but nothing seems to work. Any ideas?

Thanks in advance.
11 years ago
JSF
I am wondering if anyone on this forum can help clear up some confusion I have in transitioning from Eclipse and NetBeans to IntelliJ.

I've worked through the differences in terminology, created a project and module for Web applications and JSF, configured a server (JBoss) and added the server libraries as dependencies. However, I am getting stuck on what an artifact is, and how it relates to my modules...and the provided documentation isn't helping.

1. Is an artifact specific to a particular module, or is it something separate that configures a module for deployment, like a facet (but different)?

2. How do I configure an artifact for exploded and compressed (.war) formats, and switch from one to another?

3. What kinds of artifacts would I need, apart from the two I mentioned...compressed or exploded? I can't see how the concept or feature benefits me differently than a facet, and why the two types mentioned aren't simply provided by the tool.

Thanks in advance.
Brenden, I have to thank you immensely for the help. This is exactly what I needed, and I appreciate the guidance.

This leads to another observation...composition components are obaque enough that a really, really good article or book is badly needed. Badly. And again (although I understand it might be more powerful) the original way in which composition components worked was pretty darn easy. This is not. I can't help but wonder what the JSF 2 committe was thinking in designing an approach that is far, far less intutive.

Thanks again.
11 years ago
JSF
Well, by your description, it's acting like a classpath problem. How have you added the .jar to your project?

If you can extract the class and place it in the project, and it works, that means there isn't anything structurally wrong with the configuration. So I'd suggest trying a couple of different ways of making the .jar visible to both your project and the server (remember, the fact that the project can see it doesn't necessarily make it possible for the server to see it).

Good luck, and let us know what you find.
11 years ago
JSF
OK, maybe I'm the one confused, yet again!

JSF 2 does, indeed, include Facelets...and it no longer needs to be configured in faces-config.xml as it did in JSF 1.2. However, a few things have been added to Facelets in JSF 2. Composition components (as opposed to templating) have undergone a change, but it's possible that the previous strategy is still supported...I never thought to check that. A composition component is defined as an XHTML file in a specific location in the web project, and accessed via a tag (the tag being the name of the file itself). As a namespace, the prefix is arbitrary...I have seen it both as cc: as well as composition:. This new approach recommends that two distinct areas within the file be specified...one that represents the interface (<composition: interface>), and the other representing the implementation (<composition: implementation>). The difference is that the interface defines the way in which the client page would use the tag, typically identifying attributes that are then used within the implementation. The implementation is the code that replaces the tag when compiled.

I will have to check to see whether my old code still works. If it does, sweet! I'm still interested in finding out how to use the various facet tags, but that can wait for another day. A better day. Perhaps a day when I have a functioning brain.
11 years ago
JSF
In Facelets prior to JSF 2, composition components were fairly easy to use and understand. I must say, such is not the case any longer with the same feature in JSF 2. Here is my problem:

One use I made of composition components in Facelets (JSF 1.2) was to encapsulate the repetitive coding needed for columns in a dataTable. I cannot seem to get this to work at all in JSF 2. I understand that there is a <composition:facet> tag, a <composition:insertFacet> tag and a <composition:renderFacet> tag. I cannot find a single example anywhere as to how these tags would be used. I'd like to do something like this:



And have the client page use it this way:



Obviously with values passed in to represent the beans properties to be displayed. I have had no luck doing this, and was wondering if anyone on this forum has enough experience to tell me (a) how this might be done, and (b) what the general use of the facet tags is.

Thanks for any help in advance
11 years ago
JSF
Thanks for your reply, Tim. I have to ask what you mean by "design debt", however. The seems to be used in the sense of "the need to redesign/refactor", but how does the design debt become incurred? Or am I misunderstanding the term?

To me, good code is both functional and well-designed. And just as correctly functioning code requires overhead (implementation and thorough testing), design requires overhead. When you say "design debt", are you implying that all functionality incurs a debt (required overhead) that must be addressed by regular design changes or at least study? If so, I agree entirely, and am happy to hear that agile supports the principle.

Thanks again!
Thanks, everyone, for your thoughts. I think my limited and second-hand experience revolves around the differences between theory and practice (which, as they say, in theory is the same, but in practice is not).

Here is a specific example, on which I was called by a "Certified Scrum Master". I noticed in a group of classes that some code was doing type-specific functionality in an if/else kind of structure, and observed that it was an opportunity to use the Template Method pattern to allow the subclasses to "do their thing". The overall structure was defined at the superclass level, and each subclass had the ability to perform one or more steps in the algorithm according to their type. It was, to me, a classic case of using a Design Pattern to clean up an obviously bad structure in the first place, and to provide a good basis for future changes...and I think of Design Patterns as kind of "tactical" design tools, as opposed to "strategic" design decisions. I estimated that it would take about an hour to code and maybe half that to test. Anyway, the Scrum Master made it very clear that we should not do anything that was not specifically called for as part of a deliverable, and that the definition of the deliverable was to be viewed as that of functionality, not (as he put it) "nice to haves".

So where does the concept of design changes that DON'T specifically change functionality fall in the agile spectrum? More than one person has told me that the "Certified Scrum Master" was just plain wrong in his judgment on this issue, but honestly I see his position as being right in line with the overall philosophy of agile. My position was simple: the original code was just bad, by almost anyone's measure. And yet it worked, if in a really nasty and hard-coded way. Again, my exposure and experience is quite limited, so please help me understand when and where non-functional design changes fits in Scrum or XP iterations.

Thanks all!
Please excuse my ignorance in advance. I have some exposure to agile (XP and Scrum) through co-workers, but haven't participated in an Agile process personally in production. My question is this: does agile, in your opinion, tend to focus on functional code production to the detriment of good design? In other words, does the focus on immediate functional deliverables make the average developer spend less time on quality design? I find that good design often takes more time and thought than seems possible in agile iterations. I'm happy to be proven wrong, by the way...it just seems to me that good design might suffer.

Thanks in advance for your thoughts on this.