I didn’t get a chance to make it to Servoy World so I am a little behind on the new features of 4.1
I have downloaded beta 1 and upgraded to beta 2 this morning. I am having some issues on how to "use’ the new solutionModel. I was wondering if someone could give me an example of how to change an objects property.
For example I have always wanted a way to change the rollOverImage of a lablel/button in a method to add some dynamic buttons. From what I have read it seems this will now be possible. However when I try to use anything from the new solutionModel I get an error that says it the function has no public instance field or method named (function I tried to use).
I am sure its a syntax error on my part but I don’t think the examples are all in the beta yet so I am struggling to get it correct.
Thanks for any help!
Make sure you’re running 4.0b1 or 4.0b2. You should see a “solutionModel” node in the solution explorer. Do you see that in there? If not, then you need to update your version.
Hi Bob!
Yes I do see that node and can browse through all the different functions. Although my version shows ‘Version: 4.1.0 b2 - build 641’ is that right or no?
So for example if I click on rolloverImageMedia it places “.rolloverImageMedia” in the editor.
Here is a quick test that I did. I have a form called ‘customers’ with a button on the formed named ‘tester’. I have another form called “main” that has a button that fires the following.
var myMedia = solutionModel.getMedia(‘Alarm.png’)
forms.customers.elements.tester.rolloverImageMedia = myMedia
application.showFormInDialog( forms.customers, -1, -1, -1, -1, ‘’, ‘’, false,‘’, false)
When I run it I get an error saying "Java class “com.servoy.j2db.dataui.Zgd” has no public instance field or method name “rolloverImageMedia”
So I assume that I am using it in an incorrect manner…what would be the proper way of doing this?
Thank You!
Ok,
I found your flash demo on the Servoy site and that helped clear a few things.
I changed my method to the following:
function test()
{
var myMedia = solutionModel.getMedia('mi0004-16.gif')
var myForm = solutionModel.getForm('customers')
var theButton = myForm.getButton('tester')
theButton.text = 'it worked'
theButton.background = '#0000a0'
theButton.rolloverImageMedia = myMedia;
application.showFormInDialog( forms.customers, -1, -1, -1, -1, '', '', false,'', false)
}
It works but nothing happens when I roll over the button, if I change it to just imageMedia it sets the image to the button.
Should this be submitted in the case system or and I still overlooking something?
Thanks!
----UPDATE----
I found that it works fine if I set the imageMedia first and then set the rolloverImage. I didn’t realize that you had to set a imageMedia to get the rolloverImage to work. I thought at one point you could set just the rolloverImage if you wanted?