Saturday, August 25, 2007

javascript menu

Couple of months ago, we started a new project in the company I work for. Of course, the project needs a menu to navigate the system. This is something of the basics that you don't think of and mandatory to exist.
I was assigned to look for a menu. Well, I did and found couple of menus that really meets our requirements and the client's expectations. Well, almost.
Option number one was struts-menu. Which seemed to be the best option as we were already using struts in the project. So, I gave it a try. It does work just fine except for a very small thing. You have to do a click on the main menu items to get the menu displayed. No problem with that. But most of the menus now work with just mouse-over and mouse-out. Why the need for a click to pop up the menu and another click to make it go away?
The other thing we noticed at that time, is that the latest update was 2004 (I just double-checked now. This is not the case. The case is we were using older version, so of course, 2004 was the release date of that version).
Note: We are using Java EE 1.3 container. So, we had to use struts 1.3.7
Any way.
The other option was to go with a ready made java script menu. We found the Tigra menu. That was a very good option actually. The menu is fantastic actually.
But with just simple four problems (:D):
1- It's java script code is scrambled (I just discovered today that we were using the compressed version of the menu.js file).
2- The menu items are not displayed over a combo box in IE 6 only!!!!!! (IE 7 and FireFox are displaying it right). And you cannot overcome this issue by setting the z-index to a higher value. They say that this issue is fixed in the golden version. But the fix they made, I really think is not a fix, it's just a work around. They hide the form elements that gets displayed under the menu....!!!!??! (At least that's what I understood, I might have got that wrong).
3- It is using absolute position, which leads to having rendering issues specially with window resize.
4- Barely can be modified for Arabic usage (right to left display).

So, actually, I had enough of this menu issue. We have been trying different menus for the last couple of months now and still have not reached a solution of a menu that works without any cross-browsers issues. For each menu, we have different issue either for all browsers or for a specific browser.

So, I decided to give it a try. All menus are just doing some onmouseover and onmouseout java script calls. So why not making it simple HTML nested tables?
I tried it and it worked for all browsers displaying the same. And you can very easily apply what ever style sheet you want on each menu item seperatly. I made it in just in one day with its custom tag that loads its items from an external XML file. And it really renders just fine on all browsers.

Well that's what I thought till last Thursday...!!!!
It cannot display its items over combo boxes...!!!!

I'm really disappointed. :( :'(

Thursday, August 16, 2007

JDK 7 - Looking ahead

I have read today the following article at Sun. And you can vote yourself with what you think is better to be added right here.

For me, I am not sure if adding new major language changes to Java is a pretty good idea or not. But a general idea is that I totally agree with one of the replies who specifically said:"The reason of success for Java was that it was a simple language that can easily be kept in mind, but was powerful enough to get most jobs done.".
Any way, this is what I think in details:
  • Language-level XML support : why adding new features that would tide the language to something else other than Java (like we did with Java and Expression Language (EL)). IMHO, I think the way Java community did with the Scripting project (JSR 223) is a much better way of using other things than Java inside Java. It makes it very easy to use, and still have a very high way of abstraction and isolation of dependencies between Java and others, even if it was XML. The reason why I am saying this is because to add XML support you will need to add support for a lot of XML-related technologies. We do have some of them already in the JDK XML packages and classes implementations. But why add them to the Java syntax.
  • Closures : I am not sure what closures are. But when I read about it, the first impression I had is that its syntax is complicated.
  • Block constructs : don't know.
  • Strings in switch statements : Yes. I think it is a very useful feature.
  • Language support for BigDecimal : I am not sure what is the feature in this.
  • Java property support : I have read a long article discussing this feature right here. And to tell you the truth, my final conclusion is that IT WILL depend actually on how they propose it. I find it very useful, but it really needs to be easy to use.
  • Lightweight method references: Not sure what is the meaning of this.
  • Extensions to the annotation mechanisms: Yes (if it means annotations inheritance).
Well, one thing I like though and I really hope it would make it to Java 7, the Measures and Units project (JSR 275). I think it is a good thing to have in Java and I think it is something that should have been there along time ago.

Sunday, August 05, 2007

Finally, struts 1.3.8 is up in the project

Well, it has been a while since I had the time to do anything but work.
Today, I am almost finished with my task that I have been working on for the last couple of weeks. The task is, in general, to work with struts framework inside the framework we are using. Any way, I have learned alot of struts in this task.
I will post a briefe How-To about struts.

But to tell you the truth, struts documentation online really needs to be more explainatory than the current documentation. I find it too briefe to be understandable.
I was working on Struts 1.3.8

Well, till next time with the struts discussion.

Saturday, June 30, 2007

Java Passion

Few months ago, I ran into this web site.
It's a free Jva online courses. I think the auther of these course is
giving something that really few would appreciate.

Thanks to Sang Shin.

Thursday, June 28, 2007

3D Java-based Desktop

I am not sure why do people think that Microsoft has made a new jump in the desktop world by adding a 3D feature to some elements in its new Windows.

Sun has made its own project for 3D desktop few years ago (3D java-based Desktop). The project is still in progress (beta version), but I think it is cool thing.
The only problem for windows users, is that only a demo version is available (Windows does not separate the shell from the OS, as Unix-based operating systems do).

The project name is: Project Looking Glass.