Filling Global Media datatypes

Basically in Filemaker-language:
-I wanna fill a Global Container with an image or clear it with a method.

I saw on the CRM example that it can be done…I tried to emulate it…But I still don’t get it to work…

So I’m kinda annoyed :evil:
I must be missing sumthing

Thx in advance guys

what do you do now?

I tried 2 things:
-global.field=“media:///picture.gif” (field is mediatype)
-a label with the text %%global.field%% (field is text type) and global.field=“media:///picture.gif”

Why are you trying to use a global?
use:
elements.myImage.setImageURL(‘media:///test.gif’)
or
elements.myImage.setImageURL(null);//to clear

Becoz I want some users to see the image and other users don’t get to see the image…due to their priviliges…
For example a trash-ikon…
Some users can view the ikon and use it…and some can’t.
And I don’t want to use the security of Servoy becoz I want my client to be able to make and edit users…without using Developer. So I make my own table of users and groups and priviliges.

If I’d use elements.myImage.setImageURL(‘media:///test.gif’) than all users would see the the test.gif (toch?)

Paulo

It seems you are mixing up things:
You NEVER can modify the repository objects descriptions(solution,form,field,etc.) from within JavaScript.
The thing you modify in JavaScript are the runtime object created from reposictory object descriptions, those runtime object are created in the application when a user loads a solution.

Changes done in javascript are application/user specific as a result ALL javascript changes on elements are not seen by other users!

Well in that case…my problem is solved…
To much Filemaker in me brain :D

Why can you have a global media field type if you can’t dynamically assign diifferent images to it?

I want a global media field to set a logo on startup that is used on several forms. It would be easier than doing it with a label element.

?? what you are saying is perfectly possible.

Oh. How do you do it then? This doesn’t seem to work:

globals.logo = ‘media:///logo.gif’

and do I then set the field type to IMAGE MEDIA on the form?

In Servoy there are 2 types of media

  1. Servoy static solution media
  2. Database media

The first can be found in the media dialog and is assigned to elements via the properties in designer or via scripting for example: elements..setImageURL(‘media:///logo.gif’)

The second one is database blobs and are set via dataproviders
in scripting: globals.logo = mydb_blob
on a form: you can have a field(type media) with dataprovider mydb_blob (column) displaying database blobs as part of a records (and is changed when other record is displayed)