Filling Global Media datatypes

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Filling Global Media datatypes

Postby tweetie » Tue Mar 09, 2004 9:41 pm

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
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby jcompagner » Tue Mar 09, 2004 10:53 pm

what do you do now?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby tweetie » Wed Mar 10, 2004 9:07 am

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"
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby Jan Blok » Wed Mar 10, 2004 12:12 pm

Why are you trying to use a global?
use:
elements.myImage.setImageURL('media:///test.gif')
or
elements.myImage.setImageURL(null);//to clear
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby tweetie » Wed Mar 10, 2004 12:35 pm

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
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby Jan Blok » Wed Mar 10, 2004 1:02 pm

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!
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby tweetie » Wed Mar 10, 2004 4:17 pm

Well in that case...my problem is solved...
To much Filemaker in me brain :D
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby amason » Tue Jun 27, 2006 8:41 pm

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.
amason
 
Posts: 138
Joined: Mon Jan 16, 2006 12:12 am

Postby Jan Blok » Tue Jun 27, 2006 8:54 pm

?? what you are saying is perfectly possible.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby amason » Tue Jun 27, 2006 8:59 pm

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?
amason
 
Posts: 138
Joined: Mon Jan 16, 2006 12:12 am

Postby Jan Blok » Tue Jun 27, 2006 10:35 pm

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.<mylabel>.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)
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests