Multi select CheckBox

437 views
Skip to first unread message

parimip...@gmail.com

unread,
Nov 18, 2013, 3:42:16 PM11/18/13
to suppor...@runmyprocess.com
My Requirement

I have multiple check boxes.
Example ABC
DEF
EOL
PQR

1 If i check EOL or combination of check boxes with EOL A text box should be populated with a value.

2 If I uncheck EOL the textbox should be blank.

Issue
Even if i uncheck the EOL the textbox still holds the value.
The event is not triggered when we uncheck the boxes.

Could you please help me to fix the issue. Please find the screenshots and javascript snippet from the attachment.


Thanks
Prasanthi

Multi select.doc

madhuri.ru...@gmail.com

unread,
Nov 19, 2013, 1:03:04 AM11/19/13
to suppor...@runmyprocess.com, parimip...@gmail.com
Hi Prasanthi,

Could you please try this code-

var choice=JSON.parse(id_type.getSelectedValue());

if(choice.length != 0){

for(var i=0;i< choice.length;i++){

if(choice[i]=="EOL")
{

RMPApplication.setVariable("deviation_number","1234");
}
else
{
RMPApplication.setVariable("deviation_number","");
}
}
}


Please let me know,if this works.

Thanks,
Madhuri,Fujitsu

prasanthi parimi

unread,
Nov 19, 2013, 3:13:49 AM11/19/13
to madhuri.ru...@gmail.com, suppor...@runmyprocess.com
Hi Madhuri,
 
Thanks for quick turn around, I tested this code the actual issue is when we had only one check box selected and if we uncheck that checkbox then javascript function is not invoking on the event.
 
we never get (choice[i]=="EOL") condition true becuase this javascript function is not invoking when we uncheck the checkbox(if single check box is checked and then we uncheck that).
 
Its triggering the javascript if we had multiple checkboxes checked and if we uncheck one of them, but if we had only one checkbox is checked and if we uncheck that then the attached javascript function is not invoking.

Can you please help me in that usecase.

Regards,
Prasanthi.

maddyra...@gmail.com

unread,
Nov 19, 2013, 4:25:05 AM11/19/13
to suppor...@runmyprocess.com, madhuri.ru...@gmail.com, parimip...@gmail.com
Hi,
Can you please tell me that you want text box to be set with value when selected EOL Or EOL with any other value(just 1 other) or (more than 1 other values with EOL)?

Thanks,
Madhuri,Fujitsu

prasanthi parimi

unread,
Nov 19, 2013, 5:49:20 AM11/19/13
to maddyra...@gmail.com, suppor...@runmyprocess.com, madhuri.ru...@gmail.com
Hi Madhuri,
 
EOL is a checkbox widget which has multiple checkboxes(custom list), If I select a checkbox from the list then my textbox should be populated with the selected value that is working fine. If I uncheck the checkbox again then my textbox should be cleared(value should be reset to blank). When we uncheck the checkbox attached javascript is not triggering where we are resetting the textbox value to blank.
 
1. EOL is a checkbox widget: custom list with multiple checkboxes
2. When we select any checkbox that value should be populated to a textbox
3. Setting the value is working fine becuase attached javascript is invoked when we check the checkbox
4. When we uncheck the checkbox(if only one checkbox is checked in the widget) we need to reset the text box value, but here javascript function is not invoking at all to set the text box value.
 
Regards,
Prasanthi

Gareth Thiveux

unread,
Nov 19, 2013, 6:26:30 AM11/19/13
to suppor...@runmyprocess.com, maddyra...@gmail.com, madhuri.ru...@gmail.com
Hi Prasanthi,


Emptying a field (which is what happens when you untick the last box of a multi-checkbox widget) doesn't trigger any event, so is not detected by your javascript
In this case, the only solution I can offer is to use a "manual" listener, which will be able to detect when fields are emptied.

So replace the content of your JS widget with the following code (and empty the "Listen to variables" field of it) :


var dn = document.getElementById('id_deviation_number');

function validate(){        
                var choice=JSON.parse(id_type.getSelectedValue());
                if(choice.length != 0){
                               for(var i=0;i< choice.length;i++){
                                               if(choice[i]=="EOL"){
                                                               dn.disabled = false;

                                                                RMPApplication.setVariable("deviation_number","1234");
                                               }
                                               else if(choice[i]=="")
                                                {
RMPApplication.setVariable("deviation_number","");
                                                            dn.disabled = true;

                                                }
                               }
                  }
                  else if(choice.length == 0){
                                RMPApplication.setVariable("deviation_number","");
                 }            

                  //if(id_type.isChecked())
                  //{
                //            alert("checked");
                  //}
}

function valueChanged_type( name, value ) {
if(name == "type") {
validate();
}
}
RMPApplication.addListener( valueChanged_type );


Just to give a little explanation, when you use the RMPApplication.addListener function, you're creating what we could call a manual listener, that listens to anything that changes in your form, and each time something changes, calls the function given as a parametervalueChanged_type in this case.
And it's in this function that you'll filter on which variables you want to perform an action. In this case, you want to react if the variable type changes. You just add below whatever action you want to perform (could be an alert, or set a field as visible or active ... or in your call another function that you have already defined).

That should hopefully solve your problem.

Hope I was clear enough.

Pre-Sales Consultant / Consultant Avant-Vente
 Fujitsu RunMyProcess
3 rue de Gramont, 75002 Paris - France

     


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.


2013/11/19 prasanthi parimi <parimip...@gmail.com>
--
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/CACxsc-aXpS5POPmzLzUwU45i-XvyharOJWAKYB2tDP8uiWmWZA%40mail.gmail.com.

prasanthi parimi

unread,
Nov 19, 2013, 11:38:48 AM11/19/13
to maddyra...@gmail.com, suppor...@runmyprocess.com, madhuri.ru...@gmail.com
Hi Madhuri,
 
We discovered a bug in RMP, Can you please help us in conforming that and get the fix for this.
 
Please find the scenario and issue we had:
 
1.       My widget is a check box list.
2.       The checkbox list widget labeled “Type”.
3.       My list of checkboxes Contains let’s say : EOL, TTS,ABN
 
Bug:
uncheck event is not calling the attached javascript in one usecase:
If we had two checkboxes checked out of the three checkboxes and now if I am unchecking one of them then javascript attached to it is invoking.
But If I had only one checkbox is checked out of the three checkboxes and now if I am unchecking that then javascript attached to it is not invoking.
 
Because of this issue we are not able to rely on the uncheck event of the checkbox and it is impacting our functional usecase.
 
Thanks,
Prasanthi.

parimip...@gmail.com

unread,
Nov 19, 2013, 3:23:52 PM11/19/13
to suppor...@runmyprocess.com, maddyra...@gmail.com, madhuri.ru...@gmail.com

Hello Thiveux,

Problem solved using manual listener. Very good explanation on the usage of manual listener. Thank you very much for the response.

Regards
Prasanthi

Reply all
Reply to author
Forward
0 new messages