Trying to set a calculated attribute in an entity implementation java file

Hi,, im working in Jdeveloper 9.0.3.2 in a web application and the problem is as follow:
I have one table, This table has an attribute which value is calculated from another attribute in the same table. Take in account That it is not a trascient column, it is a real entity column in the entity object.
First i tried this by using custom code in the validateEntity method but it was impossible because of the error: "JBO-28200: Validation threshold limit
reached. Invalid Entities still in cache".
next, i try the same by using custom code in the setter and getter methods by using the populateAttribute method and seems that transaction is successful but this result is only reflected in the entity cache so when im query directly the database this attribute is empty.
I have not idea what to do.. im bored trying to get solution to this problem.
Please help me!!!
Thank u
Orlando Acosta
Infogroup Team
Colombia South America

Thank you very much for the answer.
I tried to do what you suggested, but I get an error message when I tried to put session data into the user session object on my JSP page.
Here is part of my codes in the JSP page.
<%
// Retrieve all request parameters using our routine to handle multipart encoding type
RequestParameters params = HtmlServices.getRequestParameters(pageContext);
String dsParam = params.getParameter("datasource");
String formName = dsParam + "_form";
String rowAction = "Current";
String event = "Update";
String userName = (String) session.getAttribute("userName");
if (!(getDBTransaction().getSession().getUserData().containsKey("user")))
getDBTransaction().getSession().getUserData().put("user",userName);
%>
And here is my error message.
Error(16,16): method getDBTransaction not found in class _DecalDataEditComponent
I got the other half working where I retrieved the session data in a setter method of an Entity Object Class as below.
public void setDestroy(Date value)
if (value!=null)
setDestroyedBy((String)getDBTransaction().getSession().getUserData().get("user"));
setAttributeInternal(DESTROY, value);
Your help is very appreciated.

Similar Messages

  • Calculated attribute setter & getter methods

    Hi,
    i want more information on Calculated Attribute setter method & Calculated Attribute getter method.
    i have a value attribute, to which properties of  CalculatedAttributeGetter &  CalculatedAttributeSetter values are given with the method names.
    Is it like whenever we try to set a value for that attribute the setter is called and getter is called whever tries to get value.?
    Please give more info on this.
    Attribute: Emp
    Setter: setEmp
    getter: getEmp
    Thanks
    Hussain

    hi,
        hope this link will help you.
    If we create a value attribute then there will be a property called "calculated",set that property as true then we get two methods called "getter" and "setter".This is to be used for setting some values to our variables and getting that.In java .
    ( used for Encapsulation purpose.)
    [http://help.sap.com/saphelp_nw70/helpdata/en/7f/a0384162316532e10000000a1550b0/frameset.htm]

  • Problem with calculated attribute

    I have created a calculated attribute on an Entity that derives its value from two persistent attributes.
    I am only interested in displaying the calculated attribute and not the attributes it is derived from.
    If I put the calculated attribute in a View object without the other attributes I will get an error ( (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for AccountPosting) when displaying data from the View object.
    This error does not occur if I add the other attributes to the View object and it all works OK.
    Why is this? Surely the calculated attribute is only calculated at the Entity object layer, so what does the View object have to do with this?

    The Java datatype for the two Number attributes is Number
    When I switch to Integer or Long, I get an error but the stack is different.
    oracle.jbo.DMLException: JBO-26080: Error while selecting entity for SLEO
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:658)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ## Detail 0 ##
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:533)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ----- LEVEL 1: DETAIL 0 -----
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:533)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Jdev11G XMLMenuModel : Setting the "destination" attribute for the itemNode

    Hi,
    I am trying to set the "destination" attribute for the itemNode in the metadata.xml.This is the URI to which the user must be taken on clicking that node. But it is unable to pick the URI set for the destination attribute and hence there is no navigation that happens.Using the "action" attribute works fine. But I need to use the "destination" attribute.
    Here are some of the files:
    The metadata.xml (root_menu.xml):
    <?xml version="1.0" encoding="windows-1252" ?>
    <menu xmlns="http://myfaces.apache.org/trinidad/menu">
    <groupNode id="groupNode1" idref="itemNode1" label="Merchant">
    <itemNode id="itemNode1" label="Sites" action="site_action" rendered="#{testBean.test}"
    focusViewId="/common/site/Site.jspx">
    </itemNode>
    <groupNode id="groupNode2" idref="itemNode2" label="Settings">
    <itemNode id="itemNode2" label="Page Template" action="template_action"
    focusViewId="/common/template/TemplateRules.jspx">
    </itemNode>
    <itemNode id="itemNode3" label="Configuration Parameters" destination="http://www.google.com"
    action="config_action" focusViewId="/common/others/ConfigurationParameters.jspx">
    </itemNode>
    </groupNode>
    <groupNode id="groupNode3" idref="itemNode4" label="System Admin">
    <itemNode id="itemNode4" label="Cache Invalidation" destination="/faces/common/others/CacheInvalidation.jspx"
    focusViewId="/common/others/CacheInvalidation.jspx">
    </itemNode>
    </groupNode>
    </groupNode>
    </menu>
    The faces_config.xml:
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    </application>
    <navigation-rule>
    <navigation-case>
    <from-outcome>site_action</from-outcome>
    <to-view-id>/common/site/Site.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>template_action</from-outcome>
    <to-view-id>/common/template/TemplateRules.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>config_action</from-outcome>
    <to-view-id>/common/others/ConfigurationParameters.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>cache_action</from-outcome>
    <to-view-id>/common/others/CacheInvalidation.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>root_menu</managed-bean-name>
    <managed-bean-class>org.apache.myfaces.trinidad.model.XMLMenuModel</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>createHiddenNodes</property-name>
    <value>false</value>
    </managed-property>
    <managed-property>
    <property-name>source</property-name>
    <property-class>java.lang.String</property-class>
    <value>/WEB-INF/root_menu.xml</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>testBean</managed-bean-name>
    <managed-bean-class>testBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    </faces-config>
    Can you please tell me what else has to be set for the "destination" attribute to work?
    Thanks,
    Swapna

    The code you sent is not clear, could you send your jspx page.
    Thanks

  • Calculated attributes in WDA

    Hi people,
    I'm new in WebDynpro for Abap. Is it possible to declare a calculated attribute like in WebDynpro for Java? I can't find a attribute-property for doing that.
    Is this concept not available in WDA?
    Regards,
    Thomas

    Hi,
    in WD4Java you have the possibility to declare an attribute as "calculated". The framework generates then 2 methodes, a getter and a setter method, which the application developer can use to put in his coding.
    A use case can be the following: You have a Inputfield with a simple value help (i.e. from the domain of the data element). The value you can see, after the selection is the key (of the key-value list). Now I want to show near the inputfield the value of the selected key. In this case I can declare (in WD4Java) a calculated attribute which i bind to a TextView element near the Input field. The getter methode of the attribute (implemented by the application developer) determines the value of the selected key.
    If this wasn't clear enough, visit this [link|http://help.sap.com/erp2005_ehp_03/helpdata/EN/7f/a0384162316532e10000000a1550b0/frameset.htm], where the concept of calculated attributes is described in detail.
    Regards,
    Thomas

  • Set a VO attribute to be untested by method "isTransactionDirty()"

    Hi,
    I'm using jdev 11.1.1.0.1.
    I'm trying to set a VO attribute to be untested by method "DataControl.isTransactionDirty()" : is there any method for this?
    In other words, i would like that changing a specifique VO attribute doesn't make the iterator set to "changed".
    Thanks in advance
    Clément

    Hi Franck,
    In my usecase, i can't use a transcient attribute : is there any other solution than using a transcient attribute?
    I hope there is an other solution.
    My use case :
    In my ViewRowImpl, i have overriden "protected Object getAttributeInternal(int i)" and use this method to set some attribute (because of a complexe use of a tableTree). The attributes set are FK and have to be initialized.
    Clément
    Edited by: Clement Visa on 3 mars 2010 14:00

  • Can not set the value attribute of a ContextNode

    Hi,
       I am trying to set the value Attribute in a value Node it is a simple way but it gives me java.lang.NullPointerException error on the given line:
    wdcontext.current(ValueNodeName)Element.set(AttributeValueName)
    Thanks in advance
    Best Regards
    Beata

    Like all above suggested do this:
    wdContext.node(ValueNodeName).add(
               wdContext.node(ValueNodeName).create(ValueNode)Element()
    wdContext.node(ValueNodeName).moveLast();
    wdContext.current(ValueNode)Element().setATTR(..);

  • Accessing custom attributes in LDAP using WD Java - UME APIs

    Hello Friends,
    I am trying to access a custom attribute from LDAP in WebDynpro Java. I am using bellow code.
    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser sapUser = clientUser.getSAPUser();
    if (sapUser != null) {
    String[] str_emp = sapUser.getAttribute(<Name Space>,"Attribute Name");
    if (str_emp == null || str_emp.length == 0) {
    wdComponentAPI.getMessageManager().reportSuccess(" NULL ");
    return;
    } else {
    strEmpID = str_emp[0];
    wdComponentAPI.getMessageManager().reportSuccess(strEmpID);
    The name space is "$usermapping$". I am not sure why it is like that only for this attribute i am trying to access.
    I am getting null value if i run this code.
    Can any one help
    thanks
    Shobhan

    Hi,
    Are you sure this is the right namespace? The default namespace is com.sap.security.core.usermanagement.
    You can get all namespaces and the names of all attributes defined for a user using methods getAttributeNamespaces and getAttributeNames : [Interface IPrincipal|http://help.sap.com/javadocs/NW04S/current/se/index.html].
    Regards,
    Pierre

  • Trying to set attribute value based on user selection of another attribute

    I am trying to set an attribute value based on the user's selection of another attribute using JSP EditCurrentRecord. When the user chooses the AreaId from the combo box I want to look up the value of the RgnID, preferrably without the user seeing this field at all. Below is my code which does not work. When I run it I get Error Message: null. Any suggestions are appreciated!!
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <%
    RowEditor.initialize(pageContext, "MyProject2_package1_SRSecurityModule.UsrAreaWhView");
    RowEditor.setTargetUrl("UsrAreaWhView_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setDisplayAttributes("OracleId, RgnId, RegionKey, AreaId");
    RowEditor.useEditField("OracleId");
    RowEditor.getFieldRenderer("OracleId").setPromptText("Oracle ID");
    RowEditor.useEditField("AreaId");
    RowEditor.useComboBox("AreaId","AreaWhView","Area","AreaKey");
    RowEditor.getFieldRenderer("AreaId").setPromptText("Area");
    RowEditor.useEditField("RgnId");
    RowEditor.getFieldRenderer("RgnId").setPromptText("Region");
    RowEditor.getRowSet().getViewObject().getCurrentRow().setAttribute("RgnId",RowEditor.getRowSet().getViewObject().getCurrentRow().getAttribute("RegionKey"));
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    %>
    </jsp:useBean>

    ok, sorry everyone for making it confusing; this is what I am
    trying to acheieve;
    I would like the user to populate my database with thier
    username AND userID. I have a dropdown box with thier username
    dynamicly populated already, what I am trying to achieve, is a way
    of when the user selects thier username either another dropdown or
    a hidden field is automatically populated with the appropiate
    userID (to match thier username). Now I could just have two
    dropdowns and they select both, but i'd rather avoid the
    possibility of mismatches, and that is why I would like it to be
    automatic and based on thier username selection...
    Does that make sense....?

  • SetAttribute at calculated attribute at prev next binding

    I use JDev version 10.1.2.1.0 (Build 1913). I try to set attribute at calculated attribute.. that all row divide some page using prev next binding. The result was disorder. I think i must set attribute repeat every i click prev next button.. but i don't know where i must overwrite method form prev next binding.. or any other solution... please give me advice.. thank you

    Dimitar, thank you for your response.
    If I am trying to insert a new row (not update an existing one), I believe I need to create a Managed Property bomEditChild under the Managed Bean bomCRUD, and then set the binding of the af:InputText to +#{bomCRUD.bomEditChild}+ as seen below:
    <af:popup id="p1" ... >
    <af:dialog id="d2" dialogListener="#{DialogListenerCollection.editDialogListener}" title="BOM Edit">
    <af:inputText label="Child" id="it1" binding="#{BomCRUD.bomEditChild}"/>
    </af:popup>
    From adfc-config.xml
    <managed-bean id="__11">
    <managed-bean-name id="__9">BomCRUD</managed-bean-name>
    <managed-bean-class id="__12">erp.view.framework.BomCRUD</managed-bean-class>
    <managed-bean-scope id="__10">request</managed-bean-scope>
    <managed-property id="__2">
    <property-name id="__3">bomEditChild</property-name>
    <property-class>oracle.adf.view.rich.component.rich.input.RichInputText</property-class>
    <value id="__1"></value>
    </managed-property>
    </managed-bean>
    However, when I print the value of the String Child variable of the createChildren class, I get the following:
    System.out.println("Child: " + Child); // output command gets me the text below
    +Child: RichInputText[UIXEditableFacesBeanImpl, id=it1]+
    The createChildren method is detailed below in the pages definition file and implemented in the AppModuleImpl class.
    <methodAction id="createChildren" ...>
    <NamedData NDName="Child" NDValue="#{BomCRUD.bomEditChild}" NDType="java.lang.String"/>
    </methodAction>
    It appears the value being passed into my createChildren class is the container ID, not the value entered into the container by the customer. The output is the same whether I declare bomEditChild as a Managed Property under the Managed Bean bomCRUD or not. I am still unsure how to grab the value of the inputted text and/or if the managed property is updating before the createChildren method is being called via the editDialogListener.
    Any further ideas?

  • How to change sql expression of SQL-Calculated Attribute of view object ?

    Hi
    jdev 11.1.1.5
    I have a view object with a SQL-Calculated Attribute (sumAnalytic) how can I change sql expression of this attribute in runtime?
    for example in application module method??

    Hi Mr Timo
    Thanks for your reply but I do not need dynamic vo because I can not change all of my vo
    I only need to change expression of SQL-Calculated Attribute of view object in run time.
    For this I set expression in view object something like this 'select 2 from dual' and in run time in my AM method I get the vo query and replace 'select 2 from dual' with something like 'selet sum(amnt) over (partition by 1)' and set new query.
    But I think the better solution must exist
    Thanks

  • How can I set a VO Attribute value ?

    Hi,
    I'm relatively new to developing OA framework pages, so apologise in advance if my terminology is not quite right at the moment. But I have an experienced Oracle Forms developer so am getting to grips with new tools.
    I've managed to develop a number of simple pages (query page and create single record page). I now want to develop a simple "master-detail" page. I've created a page that has two regions Header region and Lines region. Region styles are set to Header and AdvancedTable (child of Header region). I created some test data in TOAD and have written the code to query back the header and related lines. This works and the correct lines get displays when a new header record is displayed. I coded this in the initQuery methods. But now I'm stuck trying to create detail/line rows from the page.
    I've added the "Add New Rows" to and want to populate the Lines row with the value of my parents primary key (eventually I'll make the child fkey column hidden). For the last few days, I've read lots of forum notes and the OA dev guide. At the moment, I've created a CO on my Lines region and this basically does the following in the processFormRequest :-
    a) Traps the Add Rows Event
    b) Fetches the current row for the parent and parent Id (primary key)
    c) Fetches the current child row
    d) Tries to update the child foreign key attribute using parent's primary key.
    When I pressed the Add Rows button I was getting an error "Attribute set <attribute> failed for ...>.
    I read various notes suggesting that I did not have my EO and VO properties set for the attribute I was updating. So I changed the EO and VO to allow the attribute to always be updateable. Now I don't get the error, but the column is not populated. An empty row appears. I used the messaging and am definately getting a value in the parentKey variable.
    I know I'm in the Add Rows event because I manged to display some dummy messages.
    Below is the code in my Lines CO processFormRequest :
    OAAdvancedTableBean tableBean = (OAAdvancedTableBean) webBean.findChildRecursive("RoutesRN");
    if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM))
    && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    OAViewObject parentVO = (OAViewObject)am.findViewObject("XXRPAirlineCreateVO1");
    OARow parentRow = (OARow)parentVO.getCurrentRow();
    String parentKey = (String)parentRow.getAttribute("CompCode");
    OAViewObject childVO = (OAViewObject)am.findViewObject("XXRPRouteFullVO1");
    OARow childRow = (OARow)childVO.getCurrentRow();
    //String childFKey = (String)childRow.getAttribute("CompCode");
    //childRow.setAttribute("CompCode",parentKey);
    childRow.setAttribute("CompCode",parentKey);
    ///// String message = "Pressed Add Rows Button Parent = " + parentKey + " Child = " + childFKey;
    /// // throw new OAException(message, OAException.INFORMATION);
    I guess the above may not be the best way to the "copy" of a parent id into a child foreign key.
    Any help would be really appreciated.
    Thanks
    Ramnik
    The region style for the Header

    Look in the dev guide, Tables --> Adding rows.
    If you are handling the add row event, you need to set autoInsertion off. You need to create a row in the child VO and then set the desired attributes

  • How to set a extended attribute as read-only in runtime

    Hi Team,
    I would like to set a extended attribute as read-only in runtime based in a condition.
    I tried with "Criterion" in a extended model definition, but if the condition is false the content field disappear.
    Best regards

    Hi Bruno,
    About the first part of your problem : User with permission and user without permission.
    To meet your needs I would have defined a Group named "WithPermission" and associated this group to a Member (user) "A"
    While other users would not have been associated with this group.
    When an user login I would have checked what groups that are associated with. If the group "WithPermission" was found I would have allowed the current login user to write "My Example". If the current login user was not associated to group name "WithPermission". The user would not have been able to edit the field.
    I did a search in the metamodel object and I found nothing Method. Following my reading it seems that it is not possible. Read below.
    In Sybase Guide "Customizing and Extending PowerDesigner" - CHAPTER 7: Scripting PowerDesigner you can read the following :
    Manipulating the Repository By Script
    PowerDesigner lets you access the Repository feature via scripting using the RepositoryConnection as BaseObject global property.
    It allows you to retrieve the current repository connection, which is the object that manages the connection to the repository server and provides access to documents and objects stored under the repository.
    The RepositoryConnection is equivalent to the root node in the Repository browser.
    You can access the repository documents, but you cannot access the repository administration objects, like users, groups, configurations, branches, and list of locks. In addition, only the last version of a repository document is accessible using scripting.
    As described by Dirk I think the only thing you can do is to make a check on a specific username. Unfortunately it will be "hard coded" in your program. Or If you can by vb script access the repository tables. You could resolve your problem by checking Group permission associated to each users logged in..

  • Setting Application Context Attributes for Enterprise Users Based on Roles

    Hello,
    We have an Oracle 11g database with a table containing data from multiple sites (a SiteID field identifies the site for a record). Since application users can have access to different subsets of sites, we would like to use Oracle's Virtual Private Database feature to enforce row-level security on the table.
    I did a successful proof-of-concept with database users. I created a role for each site (example: USER_SITE_A, USER_SITE_B, ...), and then assigned the appropriate site roles to each database user. I then created a package (run via a logon trigger) which set application context attributes for each site. If the current database user has been assigned a role for a given site, then the corresponding attribute named "SITE_PRIVILEGE_SiteID" is set to 'Y'... otherwise, it is set to 'N'. Here is the code which worked to set application context attributes for database users:
    -- For each record in my RoleSitePrivileges table, set
    --   an attribute named 'SITE_PRIVILEGE_<SiteID>'.
    --   If the current user has been assigned a role matching
    --   the value in the 'RoleName' field, set the corresponding
    --   attribute to 'Y'... otherwise, set it to 'N'.
    FOR iPrivRec IN (SELECT RoleName, SiteID
                       FROM RoleSitePrivileges
                       ORDER BY SiteID)
       LOOP
          SELECT COUNT(*)
            INTO roleExists
            FROM dba_role_privs
            WHERE granted_role = UPPER(iPrivRec.RoleName)
              AND grantee = USER;
          IF roleExists > 0 THEN
             DBMS_SESSION.set_context(
                         namespace   => 'my_ctx',
                         attribute   => 'SITE_PRIVILEGE_' || iPrivRec.SiteID,
                         value       => 'Y');
          ELSE
             DBMS_SESSION.set_context(
                         namespace   => 'my_ctx',
                         attribute   => 'SITE_PRIVILEGE_' || iPrivRec.SiteID,
                         value       => 'N');
          END IF;
       END LOOP;To finish things off, I created a security policy function for the table which returns the following:
    RETURN 'SiteID IN (SELECT TO_NUMBER(SUBSTR(attribute, 15))
                         FROM session_context
                         WHERE attribute LIKE ''SITE_PRIVILEGE_%''
                            AND value = ''Y'')';This setup worked great for database users. I am now working to do a comparable proof-of-concept for enterprise users created in Oracle Internet Directory (OiD). I have Enterprise User Security (EUS) up and running with OiD, global roles created in the database, enterprise roles defined in EUS with global role assignments, and enterprise roles assigned to OiD users. The enterprise users are able to successfully login to the database, and I can see the appropriate global role assignments when I query the session_roles view.
    I tried using the same application context package, logon trigger, and security policy function with the enterprise users that I had used with the database users. Unfortunately, I found that the application context attributes are not being set correctly. As you can see from the code above, the applicaiton context package was referencing the dba_role_privs view. Apparently, although this view is populated for database users, it is not populated for enterprise users.
    I tried changing the application context package to use invoker's rights and to query the session_roles view instead of the dba_role_privs view. Although this package sets the attributes correctly when called manually, it does not work when called from the logon trigger. That was an oops on my part, as I didn't realize initially that a PL/SQL procedure cannot be called with invoker's rights from a trigger.
    So, I am now wondering, is there another view that I could use in code called from a logon trigger to access the roles assigned to the enterprise user ? If not, is there a better way for me to approach this problem? From a maintenance standpoint, I like the idea of controlling site access from the LDAP directory service via role assignments. But, I am open to other ideas as well.
    Thank you!

    Hello,
    We have an Oracle 11g database with a table containing data from multiple sites (a SiteID field identifies the site for a record). Since application users can have access to different subsets of sites, we would like to use Oracle's Virtual Private Database feature to enforce row-level security on the table.
    I did a successful proof-of-concept with database users. I created a role for each site (example: USER_SITE_A, USER_SITE_B, ...), and then assigned the appropriate site roles to each database user. I then created a package (run via a logon trigger) which set application context attributes for each site. If the current database user has been assigned a role for a given site, then the corresponding attribute named "SITE_PRIVILEGE_SiteID" is set to 'Y'... otherwise, it is set to 'N'. Here is the code which worked to set application context attributes for database users:
    -- For each record in my RoleSitePrivileges table, set
    --   an attribute named 'SITE_PRIVILEGE_<SiteID>'.
    --   If the current user has been assigned a role matching
    --   the value in the 'RoleName' field, set the corresponding
    --   attribute to 'Y'... otherwise, set it to 'N'.
    FOR iPrivRec IN (SELECT RoleName, SiteID
                       FROM RoleSitePrivileges
                       ORDER BY SiteID)
       LOOP
          SELECT COUNT(*)
            INTO roleExists
            FROM dba_role_privs
            WHERE granted_role = UPPER(iPrivRec.RoleName)
              AND grantee = USER;
          IF roleExists > 0 THEN
             DBMS_SESSION.set_context(
                         namespace   => 'my_ctx',
                         attribute   => 'SITE_PRIVILEGE_' || iPrivRec.SiteID,
                         value       => 'Y');
          ELSE
             DBMS_SESSION.set_context(
                         namespace   => 'my_ctx',
                         attribute   => 'SITE_PRIVILEGE_' || iPrivRec.SiteID,
                         value       => 'N');
          END IF;
       END LOOP;To finish things off, I created a security policy function for the table which returns the following:
    RETURN 'SiteID IN (SELECT TO_NUMBER(SUBSTR(attribute, 15))
                         FROM session_context
                         WHERE attribute LIKE ''SITE_PRIVILEGE_%''
                            AND value = ''Y'')';This setup worked great for database users. I am now working to do a comparable proof-of-concept for enterprise users created in Oracle Internet Directory (OiD). I have Enterprise User Security (EUS) up and running with OiD, global roles created in the database, enterprise roles defined in EUS with global role assignments, and enterprise roles assigned to OiD users. The enterprise users are able to successfully login to the database, and I can see the appropriate global role assignments when I query the session_roles view.
    I tried using the same application context package, logon trigger, and security policy function with the enterprise users that I had used with the database users. Unfortunately, I found that the application context attributes are not being set correctly. As you can see from the code above, the applicaiton context package was referencing the dba_role_privs view. Apparently, although this view is populated for database users, it is not populated for enterprise users.
    I tried changing the application context package to use invoker's rights and to query the session_roles view instead of the dba_role_privs view. Although this package sets the attributes correctly when called manually, it does not work when called from the logon trigger. That was an oops on my part, as I didn't realize initially that a PL/SQL procedure cannot be called with invoker's rights from a trigger.
    So, I am now wondering, is there another view that I could use in code called from a logon trigger to access the roles assigned to the enterprise user ? If not, is there a better way for me to approach this problem? From a maintenance standpoint, I like the idea of controlling site access from the LDAP directory service via role assignments. But, I am open to other ideas as well.
    Thank you!

  • BC4J: Updating calculated attributes

    We're working on some web services with BC4J. For querying data, we have various tags which are calculated. I'm looking for the best practice for receiving updates to those calculated values.
    For example, the web service needs to work with the <countyFIPSCode> element, which might have a value of 55043. Internally, that might relate to our county_code = 21.
    It's easy enough to build a BC4J calculated attribute for countyFIPSCode, and that's perfect for queries. But I'm looking for the best approach for handling an update or insert that has a value for countyFIPSCode.
    For example, one way would be to absorb the XML document, find the <countyFIPSCode> element, get the value, call a database function to get my internal county_code, and use it for the update. I can see lots of approaches, though, and I certainly haven't plumbed the depths of what BC4J can do, so I'm wondering what would be best approach.
    -- jim

    If you allow the transient CountyFIPSCode attribute to be updateable, then in the setCountyFIPSCode() method in the view row class (or optionally at the entity level if you want to enable this CountyFIPSCode->NormalCountyCode mapping), just after invoking the setAttributeInternal() method to set the value of the transient attribute, you can remap the value, then invoke the setCountyCode() method with the remapped value.
    How you accomplish the mapping would depend on how many different county-codes there are. If you have an existing stored function that does the mapping, you could just write an expert-mode view object that looks like:
    select yourfunction.map_fips_to_county(:0) as county_code from dualThen you can use this VO to set a value for the zero-th bind variable with the value of the FIPS code, then retrieve the value of the "CountryCode" attribute in the resulting row.

Maybe you are looking for

  • "Unknown Error" Message when saving Illutrator CS3 file

    I get this unknown error message when attempting to save an illustrator file.(CS3). I tried to open and then save several files with the same resulting error message. As a work around, I have reverted to working in CS2 until I can get this resolved.

  • Waiting components some time to be rendered after login

    Hi all, I have an ADF application with a login page. When I run the application for the first time with integrated weblogic server and click the login button ,go to the second page after login, it takes about 5 seconds for the all components to be re

  • How to store bit data in VARCHAR(4000) field?

    Hi. Please help! We are porting some C/C++ software with embedded SQLs from NT/DB2 to Linux/Oracle. On NT/DB2 we have some table to store file data in a VARCHAR(4000) blocks. Table looks like this CREATE TABLE FileData (filetime as timestamp not null

  • Administrative console doesn't seem to work

    I've just installed appserver7 on windows 2000 professional sp2. (256mb, P3 733MHz). Everything seems to work quite fine, application server and administrative server are up. I can connect to localhost:4848, will be asked for passw and login, can get

  • How to block manual PR

    Dear All, We are using plant level MRP and in MRP all requirement will generate like PR& Planned order but users are creating manual PR .Now my question is how to block manual PR even though  MRP PR exist in the system for particular material. Thanks