reset or empty a widget array

155 views
Skip to first unread message

emon...@lanogalera.biz

unread,
May 1, 2017, 2:21:51 PM5/1/17
to Fujitsu RunMyProcess Developer Community
How can I reset or clear a widget array with code, I fill an array with code in a loop, but I need to reset as default with 1 clear row for the next loops

Gunjan Rajgure

unread,
May 1, 2017, 3:13:50 PM5/1/17
to emon...@lanogalera.biz, suppor...@runmyprocess.com
Hi There,

Thank you for contacting Fujitsu RunMyProcess Support.

You can use following code in your loop to reset array widget row with the index number of its.

id_array_widget.id_column[index_number_of_row].setValue("");

Note : index_number_of_row - Here, you can use your loop counter number which represent row number.

Please refer documentation for more clarification.



Hope this will helps you. 

Please feel free to contact with us for any query.


Thanks & Regards
Gunjan Rajgure
Fujitsu - RunMyProcess Support

On Mon, May 1, 2017 at 11:51 PM, <emon...@lanogalera.biz> wrote:
How can I reset or clear a widget array with code, I fill an array with code in a loop, but I need to reset as default with 1 clear row for the next loops

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://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/7641e670-0c37-4531-ac6a-5abff64ba54b%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

emon...@lanogalera.biz

unread,
May 1, 2017, 3:19:32 PM5/1/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Hi gunjan

I have an array with 7 columns and more than 10 rows, Im looking for an istruction to reset or clear and delete the rows dynamically every loop



El lunes, 1 de mayo de 2017, 13:13:50 (UTC-6), gunjan.rajgure escribió:
> Hi There,
>
>
> Thank you for contacting Fujitsu RunMyProcess Support.
>
>
> You can use following code in your loop to reset array widget row with the index number of its.
>
>
> id_array_widget.id_column[index_number_of_row].setValue("");
>
>
> Note : index_number_of_row - Here, you can use your loop counter number which represent row number.
>
>
> Please refer documentation for more clarification.
>
>
> https://docs.runmyprocess.com/Developer_Guide/Development_Environment/Toolbox/Web_Interfaces/Widget/Array_Widget
>
>
>
> http://docs.runmyprocess.com/Developer_Guide/Web_Interface/Design/Summing_Array
>
>
>
> Hope this will helps you. 
>
> Please feel free to contact with us for any query.
>
>
>
>
> Thanks & Regards
> Gunjan Rajgure
> Fujitsu - RunMyProcess Support
>
>
> On Mon, May 1, 2017 at 11:51 PM, <emon...@lanogalera.biz> wrote:
> How can I reset or clear a widget array with code, I fill an array with code in a loop, but I need to reset as default with 1 clear row for the next loops
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.

Gunjan Rajgure

unread,
May 1, 2017, 3:48:58 PM5/1/17
to suppor...@runmyprocess.com, emon...@lanogalera.biz
Hi There,

Yes, you can do it. You need to get array row counts and then make your loop according to row count. Then you can use this code inside loop to reset rows.

var arr_length = id_array_widget.getRowsCount();

for(counter=0; counter<=arr_length; counter++)
{
     id_array_widget.id_column1[counter].setValue(""); 
     id_array_widget.id_column2[counter].setValue("");
     .
     .
     .
     .
     id_array_widget.id_column7[counter].setValue("");
}
 
Note : you can make this code inside function and use that function to reset array any time whenever you want.

Please don't hesitate for any further query.

Thanks & Regards
Gunjan Rajgure
Fujitsu - RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

emon...@lanogalera.biz

unread,
May 1, 2017, 3:53:43 PM5/1/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Hi!

Ok but on my first loop I need 10 rows, on the second loop I need 6 rows, how can I delete this 4 rest rows?

emon...@lanogalera.biz

unread,
May 2, 2017, 12:23:56 PM5/2/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Hi Prachi

Yes my requirement is to delete complete row from array widget. I use a CAPI to fill the array, I dont have a problem with the first request, my issue its for the next request when the result needs less rows than the first request.

I need to reset the array before fill the array
function getTratos(Tratos){
id_spinner.setVisible(false);
var Tr=Tratos;
var a=Tr.length;
if(a==undefined){
var Tr2=Tr.row.length;
if(Tr2==undefined){
id_tratos.id_idtrato[0].setValue(Tr.row.column[0].P_value.toString());
id_tratos.id_prod[0].setValue(Tr.row.column[2].P_value);
id_tratos.id_proc[0].setValue(Tr.row.column[3].P_value);
id_tratos.id_cal[0].setValue(Tr.row.column[7].P_value);
id_tratos.id_vol[0].setValue(Tr.row.column[5].P_value.toString());
id_tratos.id_pp[0].setValue(Tr.row.column[6].P_value.toString());
}
else{
for(var i=0;i<Tr2;i++){
if(i==0){
id_tratos.id_idtrato[i].setValue(Tr.row[i].column[0].P_value.toString());
id_tratos.id_prod[i].setValue(Tr.row[i].column[2].P_value);
id_tratos.id_proc[i].setValue(Tr.row[i].column[3].P_value);
id_tratos.id_cal[i].setValue(Tr.row[i].column[7].P_value);
id_tratos.id_vol[i].setValue(Tr.row[i].column[5].P_value.toString());
id_tratos.id_pp[i].setValue(Tr.row[i].column[6].P_value.toString());
}
else{
id_tratos.insertRow(i);
id_tratos.id_idtrato[i].setValue(Tr.row[i].column[0].P_value.toString());
id_tratos.id_prod[i].setValue(Tr.row[i].column[2].P_value);
id_tratos.id_proc[i].setValue(Tr.row[i].column[3].P_value);
id_tratos.id_cal[i].setValue(Tr.row[i].column[7].P_value);
id_tratos.id_vol[i].setValue(Tr.row[i].column[5].P_value.toString());
id_tratos.id_pp[i].setValue(Tr.row[i].column[6].P_value.toString());
}
}
}
}
else {
alert("No hay tratos disponibles para este productor");
arrayTratosFilled_11Rows.PNG
tratosarrayNeedClearBefore.PNG
anotherProductor.PNG
arrayTratos.PNG

emon...@lanogalera.biz

unread,
May 3, 2017, 5:16:24 PM5/3/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Hi!

Any update?
Any Update

Abhilash Sambhare

unread,
May 11, 2017, 4:28:29 AM5/11/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

Good Day.

Sorry for delay in response.As per my understanding you are retrieving the data from CAPI.

To delete the row you can implement the following solution:

1.Firstly you need to store the result of CAPI into one variable.eg previous_records
2.Get the count of records in CAPI by using the function "variable_name.lenth" and store this value into some variable eg.previous_count
3.Then you need to store the latest result of CAPI into another variable ie.Current_records
4.Get the count of latest result of CAPI using the same function "variable_name.lenth" and store this value into variable eg.latest_count
5.Then compare the count of both the results ie if(previous_count>latest_count) and then use the function "removeRow();" to delete the particular rows.

Hope this helps you.Please don't hesitate to contact us for any further query.

Thanks & Regards,
Abhilash
Fujitsu Runmyprocess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

emon...@lanogalera.biz

unread,
May 12, 2017, 10:26:27 AM5/12/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Hello Abhilash!

Thanks, its work for me
Reply all
Reply to author
Forward
0 new messages