<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Mapping data of parent JSF dialog get data back from Child Component</title><link>https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component</link><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;My current solution :&lt;/p&gt;
&lt;p&gt;Parent dialog : 
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/parent_dialog_1.png"&gt;
Dataclass &lt;strong&gt;UserData&lt;/strong&gt;
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/userData.png"&gt;
Child Component
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/child_component_1.png"&gt;
Mapping data in startLink
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/Mapping.png"&gt;&lt;/p&gt;
&lt;p&gt;With this solution, I can get the selected &lt;strong&gt;IUser&lt;/strong&gt; via object &lt;strong&gt;userData&lt;/strong&gt;. 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.&lt;/p&gt;
&lt;p&gt;But I have a requirement to make it more flexible, do not use object &lt;strong&gt;userData&lt;/strong&gt;. User UserName or IUser for input parameter.Like this 
Parent dialog : 
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/Parent_dialog_2.png"&gt;&lt;/p&gt;
&lt;p&gt;But when I try to mapping like my current solution. Parent dialog can not get the selected data from child component. I think because &lt;strong&gt;UserName&lt;/strong&gt; is a string, and it will create a new object when we change it. For IUser, it's an Interface.&lt;/p&gt;
&lt;p&gt;So if anybody has experience to solve it. Please help me.&lt;/p&gt;
&lt;p&gt;Thank you and regards.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 29 May 2015 09:55:56 -0400</lastBuildDate><item><title>Answer by Dominik Regli</title><link>https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component/1343</link><description>&lt;p&gt;Another approach could be, to simply map output arguments for the start method of the component.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;This works but has one bigger issue: The result mapping is done &lt;strong&gt;after&lt;/strong&gt; 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.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik Regli</dc:creator><pubDate>Fri, 29 May 2015 09:55:56 -0400</pubDate><guid>https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component/1343</guid></item><item><title>Answer by Dominik Regli</title><link>https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component/1342</link><description>&lt;p&gt;Maybe it's a solution for you to work with a callback method? &lt;/p&gt;
&lt;p&gt;You can get more details about it, in the HtmlDialogDemos project -&amp;gt; Component Callback Demo (Component/ComponentEventListenerDemo.ivp).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik Regli</dc:creator><pubDate>Fri, 29 May 2015 09:54:41 -0400</pubDate><guid>https://answers.axonivy.com/questions/1326/mapping-data-of-parent-jsf-dialog-get-data-back-from-child-component/1342</guid></item></channel></rss>