DropDown listbox with 2 columns, or concat values from 2 fields

R

Richard

I have a web service that returns persons identities, ( first, last , id ,
etc.)
I want to be able to have a drop down list box to have the user select from
unique first and last names.
My preference is a single drop down list box with unique concated last,first
as the display.

I have seen in the lists how to apply filter between 2 drop down list boxes.
But is there a way to do this in a single list box. ?
 
B

B King

Couldnt you just concat these in the SQL query of the web service and a
displayname field in your query ?
 
R

Richard

I am using a web service connection, not to a database, so , there is no sql
query dialog.
 
R

Richard

Thanks, I was able to do this via the xsl file, however, My problem is with
pointing to the current first and last name that is selected by the user via
this drop down box.
Here is more detail:
I have the dropdown list box bound to the web service that returns something
like this:
<result>
- <patientPatient xmlns="urn:hl7-org:v3">
- <name>
<prefix>Mrs.</prefix>
<given>Ellen</given>
<family>Ross</family>
</name>
<administrativeGenderCode code="F" codeSystem="2.16.840.1.113883.5.1" />
<birthTime value="19600127" />
</patientPatient>
- <patientPatient xmlns="urn:hl7-org:v3">
- <name>
<prefix>Mrs.</prefix>
<given>Patricia Komar</given>
<family>Smith</family>
</name>
<administrativeGenderCode code="F" codeSystem="2.16.840.1.113883.5.1" />
<birthTime value="19600127" />
</patientPatient>
</result>

In the properties of the dropdown box , entries is pointing to
patientPatient., value points to the given, and now display is showing
nothing since, I have modified the xsl file to have the concat of the first
and last,
Preview, shows the first and last in the dropdown box and all is ok, However,
Now , I want to pass the selected first and last as a parameter to another
webservice, so , I have the following code:

Note:
field3 is the dropdown box bound to the webservice GetPatients
field23 is the list box where the result of the second webserivce
GetPatientCDA is bound to.



Dim objlistbox
objlistbox =
thisXDocument.DOM.selectSingleNode("/my:myFields/my:field23")
objlistbox.text = ""


'Get a reference to the Web Service
Dim wsDOM, ws2DOM As IXMLDOMDocument3
wsDOM = thisXDocument.DataObjects("GetPatientCDA").DOM
ws2DOM = thisXDocument.DataObjects("GetPatients").DOM


'Set the SelectionNamespaces so that you can find the correct
field
wsDOM.setProperty("SelectionNamespaces",
"xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution""
xmlns:tns = ""http://tempuri.org/"" xmlns:soap =
""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi =
""http://www.w3.org/2001/XMLSchema-instance"" xmlns:mime =
""vhttp://schemas.xmlsoap.org/wsdl/mime/"" xmlns:tm =
""http://microsoft.com/wsdl/mime/textMatching/"" xmlns:soapenc =
""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:ns1 =
""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:http =
""http://schemas.xmlsoap.org/wsdl/http/"" xmlns:wsdl =
""http://schemas.xmlsoap.org/wsdl/"" xmlns:ns2 = ""urn:hl7-org:v3""
xmlns:xhtml = ""http://www.w3.org/1999/xhtml"" xmlns:d =
""http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"" xmlns:my
=
""http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-04-05T18-57-23"" ")
ws2DOM.setProperty("SelectionNamespaces",
"xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution""
xmlns:tns = ""http://tempuri.org/"" xmlns:soap =
""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi =
""http://www.w3.org/2001/XMLSchema-instance"" xmlns:mime =
""vhttp://schemas.xmlsoap.org/wsdl/mime/"" xmlns:tm =
""http://microsoft.com/wsdl/mime/textMatching/"" xmlns:soapenc =
""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:ns1 =
""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:http =
""http://schemas.xmlsoap.org/wsdl/http/"" xmlns:wsdl =
""http://schemas.xmlsoap.org/wsdl/"" xmlns:ns2 = ""urn:hl7-org:v3""
xmlns:xhtml = ""http://www.w3.org/1999/xhtml"" xmlns:d =
""http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"" xmlns:my
=
""http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-04-05T18-57-23"" ")


Dim fieldValue1, fieldValue2 As IXMLDOMNode

fieldValue1 =
thisXDocument.DOM.selectSingleNode("/my:myFields/my:field3")
'Set Web Service parameters
Dim queryValue1 As IXMLDOMNode

queryValue1 =
wsDOM.selectSingleNode("//dfs:myFields/dfs:queryFields/tns:GetPatientCDA/tns:given")
Dim resourceName As String

If (Not queryValue1 Is Nothing) Then
resourceName = queryValue1.text
Else
'handle the possibility that there is no resourceNode
Exit Sub
End If

queryValue1.text = fieldValue1.text


Dim queryValue2 As IXMLDOMNode

queryValue2 =
wsDOM.selectSingleNode("//dfs:myFields/dfs:queryFields/tns:GetPatientCDA/tns:family")

If (Not queryValue2 Is Nothing) Then
resourceName = queryValue2.text
Else
'handle the possibility that there is no resourceNode
Exit Sub
End If



fieldValue2 =
ws2DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/tns:GetPatientsResponse/tns:GetPatientsResult/result/ns2:patientPatient/ns2:name/ns2:family")
' the above does not give the correct family for the selected
given,family pointed by field 3


queryValue2.text = fieldValue2.text


'Requery the webservice datasource
thisXDocument.DataObjects("GetPatientCDA").Query()




The first parameter is fine as it points to the field3 value which is the
current given ,
But the second parameter I want to point to the family for which
name =name as pointed by the current dropdownbox

I am not sure how to modify the xpath in the fieldvalue2, ?????



Thanks for your help..


Greg Collins said:
You can manually edit the view .xsl file and update the display portion to use concat(). This should last until you modify the drop-down list in the designer. Then you'll need to fix it again.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



I have a web service that returns persons identities, ( first, last , id ,
etc.)
I want to be able to have a drop down list box to have the user select from
unique first and last names.
My preference is a single drop down list box with unique concated last,first
as the display.

I have seen in the lists how to apply filter between 2 drop down list boxes.
But is there a way to do this in a single list box. ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top