[Cartoweb-users] list in cartoweb HELP!!!!!!!!!!

Fabio D'Ovidio fabiodovidio at gmail.com
Tue Jun 10 19:31:44 EDT 2008


Giovanni,
IMHO you must modify your PHP source code in order to do what you want.

In the ClientYourPluginName.php file you could modify as following:

public function renderForm(Smarty $template) {

......

     $template->assign('first_query', $this->query_sql());

...
...

}

where query_sql() is the function that queries your database and return
resultset (you can look at here:
http://www.cartoweb.org/cwiki/HowToDisplayOnTheMapAPointFromADatabaseQuery).
Remeber Cartoweb uses PEAR extension to connect and query DB...
After you can call the variable "first_query" from your application
cartoclient.tpl file (so you must modify it. Remeber to make a --clean after
deploying cartoweb). All values can be put in the YourPluginName.tpl file
where a  <select></select> section is just prepared or you can create
YourPluginName.tpl file dinamically inserting you values..

In order to select a second value coming from the choise of the first one,
you have to create an "onchage" event on the first select item in order to
fetch the value and make the second query...

Fabio D'Ovidio


2008/6/10 Giovanni Virdis <g.virdis at riteco.it>:

>  Can someonehelp me . I post  my answer many times but nobody help me.
> Please I'm new and I need help
>
>
>
> Hi,
>
> if is possibile i want populate the select item from db. I have modify the
> dhtmlEdit.js file to show a select item with a fix value
>
>
>
> var authorisedOptionsList = new Array(1, 2, 3);
>
> var authorisedOptionsListLabel = new Array('Strutture pubbliche',
> 'Strutture per il commercio', 'Strutture militari');
>
>
>
> How i can populate this item  by db select?
>
>  Is possible chanche the value of second select item when I change the
> value of first select item ?
>
> Example
>
>
>
> 1° Select value:
>
>
>
> 1, 'America'
> 2, 'Europa'
>
> 3, 'Asia'
>
> 4, 'Oceania'
>
> 5, 'Africa'
>
>
>
> 2° Select value:
>
>
>
> 1, 'Giappone'
> 2, 'Cina'
> 3, 'Mongolia'
> 4, 'Stati Uniti'
> 5, 'Canada'
> 6, 'Messico'
> 7, 'Italia'
> 8, 'Spagna'
>
>
>
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080611/5d989f17/attachment.html


More information about the Cartoweb-users mailing list