4 Replies Latest reply on Jun 26, 2008 2:58 AM by 666705

    ALBPM: Required Text Box in a Presentation

    666705
      Hi guys!

      I have got one required field in my presentation like Eg: "Order Number".
      My problem is: I set it as a required in the properties and I can't change the message to portugues and don't show the field's.

      I tryed to write something in "Validation Error Message" but I does not work at alll...

      If someone has idea how to work it out, feel free to suggest!!!

      Thank you very much!!!

      Leonardo Pinho
        • 1. Re: ALBPM: Required Text Box in a Presentation
          666705
          If I correctly understand the problem statement, you want to display custom message to the user if the text field has some incorrect value

          You can use the following under an if condition (PBL) : -
          showError this
          using error = "Custom Message"


          Thank you
          Regards
          Jayant
          • 2. Re: ALBPM: Required Text Box in a Presentation
            666705
            Yes Jayant!
            I want exactly that! "display custom message to the user if the text field has some incorrect value"

            But I don't know where I should write this expression.

            Should I write in "required expression" and "check expression" inside the my object?
            I tryed but I couldn't make it work...
            If I see some example where it works...

            And I also want to write code in Java rather than PBL.

            --
            Edited by leonardopinho at 06/24/2008 10:48 AM
            • 3. Re: ALBPM: Required Text Box in a Presentation
              666705
              Let us take a small scenario:

              An user enters a value in text box. If the user leaves the text box blank and clicks on submit, he should get a message saying "Text Box cannot be null"

              Implementation.
              In a BPM Object you have an attribute which is referenced to the text box in a presentation. The presentation also contains a Submit button. On Click submit invoke a Method where Server Side = False. Add the following code (in Java)

              if (this.text1 = null)
              {
              this.showError(error : "Text Box Cannot be null");
              }

              Here text1 is the name of the attribute

              If you want to call a method after submit which is a Server Side Method, you may modify the code as follows:

              flag = 0;
              if (this.text1 == null)
              {
              this.showError(error : "Text Box Cannot be null");
              flag = 1;
              }
              if (flag == 0)
              this.callMethod();


              Hope this helps.
              • 4. Re: ALBPM: Required Text Box in a Presentation
                666705
                Thanks!!!
                I did it and it works fine!
                I was forced to change the submit button Action to "action".
                and I added this code:

                boolean hasErro = false;
                if (this.cod_pedido == null){  
                hasError = true;
                this.showError(error : "Código do Pedido - Campo obrigatório");
                }
                if(!hasError){
                this.submit(text : "submit");
                }

                I couldn't make a link to the component in order to click and go to the field in the Presentation(The same way as default message)
                But anyway it solves my problem!
                Now I m going to test ServerSide method...

                Thanks for helping!!!