[SOLVED] Row level view object validation (cross-field/multi-field)

Hi,
I'm trying to implement a validation rule across multiple view object fields in ADF 11g (11.1.1.2.0). I have 4 fields that the user needs to either leave all blank or there are some pretty complicated rules around which fields should be specified in combination. I'm having trouble using standard expression type validation rules because:
- The validation rule is always attached to a particular field
- The validation rule is not executed if the field is left blank. I need it to.
- I can't control which field the validation message shows in (it always shows in the field on which the rule is attached).
Is there any way I can hook into the v
I've found the following example that seems to tackle similar problems:
+107. Displaying ADF BC Mandatory Field Errors Using UI Hint Labels+
http://blogs.oracle.com/smuenchadf/examples/
It's fairly long and complex solution though, which quite a lot of code to be written. This example is from 10g (in 2007). Does anyone know of a more elegant way to achieve this in 11g (in 2010 :) )?

Thanks John! I didn't realise you could define entity-level rules - now found it in the Business Rules section of the entity properties.
One more question: is there any way that I can specify which field is in error when an entity-level validation fails? It would be nice if my error message was attached to the field that is in error.

Similar Messages

  • How to get first row from View Object cache.

    hi,
    I am using Jdeveloper 11.1.1.6
    can we get first row from View Object cache??
    Thanks in Advance.
    Best
    Shashidhar

    Hi Frank,
    Thanks for reply!!
    My case is:
    I have a Query based ViewObject.
    One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOVĀ  filed the value is selected.
    when i create second row LOV value got refreshed because both are in same VO.
    I need to get the LOV value of first row and set same value to second Row.
    Shashidhar

  • [SOLVED] ADF BC : View Object "second level" Entity reference issue

    hi
    If I insert a row in a View Object that uses "two levels" of Entity references, the attributes of the Entity on the "second level" don't get a value.
    Consider these tables:
    MY_ROW (MY_ROW_ID, MY_ROW_STUFF, MY_ROW_LU1_ID)
    MY_ROW_LU1 (MY_ROW_LU1_ID, MY_ROW_LU1_STUFF, MY_ROW_LU1_LU1_ID)
    MY_ROW_LU1_LU1 (MY_ROW_LU1_LU1_ID, MY_ROW_LU1_LU1_STUFF)
    Where MY_ROW.MY_ROW_LU1_ID is a "look-up" in MY_ROW_LU1 and MY_ROW_LU1.MY_ROW_LU1_LU1_ID is a "second level look-up" in MY_ROW_LU1_LU1.
    I created default Entities and Associations on these tables and a View Object that uses all 3 Entities (MyRow as Updatable, MyRowLu1 and MyRowLu1Lu1 as Reference).
    See example code in
    http://verveja.footsteps.be/~verveja/files/oracle/ViewObjectEntityReferenceIssue-v0.03.zip
    (contains no Java code, all out-of-the-box ADF BC)
    problem scenario:
    If run the MyRowService Application Module in the Oracle Business Component Browser and "open" the MyRowViewAll View Object instance, I get the rows and their related "look-up values".
    If I click the "Insert a new record" button and fill out values for MyRowId, MyRowStuf and MyRowLu1IdEntity, I only get "look-up" values for the "first level". While the "second level" stays empty.
    For example, a MyRowLu1IdEntity of "2003" gives a MyRowLu1Stuff value of "2003 stuff", but no value in MyRowLu1Lu1Stuff.
    What am I doing wrong? What should I change to also get a value in the "second level" MyRowLu1Lu1Stuff attribute?
    many thanks
    Jan Vervecken

    Jan,
    If you create a view object on Emp and Dept, with Dept as a reference entity, you might choose to build the view object to only include the:
    Emp.Empno (required, since it's the PK of Emp entity usage)
    Emp.Ename (included since you want to show the ename)
    Dept.Deptno (required, since it's the PK of the Dept entity usage)
    Dept.Dname (included since you want to show the dname)
    The wizard enforces the inclusion of the required attributes above.
    When you run this view object, a join is performed and you see the reference data.
    Now, if you want to allow the user to UPDATE the reference data, you need to add one more attribute to the list of attributes:
    Emp.Empno
    Emp.Ename
    Emp.Deptno (To allow user to change Deptno employee belongs to)Dept.Deptno
    Dept.Dname
    At this point, not only is the join performed for you, but the ADF BC reference mechanism reacts to any modification of the Emp.Deptno attribute, correctly showing the reference information for that new foreign-key-referenced department (even before commiting and requerying, at which time the SQL join would pickup that correct, related information).
    The "second level" problem you describe in this thread is simply the same issue described here as a master/first-level-detail situation, taken to its logical next step. If you want the end-user to be able to change the second-level detail to which the first-level-detail is associated, you need to include the first-level-detail's foreign key attributes in the view object's select list. Otherwise, there is no foreign key attribute whose value-change event the framework can react to in order to coordinate the related reference data in the row.
    I've blogged a link to a working example of a four-level reference information view object here:
    http://radio.weblogs.com/0118231/2007/05/09.html#a818
    based on the HR schema.

  • ADF View object validation. Cannot have same column value multiple time.

    Hi Expert,
    I have a ADF viewobject validation question. I have the Department and employee view objects. Each department have multiple employees. (may be u can also assume. the employee name is an VO attribute not the database field)
    I need to implement the following validation rule
    One department shouldn't have same employee name. How can i implement this validation rule in the ADF-BC.
    Looking forward ur expert suggestions. Thanks
    -t

    Assuming that the employee name (which you have said is a transient attribute) is created by concatenating some other fields, you could, I suppose create a unique index in the DB or a unique validator in the EO to ensure that the department ID (assume you have such an attribute) and the fields that make up the name are unique. It seems kind of unusual to be validating a transient field like this.
    John

  • [SOLVED] Multiple Dynamic View Objects and View Links - ADF Tree Table

    Hi all,
    I've got a method that creates 3 dynamic viewobjects using this:
                ViewDefImpl Level1ViewDef = new ViewDefImpl("Level1View");
                Level1ViewDef.addViewAttribute("LevelDescription","LEVEL1_DESCRIPTION",String.class);
                Level1ViewDef.addViewAttribute("SetOfBooksId","SET_OF_BOOKS_ID",Number.class);
                Level1ViewDef.addViewAttribute("CodeCombinationId","CODE_COMBINATION_ID",Number.class);
                Level1ViewDef.addViewAttribute("Level1","LEVEL1",String.class);
                Level1ViewDef.addViewAttribute("AccountType","ACCOUNT_TYPE",String.class);
                Level1ViewDef.addViewAttribute("PeriodYear","PERIOD_YEAR",Number.class);
                Level1ViewDef.addViewAttribute("PeriodNum","PERIOD_NUM",Number.class);
                Level1ViewDef.addViewAttribute("PeriodName","PERIOD_NAME",String.class);
                Level1ViewDef.addViewAttribute("PtdActual","PTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("YtdActual","YTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("LtdActual","LTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("BudgetName","BUDGET_NAME",String.class);
                Level1ViewDef.addViewAttribute("BudgetVersionId","BUDGET_VERSION_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdBudget","PTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("YtdBudget","YTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("LtdBudget","LTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("EncumbranceType","ENCUMBRANCE_TYPE",String.class);
                Level1ViewDef.addViewAttribute("EncumbranceTypeId","ENCUMBRANCE_TYPE_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdCommitment","PTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("YtdCommitment","YTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("LtdCommitment","LTD_COMMITMENT",Number.class);
                Level1ViewDef.setQuery(sql_level1);
                Level1ViewDef.setFullSql(true);
                Level1ViewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
                Level1ViewDef.resolveDefObject();
                Level1ViewDef.registerDefObject();
                ViewObject vo1 = createViewObject("Level1View",Level1ViewDef);I can create the view objects fine and create a single viewlink between two of them, however i'm getting problems with 2 view links.
    This is how I'm creating a view link:
                ViewLink Level2Level1FKLink = createViewLinkBetweenViewObjects("Level2Level1FKLink1",
                                                        "Level2View",
                                                        vo1,
                                                        new AttributeDef[]{
                                                          vo1.findAttributeDef("Level1")
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level1")
                                                        "LEVEL1 = :Bind_Level1");
                ViewLink Level3Level2FKLink = createViewLinkBetweenViewObjects("Level3Level2FKLink1",
                                                        "Level3View",
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level2")
                                                        vo3,
                                                        new AttributeDef[]{
                                                          vo3.findAttributeDef("Level2")
                                                        "LEVEL2 = :Bind_Level2");I can get the data to display on an adf tree table if i'm only using a single view link, but when i try and implement 2 view link (for 3 levels on the adf tree table) i'm getting problems displaying the data.
    I'm getting the following error:
    Aug 10, 2007 2:44:39 PM oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer encodeAll
    SEVERE: Error during partial-page rendering
    oracle.jbo.NoDefException: JBO-25058: Definition Level3View of type Attribute not found in Level2View_Level2Level1FKLink1_Level2ViewThe thing is, Level3View isn't in the Level2Level1FKLink viewlink.
    I've been reading about something similar here
    BC4J Master-Detail-Detail
    but I am still unsure of what the problem is.
    Thanks in advance.

    I found the answer here:
    http://radio.weblogs.com/0118231/stories/2004/06/10/correctlyImplementingMultilevelDynamicMasterDetail.html

  • How to retrieve rows in view object and display on UI

    Hi All,
    I am new to ADF. i am using jdeveloper11.1.1.5.0 . Here is my scenario.
    In my AM i have a view object say EmployeeVo. on empVo i am performing setRangeStart and setRangeSize.
    empVo .setRangeStart(2);
    empVo .setRangeSize(2);
    Rows[] rows=empVo .getAllRowsInRange();
    so from the above statement will get two rows from the empVo object. Now i have to display these rows in UI in the form of af:table.
    Can anyone suggest how to acheive this.
    Thanks in advance.

    <af:table value="#{Bean.listValue}" var="row" />
    //refer rows like
    <af:column>
    <af:inputText value="#{row.description}" />
    </af:column>
    List listValue = new ArrayList();
    //getter setter of listValue
    //bean constructor
    retrieve the rows from the AM methodthe above step is very crude hope you understand the steps

  • How To Delete a row from view object

    Hi
    I have a table whose data is populated based on the view object... and for each row i have a delete icon...
    when i press on this delete icon i want to delete that particular row from the view object only..but not from the data
    base..please help me in this issue
    Thanks

    Hi,
    as per krishna priya says u can delete .
    -----1st one thing let me know vo is eo based .???.
    If not here is the sample code to delete a row not from the data base.:
    public void Deleterow(OAPageContext pageContext, OAWebBean webBean,String prjid)
    int idtodelete;
    int fetchedrowcount;
    Number prjojectid;
    RowSetIterator deleteIter;
    prjidtodelete=Integer.parseInt(prjid);
    OADBTransaction tr = getOADBTransaction();
    ProjectsVORowImpl row=null;
    ProjectsVOImpl vo= getProjectsVO1();
    fetchedrowcount=vo.getRowCount();
    deleteIter = vo.createRowSetIterator("deleteIter");
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedrowcount);
    for(int i=0;i<fetchedrowcount;i++)
    row= (ProjectsVORowImpl)deleteIter.getRowAtRangeIndex(i);
    prjojectid=(Number)row.getAttribute("ProjectId");
    if (prjojectid.compareTo(prjidtodelete)==0)
    row.remove();
    break;
    deleteIter.closeRowSetIterator();
    Regards
    Meher Irk
    Edited by: Meher Irk on Nov 2, 2010 12:42 AM

  • Problem during Add row in View Object : View Row of Key Not found

    Hello,
    I'm facing this problem during insert of new row in the view object. I'm having 2 entities that belong to the same DB table (I need this because one is required with the composition assoc and the other one without it).
    I have three tables, COMPANY, USERS and PRIVILEGES.
    Company (1) to USERS (N)
    USERS (1) to PRIVILGES (N)
    While adding users for a specific company , i get this error msg.
    P.S: I'm not getting this error, if i add company, then user. Only if i directly add users i'm getting this error.
    04/11/27 19:31:46 [12511] DCUtil.RETURNING oracle.jbo.uicli.binding.JUFormBinding
    04/11/27 19:31:46 [12512] **** refreshControl() for BindingContainer :new_cuserUIModel
    04/11/27 19:31:46 [12513] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    04/11/27 19:31:46 [12514] Decompressed BC state:BCST:Reousers1View1Iterator=0001000000042D323535,UsertypeView1Iterator=0001000000124141414B6639414142414141537653414141,StatesView1Iterator=0001000000124141414B5A77414142414141536643414141,
    04/11/27 19:31:46 [12515] **** refreshControl() for BindingContainer :new_cuserUIModel
    04/11/27 19:31:46 [12516] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    04/11/27 19:31:46 [12517] Column count: 21
    04/11/27 19:31:46 [12518] ViewObject: Reousers1View_254_findByKey_ close prepared statements...
    04/11/27 19:31:46 [12519] ViewObject: Reousers1View_254_findByKey_ Created new QUERY statement
    04/11/27 19:31:46 [12520] SELECT Reousers1.USERID, Reousers1.CID, Reousers1.UTYPE, Reousers1.DESIGNATION, Reousers1.NAME, Reousers1.ADDRESS, Reousers1.CITY, Reousers1.STATE, Reousers1.ZIP, Reousers1.EMAIL, Reousers1.TEL, Reousers1.FAX, Reousers1.WEBSITE, Reousers1.ENTRY FROM REOUSERS Reousers1 WHERE (Reousers1.USERID = :1)
    04/11/27 19:31:46 [12521] Bind params for ViewObject: Reousers1View_254_findByKey_
    04/11/27 19:31:46 [12522] Binding param 1: -255
    04/11/27 19:31:46 [12523] OracleSQLBuilder Executing Select on: REOUSERS (false)
    04/11/27 19:31:46 [12524] Built select: 'SELECT USERID, CID, UTYPE, DESIGNATION, NAME, ADDRESS, CITY, STATE, ZIP, EMAIL, TEL, FAX, WEBSITE, ENTRY FROM REOUSERS Reousers1'
    04/11/27 19:31:46 [12525] Executing FAULT-IN...SELECT USERID, CID, UTYPE, DESIGNATION, NAME, ADDRESS, CITY, STATE, ZIP, EMAIL, TEL, FAX, WEBSITE, ENTRY FROM REOUSERS Reousers1 WHERE USERID=:1
    oracle.jbo.RowNotFoundException: JBO-25020: View row of key oracle.jbo.Key[-255 ] not found in Reousers1View1.

    Hi Timo,
    once again thanks for ur reply.
    as my vo are based on procedure, i know that i can't update the table using them.
    i only wanted to insert the rows in the vo and show it to user (only for selection purpose).
    Now my problem is sorted as i have changed the code like this-
    Row new_row=vo1.createRow();
    new_row.setAttribute(index,vo2.getAttribute(index)) ;
    vo1.insertRow(new_row);
    Earlier i was only inserting a new row, without creating any row.
    Thanks a lot.

  • [Solved] Referencing another View Objects Bind Variables

    Hello,
    I have a Master view object and a detail object.
    The Master object, vProjects, has a bind variable :pProjectId that the user selects by using a selectOneChoice component. The View object vSections then shows only those Sections that have the selected ProjectId.
    I have a view link to get to the lower level which connects vSections to vRequirements.
    This works well except that the vRequirements lists all requirements that match the SecID I pass through the link. I need it to list only the ones that match the SecID AND the ProjectId chosen earlier.
    Is there a way to reference the bind variable that I used in vProjects inside of vRequirements?
    Thank you,
    Nelson
    Message was edited by:
    TheNelson

    Thanks, I can't believe I didn't think of that. I was rewriting queries and everything.
    Thanks again.

  • Sequence of Create Rows in View Object

    I have to insert a sequence of Rows in a entity object. While doing this , I need to display the master table record at the top of the page. I created a Data action (Dragged and Dropped Create button) which forwards to the data page containing ADF UIX input form and ADF UIX read only table(Master record). When I click te submit button, I commit the transaction and forward to the create data action again. I removed the following line from the Data Page.
    <formValue name="${bindings.statetokenid}" value="${bindings.statetoken}" id="_uixState"/>
    But Still, I'm not able to get the master record to display(Shows Empty Record) on third and subsequent insert rows. But the child record is inserted into the database on the first and second attempt.
    Please help me solve this problem.
    Sathya

    Are you using alterts related to that data object?
    Do you have any open report that uses that data object?

  • Creating emty rows in View Object

    Hi,
    My Application is ADFBC.
    My requirement is create empty rows while page loading.I am using three tables one is master and another two are detailed tables.
    creation form is: master form
    detailed table
    detailed table.
    when i am pressing create button the form shows two emty rows in detailed table and 7 empty rows in second detailed table.
    i wrote code in AMImpl is
    public void createcomp() {
    SequenceImpl s = new SequenceImpl("ATTRIBUTE_ID_S", getDBTransaction());
    Number next = s.getSequenceNumber();
    Number n=(Number)s.getData();
    Number ssid=next+(new Number(1));
    FbCmnEmcStorageSystemsVOImpl fbCmnEmcStorageSystemsVO = (FbCmnEmcStorageSystemsVOImpl) this.getFbCmnEmcStorageSystemsVO1();
    FbCmnEmcStorageProcessorsVOImpl fbCmnEmcStorageProcessorsVO = (FbCmnEmcStorageProcessorsVOImpl) this.getFbCmnEmcStorageProcessorsVO2();
    FbCmnEmcStorageComponentsVOImpl fbCmnEmcStorageComponentsVO = (FbCmnEmcStorageComponentsVOImpl) this.getFbCmnEmcStorageComponentsVO2();
    // FbCmnEmcStorageSystemsVORow fbCmnEmcStorageSystemsVORow = (FbCmnEmcStorageSystemsVORow) fbCmnEmcStorageSystemsVO.createRow();
    for(int i=1;i<=2;i++)
    FbCmnEmcStorageProcessorsVORow fbCmnEmcStorageProcessorsVORow = (FbCmnEmcStorageProcessorsVORow) fbCmnEmcStorageProcessorsVO.createRow();
    fbCmnEmcStorageProcessorsVORow.setStorageSystemId(new Number(ssid));
    fbCmnEmcStorageProcessorsVORow.setSpId(new Number(i));
    for(int i=0;i<7;i++) {
    FbCmnEmcStorageComponentsVORow fbCmnEmcStorageComponentsVORow = (FbCmnEmcStorageComponentsVORow) fbCmnEmcStorageComponentsVO.createRow();
    fbCmnEmcStorageComponentsVORow.setStorageSystemId(new Number(ssid));
    fbCmnEmcStorageComponentsVORow.setComponentName("sample"+i);
    i am calling this method while page loading using these procedure:
    expose the method as a client method and create a method binding for it (in pageDef). Then create an invokeAction (also pageDef but Executables section) pointing to the method binding. Set the invokeAction refresh condition (property of it) to
    ${!adfFacesContext.postback}
    but i am not getting emtyrows in display.
    what i have to do?please help me.
    Thanks,

    Hi,
    see this section in the developer guide for the answer
    http://download-uk.oracle.com/docs/html/B25947_01/bcdcpal004.htm#sthref823
    Frank

  • Error: Attribute set for field_name in view object VO_instance failed

    While I try to add a new row in a table using a VO created on two EOs, it comes back with error message 'Attribute set for <field_name> in view object <VO_instance> failed' for each field I enter the data. Please suggest me if I am missing something while doing it.

    Are you sure you are specifying a value for the attribute of the VO and the value of correct data type.
    Also, please make sure that you have one row coming from each EO , so that the VO has one row, and a outer join is not happening.
    Thanks
    Tapash

  • Entity Object validation for "Date" type

    I am trying to use the Entity Object validation for a Date field type, it is a required field.
    I am using the format: MM/dd/yy HH:mm:ss
    It is a simple validation where the date value must be less than or equal to the current date/time.
    I tried using "Query Result" validation where the date is LESS THAN the query SELECT SYSDATE FROM dual.
    This throws an error:
    JBO-27011: Attribute set with value 2006-07-09 14:05:53.0 for LksrSurveyDte in LCFSReportService.LeakDetailView1 failed.
    I have be unable to find help on validating dates using validation for an Entity Object and need some help.
    Thanks in advance.

    In your case you can implement a service method in the VO to check if any other reservation overlaps with the new one (which is not inserted in the db).
    I would use a an other VO (e.g. VODateCheck) for this. This VO has it's query build to check if a given roomid and a given startdate(time?) overlaps any other record for the roomid
    select * from ReservationRoom where RoomId=:bindRoomId and ReservationEnd>=:bindReservationStartIf this query returns one or more rows you have an overlapping in the schedule and throw an error.
    You call this VODateCheck from your service method in the other module before inserting the record. Set the bind variables in the VODateCheck and execute the query.
    Timo

  • Finding Application Module name in read-only view object classes

    Hi all,
    I have a fairly basic question about finding application module name when we are coding in ViewObject java classes.
    I want to know how can I obtain <<application module>> NAME that our current view object is contained in it at run-time. I think there should be a way to find current application module NAME, when we are in ViewObject classes including View Object, View Row or view object definition classes (I've overridden all mentioned classes).
    I should notify that since our view object is read-only I may not count on view object's entity classes, coz as you know a read-only view object don't have any entity in it!
    So, if you have any idea about finding current application module name in view object java classes please let me know.
    Appreciate for your replies,
    Nasser

    Thanks guy, it was helpful:)
    Now i can access application module name through viewObject classes.
    But another question is raised...sorry if i m boring:( I promise its the final question ;)
    Is there a way to get application module name in an extended version of JboException class?
    Thanks again for your reply:)
    Nasser

  • Data level and object level security how can we impliment in the obiee11g

    How can we implement the data level security in obiee11g,

    Concept is more or less same as in 10g
    Data level
    http://www.rittmanmead.com/2012/03/obiee-11g-security-week-row-level-security/
    Object level
    http://docs.oracle.com/cd/E28271_01/bi.1111/e10543/intro.htm#BABHDGGB
    Mark if helps
    Edited by: Srini VEERAVALLI on Mar 5, 2013 6:48 AM

Maybe you are looking for