General information event and Beans

Hello,

I’m new to Servoy, I wanted to try it to see how it performs in comparison to Filemaker. Also, I like the idea of being able to use any type of database.

So, my first project is an Address book.

I learned many things since I started and found my answers on this forum and elsewhere. But now I can’t find what I’m looking for.

In fact, I want to know how events work. I know each object has properties and some has Event actions. But I can’t find any way to create a scroll bar (for a navigation form) with a trigger event when clicked!

I only found this:
http://forum.servoy.com/viewtopic.php?p … e0e7bfb752

Also, I spent time searching for a way to use AddAdjustmentListener but I can’t find where I need to activate this Java Event.

If you say I can’t have an event on Java Beans, is there any other way to have events?

Hi, first of all welcome to the Servoy community!
It’s a bit difficult to help you based on your post, can you explain exactly what you are trying to do? I have the feeling that you won’t need any event to handle that scrollbar but I would like some more details to help me help you :)

Thanks for the fast reply.

I’ll show you:

I want to use the scroll bar like the default navigation panel does: Change it and switch to the record #. But now, I need to press Apply.

You are talking about using Java beans (not Servoy (aware) Beans) here.
You can use/attach events etc. but you have to code everything with… Java, not JavaScript.

An excellent source of information to get started with this is: http://java-servoy.blogspot.com/

Hope this helps

Wow! From Filemaker to JavaBeans is quite a good jump! :)
Why don’t you try to use Servoy builtin tools to start with? They are very powerful and easy to use.

Thanks again for the fast answer.

I’ll look in the blog when I’ll have time. Take note that I’m a 5 years programmer in VBA (Excel), so I should be able to find my way with the blog.

For the built-in tools, I don’t see any scroll bar. Are they hidden somewhere ?

Hello, just to tell you that I found a way to do what I want:

var listener = new Packages.javax.swing.event.MouseInputListener({ mouseDragged: ScrollChange});
elements.ScrollBarNavigate.addMouseMotionListener(listener)

I put that code in the Navigation Form Load event.

The next step is to make the up/down buttons to work in the JScrollBar.

After that, I will face a problem: I would like to make the JScrollBar to work in the Web server.

Nice and good work :)

Hello, I still didn’t find how to make the up/down buttons to work in the JScrollBar.

Any idea?

The main thing I think you could help me is in the type of the event. I wonder if I can add a mouseclicked event on the buttons, or if I need an event on changing the Scroll bar value.

You have to be more specific. What up and down buttons?
Servoy ? Java?

If Java, it is best to look for tutorials on the web.
That is what I always do…

In the image up in this thread, you see at the left:

  • Standard button “Previous”
  • JScrollBar bean
  • Standard checkbox
  • Standard button “Apply”
  • Standard button “Next”

Inside the JScrollbar, there are buttons, up and down, can you see them?

Don’t ask me if it’s servoy or Java, you should be able to tell me. If it’s Java, I searched many hours on the web, I didn’t find anything specific to those buttons. There are no tutorials for that!

I think that it is not a scrollbar but scrollpane of some sort.

It is not a standard Java bean but I guess some sort of open source thing?

Anyway, that is very specific and really the info should be on the site where you found it.

If not, it is really hard to help you with this.

I would have to download the bean and start investigating.

Unfortunately that is not really something that I have the time for…

It is not downloaded, it’s part of Servoy!

I suggest that you ask support directly to the Servoy team for this, maybe a good start point would be to create a case in the support system (see the Issues and Bugs forum for the guidelines).

Hi Kensiko,

Pretty much all the beans you see in that list are standard Java components. The exceptions would be the DBTreeView bean.

Although you can use these Java components in conjunction with Servoy, knowledge of Java is required to interact with these beans.

As these components are default Java components and not specifically created for/by Servoy, information on these beans can be found on the internet at large. Just google for “JScrollBar” and the JavaDocs for this component will show up at the top of the list.

As to this specific case: I do not think a JScrollBar allows you to bind ActionListeners (easily) to the “buttons” at the top and bottom of the scrollbar, as these buttons are hardcoded to move the scrollbar.

Paul

Thank you.

I read a lot on Jscrollbar and the only info I got is we can’t associate up and down buttons to an action. I also found it was not possible to directly generate an event on the scrollbar, but I did. This is why I still search for a way to have the event on the buttons.

I’m new to Java and Servoy is a way to learn it.

What you want is very doable. I will post some code on the java blog for you shortly.