Date Validator in Input Processor

Hi, I would like to validate a date in a Input Processor, but I don't find a validator
like "STRING_VALIDTOR", "EMAIL_VALIDATOR" or "PHONE_VALIDATOR", etc...
Does any one have any idea.
Thanks Ben.

Hi
I dont think this is available out of the box, but it is pretty easy to write
your own
check the samples(a custom validator is included)
You can also use regular expressions (a regex validator does ship out of the box).
search the net for a regex that represents a date.
(e.g. http://www.regxlib.com/REDetails.aspx?regexp_id=369)
I think in portal 4.0 the regex classes were missing, dunno if this has been
fixed in later versions
regards
deepak
"Ben" <[email protected]> wrote:
>
Hi, I would like to validate a date in a Input Processor, but I don't
find a validator
like "STRING_VALIDTOR", "EMAIL_VALIDATOR" or "PHONE_VALIDATOR", etc...
Does any one have any idea.
Thanks Ben.

Similar Messages

  • Help with date validation on input boxes.

    I need some help with date validation on input boxes.
    What I�m trying to create is a form where a user inputs dates and then the rest of the form calculates the other dates for them.
    i.e. � A user inputs 2 dates (A & B) and then a 3rd date which is 11 weeks before date B is calculated automatically.
    Is this possible and if so how do I do it ???
    Thanks

    Hi,
    to get third date try this:
    java.util.Date bDate = ...;
    Calendar yourCalendar = new GregorianCalendar();
    yourCalendar.setTime(bDate);
    yourCalendar.roll(Calendar.WEEK_OF_YEAR, -11);
    java.util.Date cDate = yourCalendar.getTime();Regards
    Ldinka

  • Data corruption in input processor

    Hi,
    We have class scoped variables in the input processor. What is happening is that
    when userA and userB are trying to access the screen concurrently userA's class
    scoped variables start showing data of userB. Does anyone know if the webflow
    framework is handling the input processor objects lifecycle in a special way.
    Also, after changing from class scope to method scope the problem seem to go away.
    Any help appreciated.
    Thanks.
    Pasari

    Hi!
    I've seen this before on many occasions. As you've noticed, it only occurs on some messages and when the number of threads gets higher and higher. All it is, is a problem with the threading of the underlying java VM. Your solution, and I kidd you not, is to install the latest java VM as they have fixed threading issues and have properly synchronized the necessary blocks of code.
    Cheers,
    Mike
    ps Do I get my points? :-)

  • Character Encoding in Input Processor

    hi,
    I am running Portal 4.0. I am using the <portlet:form> tag to create a
    formular. I send the data to an Input Processor. The IP grabs the parameter
    with request.getParameter("xyz"). Inside the IP the character encoding does
    not work. I need support for the german "umlaute". Theses characters are not
    displayed properly. Hoc can I set the character encoding inside of the IP?
    Regards
    Michael

    on the form processing page, you probably need to call request.setCharacterEncoding("UTF-8") (or whatever encoding you're using) before reading any values.
    Reply #14 of this post has some test page with Chinese which should work as is...
    http://forum.java.sun.com/thread.jspa?forumID=513&threadID=546863

  • Validating keyboard input data

    I am new to java and have a question regarding validating input.
    I did check the FAQ for "Validating keyboard input data" but found no help.
    I have to check that the keyboard input is only one of the following char a c,C,d,D
    Ihave tried different conditional loops and statements but cannot get it right.
    Could someone point me in the right direction.
    I am using the latest java.
    Thanx

    well i think i am close but i can't figure out why i have an endless loop or how to fix it
    System.out.print("Please enter the Costumer Type C or R: ");
    String cosTypeTemp = scan.nextLine();
    cosType = cosTypeTemp.charAt(0);
    while (cosType != 'c' || cosType != 'C' || cosType != 'd' || cosType != 'D');
    do
    costumerType = 'N';
    System.out.print("Wrong input please enter the Costumer Type c or r: ");
    cosTypeTemp = scan.nextLine();
    cosType = cosTypeTemp.charAt(0);
    while (cosType != 'c' || cosType != 'C' || cosType != 'd' || cosType != 'D');
    costumerType = cosType;
    System.out.print("Please enter the Number of basic service connections: ");
    System.out.print("Please enter the Costumer Type C or R: ");
    String cosTypeTemp = scan.nextLine();
    cosType = cosTypeTemp.charAt(0);
    while (cosType != 'c' || cosType != 'C' || cosType != 'd' || cosType != 'D');
    do
    costumerType = 'N';
    System.out.print("Wrong input please enter the Costumer Type c or r: ");
    cosTypeTemp = scan.nextLine();
    cosType = cosTypeTemp.charAt(0);
    while (cosType != 'c' || cosType != 'C' || cosType != 'd' || cosType != 'D');
    costumerType = cosType;
    System.out.print("Please enter the Number of basic service connections: ");
    numBsSrvConecs = scan.nextInt();
    when i enter the correct data ( c, C, d, D) it goes into infinite loop and never reaches the next keyboard scan for System.out.print("Please enter the Costumer Type C or R: ");

  • ABAP - input data validation

    I have been trying to look through the forum for means of input data validation to no vail. It is necessary to validate data before saving in database. There is an interface IF_WD_VALIDATION out there which seems to handle this task but no more information is provided on how to use it. Does anyone know more about it?
    By validation, I mean verification of:
    data type
    data value (min value, max value)
    data dependence (a<b, or a>b)
    Your suggestion is appreciated.

    There is more solution to validate fields.
    If you import adaptiev RFC model, Dynpro will make validation.
    Secend vay is to put validation in setters function and raise exception if is not valide
    public void setName(String name)
      if(name.length() > 100) throw new Exception("name is to loong");
      this.name = name;
    or mabie more simpliest is to make boolean function check()
    If you want stop workflow in not valide case you can do with
    wdComponentAPI.getMessageManager().raiseException("message", true)

  • Inputs for Data validation

    Hi,
    can anyone share the inputs for data validation.
    Source data to SAP retail data
    any validation tools?
    any enay method to extract data from SAP, apart from tables
    Regards,
    Arun

    Hi vamsi nagaraju
    it depends on wich version of ECC you are using, if you are using ECC 6.0 or ECC 5.0 all records are in table FAGLFLEXT but if you are using R/3 4.7, 4.6 etc, all records are in ECMCT for consolidation purposes.
    Try to run T-code F.01 for balance sheet in both versions.
    which validations do you want?
    regards!!

  • How to do validation of input fields

    Hi all,
              I have a rquirement to do the validation of input fields.Can anybody explain me how to go for that???Please explain in detail.U can also give me a link where i can find the tutorial for doing this.

    Hi Amit,
    What everyone has said above is correct - in the method of your action simply test for whatever condition you need to validate for.  However, the following tutorial shows you how to use Web Dynpro's Message Manager to display the messages on the screen in an easy user-friendly way:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/a%20simple%20input%20form%20with%20message%20and%20error%20service%20support.pdf">Enabling Message and Error Support</a>
    In addition, there are some validations that are done automatically depending on what you have your input fields set to - for instance, if you bind your input field to a date and a user enters words into the field instead of an actual date, it will automatically display an error message.  To learn how to turn this feature on and off, see this tutorial
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/edf6ea90-0201-0010-7696-a68662381c12">Using Validating and Non-Validating Actions</a>

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

  • How to do a date validation with leap years

    I'm doing a date validation program in my Java class, and well it's pretty hard (for me that is). I have to be able to type in a date, have it say whether it's a leap year or not, and print out the number of days in the month. It seems pretty straight forward, but I get confused on trying to do the 'if else' statements and even the simplest things like getting the day prompting to work. >< The years I'm doing only goes through 1000 to 1999, so that's why those numbers are there. The program isn't complete, so if anyone could help show me what I'm doing wrong in the areas I'm working on then I'd appreciate it...and I'm still kind of in the basics of Java so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced so yea.
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    }

    Here are some helpfull hints for you:
    1. Your code is really hard to read, there are two main reasons for this. First, your indentation sucks. Second, you seem to be fascinated with saving two (ok four if you count the shift key) keypresses to avoid using { and }.
    2. Not using the brackets (you know { and } which you like to avoid) also is causing your code to do some stuff you don't realize or want to happen, or at least it would be if your code compiled.
    3. If statements require arguements, "year == 1" is an arguement, "3" is not an arguement. Each operator like the or operator ("||") is essentially a new if and requires a complete arguement. So the following code peice:
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)Literally translates to if year equals 1 or if 3 or if 5 or if 7 or if 8 or if 10 or if 12. Doesn't make much sense in english, and it doesn't make much sense in Java either.
    4. I am pretty sure "year" is not the variable you want in the code snippet above (the one used in hint 3), especially considering years 1, 3, 5, 7, 8, 10, and 12 are not between 1000 and 1999. You need to be really carefull not make these kind of mistakes when coding, because they are by far the hardest to track down and fix later since they don't really throw up any flags or anything at compile or run time. Take your time and think thuroughly about each line of code while coding it, it will save you tons of time in the long run.
    5. What exactly do you expect statements like "month = month;" to do? That translates as make month equal to month. Do you go to the bank and say " I have exactly $3.56 in my pocket, so I would like to deposite all $3.56 and then withdraw $3.56 and put it back in my pocket"? How do you think the teller would look at you? Teller would probably do it, but the teller would feel like he/she wasted time with you and that you are not really right in the head. Java feels the same way when you make it do the same thing, and you love to do it.
    6. Code like the following is all wrong, and for more reasons than pointed out in hint 5.
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;Let's say someone put 13 in as the month. It passes the first check because 13 is greater than or equal to 1. so month which is 13, now gets set to 13 (gee that was effective). Now we hit the else and things get confusing because you didn't use brackets or proper indentation (hint 1) so we don't know what your real intent was. Did you mean else do nothing, and the next if statement is then executed, or did you mean to just run the next if statement if the else condition was met? Fortunatly it doesn't matter here because the next if statement is failed anyways since 13 is not less than or equal to 12.
    So, we leave this code with month ebing 13, wait when did we add a 13th month to the calendar? Are you using the Jewish calendar? Could be, except even if I put 1234567 as the month your code would except it as valid, and I know no calendar with that many months. Try writing this in english first and translating it to jave, like i would probably say "if the month is greater than or equal to 1 and less than or equal to 12 then the month is valid." Course now what do you do if it is invalid? Hmm, maybe I would actually say "while the month is less than 1 or greater than 12 ask the user for the month" until they get it right.
    There are a few other problems, but most of them are probably things you haven't learned yet, and they are not show stoppers so we will let them fly. You already have a lot of work to do to make this better. But I do have one more really really big usefull hint for you:
    Never, ever, under any circumstances, should you ever ask in any way or even hint at asking for someone else to provide code solutions to your problems. So "so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced " was a very bad thing to do, but fortunatly for you you followed it with proof you were trying to write the code yourself. Had the code you provided not been so full of problems it was obvious a beginner wrote it, you would probably have gotten much less cordial responses. I would seriously consider avoiding any implication of wanting code, at least until you become a regular poster here and people know you are not just looking to get your homework done for you.
    Hope some of this helps.
    JSG

  • Validation of input parameters in Oracle BI Publisher reports

    Hi
    I am new to Oracle Bi Publisher.
    In my project i am using oracle BIPfor generating simple reports.
    here i need validation for input parameters (Date field) and i want to make it (Date field) disable, so that user can select the date through the Calendar component only.
    Can anyone please provide me the solution in detail, it is urgent.

    I have the same task to validate input parameters with Oracle BI Publisher 5.6.3 running under Oracle eBS 10.5.10.2. My validation goes beyond of what I can do during parameter registration. I am using Data Templates.
    My first logical place was the before report trigger. So, I built a report trigger which returns 'false' in case the parameters are not proper. Guess what... XMLP just returns a hard-coded message
    !!Error : trigger '" + datatrigger.getName() + "' returns status as 'false'
    First of all, this is a bad style to hardcode messages visible by the user (especially during French implementation). Second of all, it is not informative at all. It would be nice to change oracle.apps.xdo.dataengine.XMLPGEN.executeTrigger() to read, for example, a message from the message stack when the trigger returns 'false' and let the user read it.
    Anyway, what I did was I built a special data group, decalred before any other data group, query like
    select my_package.my_validation fro dual
    If parameters fail the validation my PL/SQL package throws an application exception with a message. At least, in this case the error message gets available as the description of the concurrent request.
    I wish the before report trigger worked!!!

  • Losing Data Validation Messages when writing back to context

    ( The base for this question is the ALV grid in section 2 of this [TimeSheetMockUp|http://www.duke.edu/~michaelm/TimeCard/AnnotatedTimeSheet.jpg] )
    Users enter values in the white cells which represent the hours recorded on a given day for a certain type of time.  
    Lets say we have a z-object that supplies us with the overall grid structure, including the headers and (the shaded) summarization cells. The web dynpro ALV had been set to allow input only on the raw data cells. They are set to 4 places with one decimal.
    As the app was being developed, when we entered invalid data in a cell, such as 123456, or 1.2345 or u2018qu2019, a nice message was displayed that told the us about the issue.  This was free u2013 I guess the phase model does that for us, and we liked it.
    Well, down the road a pieceu2026 we needed to add a method to recalc all the summary values from the raw inputs. 
    METHOD wddoafteraction .
    * wizard: navigate to and get the rows data                         *
      DATA lo_nd_nd_rows TYPE REF TO if_wd_context_node.
      DATA lt_nd_rows TYPE wd_this->elements_nd_rows.
    * navigate from <CONTEXT> to <ND_ROWS> via lead selection
      lo_nd_nd_rows = wd_context->get_child_node( name = wd_this->wdctx_nd_rows ).
      lo_nd_nd_rows->get_static_attributes_table( IMPORTING table = lt_nd_rows ).
    * do the math                                                       *
      DATA lt_updated_rows TYPE wd_this->elements_nd_rows.
      CALL METHOD wd_assist->o_wc->recalc_update_and_return_wrows
        EXPORTING
          im_rows = lt_nd_rows
        IMPORTING
          ex_rows = lt_updated_rows.
    * repopulate the rows                                      *
      lo_nd_nd_rows->bind_table( new_items = lt_updated_rows set_initial_elements = abap_true ).
    Now, weu2019re losing all the nice data validation messages u2013 they do not display (the offending entries are just cleared) !!!
    After some investigation, it seems that the bind_table call is where they get lost (without that call, they appear) .
    Iu2019ve tried placing this code in a number of hook methods, but the same thing occurs.  It is currently in the viewu2019s afteraction hook.
    So, u2026 I have two questions.
    u2022     How do I get my nice messages back. ?
    u2022      Where is the right place to update my context from 
    ( Btw, downstream, our recalc outines will also want to throw messages that we will want processed after we get through the initial validation  )
    Thanksu2026
    u2026Mike

    Fixed with SAP Note 1410122 - WD ABAP ALV: Messages are not displayed

  • Trouble with a data validating loop.

    So I tried to make a data validation loop to make sure no single number in an array are the same.
    At first I thought it was working fine, but after the sixth test, I noticed I had two of the number "5".
    Based on looking at my code, it seems like it could work, but I could not be seeing something significant.
    Anyone have any advice or suggestions?
    Oh and also, MAX_PICK is a static final int set to 47
    picks[0] = randomNumbers.nextInt(MAX_PICK);
    picks[1] = randomNumbers.nextInt(MAX_PICK);
    picks[2] = randomNumbers.nextInt(MAX_PICK);
    picks[3] = randomNumbers.nextInt(MAX_PICK);
    picks[4] = randomNumbers.nextInt(MAX_PICK);
    while(!valid)
         for(int i=0;i<=4;i++)
             if     (picks[i] == picks[0] ||
                  picks[i] == picks[1] ||
                  picks[i] == picks[2] ||
                  picks[i] == picks[3] ||
                  picks[i] == picks[4])
                       picks[i] = randomNumbers.nextInt(MAX_PICK);
             valid = true;
    }One thing I just noticed is also, lets say i = 4 and when it compares picks[i] to picks[4] , it will go in the statement anyway, causing it to change picks[4] to another number which could by chance be the same as picks[3]. Is there a way around this? I was thinking about maybe a while loop with the condition the if statement has, but then the loop would run forever. Any insight?
    Much Appreciated.

    * Created on 2007&#24180;10&#26376;10&#26085;
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    import java.util.*;
    public class MyRan {
         static int picks[];
    public static void main(String args[]) {
         int MAX_NUM = 5;
         picks = new int[5];
         Random generator2 = new Random( System.currentTimeMillis() );
         //                    picks[j] = generator2.nextInt(MAX_PICK+1);
         System.out.println("======");
         for(int i=0;i<=4;i++)
         picks[i] = generator2.nextInt(MAX_NUM)+1;
         while(!check(picks))        
                for (int i=0; i<5; i++)
                      for (int k=0; k<5; k++)
                            if (i!=k)
                                 boolean genSuccess = false;
                                 if (picks==picks[k])
                                  while (!genSuccess)
                                       picks[k] = generator2.nextInt(MAX_NUM)+1;
                                       if (picks[i]!=picks[k])
                                            genSuccess = true;
         for (int i=0; i<5; i++) {
              System.out.println(picks[i]);
    public static boolean check(int input[])
         int duplicateCount = 0;
         for (int i=0; i<input.length; i++)
              for (int k=0; k<input.length; k++)
                   if (i!=k)
                        if (input[i]==input[k])
                             duplicateCount++;
         if (duplicateCount>0)
              return false;
         else
              return true;

  • Form Data Validations

    Imagine there is a field called "Username" ,"Password" and "Submit button".
    I want to implement following validations on click of "Submit" button.
    1 . Please enter Username.
    2.  Username should have a length of 10 characters.
    3.  Please enter Password.
    I want the validation procedure in 2 ways.
    1. The process of validation by indvidual criteria
    Example:
    displaying each validation message by validating all bussiness criteria one by one.
    That is in the above "Username" will be validated first.
    If user enters value it will check for number of characters less then 10.
    If this is passed then need to check for password entry.
    2.  Validating complete form at once
    Validating complete form for all bussiness conditions and displaying them at once.
    Please provide any links for data validations.

    Hey Raghu,
    you can implement a method like checkFields() in the "@@begin others" part of your view which returns a boolean value. When you press the "SUBMIT"-button it is checked whether every mandatory field is filled with the correct data. There you can implement the logic of your query.
    Here is an example for the method <b>checkFields()</b>:
    /** Checks whether the mandatory input fields are filled with regular data. */     
      private boolean checkFields()
         if ( wdContext.currentFreightrequestElement().getTitleInputField() == null ||
                   wdContext.currentFreightrequestElement().getTitleInputField().trim().length() == 0 )
              wdComponentAPI.getMessageManager().
                   reportContextAttributeMessage(wdContext.currentFreightrequestElement(),
                   wdContext.nodeFreightrequest().getNodeInfo().getAttribute(ATTRIBUTE_TITLE_INPUT_FIELD),
                   IMessageFreightRequestComponent.ERROR__01,
                   null,
                   false);
              return false;
    The important thing is the <b>reportContextAttributeMessage()</b> which highlightens a field you want to check.
    In the action-part you can use parts of the following code:
    boolean success = false;
         if ( checkFields()) {
              success = wdThis.wdGetRequestComponentController().executeSave();
         if (success == true)
              IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
              String dialogText = wdComponentAPI.getTextAccessor().getText("TEXT_03");
              IWDConfirmationDialog dialog =
                   wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText, controllerInfo.findInEventHandlers("createNewRequest"),wdComponentAPI.getTextAccessor().getText("TEXT_04"));
              dialog.addChoice(controllerInfo.findInEventHandlers("returnToWelcomeView"), wdComponentAPI.getTextAccessor().getText("TEXT_05"));          
              dialog.setTitle(wdComponentAPI.getTextAccessor().getText("TEXT_02"));
              dialog.show();          
    So far,
    Domingo

  • Viewset - active view and data validation problem

    Hey there,
    I've a problem while using a viewset (1 col, 2 rows) and the data-validation in the wdDoBeforeAction() method.
    My application works basically like this:
    The first view is displayed with 2 mandatory input fields. Upon the evaluation result of the entered data in these fields, a corresponding second view will be displayed. The input fields in the first view are set to read only and a button named "Change" appears. This button triggers an action which fires and outbound-plug to an empty view, so that the second view disappears and resets the "read only" properties of the input fields in the first view, so that the user can enter new data.
    The problem is, that the second view contains input fields itself, which are validated in the wdDoBeforeAction() method of this view. The navigation is cancelled if an error occurs. Well, this is fine if i want to submit (pressing the button "Approve" in the second view) this data and proceed, but if i want to go back to the first view (by hitting the "Change" button), i want to discard all information entered in the second view and i dont want this data to be validated. It's quite annoying if u just want to correct the first views data but have to enter correct values for the second view in order to get through the second views checks..
    I hope that's clear enough, otherwise i will upload a screenshot to clarify.
    Thx in advance
    Regards
    Pascal

    Hi Pascal,
    although I wont prefer to do so for reasons of readability, you could use wdDoProcessbeforeAction to control your view-flow.
    Take a look at the example, I have two Buttons with two actions, one is set on "Validate", the other is not (guess which on is the validating ).
    You can get the action triggered inside the doBefore ... method and determine whether or not the checkbox is set.
    So put your code to validate the input in the i(isValidting) branch and your problems are solved.
    Keep in Mind: I would delegate the Validation from the view to the controller, handle the validation myself with custom coding and then check in the view controller if any errors occured.
    hope that helped,
    Jan
      //@@end
      public void wdDoBeforeAction(com.sap.tc.webdynpro.progmodel.api.IWDBeforeAction validation)
        //@@begin wdDoBeforeAction
           IWDAction currentAction = validation.getCurrentAction();
           if (currentAction == null) return;
           String action = currentAction.getText();
           boolean isValidating = currentAction.isValidating();
           if (isValidating) {
                wdComponentAPI.getMessageManager().reportException(action);
           } else {
                wdComponentAPI.getMessageManager().reportSuccess(action);
        //@@end
    Edited by: Jan Galinski (Holisticon) on Sep 8, 2009 3:15 PM

Maybe you are looking for