cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Get the selected row from a contained mashup

SOLVED
Newbie

Get the selected row from a contained mashup

Hi,

I have a mashup where I launch a service in order to get an infotable which contains data for a Tree Table I want to display.

The Tree Table will be displayed in a contained mashup (name coming from another service) as depending on some parameters I don't want to show the same columns and rendering. I have added to the contained mashups a "Tree" parameters which is my infotable binded to the result of my service.


My problem is that when a row is selected in the Tree Table, I don't know how to provide the selected row to the parent mashup. I need that selected row for other purposes.


Thanks in advance for your help.

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Get the selected row from a contained mashup

Hi Carles!

I think I found another solution by passing the primary key to the parent mashup and using an invisible dropdown list to select the row in the data.

Then I can use the selectedRow from the parent data directly.

https://www.dropbox.com/s/e0lzwp9pc3ugsrq/NicolasLaffargueSampleInnerSelectedRowV3.xml?dl=0

Best regards,

View solution in original post

15 REPLIES 15

Re: Get the selected row from a contained mashup

Dear Nicolas,

Regarding how to get the selectedRows from contained mashup, here is some steps you could follow and it should work:

1. in your contained mashup, create a Tree widget, and bind the necessary service to it, e.g., call GetDataTableEntries from a DataTable you created

2. in UserManagementSubsystem User Session Shape Settings section, add a new ThingShape "ts1" with only one property "selectedRows" with INFOTABLE type

3.bind the Selected Row(s) to the session's "selectedRows" parameter:

4. Likely, in your parent mashup, bind the selectedRows in session to the widget(e.g., you want to display the selectedRows in a Grid) :

5. view the mashup, you should see the Grid data change accordingly when the Tree table selected rows changed in the contained mashup.

Hope this helps,

Thanks,

Br,

Anna

Re: Get the selected row from a contained mashup

I think you can do it without using Session Variables, you just add a parameter on the inner mashup with the values you want to return as selected row, and then you just need to bind selected rows values to Mashup Parameters, this will be cleaner than Session Variables and also you don't mess up Session Variables for just a Mashup.

Re: Get the selected row from a contained mashup

Hi Carles,
Thanks for your suggestion. It is working when I want to return specific attributes to the parent mashup but in my case I would like to provide the full selected row as an infotable because it contains lots of attributes and I would like to avoid creating twenty mashup parameters.

I don't know exactly why (looks like a "bug") but I can display in the parent mashup the selected row in a grid but I can't bind specific attributes to widgets (no arrow available as you can see in the screenshot)

Capture.PNG

The only workaround I see should be to have a useless service which gets and returns the same infotable and call this service when a selected row is changed in the contained mashup... This way I will be able to bind attributes to my widgets.

Re: Get the selected row from a contained mashup

Dear Carles,

The reason I consider to use session is that in containedMashup when you want to create a parameter with type of INFOTABLE, it is only out-bounded, so I could not assign the Selected Row(s) to the mashup paramter hence to pass it to the parent mashup. If you have any idea how to implement that, I'm also curious to know how

In contained mashup, if I just add a mashup parameter with STRING, NUMBER,etc but not INFOTABLE, it's two way bound -- in-bound and out-bound, but for INFOTABLE it's only out-bound.

Br,

Anna

Re: Get the selected row from a contained mashup

Hi,

I did a quick test, and if I understand well what you want to do it's totally feasible with your first approach. I've prepared a sample set of objects attached here to sample it: https://www.dropbox.com/s/mgbq2a1vlgvmcxj/NicolasLaffargueSampleInnerSelectedRow.xml?dl=0

Best Regards,

Carles.

Re: Get the selected row from a contained mashup

Hello, actually, that's what Nicolas needs, an out-bounded mashup parameter InfoTable, from the ContainedMashup to the parent Mashup. So he assigned the SelectedRow from the service to the mashup parameter and then pass it to the parent mashup.

Highlighted

Re: Get the selected row from a contained mashup

Hi, I have a question. How could you export the Model Tag (which is not tagged with "SampleInnerSelectedRow") in the same file ?

Re: Get the selected row from a contained mashup

Hi Carles,

I tested against the sample you provided, and it works perfectly. Thanks!

I think the reason I failed to bind Selected Row(s) service to the selectedRows mashup parameter is that I tried to directly drag the Selected Row(s) to the selectedRows parameter, but that's not allowed as they are both out-bound. But if I bind with configure the current entity icon when I focused on GetData(in your sample) binding is allowed. Although I dont understand why, but it did work with your way.

Re: Get the selected row from a contained mashup

Magic

No man, it's just how it works, you can export entities with a Tag/ModelTag which doesn't exist on the destination system and it works