<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
</STYLE>
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY class=hmmessage bgColor=#ffffff>
<DIV><FONT face=Arial>Hi</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>you dont really need the CDATA tag but it is a more
correct syntax for xhtml.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>as for your other question, </FONT><FONT face=Arial>well,
passing data from server side to client side is certainly possible but you will
need probably as much code fot that than you would need to access the data from
the client side.</FONT></DIV>
<DIV><FONT face=Arial>see <A
href="http://www.cartoweb.org/cwiki/HowToReturnDataFromServerToClient">http://www.cartoweb.org/cwiki/HowToReturnDataFromServerToClient</A> (you
can ignore the wsdl part)</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>regards</FONT></DIV>
<DIV><FONT face=Arial>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=tekuganda@hotmail.com href="mailto:tekuganda@hotmail.com">Broun
Uganda</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=oliver.christen@camptocamp.com
href="mailto:oliver.christen@camptocamp.com">Oliver Christen</A> ; <A
title=cartoweb-users@lists.maptools.org
href="mailto:cartoweb-users@lists.maptools.org">cartoweb-users@lists.maptools.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, November 14, 2007 1:01
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Cartoweb-users] How to use
dropdownlist with data from database</DIV>
<DIV><BR></DIV>Dear All<BR>Thank you Oliver for your detailed advice. I can
now retrieve data into the dropdownlist, although i did not construct a new
plug in: wrote an external php function to retrieve item
names from database which i call from ClientEdit renderform
function in edit plugin. My question related to this is: How do i use
this function instead from the Server side so i can take advantage of the
already constructed dsn? ( i now have to make another connection to
database.)<BR>Do i need this? I didnt use it and it works!<BR><FONT
face=Arial>
/*<![CDATA[*/ .........................
/*]]>*/</FONT><BR><BR>Broun Uganda<BR><BR><BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
From: oliver.christen@camptocamp.com<BR>To: tekuganda@hotmail.com;
cartoweb-users@lists.maptools.org<BR>Subject: Re: [Cartoweb-users] How to
use dropdownlist with data from database<BR>Date: Thu, 13 Sep 2007 10:29:25
+0200<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;}
.ExternalClass EC_BODY.hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
<DIV><FONT face=Arial>Hi</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>do it in two phase.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>first make a plugin that will return the list of
values for the select.</FONT></DIV>
<DIV><FONT face=Arial>but instead of producing html, simply output a string
with the values separated by comma, like this: </FONT></DIV>
<DIV><FONT face=Arial>option1,option2, option3, ... </FONT></DIV>
<DIV><FONT face=Arial>if the option name is different from the option value,
simply generate two string</FONT></DIV>
<DIV><FONT face=Arial>you do this in the renderform function of your plugin,
by setting, for example $optionNamesList = 'option1name,option2name,...' and
$optionValuesList = 'option1value,...'</FONT></DIV>
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>and in your template, add this somewhere:</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial><script type="text/javascript"><BR>
/*<![CDATA[*/<BR> var optionNamesList =
'{$optionNamesList}';</FONT></DIV>
<DIV><FONT face=Arial> var optionValuesList =
'{$optionValuesList}';<BR> /*]]>*/<BR></script></FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>this way to can access the options data via the
edit plugin javascript</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>the edit plugin javascript is complex, maybe ask
someone who know javascript to help you with that part</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>In the actual HowToAddDropdownInEditPlugin example,
the options data is written in hard in the code. All you have to do is,
instead, get the optionNamesList and optionValuesList javascript variable
(defined in the template, see above).</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>so, instead of using </FONT></DIV>
<DIV>var authorisedOptionsList = new array( ...</DIV>
<DIV>var authorisedOptionsListLabel = new array( ...</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial>you use</FONT></DIV>
<DIV>var authorisedOptionsList = <FONT
face=Arial>optionValuesList</FONT>.split(",");</DIV>
<DIV>var authorisedOptionsListLabel = <FONT
face=Arial>optionNamesList.split(",");</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>this convert the string provided by your other plugin
into an array of options label and value the javascript from the edit plugin
can use.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>regards</FONT></DIV>
<DIV><FONT face=Arial>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>Hey all,<BR>If i want to use the example given in the wiki for
retrieving data from server (<A
href="http://cartoweb.org/cwiki/HowToReturnDataFromServerToClient"
target=_blank>http://cartoweb.org/cwiki/HowToReturnDataFromServerToClient</A>),
but i want to return this data list to the javascript that constructs an
edit table (in edit plugin), how would i do that? I want to combine the
above HowTo and the dropdownlist(<A
href="http://cartoweb.org/cwiki/HowToAddDropdownInEditPlugin"
target=_blank>http://cartoweb.org/cwiki/HowToAddDropdownInEditPlugin</A>)
HowTo.<BR>Am not a pro in these things (javascripts,
php)<BR>Thanks<BR>Broun Uganda<BR><BR><BR>
<HR>
Get news, entertainment and everything you care about at Live.com. <A
href="http://www.live.com/getstarted.aspx" target=_blank>Check it out!</A>
</DIV>
<HR>
<P><BR>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></P></BLOCKQUOTE></BLOCKQUOTE><BR>
<HR>
Get news, entertainment and everything you care about at Live.com. <A
href="http://www.live.com/getstarted.aspx " target=_new>Check it out!</A>
</BLOCKQUOTE></BODY></HTML>