Skip to main content

Hello All!

 

In a form would like to have two views.  The first view (view_1) is a list view that is populated on form initiation with rows of data from a SQL db table.  Now when the user single clicks any row, I would like  to append that row to another view (view_2) on the same form.  I would like for the user to be able to do this as many times as they liked. Each time the newly selected row is appended in the view_2.

I have been able to add one row from view_1 to view_2, but when I click a second row in view_1, the newly selected row replaces the first selected row in view_2.

 

Currently I set up both view_1 and view_2 to use the same smart object data source.  In the form I created a rule, When view_1 executed item click, then transfer data (configure = view_2; item1 = item1, item2 = item2, item3 = item3)

 

Any help would be much appreciated.

 

Hi,

 

First of all you need to change the data source smartobject of second view to a new one.

Second thing, in rules instead of using transfer data, use below rules

  • then add a new row to the editable list
  • then transfer data (configure)
  • then apply the changes made to the row on the editable list

 

These rules will partially/temporarily add the record to the list view in UI only. it will not update the database at present.

 

Once you are done adding all the required rows, have a final save button and its button click rule add below rules to save them to database

 

this will add the rows to database.


Hi Core2,


 


I hope i understand your questions correctly, but i was able to get the results by doing the following:


 


I have 2 SmartObjects:


 


ListOfApprovers     (ID, Name, Surname, Email)


NOTE: This one contains a list of Employee Names


 


ProcessApprovers     (ID, ProcessID, Name, Surname, Email)


NOTE: This one will be the SmartObject that i will populate with names from the first one


 


I then have 2 Views:


Approvers List(This will will show a list of Approvers available):


 



 


ProcessApprovers (This is an editable list from the ProcessApprovers SmartObject)



 


I added both of these 2 Forms to a Form and in the rules i added the following rule:


 


When Approvers List executed List item double click


   then complete the following one after another


     then add a new row to the ProcessApprovers View


     then transfer data (configure)


 


In the Transfer data, i transfered data from the Approvers List to the ProcessApprovers view:



(NOTE: My Forms / Views are different in this example, but the concept is the same)


 


Runtime (Form):


 


1. When nothing is double clicked:



 


2. Double click any item:



 


3. Double Click another item:



 


The values from the bottom view can now be saved to a SmartObject for retrieval later in the Process.


 


HTH


 


-Jean


Thank you for everyone's replies.  

 

Jean, I have tried several times to implement the steps you laid out.  My form and views do not respond they way yours does.

1. When I click on an item in view_1, a new row pops up in view_2, but the data from view_1 does not populate the new row.

2. If I click another row in view_1, the first row I clicked on in step 1 fills the previously added row.  If I click a third row in view_1, the second row I picked will then populate that second row added.  It is offset by one.  Why is that?

3.  The data that does get to view_2 is stored permanently and I did not expect this.  I thought i would have to tell the smartbox object to save the data. 

 

Another Question: Is there a way from the designer or mangeament to delete the contents of a smartbox object?  so far i have been logging into the SQL server and truncating the table.  

 


Hi Core2,


 


Dont know if its possible to attach a k2 package to this thread? Otherwise you mind attaching some images of how your rules are set up?


 


-Jean


Jean,

 

Thank you for you reply. The form is now working correctly using these rules:

1. When view_1 exectued list item click.

2. then add a new row to the view_2 view.

3. then transfer data (Configure: view_2 displya rows.)

4. then apply the changes made to the row on the view_2 editable list.

 

 

The fourth rule is what brought it all together.  now the data that is added to the view_2 is not added to the sql table.  if you refresh the form the data in the list is lost and no data ever made it to the db table.  Good stuff.

 

All is good.   Thank you for your direction, without it I wouldn't have made it this far.


VJay,

 

now that i'm re-reading through the post, I see you had that rule the entire time.  Sorry I missed it in your post.  Leasoned learned, read carefully each persons post!

 

Thank you for your time.


Thanks Core2,

 

If possible mark my post as solution if it was helpful to you.

 

 


Reply