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 conversion is to attach ".value" in the end of EL binding reference and it will convert it to a java.lang.Double format type.
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 conversion is to attach ".value" in the end of EL binding reference and it will convert it to a java.lang.Double format type.
Comments
for ex:
"#{binding.myAttr.inputValue}"
actually i have "Y" returned by above binding when i try to use like
"#{binding.myAttr.inputValue=='Y'?'true':'false'}, its not comparing the value.
please suggest me,
if it's Varchar2 type in DB and it's automatically converted to String in EL. You can print out the value of #{bindings.myAttr.inputValue} first to see whether it returns "Y".
currently i am handling with hidden(invisible) outputtext which has the binding in bean, then i am using with this binding var, in another method which is avbl in same bean, it consumes server calls, hence performance issue raises.
suggest me right way how to handle this using #{binding.xx.inputValue}
Let me know if there is any other way we can handle this without calling to Bean.
TIA,
If you need my help, please explain the use case and any codes you are implementing. It's hard to guess what you are doing.
i have a number in EL(DB field is number) i.e.
#{bindings.AssetId.inputValue}
how to convert this into String???
You'd better do it in the managed bean to convert the Number to String type and reference it from the EL.
When we use IN clause in the query used to create View object,
how do we give multiple parameter values?
Bigo Live Stream users