[Chameleon] RE: SPATIALSEARCHLIST in LocateByAttribute widget

Delfos, Jacob jacob.delfos at maunsell.com
Mon Mar 6 23:38:57 EST 2006


Dejan,

You could try this:

Replace line 613 of searchresults.phtml:

Currently:
print $bodycontent;

Replace with:

      $bodycontent= str_replace ('"','\"', $bodycontent);
      $bodycontent= str_replace ("\n"," ", $bodycontent);
      $bodycontent= str_replace ("\r","", $bodycontent);
      print "<SCRIPT>\n";
      print "var resultcontent = \"".$bodycontent."\"\n\n";
      print "win = window.open('', 'win', 'width=600 ,height=300,
menubar,scrollbars,resizable')\n";
      print "win.document.write(resultcontent);\n";
      print "</SCRIPT>\n\n";


I haven't tested it. But something along those lines should work.

Regards,

Jacob




> -----Original Message-----
> From: Gambin Dejan [mailto:Dejan.Gambin at pula.hr] 
> Sent: 6 March 2006 18:08
> To: Delfos, Jacob
> Cc: chameleon at lists.maptools.org
> Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> 
> Jacob,
> 
> I had to change the "layout" of your widget (I have put it in a
> "vertical" tab like legend layer tab) so when using JSAPI mode, the
> results are returned in an iframe inside the widget (above it). Since
> this "tab" doens't have enough space, I would rather show the 
> results in
> a separate popup window. My questions are:
> 
> 1. Can I use the widget in JSAPI mode, with popup=false (so without a
> link to a popup), and show the results in a popup window?
> 
> 2. If yes, is there any way of avoiding "popup blocker" 
> warning because
> many ordinary users won't understand what is happening and the will
> think there is o result or something is wrong (this is from my
> experience, I am receiving calls telling me that something is 
> wrong, but
> the truth is that popup blocker has blocked the popup window showing)
> 
> regards, dejan
> 
> > -----Original Message-----
> > From: Delfos, Jacob [mailto:jacob.delfos at maunsell.com] 
> > Sent: Friday, March 03, 2006 12:37 AM
> > To: Gambin Dejan
> > Cc: chameleon at lists.maptools.org
> > Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> > 
> > 
> > Dejan,
> > 
> > Put these lines in your template, somewhere before the "<form" tag:
> > 
> > <cwc2 type="cwcjsapi" debug="false"/>
> > <cwc2 type="SharedResource" name="CWCJSAPI"/>
> > 
> > You don't need to be a javascript expert. In fact, you don't 
> > need to know anything about it. The widget can't tell :) The 
> > difference is that it will perform certain operations without 
> > submitting the whole page, like zooming in/out, panning, etc.
> > 
> > Regards,
> > 
> > Jacob
> >  
> > 
> > > -----Original Message-----
> > > From: Gambin Dejan [mailto:Dejan.Gambin at pula.hr]
> > > Sent: 2 March 2006 16:28
> > > To: Delfos, Jacob
> > > Cc: chameleon at lists.maptools.org
> > > Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> > > 
> > > Thanks Jacob,
> > > 
> > > To be honest, I am not using JSAPI mode just because I am 
> > still pretty 
> > > newbie in JavaScript and I have much better PHP knowledge :-((.
> > > 
> > > Can you tell me what do I have to do to use JSAPI mode? I
> > > would like to
> > > use JSAPI mode for some other widgets if this gives better 
> > > performance,
> > > etc. Should I use it everywhere?
> > > 
> > > Just point me to the right direction so I can change my 
> > application. I 
> > > would really like to have something that gives the best 
> performance.
> > > 
> > > Regarding the wildcards...you are right :-))
> > > 
> > > thanks, dejan
> > > 
> > > > -----Original Message-----
> > > > From: Delfos, Jacob [mailto:jacob.delfos at maunsell.com]
> > > > Sent: Thursday, March 02, 2006 8:57 AM
> > > > To: Gambin Dejan
> > > > Cc: chameleon at lists.maptools.org
> > > > Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> > > > 
> > > > 
> > > > Hi Dejan,
> > > > 
> > > > The "$wincontent" variable holds whatever goes into the
> > > > popup, which includes all results. This popup has all 
> > > > attributes, no matter what. You could modify it, though. Or 
> > > > remove the fields from the DBF that you don't use. I guess I 
> > > > haven't really focused too much on the non-jsapi mode, just 
> > > > making sure that it worked. I am not sure why anyone would 
> > > > choose not to use the JSAPI mode, though. I can not see 
> > > > disadvantages to it, only a big improvement in performance 
> > > > and usability. Browser compatability is not really a relevant 
> > > > problem anymore.
> > > > 
> > > > Regarding the wildcard: it doesn't need one for strings. It
> > > > automatically searches for values containing the 
> > > > searchstring. For numberfields, it does an exact match (I 
> > > > thought that wildcards don't make sense in numbers).
> > > > 
> > > > Regards,
> > > > 
> > > > Jacob
> > > > 
> > > >  
> > > > 
> > > > > -----Original Message-----
> > > > > From: Gambin Dejan [mailto:Dejan.Gambin at pula.hr]
> > > > > Sent: 2 March 2006 15:44
> > > > > To: Delfos, Jacob
> > > > > Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> > > > > 
> > > > > Hi Jacob,
> > > > > 
> > > > > First, my widget is defined like:
> > > > > 
> > > > > <cwc2 type="LocateByAttribute" searchall="false" height="250"
> > > > > width="120" highlight="true" allowdownload="false" 
> > popup="false" 
> > > > > VISIBLE="TRUE"/>
> > > > > 
> > > > > In my map file I have:
> > > > > 
> > > > > "SPATIALSEARCH" "FIELD1|Field_description" (I have slightly 
> > > > > modified the code so that I can have the field 
> > description shown 
> > > > > on a page instead of
> > > > > field name that is sometimes not so "descriptive")...but it 
> > > > works ok.
> > > > > 
> > > > > "SPATIALSEARCHLIST" "FIELD1, FIELD3"
> > > > > 
> > > > > My dbf file has FIELD1, FIELD2 and FIELD3 field names so it
> > > > should be
> > > > > ok. But my popup results table has all the 3 fields shown.
> > > > > 
> > > > > When lookin to code, I see SPATIALSEARCHLIST is parsed once 
> > > > > (around line 647). I can see it is used only when 
> > "bodycontent" is
> > > > printed and this
> > > > > is not the case since I am not using javascript (cwcjsapi) or
> > > > > popup so I
> > > > > have "openResultsWindow()" printed....
> > > > > 
> > > > > It seems I am missing something...if I parse
> > > SPATIALSEARCHLIST for
> > > > > "$winContent" then it works...but I would like to know 
> > where am I
> > > > > wrong?
> > > > > 
> > > > > By the way, can you tell me how can I enable wildcard 
> attribute
> > > > > searching, so I can search by the part of the attribute 
> > > > value? Now the
> > > > > search is case insensitive but I have to put the whole
> > > > attribute value
> > > > > for result to be found.
> > > > > 
> > > > > thanks, dejan
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: Delfos, Jacob [mailto:jacob.delfos at maunsell.com]
> > > > > > Sent: Thursday, March 02, 2006 12:30 AM
> > > > > > To: Gambin Dejan; chameleon at lists.maptools.org
> > > > > > Subject: RE: SPATIALSEARCHLIST in LocateByAttribute widget
> > > > > > 
> > > > > > 
> > > > > > Dejan,
> > > > > > 
> > > > > > It is a comma separated list, so make sure not to put 
> > any spaces 
> > > > > > after the comma. Also, it is case sensitive 
> > (attribute names). 
> > > > > > If it still doesn't work, let me know in what way 
> it doesn't 
> > > > > > work. There *should* be PHP errors in your log, which would 
> > > > > > explain why.
> > > > > > 
> > > > > > Regards,
> > > > > > 
> > > > > > Jacob
> > > > > > 
> > > > > >  
> > > > > > 
> > > > > > > -----Original Message-----
> > > > > > > From: Dejan Gambin [mailto:dejan.gambin at pula.hr]
> > > > > > > Sent: 2 March 2006 03:43
> > > > > > > To: chameleon at lists.maptools.org
> > > > > > > Cc: Delfos, Jacob
> > > > > > > Subject: SPATIALSEARCHLIST in LocateByAttribute widget
> > > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > I am using the LocateByAttribute widget and I am trying
> > > > > to use the
> > > > > > > SPATIALSEARCHLIST parameter to choose the attributes
> > > > > > > (columns) to be shown
> > > > > > > in the results table. But it doesn't work. I am using
> > > > iframe (not
> > > > > > > a link to popup). Is this parameter intended for 
> > this purpose
> > > > > > > anyway?
> > > > > > > 
> > > > > > > Thanks
> > > > > > > 
> > > > > > > regards, dejan
> > > > > > > 
> > > > > > > 
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 



More information about the Chameleon mailing list