Solved

Transfer Data from Subview to Form

  • 18 October 2017
  • 2 replies
  • 156 views

Badge +1

Hi All,

 

I want to transfer the Data from a Subview to Main Form. I tried with 'Transfer Data' and fails.

 

Please note that, this subview is not a member of Main Form.
 

 

 

icon

Best answer by RaymondJVR 18 October 2017, 14:37

View original

2 replies

Userlevel 4
Badge +13

Good Day Russel


 


To be able to transfer date from a subview or subform back to the main form you would need to access the subview from from the main form via your rule and pull back the data instead of trying to pass on the data from the subview to main view.


 


To do this I would recomend that you have at least two rules present on your Main Form:


1st Rule) The rule that would be used to open the subview - this can be on button click or on an event firing, etc.



2nd Rule) You would need to used the rule called "When a subview executes a method" or "When a control on a subview raises and event" or "When teh subview is closing" to pull back the data from your subview and place it into your main form. The rule to be used between the three above mentioned will depend on what your project requirements are.




However in the small scenario I have taken the screenhtos from I had a button on the Main Form which when pressed will open the subview, I also had an addiotnal rule on the Main Form that when the subview (which is a list view) executes the list item clisk it would then transfer the data from the subview to the Main form.


 


Kind Regards


Raymond


 

Badge +10

I achieve this with a little trickery.... 

 

Sometime is not easy to pass data back & forward between a main Form and a SubForm or SubView... however ... if the regulard classes [K2 Methods] have some limitations some times, you can use params as runtime variables to achieve the desired result.

 

In an example have a main Form with a List View. Added an event On Lit Item Click open a Subview.... 

 

What I did is pass the ID of the List ittem clicked in some of the param_temp_id with the transfer data

Later open the SubView passing the Params of the same ID and executing the Read Method. This way can edit all day. once ready. have the button to apply [Update] the changes, refresh the list view and close the SubView.

 

Since you like to pass data from the main SubView to the Form, you already know the ID you can have an outbound rule to read the values of the data and do some transfer, then you will be within the scope of the main Form.

 

Like I said.. some trickery but gest the job done.

 

Hope this helps !!!

 

Dino.

 

Reply