How to compare transient attribute

Hi
I am using jdev11.1.2.1.0
I have an adf table based on view object which have two columns (one is applied_amt and second is pass_amt)
I have two calculated transient fields(named total_amt and total_pass_amt) which have Sum of Amount of both columns (applied_amt and pass_amt) respectively
On jsf page I want to apply a validation which checks that if user changes the value of pass_amt column the it checks that total_pass_amt must always less than or equals to total_amt (i. e. total_pass_amt<=total_amt).
How can I do the same.
Please provide the solution ASAP.
Thanks
Edited by: Chandan Srivastava on २१ मई, २०१२ ११:४८ पूर्वाह्न

Chandan,
Your use case is not very clear. Please correct me if my understanding is wrong:
total_amt = applied_amt + pass_amt
total_pass_amt = applied_amt + pass_amt
These two values total_amt, total_pass_amt will always be equal as soon as you have the same condition on RHS.
On jsf page I want to apply a validation which checks that if user changes the value of pass_amt column the it checks that total_pass_amt must always less than or equals to total_amt (i. e. total_pass_amt<=total_amt)On JSFF page, do you want to recalculate only total_amt once the value in pass_amt column is changed?

Similar Messages

  • How to save transient attributes?

    Hi,
    I have a query related to saving the View Object transient attributes :-
    Following is the scenario which we want to implement:-
    1. We have a  page on which we are using a table component with 5-6 VO transient attributes and n number of rows.
    2. There is a save button on the page which allows user to save the activity which he is performing and able to resume the activity later on.
    3. As soon as he click on the save button, all the EO attributes get persisted.
    4. When he re-opens a flows, he can see a resume button which allows him to resume the activity from the point he left.
    5. So User should be able to see the changed he made on the table component on clicking the resume button which he made before saving the activity.
    Now, the question is how we can retrieve the transient attributes on resuming the activity or is there any way by which we can save the transient attributes of View object ?
    Please help !!

    Refer
    ADF Practice: Passivation and Activation of View Objects with Transient Attributes

  • How to populate transient attribute from view object dynamically

    I have three 4 tables named as "employee,event,event_progress,and checklist progress". i have created a view object using the first three tables . i ahave also created 5 transient variables in to the same view object.when i dragged the view object in to my page as a table i want to populate those transient attribute.
    i have 5 transient attribute which are present as a column value named as chechlist_name in another table "checklist".those all transient attribute also having two sub rows whose data should be populated from the checklist progress table.

    Hi
    Please post your question on this forum, your question belong to this forum.
    JDeveloper and ADF
    Muhammad Nasir

  • How to make Transient Attribute Mandatory in View Object?

    Hi ,
    I have a Transient Attribute 'TransientFromCode' which is based on LOV .On UI ,I am showing this 'TransientFromCode' as 'SelectOneChoice' .
    So on selection of this i am populating other mandatory attributes.
    My requirement is to show this as 'Required' on UI but in View Object i am not able to find mandatory property for this attribute.
    I dont want to use required='true' . So can you plesae tell me is there any way to make Transient attibute as mandatory on UI .
    Thanks

    940637 - Your Use Case is a little vague\confusing.
    If you are just trying to get the standard "Required" architecture, it probably isn't working because you have incorrect syntax. It is #{bindings.MyViewObj.MyAttr.hints.mandatory}
    Yours: "#{bindings.UnitOfMeasureIntraClassConversion.hints.TransientItemDesc.mandatory}"
    It will "dynamically" pick this up at Runtime from the ViewObject Attributes "Mandatory" property (Attributes\Details tab), BUT the EL will always evaluate to "true" so this is the same functionally as just hard coding the UI component's Required property to "true" (although doing so is against Best Practices)
    If you are just wanting to SHOW the field as required without the standard Validation logic (because you are coding your own), you could:
    1) JUST set the UI component's "ShowRequired" property = true. This displays the * next to the Label (regardless of actual View Object Attr setting) but fires no validation.
    2) If you want to not show * but some custom standard, you could just create ANOTHER transient Attribute in the View Object and call it "TransientItemDescRequired" and set it to a Literal "y" or leave it blank and programmatically set it later... You can code your own validator\method\whatever against it, etc
    Edited by: donhoyt on Jul 5, 2012 7:58 AM

  • How to add transient attribute to URL Data Control

    Hi,
    Is it possible to add a kind of "transient" attribute to an URL Data Control on model layer?
    regards
    Peter

    Hi,
    no. it doesn't. Even with ADF BC, the transient attributes need to be held by the business service and not the data control
    Frank

  • How to compare user attribute : Urgent

    Hi,
    I have two users in same company code with (although department is different but should not be an issue ), however their behavior is different in shopping cart ( one calculate tax one does not with same ship-to zip code ), is it possible to compare them extensively  their internal associations with plant etc.
    Points will be awarded.
    Thanks,

    Hi. Table HRT1222 stores the normal attributes. You get from there to the actual org unit / position in HRP1222.
    HRT5502 holds the plants and storage locations, linked to org unit / position in HRP5502.
    If you get the 2 users side by side i SE16 and flick between the 2 you should see differences quickly.
    Regards,
    Dave.

  • How to add new transient attribute in VO ?

    Greeting ,
    I just want to add new transient attribute in VO .suppose i have a VO which have 5 attribute and i want to add one new transient attribute type of select one choice .
    how does it possible .
    regards
    prateek
    Edited by: Prateek on Jul 10, 2011 10:25 AM

    see, i want just add a static select one choice for example :
    <af:selectOneChoice label="Connection Type"
    requiredMessageDetail="Please select a connection type"
    id="soc2" showRequired="true" autoSubmit="true"
    value="#{uploadBillDetails.connectionType}">
    <af:selectItem label="Select Connection Type" value="Select" id="si4" />
    <af:selectItem label="Landline" value="Landline" id="si3" />
    <af:selectItem label="CDMA" value="CDMA" id="si2"/>
    </af:selectOneChoice>

  • How to compare the value of a specied attribute to a string

    I am looking for an example of how to compare the value of an attribute to a string. (I think)
    I have been trying to:
    if (attrs.get("title")== "Vampire") -- you already know this did not work.
    How can I check to see if the title="Vampire"?
    The code below will get me the title of admin (which should be Vampire)
    import javax.naming.Context;
    import javax.naming.directory.InitialDirContext;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.Attributes;
    import javax.naming.NamingException;
    import java.util.Hashtable;
    class Giles {                  
    public static void main(String[] args) {
              Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://192.168.1.55:389/o=sunnydale");
         try {                                                                     
         DirContext ctx = new InitialDirContext(env);
         Attributes attrs = ctx.getAttributes("cn=admin");
         System.out.println("Title: " + attrs.get("title").get());
         ctx.close();
         } catch (NamingException e) {                                     
         System.err.println("Problem getting attribute: " + e);
    Thank you!!
    Steve

    I guess, you are looking for searching for attributes of an user object.
    Here is the sample code to list all the attributes of an 'user' objectclass.
    Tell me if it helps or not.
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    public class GetAttributes
         public static void main (String[] args)
              Hashtable env = new Hashtable();
              //Must use either the userPrincipalName or samAccountName,
              //Cannot use the distinguished name
              String adminName = "cn=abcd,cn=Users,dc=ssotest,dc=com";
              String adminPassword = "DEF1234";
              String ldapURL = "ldap://pni3w067:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialLdapContext(env,null);
                   // Create the search controls
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user))";
                   //Specify the Base for the search
                   //cn=policygroup,ou=policyusers,ou=ssoanay,;
                   //String searchBase = "ou=policyusers,ou=ssoanay,dc=ssotest,dc=com";
                   String searchBase = "cn=abcd,cn=users,dc=ssotest,dc=com";
                   //initialize counter to total the results
                   int totalResults = 0;
                   // Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        totalResults++;
                        System.out.println("\nName of Object : " + sr.getName());
                        // Print out some of the attributes, catch the exception if the attributes have no values
                        Attributes attrs = sr.getAttributes();
                        //System.out.println("6");
                        if (attrs != null) {
                             try {
                                  /*NamingEnumeration enum = attrs.getIDs();
                                  while(enum.hasMore()) {
                                       System.out.println("IDs:"+enum.next().toString());
                                  NamingEnumeration enum2 = attrs.getAll();
                                  while(enum2.hasMore()) {
                                       System.out.println("Attribute - "+enum2.next().toString());
                             catch (Exception e)     {
                                  System.out.println("Exception:" +e.getMessage());
                        else {
                             System.out.println("attribute is null");
                   System.out.println("Total results: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                        System.err.println("Problem searching directory: " + e);
         //return 0;
    }

  • How to reference a custom property in a vo transient attribute expr + bug

    Hi all
    I have created a transient attribute with an expression that evaluate null content to replace it by a appropriate text.
    <ViewAttribute
        Name="DescriptionUI"
        IsUpdateable="false"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR">
        <TransientExpression><![CDATA[((Description == null) ? 'Pas de description' : Description)]]></TransientExpression>
      </ViewAttribute>I have defined a custom property for that attribute that contains the message text. I was surprised to see that the custom property was not associate with the attribute in the source file. Don't understand where the association is done
        <Properties>
          <CustomProperties>
            <Property
              Name="flex.tree.noLabel"
              ResId="flex.noDescription"/>
          </CustomProperties>
        </Properties>I had some difficulties to use the custom property editor. When creating a new related one by using an existing resource the property column value is not changed and the content 'Property' is generated. Because no relationships exists between attribute and the property, the entry is lost in the table referring custom property list for the attribute when your come back into the view object or if you save an another entry in an another attribute.
    So my first question ? Is the attribute editing part the right part to define custom property pairs if they are not related to attributes ? is it a bug ?
    My second question is : is it possible to evaluate the bundle in the expression (replacing the literal 'Pas de description' by an expression) ? What is the expression to use ? Where it is described to do such things in the help or in the documentation ?
    Thank you

    This is wrong
    ((Label == null) ? {FlexParameterModelBundle['flex.tree.noLabel']} : Label)
    What is the correct syntax to refer to the project model standard bundle in the groovy expression ?
    Thank for the help !

  • How to call a method in Viewimpl from transient attributes value

    Hai,
    I have a method in ViewImpl say validate().I need to call this method from an transient attributes value where value type is expression.i used adf.object.validate() but its not working.
    Can any one help me
    Thanks in advance

    Hai,
    Jabr i read these in a pdf where it explains about Introduction to Groovy support in JDeveloper and Oracle ADF 11g
    Referencing custom methods in the EntityImpl class
    If you have defined a method in your EntityImpl class, then this can be called as part of your
    expression for an attribute default:
    adf.object.getDefaultSalaryForGrade()
    Unlike when referencing an attribute of the entity object, which can be done by simply
    referencing the attribute name, when referencing a method, you are required to prefix the
    method name with adf.object.
    So is there a way?
    regards

  • How to set transient value to persistent attribute at commit in View Object

    Hi
    I'm using JDev11.1.1.2
    I have a transient atttribute X in my View Object and a persistent attribute Y. I want the value of X to be assigned to Y before commit.
    I saw that the entity has a method doDML that is used for this, but the problem is that this transient attribute is in my View Object, not entity object.
    Any ideas?
    Thanks

    Hi
    My transient attribute has a groovy expression assigned. This expression is calculated from other attributes in the view object.
    It seems that the setter method of the transient attribute is not called when the value gets updated through groovy.
    I used a transient attribute that duplicates my persistent attribute because groovy expression on transient attributes are recalculated, and the groovy expression on persistent attributes are not recalculated - they are used only for default values.
    Any other ideas are appreciated!
    Thanks

  • How to search on a transient attribute in a VO ?

    Hi,
    I want to search on a field, on my page, that's not in the database. So I created a transient attribute, in the view object, that is queriable so it appears on the find page.(with JDeveloper/JHeadstart) But when I use the attribute in the where clause of the View Object I get the following error: "SQL Query Error Message: ORA-00904 "STATUSGROEP": invalid identifier".
    I also tried to use a bind variable (:1) instead of the attribute name in the where clause but then I get the runtime error: "java.sql.SQLException: ORA-01008: not all variables bound".
    What am I doing wrong ?
    Regards,
    Chris van Dijk

    Michiel / Chris
    Based on the find attributes, JHeadstart automatically adds a SQL WHERE CLAUSE to the ViewObject. Since transient attribute do not map to a valid column name, this will not work.
    I built a little testcase with a transient attribute, and it was simply ignored, I did not get the ORA-904. From your description, it looks like you added some bind variables to the ViewObject as well. That is not supported in combination with find pages, unless you overwrite method
    DataObjectSet getDataObjectSet(String queryType, HashMap arguments, Object sessionId, int startRange , int rangeSize)
    on the handler.
    Anyway, if you really want to filter on a transient attribute, you will have to do that in java code, overriding the aforementioned method:
    - remove the transient attribute from the arguments HashMap
    - call super to execute the query without the transient attribute
    - loop over the result set and remove the rows that do not match with the transient attribute value.
    This might be quite slow, depending on the size of the result set returned by the query. Can't you somehow translate the transient attribute value to some SQL column values so all filtering can be done using SQL?
    Steven Davelaar,
    JHeadstart Team.

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • Issue with value of  transient attribute after filtering or sorting a table

    Hi guys,
      i'm using jdev 11.1.1.4.0 .
      i've the use case :
             - a table with a column containing a checkbox to mark the selection of  a row
    <af:column align="center" sortProperty="TemIsChosen" filterable="true"
    sortable="true" id="c6">
    <af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
    shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
    id="sbc1"
    valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
    </af:column>
             - i select one or more rows with checkboxes
             - if i filter  or sort the table, the selection of the checkboxes reset to not selected (value false by default).
         I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
         What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
          I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
           So  now it's the filtering feature that doesn't work as expected.
       How can i implement  my use case withouth the troubles i've described.
    Best regards,
    David

    Hi Frank,
       no it's a view object level attribute inside a read-only view object.
      The view object doesn't use any entity.
      Here is the definition of the attribute in the xml file of the VO, if can help you :
    <ViewAttribute
        Name="TemIsChosen"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.Boolean"
        ColumnType="BIT"
        AliasName="VIEW_ATTR"
        SQLType="BIT"
        Passivate="true">
        <Properties>
          <SchemaBasedProperties>
            <TOOLTIP
              ResId="ADD"/>
            <DISPLAYWIDTH
              Value="50"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
    David

  • ReadOnly items based on transient attribute - best approach?

    JDev11 question:
    Do you have any idea how can I make items updatable/readOnly based on transient attribute?
    Why is there only feature for "Updatable while new"..?It should be updatable based on function.
    I tried making my coponents disabled based on transient attribute based on a groovy expression.
    However when I invoke af:query, there is a problem - a bug which is similar to this thread:
    http://cn.forums.oracle.com/forums/thread.jspa?threadID=1018561&tstart=89
    So there should be another good approach.. Please suggest anything you think is flexible enough.

    Navid,
    JHeadstart checks whether the attribute definition is queryable before adding it to the list of advanced search attributes. A transient VO attribute can still be set to queryable, for a transient EO attribute this is not possible. We will remove this check on queryability in the upcoming patch release, since you have a valid use case. For now, you can subclass JhsSearchBean and override method createArgumentListForAdvancedSearch and comment out the check for "def.isQueryable()".
    Steven Davelaar,
    JHeadstart Team.

Maybe you are looking for