Skip to main content

Posts

Showing posts with the label Binding

Programmatically Access Page Bindings

Using EL references bindings declaratively in ADF should always be followed, but there always is room for you to argument your application behavior in your own code. Here I am summarizing to access page bindings programmatically. How to access Page Definitions/Binding Context/Binding Container? BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry(); How to access page bindings in the page definition? There are different types of bindings: attributeBinding, treeBinding, listBinding, actionBinding, methodBinding, etc The corresponding types of codings have only two types: controlBinding and operationBinding. It's easy to recognize here. ActionBinding and methodBinding reference some actions and custom methods which are supposed to be executed somehow, therefore goes into the type of OperationBinding because it has execute() function. Other bindings are belonging to the valueBinding type so controlBinding is used. The codings are: OperationBind...

Expression Language Conversion in ADF

Expression Language (EL) is widely used in ADF Binding to reference items in the Binding Context. In some scenario, direct use of EL reference isn't enough and manipulation of several EL references needed to accomplish the task. While you can always manipulate the logics in a manged bean, if you want to go with "declarative", here is why I am saying about. Varchar2 type in SQL format (database) is converted to String automatically, but Number type in SQL is converted to oracle.jbo.domain.Number format. EL inherit generic Java API and can only recognize java.lang.Number type. Therefore, if you have two EL binding references to two database Number attributes: #{bindings.NumberAtt1.inputValue} and {bindings.NumberAtt2.inputValue}. If you want to evaluate if the first number greater than the second number, you cannot use compareTo() method which is belongs to oracle.jbo.domain.Number and you cannot use #{A > B} because A or B is not java.lang.Number A simple conversi...

How to reference the value in a ADF Table column declaratively and in Java

I am correcting myself. I think I could not find a way to reference the value in a ADF table column using EL outside the table component. As we all know, the value in the column of ADF table is referenced by using EL " #{row. AttributeName } ", while "row" is defined in the ADF table component attribute - "Var" by default. If there is a scenario that you have to reference the value outside of the table: for example, you have a button outside of the table and will be dynamically disabled if a value in the table is null and enabled if a value is not null. The question is, how you gonna reference the column value out of the table. Using the IteratorBinding EL is not accessible, I was trying to use #{Bindings.IteratorName.AttributeName.inputValue} to reference the value but it failed, since it is not the way it should be referenced. It is a attribute of the active Iterator binds to the table so simply it should be using the attribute binding. When drag and...