Mashup ComboBox for REST Web Service

Here’s a sample Mashup source code to display the result of a REST Web Service in a ComboBox.

Suppose you have a REST Web Service that returns the following XML:


Note: How to produce the above XML is outside the scope of this post. This particular XML is produced with a JSP querying the M3 table CMNCMP with JDBC.

In the Mashup Designer, we use the mashup:DataPanel control to call the REST Web Service. How to use that DataPanel is outside the scope of this post, but there is an example in the Mashup Designer > Help > Data Services.

Then, in the DataPanel we add our ComboBox, and in the ComboBox we use a ComboBox.ItemTemplate (similar to the ComboBox for M3 API results):

<ComboBox Name="TabComboBox" SelectedIndex="0" HorizontalAlignment="Left" ItemsSource="{Binding Items}">
          <StackPanel Orientation="Horizontal">
             <TextBlock Text="{Binding XPath=CONO, Mode=OneWay}" />
             <TextBlock Text=" - " />
             <TextBlock Text="{Binding XPath=TX40, Mode=OneWay}" />

The result looks like this:



The Mashup Designer looks like this:

The full XAML source code is of the :

<Grid xmlns="" xmlns:x="" xmlns:ui="clr-namespace:Mango.UI.Controls;assembly=Mango.UI" xmlns:mashup="clr-namespace:Mango.UI.Services.Mashup;assembly=Mango.UI">

		<ColumnDefinition Width="*" />
		<RowDefinition Height="*" />

	<mashup:DataPanel Name="Companies">
				<mashup:Event SourceEventName="Startup" />
			<mashup:DataService Type="REST">
					<mashup:DataOperation Name="List">
						<mashup:DataParameter Key="REST.BaseAddress" Value="http://hostname/Thibaud3bis.jsp" />
						<mashup:DataParameter Key="REST.RemoveNamespace" Value="True" />
						<mashup:DataParameter Key="REST.XPath" Value="Companies/Company" />
		<ComboBox Name="TabComboBox" SelectedIndex="0" HorizontalAlignment="Left" ItemsSource="{Binding Items}">
					<StackPanel Orientation="Horizontal">
						<TextBlock Text="{Binding XPath=CONO, Mode=OneWay}" />
						<TextBlock Text=" - " />
						<TextBlock Text="{Binding XPath=TX40, Mode=OneWay}" />

That’s it!

Published by


M3 Technical Consultant

2 thoughts on “Mashup ComboBox for REST Web Service”

  1. This solution was great for getting Yes/No functions in M3 handled as a Output/Input option within my Mashup like below.

                                <ComboBox Grid.Row="6" Grid.Column="2" HorizontalAlignment="Left" Margin="0" Padding="0" Width="70" Name="cbPhantom" SelectedIndex="{Binding [OVTP]}" SelectedValuePath="OVTP_selected">
                                    <ComboBoxItem Content="0 - No" />
                                    <ComboBoxItem Content="1 - Yes" />

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s