Storing media feilds in Calcs

Questions, tips and tricks and techniques for scripting in Servoy

Storing media feilds in Calcs

Postby prj311 » Fri Aug 15, 2008 5:59 am

Hi,
I have the following code in a media field, that works fine when unstored, but refuses to store the data to my mysql database if changed to stored,
does servoy have a problem storing media feilds from calculations??

Servoy Developer
Version 3.5.6-build 519
Java version 10.0-b23 (Windows XP)


Code: Select all
switch(wip_week_tag_show)
{
   case 1:
      return 'media:///tag_grey.png';
   case 2:
      return 'media:///tag_red.png;
        case 3:
      return 'media:///tag_green.png';
   
   default:
      return 'media:///tag_grey.png';
}
Regards,
Phil Routley

Servoy Developer
Worldview i.T.
NSW, Australia
User avatar
prj311
 
Posts: 137
Joined: Fri Sep 16, 2005 1:56 am

Re: Storing media feilds in Calcs

Postby ngervasi » Fri Aug 15, 2008 10:26 am

That should work nicely, do you call saveData() to save to the DB somewhere?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Storing media feilds in Calcs

Postby jcompagner » Tue Aug 19, 2008 9:52 am

what do you mean with:

does servoy have a problem storing media feilds from calculations?


what do you expect to be stored??

If you return:

Code: Select all
return 'media:///tag_grey.png';


then the string is stored... not the image your self.
So what type is the column in the database? it should be string. not media.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Storing media feilds in Calcs

Postby prj311 » Tue Aug 19, 2008 12:30 pm

Hi Johan,

Yes I worked that out :oops: , the column was set as a blob type, thanks for the reply.
Regards,
Phil Routley

Servoy Developer
Worldview i.T.
NSW, Australia
User avatar
prj311
 
Posts: 137
Joined: Fri Sep 16, 2005 1:56 am


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests

cron