List valus for another screen

171 views
Skip to first unread message

swati.sa...@gmail.com

unread,
Oct 21, 2014, 2:55:14 AM10/21/14
to suppor...@runmyprocess.com
Hi ,

I have created a web interface in which i have included a collection. In the web interface i have take two list and a button.

The first list is custom list, where as the second list is a variable based(with multiple selection enable) list. I am mapping my custom list values with those of variable list values and as result the output is generated by clicking the button.

In this web interface i have another screen called assigner with a text input. Now all i want is that when the user selects the multiple values from the variable based list and upon clicking the button those selected values get displayed in the assigner screen text input.

To achieve this out come i have given the default value of the assigner screen text input as the value variable of my variable based list.

I am getting my desired output but with some complications. The selected values are coming into the assigner screen text input , with brackets and inverted commas, I want to remove these brackets and commas, and also cannot view all my selected values . so please help me out, i am attaching the screen shot for better understanding.

1.1.png
1.2.png
1.3.png

Rajesh Chandgothia

unread,
Oct 21, 2014, 3:13:08 AM10/21/14
to suppor...@runmyprocess.com
Hi Swati,

Once you click on button for displaying your variable based list into next screen textbox at that time write javascript for looping the list variable. Assign each index value to one variable and concatenate for rest of list index value. After concatenating the values in one variable then assign that variable to your text box.

For showing the more text into text box you can select below property :

  • Lines: allows you to define the number of lines of the widget
  • Columns: this field only appears if you haven't typed "1" in field "Lines". It allows you to define the length (number of characters typed in a line) of the widget.
Hope this will solve your issue.

Regards,

Rajesh


--
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/01b9c6b2-78f7-4418-b79d-c65dbeaedcd7%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Swati Sarkar

unread,
Oct 21, 2014, 3:29:55 AM10/21/14
to suppor...@runmyprocess.com
HI Rajesh,

According to my understanding what you have said the button that i have it's action type should be execute script. But i want to start a process with my button(ie. its action type would be start process) , in that scenario how can i write a javascript for my button.

so please help.

You received this message because you are subscribed to a topic in the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/4BtIAuLxaT0/unsubscribe.
To unsubscribe from this group and all its topics, 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/.

swati.sa...@gmail.com

unread,
Oct 22, 2014, 9:59:12 PM10/22/14
to suppor...@runmyprocess.com, swati.sa...@gmail.com
Hi,

could you find any solution for my issues????

thoshino

unread,
Oct 22, 2014, 11:10:52 PM10/22/14
to suppor...@runmyprocess.com, swati.sa...@gmail.com
Hi,

In the first screen, you have web interface list widget "id_safety_officer" with variable called "safety_officer".
In the second screen, you have text widget "id_assigner", variable "assigner".

In this case, you can try:
1. In 2nd screen, leave "assigner" initialize empty.
2. In 2nd screen, make "safety_officer" widget Available, (not Visible, not Active).
3. In 2nd screen, add a Javascript widget, Available and Active, with below code.

function setAssignerText() {
var my_safety_officer = RMPApplication.get("safety_officer"); //this reads Available web interface variable "safety_officer"
var my_json = JSON.parse(my_safety_officer); //this is parsing the variable as JSON array
var my_string = "";
for (var i = 0; i < my_json.length; i++) {
my_string = my_string + my_json[i];
if (my_json[i + 1] < my_json.length) {
my_string = my_string + ",";
}
}
id_assigner.setText(my_string); //this is writing the generated string to text widget "id_assigner"
}
setAssignerText(); //when this function is executed, list variable should be parsed and written to text widget

Best regards,

Taka

Swati Sarkar

unread,
Oct 24, 2014, 12:13:09 AM10/24/14
to thoshino, suppor...@runmyprocess.com
Hi Thosino,

I have tried to implement the solution you send to me but nothing is coming in the assigner text input widget after the implementation of the code.

I am sending you the code please see where i am going wrong


    var my_safety_officer = RMPApplication.get("safety_officer");
var my_json = JSON.parse(my_safety_officer);
var my_string = "";
for (var i = 0; i < my_json.length; i++) {
my_string = my_string + my_json[i];
if (my_json[i + 1] < my_json.length) {
my_string = my_string + ",";
}
}
id_assigner.setText(my_string);
}
setAssignerText();


Takafumi Hoshino

unread,
Oct 24, 2014, 12:34:18 AM10/24/14
to Swati Sarkar, suppor...@runmyprocess.com
How about this?

var my_safety_officer = RMPApplication.get("safety_officer");
var my_json = JSON.parse(my_safety_officer);
var my_string = "";
for (var i = 0; i < my_json.length; i++) {
my_string = my_string + my_json[i];
if ((i + 1) < my_json.length) {
my_string = my_string + ",";
}
}
id_assigner.setText(my_string);
}
setAssignerText();

Taka
--
---------------------------------------------------
Taka Hoshino
Fujitsu RunMyProcess
Google Account: thos...@runmyprocess.com
<Sent from Gmail web client>

Swati Sarkar

unread,
Oct 24, 2014, 12:48:32 AM10/24/14
to suppor...@runmyprocess.com
Hi Thosino,

My assigner text input widget is still coming without the values of my safety_officer variable baesd list could you pleae tell me where i am going wrong.



On Fri, Oct 24, 2014 at 10:18 AM, Swati Sarkar <swati.sa...@gmail.com> wrote:
Hi Thosino,

My assigner text input widget is still coming without the values of my safety_officer variable baesd list could you pleae tell me where i am going wrong.

thoshino

unread,
Oct 24, 2014, 1:22:15 AM10/24/14
to
Hi,

So you tried the modified code I sent to you and it doesn't work. Correct?

Since I am not working in your environment I cannot provide exact code that will work, just by copy paste.

So I will explain what each line of code is doing, and I hope you can elaborate.

1. var my_safety_officer = RMPApplication.get("safety_officer");
This line is reading the web interface variable into my Javascript context.
It will be in string format.


2.var my_json = JSON.parse(my_safety_officer);
This line is parsing the string data as JSON array.
After this I should be able to access each selected value like my_json[0].


3. for (var i = 0; i < my_json.length; i++) {
This is for loop for each data in my_json array.

4. my_string = my_string + my_json[i];
Concatenating each data in array into string.

5. if ((i + 1) < my_json.length) {

my_string = my_string + ",";
If there is next value, then I want to separate with a comma.

6. id_assigner.setText(my_string);
This is the line that is setting the value of id_assigner text widget.


7. setAssignerText();
All of above was defining function, and this line is executing all that I wrote above.

Best regards,

Taka

Rajesh Chandgothia

unread,
Oct 24, 2014, 5:54:12 AM10/24/14
to suppor...@runmyprocess.com
Hi Swati,

In your process write freemarker code make loop of that custom list widget selected value and assign it to a variable and concatenate, Input parameter of Manual task where next screen assigned, assigned that variable to you textbox variable. Once User will open the form then value will display.

Regards,

Rajesh

Swati Sarkar

unread,
Oct 27, 2014, 12:32:40 AM10/27/14
to Takafumi Hoshino, suppor...@runmyprocess.com
Hi Thosino,

Thank you so much for the help,the issue has been solved...

On Fri, Oct 24, 2014 at 9:48 PM, Takafumi Hoshino <thos...@runmyprocess.com> wrote:
Hi,

I think I confused you a little bit. Sorry.
You should keep the same list widget in 1st and 2nd screen (no need to make id_safety_officer_a).

Using same widget in launch and 2nd screen means, values set in launch screen will be sent to process, go through process, and at 2nd screen, it will be populated with same value and be Available for use (if you select Available).

"Available/Active/Visible" rule can be set separately for each screen.

So I assume with above setting, list variable is available for use in 2nd screen.

Then we need to go through standard JS debug procedure.
Like below, to see each line execute step-by-step.

function setAssignerText() {
var my_safety_officer = RMPApplication.get("safety_officer");
alert("my_safety_officer: " + my_safety_officer);
var my_json = JSON.parse(my_safety_officer);
alert("my_json : " + my_json);
var my_string = "";
alert("my_string : " + my_string);
for (var i = 0; i < my_json.length; i++) {
my_string = my_string + my_json[i];
alert("my_string : " + my_string);
if ((i + 1) < my_json.length) {
my_string = my_string + ",";
alert("my_string : " + my_string);
}
}
alert("my_string : " + my_string);
id_assigner.setText(my_string);
}
setAssignerText();

Best regards,

Taka





On Thu, Oct 23, 2014 at 10:48 PM, Swati Sarkar <swati.sa...@gmail.com> wrote:
Hi Thosino,

Let me explain you what i am donig then you can figure it out where i am going wrong

I have variable based multiple selection list widget with th following

Lable: Safety Officer
value variable: safety_officer
lable variable:   safety_officer_name
list variable: vb_safety_officer
id:id_safety_officer

In the next screen i have a Assigner text input widjet with the following

Lable:Assigner
Value Variable :assigner
id: id_assigner.

Below this as you have said earlier i have take the "safety_officer" widget with all the field s same as of my first screen "safety_officer" widget except the identifier,which is only available but not active and visible.
id:id_safety_officer_a.

below that i have taken  a hidden split widget and in which i am giving the javascript that you have provided me .


so now could tell me where it went wrong all this time??







On Fri, Oct 24, 2014 at 10:52 AM, thoshino <thos...@runmyprocess.com> wrote:
Hi,

So you tried the modified code I sent to you and it doesn't work. Correct?

Since I am not working in your environment I cannot provide exact code that will work, just by copy paste.

So I will explain what each line of code is doing, and you hope you can elaborate.

1. var my_safety_officer = RMPApplication.get("safety_officer");
This line is reading the web interface variable into my Javascript context.
It will be in string format.


2.var my_json = JSON.parse(my_safety_officer);
This line is parsing the string data as JSON array.
After this I should be able to access each selected value like my_json[0].


3. for (var i = 0; i < my_json.length; i++) {
This is for loop for each data in my_json array.

4. my_string = my_string + my_json[i];
Concatenating each data in array into string.

5. if ((i + 1) < my_json.length) {

my_string = my_string + ",";
If there is next value, then I want to separate with a comma.

6. id_assigner.setText(my_string);
This is the line that is setting the value of id_assigner text widget.


7. setAssignerText();
All of above was defining function, and this line is executing all that I wrote above.

Best regards,

Taka





Reply all
Reply to author
Forward
0 new messages