iain coghill

Greenhorn
+ Follow
since Apr 19, 2009
Merit badge: grant badges
For More
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 iain coghill

Hi Peter,

I have been using Kotlin for android development for a couple of months now, and I wouldn't go back.

Do you see Kotlin ever becoming the de facto language for Android development, or does the Java legacy have just too strong a hold?
5 years ago
My error

I typed in rather than .

Sorry
8 years ago
I had a peek at your book using Amazon's Look Inside feature. Sadly there is a bug in the very first piece of code on page 3

Where you have I think you meant
Oh well, these things happen. Hopefully, as it appears even before the how-to-install section, it won't put anybody off as it looks like a terrific book.

8 years ago
I have an Activity whose layout has an EditText and search Button along the top, with the search results in a ListView underneath. All pretty simple so far. However, the search may not always produce a full result set and I want to give the user feedback when this occurs, along with options on how to proceed, if at all, with a potentially expensive operation. Those options and the appropriate status display will vary depending on the last action performed and the results it returned. I have decided to put the feedback/options in a small horizontal area between the search controls and the results list and to this end I have created a whole bunch of <ViewStub.../> elements in the main layout .xml file, one for each variation of feedback/options layout. Then in code I display only the appropriate version using .setVisibility(View.VISIBLE) and .setVisibility(View.GONE). This works but seems just a bit clumsy to me. Has anybody got a better solution? Any tricks or pitfalls I am missing?
13 years ago
Does anybody know if Seam 2.2.0 is compatible with Glassfish 3? I have done some googling and I can't come up with a definitive answer. Lots of suggestions that it may NOT work, followed by replies that follow the pattern "I have been using Seam with Glassfish no problems, look at this link...", but where the link points to information about earlier Glassfish implementations.

If someone here has successfully deployed a Seam 2.2.0 project on Glassfish 3 I would be interested to hear, along with any hoops needing to be jumped through. I would be equally interested in, though somewhat saddened by, reliable information to the contrary.

Paul Sturrock wrote:Have you looked at the source? This sort of change should be fairly easy.



Duh! You are quite right, it was easy. Very! Thanks.

I wish to use Apache Derby 10.7 as my DBMS. Previous releases of Derby did not support a BOOLEAN data type, causing Hibernate to map booleans to 'smallint'. Release 10.7 now supports BOOLEAN, so how hard is it to subclass org.hibernate.dialect.DerbyDialect to get Hibernate to utilise BOOLEAN? I had a look at the Javadoc but I am not sure where to start
Some unexpected tab-order oddities have cropped up when I use javafx.scene.control.ChoiceBox within an HBox.

Try the following:



What tab-order would you expect? I expected the first TextBox to have initial focus and on pressing <TAB> to cycle through the ChoiceBox then last two TextBox controls in order. What I get is rather different. The ChoiceBox gets initial focus and pressing <TAB> jumps back to first TextBox, then forward to the last two TextBoxs in order. Adding more ChoiceBox controls just adds to the weirdness, it seems ChoiceBox gets first preference in tab-order within the HBox, regardless of actual order. Replace HBox with VBox in the above code and things work in the manner you would expect

Anybody else experienced similar? Any way to manually assign tab-order or otherwise sidestep the issue?
13 years ago
I have just started learning Scala from the artima book. One thing I have found useful in this is the interpreter inside Eclipse - I can write a class and then try it straight off. Annoyingly though I have found I have to re-start the interpreter each time I change some code, else it doesn't see the changes. Is there any way to get the interpreter to see these changes or, failing that, a quicker way to restart it?
13 years ago
What editors are people using to edit .xhtml Facelets files in Eclipse?

In the past I have always used xmlbuddy for all xml stuff but it keeps flagging errors - it does not like the jsf namespace declarations. e.g.

results in the errors


Error - Attribute "xmlns:ui" must be declared for element type "html".
Error - Attribute "xmlns:h" must be declared for element type "html".



Is there a better editor or some way to configure xmlbuddy to handle this?
15 years ago
JSF
I am having trouble dealing with exceptions thrown in my managed bean code. Depending on where the exception occurs JSF seems to handle exceptions in it's own sweet way, and it is not consistent between implementations.

For example:



Where an exception occurs setting the field on the managed bean:


using the MyFaces implementation results in an error screen which is rather what I had expected. Using the reference implementation however, the exception message is displayed as a message using the <h:message... /> field. I don't think that is very useful

Next I tried throwing the exception from a value change handler. Using MyFaces the exception seems to have been swallowed completely. There seems to be no sign of the exception even in the log. To the user everything looks like it worked OK. The reference implementation did at least log the exception stack trace but then proceeded to invoke the action event handler as if nothing untoward happened. Again the user is left to assume everything is working 100%. Neither behaviour seems appropriate to me.

Is there any way I can gain control of these situations?
15 years ago
JSF

Cameron Wallace McKenzie wrote:Indeed, it is extremely important to make sure those id fields are unique.

Even when subviews may not be incorporated into a common form, and the temptation might be to ignore common ids on composite pages, one never knows when a page layout might change in the future. Plus, many helper classes, such as IBM's pagecode class, depends on a unique id across the page/form.

Try your best to keep those ids unique!

-Cameron McKenzie



Indeed, that is why I use the handy Firefox HTML Validator add-on to catch such transgressions. The problem is that this particular hidden field is generated by JSF once per form, and I don't know if or how I can control the id generated.
15 years ago
JSF
I am pretty sure that an ID attribute should always be unique within an entire document. Browsers are more forgiving as long as the ID is unique within a form as they will not conflict on submission, but it is still wrong and HTML Tidy is correct to flag it.

The problem is that JSF is injecting a hidden field with id="javax.faces.ViewState" for each form. For example:


results in

I don't know how to control the ID of those javax.faces.ViewState fields.
15 years ago
JSF
If you have a page with multiple forms each such form has its own hidden ViewState field. This gives rise to warnings when using a validator such as HTML Tidy as each field has an identical id. Is there any way to eliminate this duplication of ids?
15 years ago
JSF