<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags" xmlns:u2
XMLNS:U4><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5346.5" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>Kori,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>I don't think you have to know the column order. In
my case I am getting to it directly by field name. I am creating the
filter, query options and feature reader the same way, though. Also, my
MgPropertyType is hardcoded here. Your way of determining it from the
field is better.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>Here is part of the C# code for it:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>//loop through the featureReader, get the ID field, and add
it to an array </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>ArrayList objDBID = new ArrayList(0);<BR>while
(featureReader.ReadNext())<BR> { <BR>
objDBID.Add(featureReader.GetString("ID")); //TO DO: un-hard code this.
Pick up the field name to be queried from a request parameter
instead.<BR> }</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006><FONT face=Arial
color=#0000ff size=2>My biggest problem with these solutions is that the
non-programmer types are not going to be able to easily do this. We really
need a way to easily pass ANY field in a given layer from a selection set
client-side.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=671092417-29062006></SPAN><SPAN
lang=en-us><FONT face=Tahoma size=1>Andy </FONT></SPAN><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Kori Maleski [mailto:km@pat.ca]
<BR><B>Sent:</B> Thursday, June 29, 2006 10:15 AM<BR><B>To:</B>
users@mapguide.osgeo.org<BR><B>Subject:</B> [mapguide-users] RE: Come get your
Key IDs<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV id=idOWAReplyText28351 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2><FONT size=2>
<P>Andrew,</P>
<P>The Selection Set contains the featureIDs for your datasource.<BR>You can
get YOUR key IDs from the Selection set by querying the feature, then
reading your preferred key Column (property).</P>
<P>You have to know your key columns position in order to do this - hence my
variable - l_iKeyColumnOrdinal.<BR>i.e. - if my key IDs are in column 4
then l_iKeyColumnOrdinal = 4<BR>I utilize a lookup table that manages my
key columns. Not sure if this is the best way but it works.</P>
<P>This returns MY key IDs in a column delimited string.</FONT></P>
<P><FONT color=#008000 size=2></FONT> </P>
<P><FONT color=#008000 size=2>'query the features</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> l_oQuery
</FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>New</FONT><FONT size=2>
MgFeatureQueryOptions()<BR>l_oQuery.SetFilter(l_sFilter) <FONT
color=#008000>'derived from selection set</FONT></P>
<P> </P>
<P></FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> l_ofeatureSource
</FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> MgResourceIdentifier =
</FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2>
MgResourceIdentifier(l_oSelLayer.GetFeatureSourceId())<BR></FONT><FONT
color=#0000ff size=2>Dim</FONT><FONT size=2> l_ofeatures </FONT><FONT
color=#0000ff size=2>As</FONT><FONT size=2> MgFeatureReader =
l_oFeatureSrvc.SelectFeatures(l_ofeatureSource, l_sFeatureClassName,
l_oQuery)</P>
<P> </P>
<P></FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2>
l_ofeatures.ReadNext() </FONT><FONT color=#0000ff size=2>Then<BR></FONT><FONT
color=#0000ff size=2>Dim</FONT><FONT size=2> l_sProperty </FONT><FONT
color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>String</FONT><FONT size=2> =
l_ofeatures.GetPropertyName(l_iKeyColumnOrdinal)<BR></FONT><FONT
size=2><BR></FONT><FONT color=#0000ff size=2>Do</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> pi </FONT><FONT
color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>Integer<BR></FONT><FONT color=#008000 size=2>'For pi = 0 To
l_ofeatures.GetPropertyCount() - 1</P>
<P></FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> l_iPropType
</FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>Integer</FONT><FONT size=2> =
l_ofeatures.GetPropertyType(l_sProperty)<BR></FONT><FONT color=#0000ff
size=2>Dim</FONT><FONT size=2> l_sPropertyValue </FONT><FONT color=#0000ff
size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>String</FONT><FONT size=2> = </FONT><FONT color=#800000
size=2>""</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>Select</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>Case</FONT><FONT size=2> l_iPropType<BR></FONT><FONT
color=#0000ff size=2>Case</FONT><FONT size=2>
MgPropertyType.Boolean<BR>l_sPropertyValue =
l_ofeatures.GetBoolean(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.Single<BR>l_sPropertyValue =
l_ofeatures.GetSingle(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.Double<BR>l_sPropertyValue =
l_ofeatures.GetDouble(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.Int16<BR>l_sPropertyValue =
l_ofeatures.GetInt16(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.Int32<BR>l_sPropertyValue =
l_ofeatures.GetInt32(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.Int64<BR>l_sPropertyValue =
l_ofeatures.GetInt64(l_sProperty).ToString()<BR></FONT><FONT color=#0000ff
size=2>Case</FONT><FONT size=2> MgPropertyType.String<BR>l_sPropertyValue =
l_ofeatures.GetString(l_sProperty)<BR></FONT><FONT color=#0000ff
size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>Select</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> l_sSelectedLayerIDs
= </FONT><FONT color=#800000 size=2>""</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>Then<BR></FONT><FONT size=2>l_sSelectedLayerIDs =
l_sPropertyValue<BR></FONT><FONT color=#0000ff size=2>Else<BR></FONT><FONT
size=2>l_sSelectedLayerIDs = l_sSelectedLayerIDs + </FONT><FONT color=#800000
size=2>","</FONT><FONT size=2> + l_sPropertyValue<BR></FONT><FONT color=#0000ff
size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>If</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>'Next pi</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>Loop</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>While</FONT><FONT size=2>
l_ofeatures.ReadNext()</P></FONT></FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Obviously you have to do this server
side...</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Cheers,</FONT></DIV></DIV>
<DIV id=idSignature11303 dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2>
<DIV><FONT face=Arial color=#000000 size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: #29537c; FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-family: Arial"><SPAN><SPAN>
<DIV class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN><STRONG><FONT
size=3></FONT></STRONG></SPAN> </DIV>
<DIV class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN><STRONG><FONT
size=3>Kori Maleski</FONT> </STRONG></SPAN><STRONG><SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #29537c; FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-family: Arial">BSc</SPAN>.
<BR><FONT size=1>Senior Technical Consultant</FONT></SPAN></STRONG></DIV>
<DIV class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><STRONG><SPAN></SPAN><SPAN
style="COLOR: #29537c"><o:p></o:p></SPAN></STRONG> </DIV>
<DIV class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN><STRONG>Pacific
<st1:City w:st="on"><st1:place w:st="on">Alliance</st1:place></st1:City>
Technologies<BR></STRONG><FONT size=1>Suite 400 - 534 17 Ave.
<u2:place u3:st="on"><u2:City u3:st="on"><U4:PLACE u5:st="on"><u4:City
u5:st="on">SW</u2:City></u2:place> <u2:City
u3:st="on">Calgary</u2:City></FONT></u4:City><FONT size=1>, <u2:State
u3:st="on"><st1:State u6:st="on">AB</u2:State></FONT></st1:State><FONT size=1>
<u2:country-region u3:st="on"><st1:country-region
u7:st="on">CANADA</u2:country-region></FONT></st1:country-region><FONT size=1>
<u2:PostalCode u3:st="on"><st1:PostalCode u8:st="on">T2S
0B1</u2:PostalCode></FONT></st1:PostalCode><BR></SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #ff823d; FONT-FAMILY: 'Trebuchet MS'">TEL
</SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #2a5973; FONT-FAMILY: 'Trebuchet MS'">403.770.1917
</SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #ff823d; FONT-FAMILY: 'Trebuchet MS'">FAX
</SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #2a5973; FONT-FAMILY: 'Trebuchet MS'">877.691.9149
</SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #ff823d; FONT-FAMILY: 'Trebuchet MS'">TOL
</SPAN><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #2a5973; FONT-FAMILY: 'Trebuchet MS'">877.691.9171
</SPAN><SPAN><A title=http://www.pat.ca href="http://www.pat.ca/"><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #ff823d"><SPAN title=http://www.pat.ca><FONT
face="Times New Roman">www.pat.ca</FONT></SPAN></SPAN></A><o:p></o:p></SPAN></DIV>
<DIV class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"></SPAN></SPAN></SPAN></DIV></FONT></DIV></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Andrew DeMerchant
[mailto:andrew.demerchant@gemtec.ca]<BR><B>Sent:</B> Thu 29/06/2006 10:32
AM<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Subject:</B> Re:
[mapguide-users] Andy - Question about your tooltips...<BR></FONT><BR></DIV>
<DIV>
<DIV> </DIV></DIV></BODY></HTML>