Toggle Menu [-]

Tutorial 2 - Part 6: ServoySlider got promoted!

Published by admin on Tuesday, July 28, 2009 - 05:25:24 - Filed under News, Development, Plugins/beans, Java

Yet another big tutorial in the never ending series.

That’s 26 more pages more, making it 200 pages already - I didn’t do it on purpose but that’s a nice round number, so I’m celebrating!

This time, we applied everything we learned in part 5 from our little detour with the TestBean to our ServoySlider, promoting it to level 1 of Web compatibility: while in the Smart client it acts like the Slider we all love (and more) in the Web client it’s still a stupid text field, so that your users will be able to input a value, but that’s about it.

You realize then that we will definitely need a seventh part (at least) to transform our text field into a nice JavaScript DHTML driven Slider. So brace yourself for yet some more changes to our bean, this will come in due time!

You can get this part from the tutorials section of the Servoy Stuff main site, as usual.

One thing you should note, though, is that I am actually on holidays. For real, this time! :))

So this should leave you enough time to digest the 200 pages so far, because you really need some time on your agenda to check these, before the next part will be published…

Auto menu System in Servoy

Published by admin on Sunday, July 26, 2009 - 03:18:45 - Filed under General, News, Development, Servoy

For a project that is coming, I needed to test a navigation/menu system that would be entirely driven by a database…

So I started playing with this little solution to see what would be possible, and in the end I had a system with automatic menus, i18n compatible, Servoy security model compatible that works in the smart client AND the web client.

It is based on the popumenu plugin, a little bit of the solutionModel to build the menu from labels, and a few more tricks using the web_client_utils plugin…

Althought it’s far from being finished (still quite a lot of work to do, like the menu management form that really needs to be fool-proofed), and even if the look of it could definitively be improved both in the smart and the web client - I’m not the king of CSS to be honest :), I thought that some people would find this useful to get an idea of how the popupmenu plugin worked, so I decided to publish this little thing, it’s full of little tricks that I’m sure will help some newcomers in Servoy.

You can find it in the “others” section of the Servoy Stuff main site.

Tutorial 2 - Part 6: laying the ground

Published by admin on Thursday, July 23, 2009 - 04:43:46 - Filed under News, Development

After a short detour in the sources of Sean Devlin’s web_client_utils plugin for which I implemented a workaround for the NoClassDefFound error in the smart client (patch submitted today on Servoy’s forum), I started laying the ground for the next part of the bean tutorial…

I can’t believe it’s part 6 already, this stuff is looking more and more like a book!
I knew it was going to be big, a lot bigger than the plugin tutorial in fact, since there are a lot more things to see and understand here, and still one could consider the plugin tutorial as a pre-requisite for this one, since I don’t get back to most of the basic concepts of Java development in Servoy/Eclipse.

67 pages for the 3 parts of the plugin tutorial + 107 pages for the 5 parts of the bean tutorial until now, that’s 174 pages already, and I’m not even close to the end! Perhaps in the end I will gather all these related pieces together and make them a bulky plugins and beans definitive guide!
[Read More…]

Busy again :)) - update

Published by admin on Tuesday, July 21, 2009 - 15:30:28 - Filed under General, News, Plugins/beans, Servoy, Java

In the end I have found a workaround for the plugin problem in Firefox and in modal dialogs in IE. (A few minutes after I had finished the last blog entry in fact :))

You temember that it was the fact that I needed to add some code to the html header for the plugin call to work, mainly <script src=”…”> tags for jQuery and blockUI plugin, a CSS reference and some custom method code…

I discovered that Firefox didn’t like the insertion from an Ajax call, and IE didn’t like it either in case of a modal dialog. When you actualized you page, the code was added in the header from the previous call to the plugin (and was there for each subsequent calls), so it was OK after the first use.

That really annoyed me for a while…
And I was going to ask for a feature request for some static method in a global IPageContributor, or something like a addPermanentHeaderContribution() method (which I still think could be a great addition to the API), but I was not having too much hope to see it anytime soon.

So I imagined that if I couldn’t rely on the API to do it, maybe I could ask the user, so I added a prepare() method to the plugin to be used in the onShow event of the form where you will lately call the plugin (it doesn’t work in the onLoad though, for some reason). And that did the trick!

So if you plan to use the plugin in the web client on a form, you just need to add this code in a method called by the the “onShow” event of the form:

if (application.getApplicationType() == 5) {
    plugins.busy.prepare();
}

That’s it, and it only took me a few lines in 3 classes!

So the morale of the story is: if the API can’t do it, ask your users to do it instead ;-)

Busy again :))

Published by admin on Tuesday, July 21, 2009 - 04:47:11 - Filed under General, News, Plugins/beans, Servoy, Java

Admit it, you thought I was on holiday!

5 days without a post, and you thought: that’s it! It wasn’t meant to be, he just got tired of it this time!

Truly I needed some vacations from the tutorial series, the last one was big and took a long time to do (37 pages!), and I fear that the next part will be big too. So to make for some recreation, I had been busy again… on the busy plugin!

This time I had the plan to make it web compatible…

This is all because deep inside, I have this foolish belief that every plugins and beans should be web compatible, or not exist at all! That’s right! To be true to the platform, every single thing you do in the smart client SHOULD have its counterpart for the web client. As my daughter repeated after seeing Peter Pan lately:

“I do believe in fairies, I do, I do!”

In fact, I’m already dreaming of a web compatible JSplitPane… I have some wild ideas about it but I can’t tell right now if will be able to do it or not, I haven’t started it yet! There are so many amazing things you can do with javascript widgets nowadays and so many nice javascript frameworks around that I can’t believe that it will be impossible. Split panes browser implementations in JavaScript already exists, so why not make them available in Servoy? Something for later…

In the meantime I settled to work on an easy one. Or so I thought!
The busy plugin - for those of you who don’t know it - has been released lately as open source by Scott “Servoy Guy” Buttler. I have been made contibutor to the project on google code so I wanted to see how easy it would be to make a web compatible version out of it.
[Read More…]

Tutorial 2 - Part 5: Wicked!

Published by admin on Wednesday, July 15, 2009 - 15:42:58 - Filed under News, Announcements, Development, Plugins/beans, Servoy, Java

Sorry about the title, I just couldn’t resist :))

In this one we build a Servoy-Aware input bean of type Text, with a JTextField for the Swing part and a Panel and TextField for the Wicket part. And then we link the two with an IServoyBeanFactory implementation.

It’s packed with 37 pages of condensed information, reduced to the simplest (!), but there is a lot to chew in there for those of you who don’t know Wicket at all and/or are new in Java… So take the time to read, tests, and re-read if necessary, and go on the internet to know more about Wicket.

I hope that I managed to make everything clear and that it will be helpful to all!

In the next part we will go back to our SliderBean to start laying the ground for the Wicket part of it.
In the meantime you will find this part 5 in the tutorials section of the Servoy Stuff main site, as usual!

Tutorial 2 - Part 5 coming soon…

Published by admin on Saturday, July 11, 2009 - 23:53:48 - Filed under News, Announcements, Development

While I was doing a few tests for the SliderBean implementation for Wicket, I realized that there was lots of ground to cover before even going into the Wicket part. Too much stuff to see in one go, actually.

To be efficient, our code right now need a fair amount of refactoring, and I don’t want to lose the readers in too many details. It’s much more important to understand the basic principles before going into the details of what it takes to make our present code multi client compatible.

So, to make room for the important stuff, and avoid the code being too cluttered by less important details, I decided that this part 5, which was initially going to add a Wicket simple Label implementation out of our Swing bean, would be about building a Servoy Wicket bean, and much less about adapting the present code.

So we will be building a TextField, with almost no code involved in the Swing part: that will allow us to concentrate on the IServoyBeanFactory interface and how it is the key component used by Servoy to get the correct kind of implementation and of course the Wicket bean itself which will be a subclass of a Wicket Panel and we’ll see how to implement it.

Once all these things are acquired, it will be a lot easier to do the refactoring that needs to be done to transform our current bean.

So stay tuned, at the end of this part, you will have your first web client compatible bean done and (hopefully) operational!

Tutorial 2 - Part 4: hot delivery!

Published by admin on Wednesday, July 8, 2009 - 15:02:24 - Filed under News, Announcements, Development, Plugins/beans, Servoy, Java

Burning hot this one, I tell you!

You will learn how to turn a plain old JSlider into a full fledged input component ready to drop onto your Servoy solution, using a dataProvider, and with some cool enhancements like i18n readiness, support for double and floating point numbers with adjustable “on-the-fly” precision factor.

Yes, sir! That’s all on the menu. You ordered it! You got it!

You will also learn more about the “uncertainty principle”, some refactoring tricks in Eclipse, digging into the Swing sources, and a few more niceties…

If you can’t make some good cofee with this bean tutorial, there’s no more hope for me.

Download the stuff right were it belong, in the tutorials section of the Servoy Stuff main website.

Tutorial 2 - Part 4 is on its way…

Published by admin on Tuesday, July 7, 2009 - 08:28:45 - Filed under General, News, Plugins/beans

Man that one turned out a lot more difficult than I thought!

Basically, the idea was to alter the previous version of the SliderBean to make it useful as an input component, and show how easy it is to do that.

But then I had the bad idea to add a challenge to that, because I was unsatisfied that the slider was only capable of dealing with integers… For a number input component I thought that it was too limiting, so I thought it would be a good idea to make it work with doubles and add a precision factor to it.

Well! After a few more hours than I thought it would take, I ended up with a pretty good implementation. But now I hope that it will not be too complicated for people following the stuff. My first idea was that it would be easy if I could somehow subclass the DefaultBoundedRangeModel with my own DoubleBoundedRangeModel, but I was so wrong! The JSlider is made in such a way that it will only work with integer internally anyway, whatever the model it uses, so unless I rebuild the component entirely there was only another alternative: that’s how I came out with the idea of a precision factor (which is in turn a multiplier, a divider and… a precision factor for the number of decimals you will get out of the slider in the end), which is a fairly common answer to that kind of problem, really.
[Read More…]

Tutorial 2 - Part 3: how to polish your beans!

Published by admin on Sunday, July 5, 2009 - 00:39:09 - Filed under News, Announcements, Development, Plugins/beans, Servoy, Java

That’s right!

With this one, your beans will get this shiny little touch that only professional beans truly have!
Get it in the tutorials section of the Servoy Stuff main site.

After this one, you will be ready for the next installment of this tutorial where we will see some other usages of the bean and how to code them.

In the meantime, happy 4th to all of you celebrating out there!