Have a dim day - How do you transfer list items to controls?


Userlevel 3
Badge +16

Done a new form with a list which pulled in data from a web service.

 

My List View displays the results in 1 record with 5 fields. -This is fine upto here!

 

I then do a Transfer rule to assign individual Display Row labels from the List View to another Selected Item View where i want to display a couple of these fields, but it will not work...

 

What am i doing wrong?

 

I run the form and the fields are blank, in the Selected Item view yet the list View has my record in and displays them ok.....

 

Any ideas?


5 replies

Userlevel 1
Badge +4

Sharpharp1,

From your post is sounds like, and correct me here, that you have a form with two views.  The "top" view is a List View that displays some records and the "bottom" view displays the details.  Ok, so my next question is what event is the Data Transfer action configured on?  Typically this would be put on the "List item click" event on the List View.  That event would then call the Data Transfer.

 

What I would suggest as a quick test, is to put a Data Label directly on the form and in your Data Transfer action set some value from your into that control.  That would allow you to quickly test to make sure that your Data Transfer is happening properly.  I do this often as sometimes when I build these rules I don't map the Source field from my List View and (this especially happens when I have multiple fields named "ID", I look at to rule and it "looks" fine, but I chose the wrong ID field).

 

Once that is working then the next question is your Selected Item View just displaying details from the list or is it pulling in data from another SmartObject call.  If the later, then you might not want a Data Transfer at all instead use the "Execute a View method" and set choose Initialize and then do your Input Mappings from the fields just as you would on your Data Transfer (that we proved to work above).

 

Hope that helps.

Userlevel 3
Badge +16

Thanks for your reply,

 

I have the list filter enabled, so there will only ever be 1 record displays (5 fields).

 

I want that row to automatically (no clicks or intervention from user) to select that record and transfer the 5 fields to text boxes on another View.

 

Possible? I have a bad feeling you can;'t and must use click or double0click to select the record :-(

Userlevel 1
Badge +4

Ahh, now I get it.  I don't know of any way to "click" a row using any kind of rule logic.  I've asked a consultant this before and they weren't able to answer either.

Userlevel 1
Badge +8

Hi Sharpharp1

 

If you are only ever returning 1 row, then I suggest you don't use a list view to display your data. Just  create a data label for each field returned (you can align them in a row if required) and in your list method return the values to these data labels. You can the directly reference these data labels when transferring data.

 

Referencing a list view row without having a user select it is not possible (OOTB) as you have discovered.

 

Userlevel 3
Badge +16

Dayam, i had a snaeky feeling that even if one row is returned, that K2 would not allow me to access the list view fields until it has been selected.

 

Thank you for confirming that, i'll look at using data fields. but i do prefer a list view looks better.

 

Is there a reason why K2 cannot do a focus or click without user intervention?

 

The problem is (as i found from testing) that none of the list view fields cannot be accessed until it is selected. Just doesn't make any sense that a list view shows 1 row, yet none of those fields are not stored and unable to be referenced until a user clicks it

 

Thanks again guys,

Reply