How to use Type Casting in JSF Expression Language

I have an attribute CategoryId in my VO of type oracle.jbo.domain.Number. I am trying to use the expression of Boolean item in JSF as #{row.CategoryId != 4}
Here is the JSF code:
                      <af:column id="s141NewItem3Col" noWrap="true" width="100"
                                 rowHeader="false">
                        <f:facet name="header">
                          <af:outputLabel value="CAtIDDeq4" showRequired="false"
                                          id="ol18"/>
                        </f:facet>
                        <af:inputText id="s141NewItem3"
                                      value="#{row.CategoryId != 4}"
                                      label="CAtIDDeq4" required="false"
                                      readOnly="#{((pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn']))) or ((!pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn'])))}"></af:inputText>
                      </af:column>I am getting the run time exception as "Can not convert 4 of type class oracle.jbo.domain.Number to class java.lang.Long".
I am wondering how the row.CategoryId is treated as Long?. PLease advise. Also, will I be able to use type casting expressions in JSF Expression Language?
Thanks, Pradeep

use attributeValue
Try *#{row.bindings.CategoryId.attributeValue != 4}* ?
Check this thread for details which discusses about the same:
El expression to disable  or enable
Thanks,
Navaneeth

Similar Messages

  • How to use type cast change string to number(dbl)?can it work?

    how to use type cast change string to number(dbl)?can it work?

    Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
    2 simple examples:
    "1" cast as I8 = 49 or 31 hex.
    "1" converted to decimal = 1.
    "20" cast as I16 = 12848 or 3230 hex.
    "20" converted to decimal = 20.
    Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
    32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
    When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
    See tha attached LabView 6.1 example.
    Attachments:
    TypeCastAndConvert.vi ‏34 KB

  • How to use ternary operator in JSF using EL expression

    how to use ternary operator in JSF using EL expression

    I want to use ternary operator for h:datatable columnclasses attribute like as below
    <h:datatable
    columnClasses="#{booleanExpression ? style1,style2 : style3,style4}"
    />
    But it's not working.Is there any other alternative to do this?

  • Oracle:how to use max() function in case expression

    how to use max() function in case expression, Please explain with any example

    Hope this helps and should be self explanatory
    with t as
    (select 1 col,100 col2 from dual union
    select 2 ,100 from dual union
    select 2 ,200 from dual union
    select 3,100  from dual union
    select 3,200  from dual  )
    select col, case when max(col2)=100 then 'with 100 range'
    when  max(col2)=200 then 'with 200 range' end  from t group by col

  • Why we use type casting  ' ?='

    Hii Team
    sample code for fetching the input value from search view which is connected to btq1order contextnode
    DATA : lr_qs TYPE REF TO cl_crm_bol_dquery_service,
           lr_qr TYPE REF TO if_bol_bo_col,
    lr_qs ?= me->typed_context->btq1order->collection_wrapper->get_current( ).
    lr_qr = lr_qs->get_query_result( ).
    I am new to SAP CRM .while understanding the code i got stuck in one problem that ,
    1.what is the main purpose behind
    TYPE CASTING ie;  '?='
    2.what happens if we write ?=  becoz if we write  '='  instead of  '?='  the system thows an error.
    3.when to use this operator ?= and when we cannot use ?
    It is used almost every where in BOL coding .please help me  by giving complete explaination with an example if possible.
    Thanks in Advance

    Hi Abhishek,
    Please check returning parameter type for get_current_dquery() method. In case returning type is mutually convertible then you don't have to use type casting.
    But in case where you are taking results in some other type where results are compatible but with different structure then you use type casting.
    best example would be cl_crm_bol_entity and if_bol_bo_property_access. Here property access is an interface to class and hence we use type casting.
    Please refer to:
    type casting
    You can find more documentation on internet if you search for type casting.
    Regards,
    BJ

  • How to use TYPE addition with the OPEN DATASET ?

    Hi,
    How to use TYPE addition with the OPEN DATASET and what is the use ?
    For Example:
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Also, if I wish to do the same for a .CSV file how can we do it.
    Thanks,
    -Sid

    Hi,
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
    For more information press F1 on OPEN DATASET.
    Thanks

  • J2SE 6 warning message when using type casting

    With Java SE 5 and 6 version, there's always an annoying warning message when I write the following code:
    LinkedList<MyBean> cart0 = (LinkedList<MyBean>) session.getAttribute("cart");The warning message is because I use the type casting with the getAttribute method and thus this is not type-safe. So how do I get around the warning message and write standard code that sticks to the J2SE 6 standards? Thank you.

    Add a @SuppressWarnings annotation to the method. A bit intelligent IDE will provide you a quickfix option for it.
    Keep in mind: it's a warning, not an error. The sessionMap is cannot be specifically parameterized and will never be, it should be able to store any object to your taste. Further on this has not much to do with JSF at itself.

  • How to use postback property for JSF to reneder a popup only once

    Hi All,
    I'm using java script function to show a JSF page as popup. I have called the javascript function on page load of another JSF page.
    How do i make sure that the popup is getting rendered only once and not everytime the page is getting refreshed .
    Can i use postback property in JSF page for this purpose ?
    Thanks in Advance.

    try postback..
            Boolean postBackValue = (Boolean)resolveExpression("#{adfFacesContext.postback}");
            Boolean defaultBooleanValue = new Boolean("false");
            if (postBackValue.equals(defaultBooleanValue)) {
      public static Object resolveExpression(String expression) {
        FacesContext ctx = FacesContext.getCurrentInstance();
        Application app = ctx.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = ctx.getELContext();
        ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
        return valueExp.getValue(elContext);
      }

  • SRM 7.0 BADI Define Agents-- How to use type /sapsrm/t_wf_area_entity

    Hi Experts,
    I'm using SRM 7.0. When implementing BADI /SAPSRM/BADI_DET_AG (Define the agents of  procsess controlled workflow), I created the sub-class of interface /SAPSRM/IF_WF_AREA to develop my won logic in method GET_RESPONSIBLE_APPROVERS.
    I want use the data in workflow container, seems the method GET_AREA_ENTITY_IDS of /SAPSRM/IF_WF_AREA  can provide a pointer which type is /sapsrm/t_wf_area_entity and point workflow area.
    My question is how to use this pointer (or how to use the type /sapsrm/t_wf_area_entity )? Many thanks.
    PS. I found some example code delivered by sap, but i want know the full structure which /sapsrm/t_wf_area_entity point. Below code for your reference:
    METHOD /sapsrm/if_wf_area~get_responsible_approvers.
      DATA lt_area_entity_id TYPE /sapsrm/t_wf_area_entity_id.
      DATA lr_area_entity_id TYPE REF TO /sapsrm/wf_area_entity_id.
      DATA ls_actor_id       TYPE swhactor.
      DATA lt_approver       TYPE /sapsrm/t_wf_approver.
      FIELD-SYMBOLS: <ls_agent_id> TYPE /sapsrm/s_wf_approver.
      lt_area_entity_id = me->/sapsrm/if_wf_area~get_area_entity_ids( ).
      LOOP AT lt_area_entity_id REFERENCE INTO lr_area_entity_id.
        ASSIGN lr_area_entity_id->* TO <ls_agent_id> CASTING.
        TRY.
            ls_actor_id-otype = <ls_agent_id>-approver_ot.
            ls_actor_id-objid = <ls_agent_id>-approver_id.
            lt_approver = /sapsrm/cl_wf_config_user=>get_manager_list( ls_actor_id ).
            APPEND LINES OF lt_approver TO rt_approver.
          CATCH /sapsrm/cx_wf_error /sapsrm/cx_wf_abort.
            CONTINUE.
        ENDTRY.
      ENDLOOP.
    ENDMETHOD.

    Hi Darcy,
    You can also use FM SAP_WAPI_READ_CONTAINER to read workflow container values.
    Please state if you have some other specific requierment.
    Regards,
    Saumya

  • How to use j query in .jsf page which is designed using adfpagetemplate.

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled7.jsf" id="d1">
    <af:form id="f1">
    <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">
    <f:facet name="center">
    <af:resource type="javascript"
    source="/lib/jquery/jquery-1.3.2.min.js"/>
    <af:resource type="javascript">
    function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next() : $('#slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
    $active.removeClass('active last-active');
    $(function() {
    setInterval( "slideSwitch()", 15000 );
    </af:resource>
    <af:resource type="css">
    #slideshow IMG {
    position:absolute;
    top:0;
    left:0;
    z-index:8;
    opacity:0.0;
    #slideshow IMG.active {
    z-index:10;
    opacity:1.0;
    #slideshow IMG.last-active {
    z-index:9;
    </af:resource>
    <af:panelGroupLayout id="slideshow" layout="vertical">
    <!-- The use of groups avoids that each image gets surrounded by a div -->
    <af:group>
    <af:image source="/images/cristo1.jpg" id="i1" />
    <af:image source="/images/cristo2.jpg" id="i2"/>
    <af:image source="/images/ipanema1.jpg" id="i3"/>
    </af:group>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="header"/>
    <f:facet name="end"/>
    <f:facet name="start"/>
    <f:facet name="branding"/>
    <f:facet name="copyright"/>
    <f:facet name="status"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    Above content is my code written in jsf page....
    jquery working fine if i create page withoput pagetemplate...
    Any please guide me to use jquery in the jsf page(created with page template)...
    Thanks in advance
    Edited by: 991543 on May 7, 2013 11:05 PM

    Hi frank,
    thanks for your reply frank........still am facing the same issue even i tried wat you told.
    I have pasted the code below for your reference.....
    please let me knw wat is the wrong thing in below code if any thing wrong plz guide me to resolve because this is needed in our project, thanks in advance.
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled7.jsf" id="d1">
    <af:form id="f1">
    <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">
    <f:facet name="center">
    <af:resource type="javascript"
    source="/lib/jquery/jquery-1.3.2.min.js"/>
    <af:resource type="javascript">
    function slideSwitch() {
    var $active = $('#pt1:slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#pt1:slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next() : $('#pt1:slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
    $active.removeClass('active last-active');
    $(function() {
    setInterval( "slideSwitch()", 1000 );
    </af:resource>
    <af:resource type="css">
    #pt1:slideshow IMG {
    position:absolute;
    top:0;
    left:0;
    z-index:8;
    opacity:0.0;
    #pt1:slideshow IMG.active {
    z-index:10;
    opacity:1.0;
    #pt1:slideshow IMG.last-active {
    z-index:9;
    </af:resource>
    <af:panelGroupLayout id="slideshow" layout="vertical">
    <!-- The use of groups avoids that each image gets surrounded by a div -->
    <af:group>
    <af:image source="/images/cristo1.jpg" id="i1" />
    <af:image source="/images/cristo2.jpg" id="i2"/>
    <af:image source="/images/ipanema1.jpg" id="i3"/>
    </af:group>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="header"/>
    <f:facet name="end"/>
    <f:facet name="start"/>
    <f:facet name="branding"/>
    <f:facet name="copyright"/>
    <f:facet name="status"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    Thanks & Regards
    Gowthaman Narayanan
    Edited by: 991543 on May 15, 2013 4:27 AM
    Edited by: 991543 on May 15, 2013 4:30 AM

  • How to use web services in JSF app

    I am unsure if this is the right forum for this question. Let me know if it is not - and where I should go.
    Anyways, I'm building a JSF web app, in which there is a datatable page displaying some business data. The app is going to be deployed and run in the customer's web server, but the data to be displayed is from the business solution provider's database. Currently the provider supplies web services to retrieve the data. So, my task is to call these web services from my JSF page, get and display the data.
    I've never used web services before. Can someone give me a quick start, as what I need to know to use these web services, and how to use them in coding terms. I googled the web quite a bit and finally decided to turn to SDN forum.
    Thanks!

    http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/content.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/content.htm

  • Siebel8-How to use special character in WF expression

    How to use a special Chanarcter in a Workflow expression?
    in the below expression, am looking for comma
    IIF(Instr([&ProccProp], "','"), 'Y', 'N')
    But I am getting the following error
    The query could not be run because there is an invalid character in the field '<?>'. Please ensure that the value in the field is formatted correctly with only valid characters.
    Missing quotes around the search criteria or unnecessary punctuation will often cause an error.(SBL-DAT-00403)
    The Siebel version is 8.
    Thanks in advance

    Fine you already bypass this.
    When i readed your post and saw your solution, i asked for myself what version of siebel you were using, and from the first post understood that was version 8.
    Some months ago i have made workflows in siebel 8 and many times happened that i falled in situations and errors that were very very tricky to understand...workflow UI in that version, really needs some improvements.
    Bye

  • How to use Calander Component in JSF JSCreater

    i am using the calander component in JSCreter .
    i have one jsp page with a button and a calander component . If i let the calander field blank then the action event of button is fired but if i select some value in calandar field then then click the button then on action is fired
    what can be the reasion .

    I saw the documentation. But it uses com component which has ClassID / GUID. but how to use .net component and I think .net component doesn't maintain any registry information like classid / guid.

  • How to use javascript in visual jsf

    I have a web project and I am using visual jsf in netbeans. My problem is I cannot with javasciprt.
    When I clicked to a button I want to make some check with javascipt and then run server side java code. With jsp I used to add onclick javascipt and if it is ok, I just submit to servlet and run the java code in servlet. How can I do this with visual jsf

    If you are trying to display total number of pages in a report, Add the below formula in the column of the report and hide that column in the report.
    FX = sum(count(1))/25
    You can then reference the column in the narrative view like this: "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    Or
    You can also use something like the below:
    To calculate them use fi:
    CEILING(CAST(RCOUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the page number
    CEILING(CAST(COUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the total pages
    Put the above formula in the column and reference it in the narrative view like I mentioned in the previous example.
    If you are report view is pivot, then please refer to this link: http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    Hope this helps.
    Thanks,
    -Amith.

  • How to use %Type declaration with table residing in a different database

    How can I use the %TYPE declaration if the table is from a different database.
    E.g
    v_business_unit ps_jrnl.header.business_unit%TYPE;
    In the above declaration statement,the table 'ps_jrnl_header' resides in a different database(Database A) from the one I am currently in( Database B).(This is because data needs to be extracted from Database A into Database B).

    1. Create a database link to the other database (this probably already exists since your proc is interacting with that database)
    2. Create a synonym for the table in the other database
    create synonym foo for ps_jrnl.header@database_a;3. Reference the synonym in your variable declaration:
    v_business_unit  foo.business_unit%TYPE;

Maybe you are looking for

  • Problem with music videos

    When I first got my 30 gig, 5G iPod a few days ago, my music videos I downloaded worked fine. However, yesterday when I went to play one, it just played like a regular song, and I haven't been able to play the video. Anyone know what's up?

  • 2 problems 1) ipod shuffle and ipad

    I have an ipod shuffle with 20 Gigs of music, i dont want to loose. it was from an old computer that died long before now.I have no backups, but want to keep the music i have on it. when i try to connect it to my laptop it tries to erase and reset my

  • What's the diff betweeen Direct & Indirect Activity All

    Hello Experts, please lemme know the diff between Direct Activity Allocation & Indirect Activity Allocation.

  • PR 1.3 Already Live-Now !

    Hey Guys When Updated the Application Manager, I have just got an Update which says the following"  Do I go ahead and update it... Ver. 20.2010.36-2 is it the PR 1.3 ?

  • Memory Manager counters, Please share your coments on below counters?

    Hi Folks,  I configured below counters, Could you please coment on below counters, I felt that   unused memory is 26 GB, There is any abnormal. Memory Manager\Free Memory :2  GB Memory Manager\Maximum Workspace Memory  :  38 Gb Memory Manager\Granted