Hi, I have a scenario like this: I build an Ivy component for user selection(Autocomplete). Then after select a user, parent dialog should receive the selected IUser object.

My current solution :

Parent dialog : alt text Dataclass UserData alt text Child Component alt text Mapping data in startLink alt text

With this solution, I can get the selected IUser via object userData. Because I think in this case, 2 variables point to the same memory, so parent dialog can get the updated data when it change on child component.

But I have a requirement to make it more flexible, do not use object userData. User UserName or IUser for input parameter.Like this Parent dialog : alt text

But when I try to mapping like my current solution. Parent dialog can not get the selected data from child component. I think because UserName is a string, and it will create a new object when we change it. For IUser, it's an Interface.

So if anybody has experience to solve it. Please help me.

Thank you and regards.

asked 22.05.2015 at 10:52

Tinh%20Nguyen's gravatar image

Tinh Nguyen
(suspended)
accept rate: 0%


Another approach could be, to simply map output arguments for the start method of the component.

So, define an output argument in the interface of the component of type IUser. And then, inscribe the result mapping in user dialog start event of the component.

This works but has one bigger issue: The result mapping is done after parent dialog is rendered. So you will see values which are not up to date there (respectively with a delay of one time refresh) even though the data is correct. But have a look at it anyway.

link

answered 29.05.2015 at 09:55

Dominik%20Regli's gravatar image

Dominik Regli ♦
(suspended)
accept rate: 85%

Thank you Dominik. You help me more clear about the problem. I'm still using the result mapping now.

(16.06.2015 at 03:12) Tinh Nguyen Tinh%20Nguyen's gravatar image

Maybe it's a solution for you to work with a callback method?

You can get more details about it, in the HtmlDialogDemos project -> Component Callback Demo (Component/ComponentEventListenerDemo.ivp).

link

answered 29.05.2015 at 09:54

Dominik%20Regli's gravatar image

Dominik Regli ♦
(suspended)
accept rate: 85%

edited 28.11.2016 at 11:04

Barbara%20Brugger's gravatar image

Barbara Brugger ♦♦
(suspended)

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×79
×7

Asked: 22.05.2015 at 10:52

Seen: 4,590 times

Last updated: 28.11.2016 at 11:04