Is it possible to insert pictures from database in HTML?

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Is it possible to insert pictures from database in HTML?

Postby swingman » Mon May 17, 2004 5:08 pm

You can insert images stored inside the solution into HTML using the

Code: Select all
<img src = "media:///imagename.gif">


syntax.

I'm using databaseManager.getDataSetByQuery() to extract data from the database following the example outlined in
http://forum.servoy.com/viewtopic.php?p ... ight=#8635

Is there any way of displaying images from a normal database field?
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Postby Jan Blok » Tue May 18, 2004 8:03 pm

We are thinking about providing something like:
media:///servoy_blobloader?servername=<xxx>&tablename=<yyy>&dataprovider=<name>&rowid1=<pkid1>
In Servoy 2.1, seems to us the most easy way to do this...
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby david » Tue May 18, 2004 10:45 pm

This would be VERY cool Jan. Are we moving away from a forms based development environment here? :)

- David
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Postby Jan Blok » Tue May 18, 2004 10:56 pm

david wrote:Are we moving away from a forms based development environment here?

Very dynamic UI's cannot be easily done with forms... so we understand the need for this, and it 2 way, the form can generate a dynamic UI part with form method callbacks when a link is clicked.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby pbakker » Wed May 19, 2004 9:11 am

Do I understand correctly that in the future it will also be possible to create input forms with HTML (with buttons, comboboxes etc) and feed back the variables from the HTML back to Servoy methods?

If so, that would be very cool....

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Blok » Wed May 19, 2004 11:54 am

We did not think about forms yet, but this is possible:
Code: Select all
<a href="javascript:formMethodNameToExecute(2,4,'blabla')"><img src="media:///buttonimage.gif"></a>
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby pbakker » Wed May 19, 2004 12:06 pm

yep, using at allready, but my problem lies in passing variables back.... For example, in the HTML field, I can create a combobox with an x amount of values. The user can select a value from the combobox, but I cannot get that value back into Servoy

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby patrick » Thu Jul 15, 2004 5:21 pm

Is there any news on this:

We are thinking about providing something like:
media:///servoy_blobloader?servername=<xxx>&tablename=<yyy>&dataprovider=<name>&rowid1=<pkid1>


I am just trying to build a value list with picture and name coming from a table. I am trying to build a html table for every record and now come accross the issue of how to get hold of my image.

Thanks
Patrick
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Mon Jul 26, 2004 11:42 am

yes, that works since Servoy 2.1 beta4
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby patrick » Mon Jul 26, 2004 6:05 pm

I am trying this in a calculation:

Code: Select all
var html = '<html><table border="0" cellspacing="0" cellpadding="0"><tr><td width="25" valign="middle"><img src="' + 'media:///servoy_blobloader?servername=server&tablename=table&dataprovider=image&rowid1= ' +  pk_table + '" border="0"></td><td valign="middle">' + land + '</td></tr></table></html>'


Is this supposed to work (it doesn't in my case)?
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Tue Jul 27, 2004 11:48 am

you have to specify the parameters for servername ,tablename and dataprovider name.
example:
media:///servoy_blobloader?servername=crm_server&tablename=employees&dataprovider=headfoto&rowid1=10244
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby patrick » Tue Jul 27, 2004 11:54 am

of course, I did that. I just anonimized my example. It still doesn't retrieve a picture...
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Tue Jul 27, 2004 1:04 pm

1) is the picture of type gif/jpg/png?
2) are you sure that row has a picture?

If both questions result in true, please sent us a sample solution with some sample data to demonstrate the problem.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby patrick » Tue Jul 27, 2004 1:22 pm

1) I think it was a gif. Now it is stored in the database.
2) Yes, I am sure. I have the same picture placed directly on the form and see it...
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby patrick » Mon Aug 30, 2004 10:38 am

I am still not able to get this to work. I have tried to things:

1. a calculation

Code: Select all
var image = 'media:///servoy_blobloader?servername=spotlight&tablename=v_laender&dataprovider=flagge_klein&rowid1=' + uid_land
return image;


2. a calculation that uses an image that is supposed to be retrieved like 1. in HTML

What am I missing?
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Next

Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 42 guests

cron