Topic
  • 30 replies
  • Latest Post - ‏2013-03-05T06:03:53Z by PhaniRaju
PhaniRaju
PhaniRaju
155 Posts

Pinned topic Validation for Dropdown BPM 8.0.1

‏2013-02-13T13:41:06Z |
Hi All

Please Find the Attachment.
As the image shows I am able to get Background Color as Red for Text Fields But When it comes to dropdown I am unable to get that.
Any Help??
Thanks,
Phani.
Updated on 2013-03-05T06:03:53Z at 2013-03-05T06:03:53Z by PhaniRaju
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-14T08:49:24Z  
    Does anyone know hot to do this??
    Any Help??
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-14T10:32:25Z  
    • PhaniRaju
    • ‏2013-02-14T08:49:24Z
    Does anyone know hot to do this??
    Any Help??
    Hi,

    I 'll try to help you out with it.
    So far as I can see, the components that supports validation using the validation framework have to have a validate event.
    The OOTB Select has a script code in the validate event, and is this script code that I believe that is executed when the validation occurs.
    Maybe if you compare this code with the text box code you can find the differences and the reason why you don't observe the expected result.

    If you spot a difference you can extend the select OOTB control and try to rewrite the validate event so it behaves as you want.

    I hope it helps and i'm waiting for your feedback.

    Best regards,
    VF
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-14T13:13:36Z  
    Hii

    Thanks a lot for your reply.
    I am new to this Tool and I don't have that much knowledge like OOTB etc what you have explained .

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-14T14:00:12Z  
    • PhaniRaju
    • ‏2013-02-14T13:13:36Z
    Hii

    Thanks a lot for your reply.
    I am new to this Tool and I don't have that much knowledge like OOTB etc what you have explained .

    Thanks
    Phani.
    Hi,

    When I say OOTB it means the components that are part of IBM BPM and are ready to use since the start.
    It's just a keyword :)

    Best regards,
    VF
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-14T18:16:55Z  
    Hi,

    When I say OOTB it means the components that are part of IBM BPM and are ready to use since the start.
    It's just a keyword :)

    Best regards,
    VF
    The next question is, where is your validation code?

    Are you checking to see if the bind value's "listSelected" is initiated?
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-15T05:27:00Z  
    Actually I am storing the value in selectedString(Present in the configuration of Select Control) and passing that variable to Validation Script.
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-15T12:48:33Z  
    • PhaniRaju
    • ‏2013-02-15T05:27:00Z
    Actually I am storing the value in selectedString(Present in the configuration of Select Control) and passing that variable to Validation Script.
    Of course... my mind was on tables for some reason. Can you post the validation javascript that you're using?
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-18T13:52:22Z  
    tw.local.coachValidation = new tw.object.CoachValidation();
    tw.local.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    var errorMessage;
    if (tw.local.dropdown== "")
    {
    errorMessage = String(tw.epv.ValidationMessages.dropdownValMsg);
    tw.system.addCoachValidationError(tw.local.coachValidation, "tw.local.errorMessage.dropdown", errorMessage);
    }

    where dropdown is the variable that is attached to selectedString in Configuration of Select Control
    and dropdownValMsg is the Error Message that will display in the traingle box.

    As this dropdown Validation(Red Color) is not working we have attached all this to a text field and made it hidden.

    Waiting for Solution.

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-18T15:09:30Z  
    • PhaniRaju
    • ‏2013-02-18T13:52:22Z
    tw.local.coachValidation = new tw.object.CoachValidation();
    tw.local.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    var errorMessage;
    if (tw.local.dropdown== "")
    {
    errorMessage = String(tw.epv.ValidationMessages.dropdownValMsg);
    tw.system.addCoachValidationError(tw.local.coachValidation, "tw.local.errorMessage.dropdown", errorMessage);
    }

    where dropdown is the variable that is attached to selectedString in Configuration of Select Control
    and dropdownValMsg is the Error Message that will display in the traingle box.

    As this dropdown Validation(Red Color) is not working we have attached all this to a text field and made it hidden.

    Waiting for Solution.

    Thanks
    Phani.
    tw.system.addCoachValidationError(tw.local.coachValidation, "tw.local.errorMessage.dropdown", errorMessage); This line means that it wil add validation message against all those controls having tw.local.errorMessage.dropdown as Binding Variable.

    If your requirement is like to check whether any value is selected from dropdown.
    check if the binding variable in general configuration of dropdown for empty sting add error messgaae to that variable.
    if (tw.local.bindingvariabletodropdown== "")
    {
    errorMessage = String(tw.epv.ValidationMessages.dropdownValMsg);
    tw.system.addCoachValidationError(tw.local.coachValidation, "tw.local.bindingvariabletodropdown", errorMessage);

    }

    btw if you ars using this scipt inside a scrip block you need to use tw.system.coachValidation. If you are using seperate service for validation calculation then tw.local.coachValidation is fine.
    let me know if you have any doubts
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-18T16:03:02Z  
    Hi Anil

    What I want is to get backgroung Color as Red for Dropdown.

    I have tried What you said but it is showing error.

    tw.system.coachValidation = new tw.object.CoachValidation();
    tw.system.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    if(tw.local.select!="" && tw.local.select!=null && tw.local.select!=undefined)
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.select", "Phani");
    }

    as Select is the List variable.

    Later that I have done like this which is validating but not showing error message and background color red
    tw.system.coachValidation = new tw.object.CoachValidation();
    tw.system.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    if(tw.local.select.listSelected!="" && tw.local.select.listSelected!=null && tw.local.select.listSelected!=undefined)
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.select", "Phani");
    }
    Thanks
    Phani.
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-02-21T11:05:13Z  
    Any Help??
    Has Anybody Implemented This??

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-01T23:09:48Z  
    • PhaniRaju
    • ‏2013-02-21T11:05:13Z
    Any Help??
    Has Anybody Implemented This??

    Thanks
    Phani.
    Hi Phani,

    So, if I' right you want a validation behaviour as we can see for text box.
    If you want something like that, first you have to create a variable of the same type that you are using in dropdown's binding.
    Now in the dropdown's configuration options for the selected item you use the created variable.

    Imagine, that the list used for dropdown's binding is "myVarList" and the created variable's name is "myVar" the code in you coach validation can be like this:

    
    
    
    if(!tw.local.myVar) 
    //do validation 
    { tw.syste.addCoachValidationError(tw.system.coachValidation, 
    "tw.local.myVar", 
    "ERROR_MESSAGE"); 
    }
    


    I hope it helps and I'm waiting for your reply.

    Best regards,
    VF
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-02T07:30:28Z  
    Hi Venfil,

    Thanks a ton for your reply......
    The solution which you have provided for me made me very happy, when I had run the code it executed . But the problem is It is working only for Not Null condition.

    I have created List varible "dropdownList"
    and Variable "dropdown" and binded it to selectedItem in configuration

    in Validation script

    if(tw.local.dropdown ==" " || tw.local.dropdown ==null || tw.local.dropdown == undefined)
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.dropdown ", "Please Select Dropdown");
    }

    Same problem with Name Value Pair also.

    I have tried lot of times for Null Condition but it didn't work.

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-02T11:32:08Z  
    Hi Phani,

    Have attached the screenshot. Is this what you want to happen?

    Thanks,
    Vivekananth.T
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-02T12:03:18Z  
    Hi Vivek,

    Thanks for the reply...
    That's not actually what I require...
    In the Screenshot you have selected A in dropdown ..
    I want that validation when nothing is selected i.e., when no value is present in the dropdown(Null check).

    Same kind of validation for Date and Text area are required If possible Just Help Me.

    Thanks
    Phani.
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T06:20:40Z  
    Hi Vivek,

    Is it working for you..
    Are you checking for Null condition..
    Please reply if have achieved that validation.
    Waiting for your reply.

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T08:17:19Z  
    • PhaniRaju
    • ‏2013-03-02T07:30:28Z
    Hi Venfil,

    Thanks a ton for your reply......
    The solution which you have provided for me made me very happy, when I had run the code it executed . But the problem is It is working only for Not Null condition.

    I have created List varible "dropdownList"
    and Variable "dropdown" and binded it to selectedItem in configuration

    in Validation script

    if(tw.local.dropdown ==" " || tw.local.dropdown ==null || tw.local.dropdown == undefined)
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.dropdown ", "Please Select Dropdown");
    }

    Same problem with Name Value Pair also.

    I have tried lot of times for Null Condition but it didn't work.

    Thanks
    Phani.
    Hi,

    Which are the others validations that you want to do? Can you give me examples?

    Best regards,
    VF
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T08:18:08Z  
    Hi Phani,

    Am not sure if I get you correctly. For me , there will be a value in the drop down selected when the coach loads initially as 'Please select' as the display name and the value probably '0'. What you are asking for is, there is no value shown in the drop down intially and then when you click the drop down arrow, the subsequent values are shown. Let me see if I can recreate this. Will update you soon.

    Vivek
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T08:31:38Z  
    Hi Phani,

    Please consider the below scenario I have recreated. This is working for me.

    I have a var called tw.local.dropdownList of type List of String. One var called selected which will hold the selected value. dropdownList will be binded to the select control on the coach and the selected var will be set in the config properties of the selecte control in the 'Selected Item' option. I have initialized the dropdownList as :

    
    tw.local.dropdownList = 
    
    new tw.object.listOf.String(); tw.local.dropdownList[0] = 
    ''; tw.local.dropdownList[1] = 
    'A' tw.local.dropdownList[2] = 
    'B'
    


    Then on the Validation Script which is connected to the validation port of the coach, I have written :
    
    
    
    if(tw.local.selected == 
    '') 
    { tw.system.addCoachValidationError(tw.system.coachValidation, 
    'tw.local.selected', 
    'Please Select a Valid Option'); 
    }
    

    Please see the screenshots for the results.

    Vivek
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T09:49:11Z  
    Hi Vivek,

    Thanks a lot for your reply.
    Its working absolutely fine.
    But my dropdownList is a NameValue Pair. For this I am getting Errors.

    What I have Done is

    Created a Name Value Pair List : myVarList(NameValuePair)(List)

    tw.local.myVarList=new tw.object.listOf.NameValuePair();
    tw.local.myVarList[0]=new tw.object.NameValuePair();
    tw.local.myVarList[0].name='';
    tw.local.myVarList[0].value="0";

    tw.local.myVarList[1]=new tw.object.NameValuePair();
    tw.local.myVarList[1].name="check1";
    tw.local.myVarList[1].value="1";

    tw.local.myVarList[2]=new tw.object.NameValuePair();
    tw.local.myVarList[2].name="check2";
    tw.local.myVarList[2].value="2";

    Then I have binded this variable to Select Control .

    Later I have created myVar(NameValuePair) and attached this to SelectedItem in Configuration.

    My Validation Code is:

    tw.system.coachValidation = new tw.object.CoachValidation();
    tw.system.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    if(tw.local.myVar.name=='')
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.myVar", "Please Select Value");
    }

    When I run this I am getting errors.

    Please Look at this issue.

    Thanks
    Phani.
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T09:50:41Z  
    Hi Venfil,

    I want validations for Date and Text Area.

    Thanks
    Phani.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T10:17:16Z  
    • PhaniRaju
    • ‏2013-03-04T09:49:11Z
    Hi Vivek,

    Thanks a lot for your reply.
    Its working absolutely fine.
    But my dropdownList is a NameValue Pair. For this I am getting Errors.

    What I have Done is

    Created a Name Value Pair List : myVarList(NameValuePair)(List)

    tw.local.myVarList=new tw.object.listOf.NameValuePair();
    tw.local.myVarList[0]=new tw.object.NameValuePair();
    tw.local.myVarList[0].name='';
    tw.local.myVarList[0].value="0";

    tw.local.myVarList[1]=new tw.object.NameValuePair();
    tw.local.myVarList[1].name="check1";
    tw.local.myVarList[1].value="1";

    tw.local.myVarList[2]=new tw.object.NameValuePair();
    tw.local.myVarList[2].name="check2";
    tw.local.myVarList[2].value="2";

    Then I have binded this variable to Select Control .

    Later I have created myVar(NameValuePair) and attached this to SelectedItem in Configuration.

    My Validation Code is:

    tw.system.coachValidation = new tw.object.CoachValidation();
    tw.system.coachValidation.validationErrors = new tw.object.listOf.CoachValidationError();
    if(tw.local.myVar.name=='')
    {
    tw.system.addCoachValidationError(tw.system.coachValidation, "tw.local.myVar", "Please Select Value");
    }

    When I run this I am getting errors.

    Please Look at this issue.

    Thanks
    Phani.
    Hi Phani,

    Make your value of '0'th element in the list as null or '', so your code will be like :

    
    tw.local.myVarList=
    
    new tw.object.listOf.NameValuePair(); tw.local.myVarList[0]=
    
    new tw.object.NameValuePair(); tw.local.myVarList[0].name=
    ''; tw.local.myVarList[0].value=
    "";
    


    And check your validation like :
    
    
    
    if(tw.local.myVar.value == 
    '') 
    { tw.system.addCoachValidationError(tw.system.coachValidation, 
    "tw.local.myVar", 
    "Please Select Value"); 
    }
    


    Let me know if this is working...

    Vivek
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T10:43:24Z  
    Still not working Vivek...

    Phani.
  • PhaniRaju
    PhaniRaju
    155 Posts

    Re: Validation for Dropdown BPM 8.0.1

    ‏2013-03-04T10:44:56Z  
    Hi Venfil

    No need for Date. I have done that validation.
    Thanks for your reply.

    Need for Text Area.If you know how to do,just help me.

    Thanks
    Phani.