How to set updatable property of view object on runtime

Hello Gurus,
I am new in adf and using jdev 11.1.2.3.
I have two view object which has view link and they are based on entity object. In master view i have a column with the name of status. The target is if the value of status is 'active' then i want to allow add rows in detail view and if it is inactive then wants to disable adding or editing in the detail view.
I don't know how to do this. I don't know how to get the other view object and how to set update able property and where to write code in entity object class or view object class.
Any advice................
Thanks in Advance

There are multiple possible ways to archive this. As the VOs are in a master-detail relationship, you can opt to add a navigation method to the child back to the parent. This method can be accessed via java or groovy to allow the child access to the master row. Once the child has access you can use this to ask the master for it's status and if it's not active disable the edit and update buttons.
If both master and detail are on the same page in the ui, there is an easier way. Drag the status attribute from the master table onto the page as e.g. inputText. This will create a binding for the attribute which changes if you select a row in the master table. As you don't need to inputtext, switch to the source mode of the page and delete it. This will remove the inputtext put keep the binding. Now you can use hte binding in an EL to set the disable property of other components to true like
<af:commandButton text="commandButton 1" id="cb1" disabled="#{bindings.masterstatus.inputValue ne 'active'}"/>
The button will only be active it the binding for masterstatus is active.
Timo

Similar Messages

  • How to set query for child View Object?

    I have a hGrid in standard page. Two View Objects are present connected using view link. I need to set where clause in the child View Object. The changes are not getting reflected when i set the where clause. Also when i try to fetch rowCount it returns 0 for child View Object. But i am able to get the value for parent View Object. Any suggestions please.

    Hi,
    This solution worked for me last time, Please create One blank row and delete that row(For Child VO).
    Why we are doing this? : Because the child vo pointer might not init. See this is not our fault, this is because of OA Framework. But this works for me :)
    Thanks,
    Shrikant

  • Attribute set for Choice in view object xxPickSlipYesNoVO1 failed

    Hi all,
    I have a problem that i find pretty weird.
    The context is: I created a custom page that contains a table populated with some printer names. And the other field it contains is a messageChoice item. Both of these items are populated using custom VO that i also created and included in a custom AM. The VO that contains the printer names is used in a Query region with a table and it works perfectly. But the messageChoice is feeded by a VO that contains the following query :
    select 'No' choice from dual
    union
    select 'Yes' choice from dual
    I know this is very simple but i did not find any other way to populate the messageChoice than by using a view object. Where the problem comes is in the runtime behavior. When the custom page loads, "Yes" is automatically loaded in the dropdown. Then when i click the submit button it works perfectly but if i choose "No" i get the following message:
    Error
    Last Request Only - Attribute set for Choice in view object xxPickSlipYesNoVO1 failed
    Note: "Last Request Only" is the prompt of the messageChoice.
    And when this error is displayed the submit button does not want to work ....
    I dont know how to solve this i did some research but i did not find anyone with a similar issue!! yet! So i turned to you expertise to help me in solving this problem.
    Best Regards,
    Carl

    Carl,
    as u said u have removed the attribute sets created previously,. I would advice to delete myclassses folder , recompile and run. Also follow Sumit's suggetion for creating lookup, as that is the standard way of doing.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • How to set Update Mode for DSO in BI7.0?

    Hi,
    As you know in bw3.5, in update rules we can set  the update mode for ods as Additive or overwrite functionality.
    But can anybody tell me where are these settings in bi7.0? or
    How to set Update Mode for DSO in BI7.0?
    Thanks and Regrards,
    Harshal

    Dear Harshal,
    GO to the tramsformations of your DSO..
    In the Rule Group..Click on any key Figure..
    this pops u a window..in which u will find  AGGREGATION ..Then u can select Either OVERWRITe or SUMMATION which suites ur requirement..
    Hope this helps u..
    Assign points if helpful..
    Best Regards,
    VVenkat..

  • Error:Attribute set for DetailHideShow in view object SalaryDetailsVO faild

    Hi
    We need to add one column in the self service Manager > My Employee Information > Salary history table
    - This column does not exist in the standard view Object
    oracle.apps.per.selfservice.mgrviews.server.SalaryDetailsVO
    - With Jdeveloper we have created a new view that extend the standard view :
    cggv.oracle.apps.per.selfservice.mgrviews.server.CGGVSalaryDetailsVO
    - We used the substitution tools to substitute the standard view by the new one
    with the following column :
    java oracle.jrad.tools.xml.importer.JPXImporter $CGG_MDS_TOP/cggv/per/12.0.0/java/ParodiExtendPJ.jpx -username apps -password
    apps -dbconnection "(description = (address_list = (address = (community =
    tcp.world)(proto = tcp)(host = doradb)(port =
    1581)))(connect_data = (sid=LDEV )))"
    - the new view contain exactly the same attribute than the standard one, we just add one new attribute at the end
    - We used Self-service perzonalisation functionality to add the new column in the table region.
    When we click on the Show buton the this error message appears :
    Error : Attribute set for DetailHideShow in view object SalaryDetailsVO failed
    It seems there is a probleme when extending ViewObject and adding column to table that contains a Show/Hide Detail column.
    Do we need extend also the controler ?
    Thank a lot for your help
    Julien Robinet

    Is the new column you have added part of the show/hide detail? If not, is the correct getting displayed?
    Is show/hide also handled through the attribute of substituted VO?
    --Shiv                                                                                                                                                                                                                                                                                                                                                                               

  • How to Set "DateOnly" property in DateTimeControl using Javascript.

    How to Set "DateOnly" property in DateTimeControl using JavaScript.

    Is there any specific reason you want to set it through JavaScript ? You can directly set the DateOnly property in the markup itself.
    <SharePoint:DateTimeControl runat=server id="dtControl" DateOnly="true"></SharePoint:DateTimeControl>
    Please can you elaborate on what exactly is the requirement for setting this through javascript?
    Geetanjali Arora | My blogs |

  • Creating View Objects at Runtime for Validation

    In Oracle® Application Development Framework
    Developer’s Guide For Forms/4GL Developers tutorial there is a topic about Creating View Objects at Runtime for Validation.
    Is there any sample code available for this topic?
    Please help
    Regards
    S Karar

    I have created a helper method . The code is given below
    protected ViewObject getValidationVO(String viewObjectDefName) {
    // Create a new name for the VO instance being used for validation
    String name = "Validation_" + viewObjectDefName.replace('.', '_');
    // Try to see if an instance of this name already exists
    ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject(name);
    // If it doesn't already exist, create it using the definition name
    if (vo == null) {
    vo = getDBTransaction().getRootApplicationModule().createViewObject(name,viewObjectDefName);
    return vo;
    // Validation_bc4j_project of type ApplicationModule not found
    and created a validation method.
    The code inside validation method is given below.
    public boolean validateAvgMr(Number data) {
    String batch_catg = getQuality();
    // Get the view object instance for validation
    ViewObject vo = getValidationVO("bc4j_project.v_sqc0150");
    if (getTestStage()=="DOLLOP" && getQuality()=="DECO")
    // Set it's bind variables (which it will typically have!)
    vo.setNamedWhereClauseParam("batch_catg","DECO");
    vo.executeQuery();
    Number dol_mr_lcl=(Number)vo.first().getAttribute("DolMrLclStd");
    setStdMrLcl(dol_mr_lcl);
    return true;
    return true;
    I have checked the validation view and it is returing value with the same bind variable value but is not returning any value when using inside this method validation.
    I have checked several times but can't find the fault in the code.
    Please help

  • How to construct a new complete view object programmatically

    HI,
    I want to construct a new complete view object programmatically. I have a result set based on the rows returned from this query i need to build the new vo and show it n a form. Please tell me the complete procedure to do this or else provide me any links.
    Thanks
    Satya

    Hi,
    have a look how dynamic tables are created (using af:forEach to iterate the attribute Defs for generating columns). Your approach is similar except that you not only need to know about attributes but also the rows to fecth
    1. create a tree binding for the view object
    2. create the binding with one hierarchy
    3. ensure all attributes are deleted for the tree binding (you do this manually in the PageDef)
    4. when executing the query for a new SQL, call clearForRecreate() on the DCIteratorBinding instance
    5. On the page, use af:forEach to create the form fields and labels for each row. Like for dynamic tables, you first need to determine the attributes to render (its a nested loop you are going for
    6. Updates of the form fields must be through a managed bean
    Frank

  • To find out the last row that is updated in a View Object

    Hi OAF Gurus,
    I have requirement like,
    I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
    JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
    JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
    Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
    Just want to know,how to find out the last updated row in a particular VO.
    Any Help would be appreciated as this a immediate requirement.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on May 4, 2011 1:06 AM

    Hi Magesh
    It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean); OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    262
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    Thanks
    Pratap

  • How to populate bind variable in view objects where clause in ADF faces

    I've got a page with 2 input items.
    The user manually enters the first value.
    On the second input item I have created a LOV for the item which opens in a popup. How do I restrict the data returned in the LOV using the value entered in the first input item. I have created a bind variable and have included it in the where clause for the view object but how do I populated it.

    Here is an example:
    Using the HR schema with the EMPLOYEES and DEPARTMENTS tables.
    Example is using ADF BC and created an EMPLOYEES entity with an updateable view object for page,
    and created a DEPARTMENTS view as a lookup
    (SQL: select department_id, department_name from departments where department_name = :DeptName)
    1: add method to the backing bean to filter the LOV
    public void getTextValueToFilterLOV(ValueChangeEvent valueChangeEvent) {
    Object value_from_form = valueChangeEvent.getNewValue();
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application fapp = fctx.getApplication();
    JUFormBinding formBinding = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
    DCIteratorBinding dcBinding = (DCIteratorBinding)formBinding.get("DeptLOVIterator");
    ViewObject vo = dcBinding.getViewObject();
    vo.setNamedWhereClauseParam("DeptName",value_from_form);
    vo.executeQuery();
    2. add valueChangeListener to the inputText on the page with an id and autoSubmit="true"
    <af:inputText value="#{bindings.LastName.inputValue}" label="#{bindings.LastName.label}" binding="#{backing_DeptForm.inputText3}"
    id="inputText3"
    autoSubmit="true"
    valueChangeListener="#{backing_DeptForm.getTextValueToFilterLOV}">
    </af:inputText>
    3. reference the LOV with the id name on the partialTriggers property
    <af:selectOneChoice value="#{bindings.EmployeesUpdView1DepartmentId.inputValue}"
    label="#{bindings.EmployeesUpdView1DepartmentId.label}" binding="#{backing_DeptForm.selectOneChoice1}"
    id="selectOneChoice1"
    partialTriggers="inputText3">
    <f:selectItems value="#{bindings.EmployeesUpdView1DepartmentId.items}"
    binding="#{backing_DeptForm.selectItems1}"
    id="selectItems1"/>
    </af:selectOneChoice>
    Summary:
    When you entered a text (LastName), that value is passed into the backing bean method.
    The Bean method code will find the LOV Iterator and put the value into the bind variable.
    Cheers,
    Jim

  • Fails to update data during view object test

    Hi, I'm using:
    Postgresql w/JDBC drivers
    Jdeveloper 10g
    I created entities and associations for my tables, and now I created a view object, assigned it to application module and run it.
    It shows the data properly, but when I try to commit a change, it gives me:
    Business Component Browser - oracle.jbo.DMLException
    (oracle.jbo.DMLException) JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE PUBLIC.SIGNON Signon SET username=? WHERE username=?".
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ERROR: parser: parse error at or near "Signon" at character 22
    Any idea what I'm doing wrong?

    You're hitting Bug# 3537056. Contact worldwide support and they have a one-off patch for this that they can supply for you. The issue is related to lack of support in your database for a table alias in the update statement.

  • How to set bean property in jsf page

    Hi,
    Hopefully theres an easy solution, but I can't figure it out...
    I have a managed bean that spans several jsf pages.
    Within each page I want to set a flag that tells the bean which page it is serving (as well as some other params).
    How do I set a property of the bean in the page?
    I've tried
    <jsp:useBean id="filter3" scope="request" class="com.aol.rsistats.ui.FilterBean"/>
    <jsp:setProperty name="filter3" property="filterType" value="3"/>
    but that doesn't load the page through the normal JSF routine (and I initialise some values of the bean in the faces-config.xml file... so these are not initialiased when the setProperty is called) .
    (In general I get some strange behaviour when I mix jsf tags with jsp, or jstl, so I've avoided it as much as possilble)
    Is there another way?
    Cheers,
    Keith

    This example works for me (using jsf-1_1_01).
    Index.jsf:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page language="java" %>
    <%-- jakarta-taglibs-standard-1.0 --%>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%--
    Note, that with jakarta-taglibs-standard-1.1.1 taglib directive
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    the example NOT works!!!
    --%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <head>
    <title>MyTitle</title>
    </head>
    <body>
    <f:view>
    <%--
    Do not delete the following lines! You need to address to WIManager before using c:set.
    --%>
    <!--
    <h:outputText value="#{WIManager != null}"/>
    -->
    <c:set target="${requestScope.WIManager}" property="bpId" value="bpIdValue"/>
    <h:form id="MyWebFormTask" >
    <h:commandButton id="ok" action="ok" value="Ok"/>
    <h:inputHidden id="bpId" value="#{WIManager.bpId}"/>
    </h:form>
    </f:view>
    </body>
    </html>
    ok.jsf:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page language="java" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <head>
    <title>MyTitle</title>
    </head>
    <body>
    <f:view>
    WIManager.bpId: {<h:outputText value="#{WIManager.bpId}"/>}<br>
    </f:view>
    </body>
    </html>
    In ok.jsf I can see WIManager.bpId property set in Index.jsf.
    faces-config.xml:
    <managed-bean>
    <managed-bean-name>WIManager</managed-bean-name>
    <managed-bean-class>my.package.WIManagerBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>bpId</property-name>
    <property-class>java.lang.String</property-class>
    <value>#{param.wim_bpid}</value>
    </managed-property>
    </managed-bean>
    Resume:
    -- use <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    instead of <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    -- address to WIManager before using c:set.

  • How to set photometricInterpretation property while storing TIFF using JAI?

    I am converting JPG Grey Sale image in to bilevel image and saving in TIFF format with Group IV compression.
    When I view the output TIFF, some applications displaying it properly and some others by inverting the image.
    After a long time, I found that photometricInterpretation property is used to control this property of White_on_Black or Black_on_White in TIFF files.
    In web I have found that, if we use IndexColorModel, then there is no problem. But, I am not using it and I don't know how to set color model of RenderedOp to IndexColorModel. Did anybody know it?
    Is there any other way to set the PHOTOMETRICINTERPRETATION property ?
    Any solution or suggestions are welcome...
    Edited by: baskaraninfo on Nov 20, 2007 7:20 AM

    To view the solution :
    http://www.javaworld.com/javaforums/showflat.php?Cat=2&Number=70133&an=0&page=0#Post70133

  • Can af:selectOneRadio initial selection be set to values from view object?

    Using JDeveloper 11.1.1.4
    Hi all. I have a selectOneRadio on a data entry page which works well. Now I want to (if possible) use the selectOneRadio on an edit page--setting the choice initially to the values that were stored in a database table's record (from the data entry page). I am able to retrieve the data selected in the data entry page, but I can't find anything referencing what I want to do on the edit page. Note that my selectOneRadio objects are actually on jsff's in a region on a page. I've supplied how I designed selectOneRadio on the data entry page in hopes that someone can gleen from it and tell me how to set one up on the edit page and set its initial value to the value combination stored.
    There are two columns in the data displayed (example):
    Short Format / Text
    Short Format / Comma Delimited
    Long Format / Text
            <af:selectOneRadio value="#{bindings.Pay_File_Data_FmtVO1.inputValue}"
                               shortDesc="#{bindings.Pay_File_Data_FmtVO1.hints.tooltip}" id="sor1"
                               inlineStyle="text-align:left; font-size:2.0em;"
                               autoSubmit="true" showRequired="false" label="File Format">
              <f:selectItems value="#{bindings.Pay_File_Data_FmtVO1.items}" id="si111"/>
            </af:selectOneRadio>
    public class FileTypesBean {
        String fileFormat = null;
        String dataFormat = null;
        public BindingContainer getBindings() {
            return BindingContext.getCurrent().getCurrentBindingsEntry();
        public void getFileTypesSelection(ActionEvent actionEvent) {
            fileFormat =
                    (String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValue}");
            dataFormat =
                    (String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValues[1]}");
            //System.out.println("dataFormat = " + dataFormat);
            // now put in ParamsBean for use
            AdfFacesContext afci = AdfFacesContext.getCurrentInstance();
            ParamsBean params =(ParamsBean)afci.getPageFlowScope().get("paramsBean") ;
            params.setFileTypeParam(fileFormat);
            params.setFileDataTypeParam(dataFormat);
        public Object resolveExpression(String el) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ELContext elContext = facesContext.getELContext();
            ExpressionFactory expressionFactory =
                facesContext.getApplication().getExpressionFactory();
            ValueExpression valueExp =
                expressionFactory.createValueExpression(elContext, el,
                                                        Object.class);
            return valueExp.getValue(elContext);
    }Thanks in advance,
    Troy
    Edited by: Hoopestr on Apr 18, 2012 10:54 AM

    in the amimpl have an edit method, get the value you want to set and set that value for your af:selectOneRadio, row.setAttribute(PayFileDataFmtVO1, value);

Maybe you are looking for

  • How do you create an array without using a shell on the FP?

    I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file.

  • ERROR in running a Form

    Hi I have installed Oracle 10g DS in my PC successfully.But while i am running the form i am getting internet explorer error and the browser is shutting down. But i am not having any problem to run a oracle report. Can anybody help me out from this p

  • Safe sleep or hibernation won't work on my Macbook 13" Unibody (late 2008)

    I have a 13" unibody Macbook which I bought in October 2008. The systems sleeps well once the lid is closed but if it runs out of battery it will not hibernate. I checked the output of pmset and everything is properly set for mode 3, which is the "sa

  • I want to move a rental film from Apple TV to ipad

    I have rented a movie on my Apple tv that I now want to watch on my iPad, how do I do this

  • GR quantity for movement type 101 not updated in PCA

    Hi, Does anyone have an idea why quantity is not updated in GLPCA-MSL for 101 movement type?. It has updated in FI (BSEG-MENGE) but not in PCA (GLPCA-MSL). Appreciate prompt response. Thanks, Rashmi