Validation for transient VO/table rows

Hi,
I have 2 pages:
1. First page is an entry page with an editable table like this (It's backed by a transient VO which I initialize with some blank lines.) and a submit button:
Part Type (dropdown)          Part num (text box)          Quantity (text box)     
2. Second page is a read only table that shows results from the same transient VO with additional info.
Part Type          Part num          quantity     price
When hitting the submit button on the first page, I'd like to run a custom validator that validates each row in the entry page table.
Since it's a transient VO and has no entity object, I didn't know how to do it in the model. The validation should use the part type and part code values and call a database API to do tha validation, and then display the message from the API in the part code text box.
I got it to (sort of) work using a validator method in a backing bean.
This is how I implemented the part validation (on first page).
     - Make part type autosubmit = true.
     - Make the editable table bind to the backing bean - it basically has a getTable1() and setTable1 method.
     - Add validator to Part num column.
     - In the validator code in the backing bean, use
          it3_validator(FacesContext facesContext,
                              UIComponent uIComponent, Object object)
             FacesCtrlHierNodeBinding q = (FacesCtrlHierNodeBinding)this.getTable1().getRowData();
             Row currentRow  = q.getRow();
          OperationBinding method = getBindings().getOperationBinding("validateItem");  //call database api in AM
                 method.getParamsMap().put("item_number_in",(String)object);
             method.getParamsMap().put("item_type_in",(String)currentRow.getAttribute("PartType"));
          map = (HashMap)method.execute();
             if (map.get("valid_item")!= null && map.get("valid_item").toString().compareToIgnoreCase("Y") != 0)
                      String msgS = (String)map.get("error_msg");
                      FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, msgS, msgS);
                      facesContext.addMessage(uIComponent.getClientId(facesContext), message);
                      ((RichInputText)uIComponent).setValid(false);                        
     It works, but once a part no in a row becomes invalid it doesn't recognize changes in the part type in that row. How can I set it so that when I change part type, the validation recognizes that I've change the part type? So if I enter a correct part num but wrong pary type, and then change part type to correct value, it should not throw error message again.
Should I even be doing this in the backing bean? Is there some way I can just implement it in the model so I don't have to worry about getting row level info from getTable1?
I'd posted on this before, but the solution I tried didn't really work at all (the implementing-custom-generic-plsql uses entity object to execute the db api)
Re: Validation using a DB function
I'm using JDev 11.1.1.2.0
thanks,
Kalp

Thank you Timo that helps me understand the validation behavior..
I added this in the AM and it'scalling the validation:
        Row[] rows = vo.getAllRowsInRange();
        for (Row row : rows)
            row.validate();
        }and I added more code to the validation:
    @Override
    public void validate(){
        System.out.println("Validate in transient vo");
        System.out.println("getPartType from rowimpl:"+getPartType());
        System.out.println("getPartCode from rowimpl:"+getPartCode());       
        HashMap map = new HashMap();
        map = validateItem(getPartCode().toString(),getPartType().toString());
        if (map.get("valid_item")!= null && map.get("valid_item").toString().compareToIgnoreCase("Y") != 0)
            throw new JboException(map.get("error_msg").toString());
        super.validate();
    }   The message then appears as a popup which shows the error message for the first invalid row and also doesnt stop the navigation to next page.
So I changed to:
   @Override
    public void validate(){
        System.out.println("Validate in transient vo");
        System.out.println("getPartType from rowimpl:"+getPartType());
        System.out.println("getPartCode from rowimpl:"+getPartCode());       
        HashMap map = new HashMap();
        map = validateItem(getPartCode().toString(),getPartType().toString());
        if (map.get("valid_item")!= null && map.get("valid_item").toString().compareToIgnoreCase("Y") != 0)
            FacesContext fctx = FacesContext.getCurrentInstance();
            String msgS = (String)map.get("error_msg");
            FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, msgS, msgS);
            fctx.addMessage(null, message);
        super.validate();
    }   This is better, but still I don't know how to tie the error message to a UI component. This shows the list of validation messages in the popup but I want to tie the corresponding error message to the part code for the invalid row in the editable table UI.
I want it to have the same look/feel/behavior as when I add something like a Compare validator on an attribute in the VO. If I add a validator like Compare to 10, then the message is tied to the specific cell
in the UI table and it stops navigation.
How can I mimic this "seeded" type of behavior?
Thanks for your help on this!
thanks,
Kalp

Similar Messages

  • How to create editable tablecells for a single table row dynamically?

    Hi
    How to make the cell of a tablerow editable based on flag in backing list object bound to row? I can't decide the editable property while creating table columns. So i can't use setCellFactory() during creation. However setCellFactory() makes all cells in table column editable.How to make non-editable table row cell editable and vice-versa based on flag?

    hi
    good
    if you want to create two different view for a same table than you cant give the same name for the same view,otherwise it would allow you to create the view.Try out with different view name as well as the function group name,i hope this ll work.
    thanks
    mrutyun^

  • Validation for loaded mapping tables

    Hi
    As I know FDM doesn't validate maps imported from the file. If there is any way to do a validation for these maps? May be using any Event script?

    Hi Tushar,
       I see following benifits in storing mapping tables on R3 -
       1. R3 being the bigger system, you will have more information available for mapping in R3. E.g. if a mapping depends on some attribute of data like "material type" you have that information avialable in R3 whereas you need to have a process to pull this information into Biztalk from R3 and keep it in sync.
       2. You can reuse the mapping logic for other interfaces if coded correctly, e.g. function modules for mapping.
       3. Tomorrow if biztalk is replaced with XI, there is less impact because you need not worry about mapping logic which is alreay there in R3.
      Lastly I don't see any real reason why it should have an y impact on upgrade because you are going to use tables in customer name range. It only increases the number of tables in customer name range. Usually people calculate the cost of an upgrade based on level of customization done in the system and that is genrally linked to number of objects in customer name range. But If think pragmatically there is no impact on upgrade cost because these kind of customization do not affect upgrade.
    Cheers,
    Sanjeev

  • Generating Indiex for dynamically added table rows  in HRFORMS

    Hi ,
    We are developing Payslip  in HRFORMS by copying standard form.
    We have got one business scenario which requires a table rows needs to generated dynamically to populate the retro values in the form.
    We could able to generate the table rows dynamically by below command in HRFORMs scripts.
    Table1.Row.InstanceManager.addInstance(1) but it is not generating with correct index.
    Please help in adding table rows dynamically at specified index.
    Regards,
    akula

    You can do that with 2 differents ways :
    by creating a colomn key which is the concatenation of the key for each lin
    by using field groups
    I think you have to use the second one.
    [sample by help|http://help.sap.com/saphelp_nw70/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm]
    In this case you can put dynamiquely what are you wanted in your keys.
    Regards,
    Christophe.

  • Possible bug: validation errors raise at table row and current row is lost

    Hi everybody,
    I've just implemented a simple test case against the HR schema:
    1. Create Business Components from Tables: choose only Employees. That will generate Employees EO, EmployeesView VO, associations, viewlinks and AppModule with the following hierarchy: EmployeesView1 > EmployeesView2
    2. Create a simple page with an ADF Table based on EmployeesView1.
    3. Surround af:table with af:panelCollection
    4. Add toolbar buttons to the af:panelCollection "toolbar" facet:
    <f:facet name="toolbar">
      <af:toolbar id="t2">
        <af:commandToolbarButton actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert" disabled="#{!bindings.CreateInsert.enabled}" id="ctb1" partialTriggers="t1"/>
        <af:commandToolbarButton actionListener="#{bindings.Delete.execute}" text="Delete" disabled="#{!bindings.Delete.enabled}" id="ctb2" partialTriggers="t1"/>
      </af:toolbar>
    </f:facet>5. Create a af:panelGroupLayout that encloses everything under af:form
    <af:document id="d1" title="Employees">
      <af:messages id="m1"/>
      <af:form id="f1">
        <af:panelGroupLayout id="pgl1" partialTriggers="pc1:ctb1 pc1:ctb2">
    ...6. Delete the LastName field for any row in the table and click anywhere on the next row in the table. This will raise a mandatory field validation error. At this point, the selected row is the one you've just clicked on, but the focus (mouse cursor) is in the LastName field that raised the error.
    7. Fill in the LastName field. Don't click on it; just write something, as the field is already focused.
    8. Click the CreateInsert button
    Result: The current row is still the one you clicked on before, not the newly created row. If you click on this new row to fill in its fields, validation errors raise for every mandatory field.
    I'd appreciate any help on this. I can send you the test case if necessary.
    Thanks in advance,
    Barbara
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60

    Hi,
    if you
    1. Select (click) a row to edit last name (don't edit last name though)
    2 Press "CreateInsert"
    Does this then make the new row becoming the current if nor errors are shown ?
    Frank
    Ps.: If so, please send me the test case. My mail address is in my OTN profile. Just zip the workspace and change the ".zip" extension to something like ".unzpme" because the Oracle firewall bounces all mails with zip attachements

  • Trigger validation for upat event in row level

    Hi,
    i have a emp table with 100 columns.Iwrote  a trigger for insert and update like bellow.
    create or replace trigge t_emp
    AFTER INSERT OR UPDATE ON  emp
      REFERENCING NEW AS NEW OLD AS OLD 
    FOR EACH ROW 
    BEGIN
    if inserting then
    insert into emp_temp1 values(:new.1,:new.2.....);
    elsif updating then
    insert into emp_temp2 values(:new.1,:new.2...);
    end if;
    end;
    for insert and update i am able to get records perfect.My problem is if i open a record in emp and modify the colum with same value then also i am getting record into emp_temp2.i don't want duplicate so if i wrote like bellow
    IF :OLD.1<>:NEW1 OR :OLD.2<>:NEW.2 like  then i won't get duplicate but there are 100's of columns is there .So is there any alternative for record level validation.
    remember here is no primary keys...

    Either check all your columns or create a primary key or unique constraint or unique index

  • Requirements Gateway - Searching for requirements in table rows in a Adobe PDF file

    In my quest for creating a good understanding of the coverage of requirements of my test cases I download the NIRG (NI Requirements Gateway) and started out importing my SRS (System Requirement Specifications) documents and some of the test cases. There are many different types of sources which can be imported (Word, Excel, Visio, Access, PDF, ...) and NIRG uses REGEX (Regular Expressions) for extracting the requirement and coverage information of the sources. NI have defined some standardized REGEX formats but they (NI) have also made it possible for tweaking these to fit your purpose. 
    Instead of adding/changing the SRS documents to fit these standardized REGEX formats, I dived into how to create REGEX for my purpose. 
    Check out 
    - http://www.regular-expressions.info/ 
    - http://opencompany.org/download/regex-cheatsheet.pdf 
    NI Requirements Gateway Coupling Series 
    (http://zone.ni.com/devzone/cda/tut/p/id/8414)
    NI Requirements Gateway for Test, Measurement, and Control Applications 
    (http://zone.ni.com/devzone/cda/tut/p/id/3721)
    Is there anyone who have any experience on using NIRG on a PDF document to get information from the rows in a table?
    Best Regards,
    Marcus
    Marcus Törndahl
    Senior Software Designer @ Prevas AB

    Hi Manooch_H,
    Here is the example document and thank you for taking the time and helping me out .
    The columns which I would like to import into NIRG are actually all of them. The UC, Verification, Priority and Responsible columns should be imported as attributes to the requirement. The ID and Requirement columns should be imported as the Requirement and Text respectivaly.
    Best regards,
    Marcus
    Marcus Törndahl
    Senior Software Designer @ Prevas AB
    Attachments:
    SRS.pdf ‏212 KB

  • How to do validations for a Z*table through Sm30

    I have a requirement wherein i have to validate the data before making updations through SM30 Tcode for  Z*table.
    Any pointers will be greatly appreciated.
    Regards,
    satheesh.

    There are user-exits available for this. In the Table Maintenance generator navigate in menu Enviroment-> Modification -> Events.
    You can have sevaral events here...for example 01     Before saving the data in the database, would be ok for your situation. It will create an include for you where you can put your code....it won't be lost when you make changes in the table generation.
    Peter

  • Is it possible to enable/disable table row selection?

    I have a situation where a user can add rows to a "selection" table with a value that is used to perform a query to get a collection of objects associated with that value. Once those objects are available, a second "results" table will be populated with the row(s) returned. When the value is entered in the selection table, a web service call is made to perform the query and return the results. This may take a few moments and I am displaying an indeterminate progress indicator for the selection table row involved to indicate that the data is not yet available - the progress indicator is included as a column in the row; each row has its own indicator. Once the results are received the indicator is hidden to indicate the query for that row has completed. The user may enter as many rows in the selection table as they wish so there is a distinct possibility of multiple queries being executed at a given time. I have also attached a row selection listener to the selection table such that when a given row is selected, the results table will display the corresponding associated row(s).
    What I'd like to be able to do is somehow temporarily disable the selection of any row that has a query in progress, while leaving other rows whose queries have completed be selectable. Once the query completes, the row can then become selectable, thus allowing for the results to be loaded and displayed in the results table. The way it works right now, if the row is selected while the query is still in progress, nothing is displayed (obviously), but then the row has to be re-selected after the query has completed to see the results. This is a viable (though undesirable) solution/workaround if there is at least one other row in the table. However, if the row is the only row in the table and has been selected, it cannot be re-selected (there's no other row to select to allow for re-selection). To boil it down, what I'd like to do is prevent the selection of the row until the query for that row is complete.
    After perusing the JavaFX 2.2 API, I'm not seeing any obvious way to achieve this effect. If anyone has any solutions, suggestions, etc. on how this could be done I'd appreciate it greatly.

    Here's an [url https://github.com/james-d/Conditionally-selectable-table]example. As predicted, keyboard navigation fails if the keyboard presses would result in an unselectable item being selected using the default selection model. The best workaround I can see for this is to register event filters for the appropriate keyboard strokes, as in the previously referenced thread.
    Update: That code won't run in the current (ea b90) release of JavaFX 8.0, and probably a few recent releases; it will however run in the final release (and it runs in JDK 7). See [url https://javafx-jira.kenai.com/browse/RT-30593]RT-30593
    Edited by: James_D on May 22, 2013 7:51 PM

  • Print each table row at new page in PDF

    Hi All,
    I have a very specific requirement for Adobe forms.
    1. I have to print a table which can flow upto several pages and after that i have a structure which is having some fields which needs to be displayed at last page i.e at the bottom of last page like the total of all data in the table.
    2. I have to print a table in which each row should be printed at different page i.e 1st row which is again a table type can flow upto several pages then 2nd row which is a table type must be start from next page and so on.
    How can i achieve these two requirements.
    Thanks in advance,
    Nawal Kishor Mittal

    1. I have to print a table which can flow upto several pages and after that i have a structure which is having some fields which needs to be displayed at last page i.e at the bottom of last page like the total of all data in the table.
    If you use content: flowed + allow page breaks within content, then the rows will be distributed to the pages and the content which is placed in the hierarchy just after the table will appear at the bottom of the table
    I have to print a table in which each row should be printed at different page i.e 1st row which is again a table type can flow upto several pages then 2nd row which is a table type must be start from next page and so on.
    That means you will use the table of tables (create table of tables in the backend and then just display it in the form). To work with the page break/ pagination you should set up "top of next page" (tab Pagination) for every outer table row.
    Otto

  • How can we do the validation for non visible records in table control.

    Hi Experts,
      I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
      How can we do the validation for non visible records in table control.
    Regards,
    Bujji

    Hi,
    try validating material before displaying it in table control...'
    Rgds/Abhhi

  • Check for empty table row before adding date

    On the form below, when I click the green + button (far right), a new table row is created with today's date. the user can then enter more text to the right of the date. Problem is when the form is saved and reopened, the text the user enters is deleted and new today's date added because it is in the intialize event. How do I script to check and make sure each dated row is empty before adding today's date?
    https://acrobat.com/#d=qTINfyoXA-U6cDxOGgcSEw
    Thanks,
    ~Don

    Hi Don,
    One option would be to use the caption area of the textfield for the date and leave the value portion free for the user to input their data:
    if (xfa.resolveNode("this.caption.value.#text").value === "") {
              this.caption.value.text = util.printd("[mm/dd/yy] ", new Date() );
    See here: https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw.
    Hope that helps,
    Niall

  • How can i set the alternating colors for a table rows

    Dear All,
    Please any one help me how can i set the Alternating colors for Table Rows.
    i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

    Hi,
    The design property in Table properties should work for your requirement. Select "alternating" value for design.
    Please see the API below:
    design
    Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
    alternating - The table rows are displayed alternately in a different color.
    standard - The table background has one color. The individual table rows are displayed with grid net lines.
    transparent - The table background is transparent. The individual table rows are displayed without grid net lines.
    Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.
    Regards,
    Jaya.
    Edited by: VJR on Jun 17, 2009 6:43 PM

  • Row Level Security Not working for the ECC table.

    Hi All,
    We have created a crystal report using SQL Driver.
    We have set the row level security on PA0001 table so that we can restrict the query based on Company Code.
    But when I run the report, it bypasses the row level security and gives access.
    Am I missing some configuration?

    Hi Ingo,
    Security is set up using /crystal/rls transaction. A custom auth object is used for checking the company code with a single field "BUKRS".
    This custom auth object is maintained for the PA0001 table.
    This object is added at the role level with the restricted access to the Company Code..

  • Applying table scroll bar for only table rows with table columns fixed.

    hi oa gurus,
    i had implemented table scroll bars using oarawtextbean , there is no problem in vertical and horizontal scroll bar working its working fine. but the requirement is i need to scroll only the table rows with table columns fixed. so , how to achieve the table scroll for only table datas neglecting table headers.
    the code for vertical and horizontal bars scroll is like this,
    OARawTextBean ors = (OARawTextBean)webBean.findChildRecursive("raw1");
    ors.setText(div id=tabledivid style=height:500px;width:100%; overflow:auto>);
    OARawTextBean ore = (OARawTextBean)webBean.findChildRecursive("raw2");
    ore.setText("</div>");
    where raw1 and raw2 are rawtextbean created above and below of the table . but i dont know hoow to apply this only for table rows neglecting table columns , can anybody give any ideas.
    pelase this is very urgent , can u help me in this regards
    thanks
    Edited by: user630121 on Sep 29, 2008 5:17 AM
    Edited by: user630121 on Sep 29, 2008 5:18 AM

    hi,
    I have a similar task to do... Only to apply scrollbar at the table level.
    I tried using the above mentioned but I am facing Null Pointer Exception..
    Please explain about raw1 and raw2
    Rahul

Maybe you are looking for

  • Problem while sending HL7 ACK to HL7 external system

    Hello, I am facing a problem with GlassFish ESB. The product version indicated in the IDE is: NetBeans IDE 6.1 (Build 200810140114). I have not yet tested the current version. My problem is as follow: - I have 2 service assemblies, one is File BC > H

  • Listing packages to update without updating.

    Ok, here is the scenario. I want to setup a cron that would run pacman daily, and send me the output as to which packages COULD be updated, without actually updating them. something like pacman -Sy? I don't know what to put in for the question mark.

  • EJBContainer.createEJBContainer for maven project

    I have a simple javaee 6 app with a ejb I want to write a basic junit test that uses Embedded EJB Container api             System.setProperty("weblogic.home","C:\\share\\weblogic\\wls1212\\wlserver");             Properties prop = new Properties();

  • Flash player hanging with hardware acceleration enabled

    I'm having the following problem: The Flash player is working fine for some apparently random period of time, then it hangs when it is starting up in order to display a video.  This appears to happen only when hardware acceleration is enabled.  (I ha

  • Modifiy Installer to allow selection of LRCAT location

    I know the installer writer knows how ro add another option to set the location of the catalog. This is becioming very important with the advent of SSDs. We must be able to set the inital catalog location to another drive, either internal or external