The LANSA language goes a long way towards simplifying the different layers but there are still times where some bug has ended up in your application and needs to be found and eradicated. Over the years of developing LANSA web sites, I have found that there are some tools and techniques which are invaluable to finding and squashing those bugs.
Break it down
I find that the easiest way to find and remove those bugs in LANSA WAM applications is to break down the areas of focus into five areas. Ask yourself these five questions.
1) Are my client side objects what I think they are?
2) Is my client code correct?
4) Is my server code correct?
5) Am I passing the correct information between LANSA and the web page?
These questions are not in any particular order, just start with the one which you think is most likely the area which is malfunctioning. Often you will know right away which one is most likely causing you issues. Answering each of these questions requires a different approach.
Are my client side objects what I think they are?
Start up Firefox and click on the firebug logo in the top right toolbar and select “On for All Web Pages”
Use this technique to make sure that your onClick handler is attached to the right button, or that your handler is pulling the desired data from the right field, Etc.
Some additional Tips:
- You can use .parent(), .children(), .next(), .prev() to navigate around the HTML document….this is very useful in a table. E.g. $(‘input#name’).parent().next().html()
In my next four Blog posts I will be highlighting a number of tools and techniques to help answer the following questions:
- Is my client code correct?
- Is my server code correct?
- Am I passing the correct information between LANSA and the web page?