set dynamic list, then load selected item

192 views
Skip to first unread message

clay.a...@inspectionclean.com

unread,
Jan 5, 2014, 2:31:25 AM1/5/14
to suppor...@runmyprocess.com
I have created a dynamic list from my collection. I want to load collection data from the selected item. I have attached the code below. I cannot get the correct item to load as it continues to load the first record of the collection, not the selected record.

Can you please look at the code and tell me how to fix this?

Thank you in advance!!

This part creates the list:

function list_ko_a(result) {
//Error
alert("ko " + JSON.stringify(result));
}
function list_ok_a(result) {
var my_guru2 = new Array();
for(i=0;i<result.length;i++) {
my_guru2.push({
"label":result[i].guru2,
"value":result[i].guru2,
});
}
var a = new RMP_List();
a.fromArray(my_guru2);
RMPApplication.setList("my_guru2",a);
}
var my_pattern = {};
my_pattern.my_client_id = "[[client_id]]";
col_Guru2.listCallback(my_pattern,{},list_ok_a,list_ko_a);


This part attempts to load the collection data:

/*Defines the id of my widget*/
function get_my_id_variable_a(){
return "guru2";
}

//load_car
function load_ok(result) {
id_my_item.setVisible(true);
RMPApplication.set("my_item", result[0]);
}

function load_ko(result) {
id_report.refresh();
}

function load_clean(my_guru2) {
var my_pattern = {};
var id = get_my_id_variable_a();
my_pattern[id]= my_guru2;
col_Guru2.listCallback(my_pattern, {}, load_ok, load_ko);
}

Sabine El Rassy

unread,
Jan 6, 2014, 4:40:10 AM1/6/14
to RunMyProcess Support Forum
Hello Clay,

I can see you use RMPApplication.set("my_item", result[0]); in your load_ok  function. what you need to do is to set the value variable of your list with the correct item from the collection. In order to do that you have to write as follow: RMPApplication.set("my_item", result[0].guru2); supposing that my_item is the name of your list value variable.

Hope this works for you.

Kind regards

clay.a...@inspectionclean.com

unread,
Jan 13, 2014, 11:24:37 AM1/13/14
to suppor...@runmyprocess.com, clay.a...@inspectionclean.com
Actually, "my_item" refers to a custom widget containing the collection data. I am still missing a step somewhere. Am I setting the value variable of my list correctly?

If you have any examples where collection data is loaded by selecting an entry from a dynamically created list...I would be grateful. I have created my system from all of the examples you provide in the training.

clay.a...@inspectionclean.com

unread,
Jan 14, 2014, 3:29:44 AM1/14/14
to suppor...@runmyprocess.com, clay.a...@inspectionclean.com
Sabine,

If you are willing to look into my account, here is the path:

Web Interface = Guru_WI
Begin typing Rico Suave14 into the first labeled Customer, then select it. Next, choose the tab labeled History and select any of the items from the dropdown list. The problem is that the loaded data (from col_Guru2) for the past history is linked to the first record ever created in the collection, rather than the record you just selected in the dropdown list. How can I resolve?

Your help is greatly appreciated!
Clay

clay.a...@inspectionclean.com

unread,
Jan 24, 2014, 12:33:56 AM1/24/14
to suppor...@runmyprocess.com, clay.a...@inspectionclean.com
I have resolved my problem. Simply put, I was pointing my load_clean function to the same array (my_guru2) that I originally created for the dynamic list. So, I created a new array from the collection (my_guru3) and all works great!

Thank you for all of your help!
Clay

Sabine El Rassy

unread,
Jan 28, 2014, 6:44:19 PM1/28/14
to RunMyProcess Support Forum, clay.a...@inspectionclean.com
Hello Clay,

Sorry for the late reply.
Glad you've managed to solve the problem!

Regards,

Sabine EL RASSY

Customer Solutions Engineer

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.


Clay

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/4edd1716-7262-4747-9c53-f38066cbcb14%40runmyprocess.com.

Reply all
Reply to author
Forward
0 new messages