Model Binding and Calculated Field Syntax for "class" Attribute

Hi,
I tried to use the calculated field syntax from SAP UI5 to change the CSS class attribute of an element based on some model property, i.e., I wanted to change the class in the corresponding formatter function based on the currently bound value. However, my formatter function is not called. When I use the same syntax on a text attribute, it works.
I also tried to use normal property binding, but it did not work on the class attribute either (it just put class="{property}" in the rendered HTML).
Is there anything I missed or is it just not possible to use property binding and calculated field syntax for class attributes? Did anybody try something like this before?
I think it is a standard use case to change the CSS class based on some model property. So, if anybody knows how to do that, could you give a short example?
Best regards
Svenja

They have a class property. At least, I can do the following in an XML view:
<Button
              icon="sap-icon://add"
              press="onButtonPress"
              class="my-button-class" />
I would expect the following to work as well, but for me it did not:
<Button
              icon="sap-icon://add"
              press="onButtonPress"
              class="{/customClass}" />
This renders the following HTML (cropped to the important parts):
<button type="button" class="sapMBtn {/customClass}">
</button>
It seems like the class attribute is something special although I don't see a reason why. Other HTML templating engines, for example, support things like that.

Similar Messages

  • Can we mix mandatory and optional field entries for file import?

    Can we have devices with mandatory fields only and some other devices with mandatory and optional fields within the same CSV file used for file import?

    Hi Rita and Sandra,
    That is correct, you can mix mandatory and optional field entries for file import. However, if you don’t have OS type and version, the alerts matching would be impacted.
    Thanks,
    June

  • Field-symbols as class attribute

    Hi Fellas,
    Is there a way we can define a field-symbols as a class attribute ? My requirement is that i am dynamically constructing a structure at runtime in my model class and binding the component of this structure to my view fields. I am able to create the structure which is basically ref to cl_abap_structdescr and the problem is when i am binding to the model attribute, i need this to be a structure so that i can address the components as "//model/structure.component".
    Please let me know how we can define a field-symbol as a class attribute.
    Cheers,
    Ram.

    Hi Ram,
    Field-Symbol as class attribute is not possible. Your way to do this by REF TO DATA is the correct way for that.
    By default data binding is only possible like this:
    Simple field attribute
    value=”//<model>/<field name>”
    Structure attribute
    value=”//<model>/<structure name>.<field name>”
    Table attribute
    value=”//<model>/<table name>[<line index].<field name>”
    If you want to bind to your data reference you have to implement your own getter and setter methods. Read this <a href="http://help.sap.com/saphelp_nw70/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/frameset.htm">http://help.sap.com/saphelp_nw70/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/frameset.htm</a> for further information. In addition to that, you have to implement your own GET_M_S_xxx to return metadata of your structure. By doing all this it is possible to implement a completely dynamic data binding. In the view it looks like the regular Structure attribute: value=”//<model>/<data-ref name>.<field name>”
    Regards,
    Thilo

  • Field symbols as Class Attributes

    Hello Gurus,
    Is anybody able to say to me if it is possible to declare field symbols as class attributes? As I can understand until now, this is not possible and we need to use some attribute with the "TYPE REF TO Data" to get the information we need. Correct?
    Thanks,
    Daniel.

    Ok, let me see if someone can give me some idea on how to improve my method:
    Method: PREPARE_PTOOL_DATA
    Parameters specification:
    Parameter        Type     Typing     Reference Type
    PF_ANALYSIS        Importing     Type     /SYM/SC_PT_ID_ANALYSIS_D
    PF_ANAL_DESC        Importing     Type     /SYM/SC_NM_DESC_ANALYSIS
    PF_LOGIC        Importing     Type     CHAR01
    PF_MATERIAL        Importing     Type     MATNR
    PF_MAKTX        Importing     Type     MAKTX
    PT_DATA_COMPA        Exporting     Type     /SYM/SC_TAB_PT_RESULT_CP
    PT_CALC_ANALY        Exporting     Type     /SYM/SC_TAB_PT_RESULT_CA
    PT_DATA_MATERIAL1 Changing     Type     /SYM/SC_TAB_PROC_ALLERG_RESULT
    PT_DATA_MATERIAL2     Changing     Type     /SYM/SC_TAB_PROC_ALLERG_RESULT
    Source code:
    From the /SYM/SC_CL_PROCESS_ALLERG_GEN class
    Old version (but it is working)
    METHOD prepare_ptool_data.
      DATA: ls_data_material1   TYPE /sym/sc_s_proc_allerg_result,
            ls_data_material2   TYPE /sym/sc_s_proc_allerg_result,
            lf_index_material1  TYPE sy-tabix,
            lf_index_material2  TYPE sy-tabix,
            ls_result_cp        TYPE /sym/sc_pt_result_cp,
            ls_result_ca        TYPE /sym/sc_pt_result_ca.
    Prepare data for Data Comparison step
      IF pt_data_compa IS REQUESTED.
        LOOP AT pt_data_material1 INTO ls_data_material1.
          lf_index_material1 = sy-tabix.
          CLEAR ls_result_cp.
          MOVE pf_analysis   TO ls_result_cp-analysis.
          MOVE pf_anal_desc  TO ls_result_cp-desc_analysis.
          MOVE ls_data_material1-algbe TO ls_result_cp-desc_property.
    If Logic 'A', move the text from ls_data_material1 to original
    material status
          IF pf_logic EQ c_logic_a.
            MOVE ls_data_material1-agsbe TO ls_result_cp-val_orig_matnr.
    If Logic 'B', move the text from ls_data_material1 to "toy"
    material status
          ELSEIF pf_logic EQ c_logic_b.
            MOVE ls_data_material1-agsbe TO ls_result_cp-val_toy_matnr.
          ENDIF.  " IF pf_logic EQ c_logic_a.
    Read the lt_data_toy by the Allergen ID (ALGEN)
          CLEAR ls_data_material2.
          READ TABLE pt_data_material2 INTO ls_data_material2
                WITH KEY algen = ls_data_material1-algen BINARY SEARCH.
          IF sy-subrc EQ 0.
            lf_index_material2 = sy-tabix.
    If Logic 'A', move the text from ls_data_material2 to "toy°
    material status
            IF pf_logic EQ c_logic_a.
              MOVE ls_data_material2-agsbe TO ls_result_cp-val_toy_matnr.
    If Logic 'B', move the text from ls_data_material2 to original
    material status
            ELSEIF pf_logic EQ c_logic_b.
              MOVE ls_data_material2-agsbe TO ls_result_cp-val_orig_matnr.
            ENDIF.  " IF pf_logic EQ c_a.
    Delete record from lt_data_toy, index lf_index_toy
            DELETE pt_data_material2 INDEX lf_index_material2.
          ENDIF.  " IF sy-subrc EQ 0.
          APPEND ls_result_cp TO pt_data_compa.
    Delete record from lt_data_orig, index lf_index_orig
          DELETE pt_data_material1 INDEX lf_index_material1.
        ENDLOOP.  " LOOP AT lt_data_material1 INTO ls_data_material1.
      ENDIF.  " IF pt_data_compa IS REQUESTED.
    Prepare data for Calculation Analysis step
      IF pt_calc_analy IS REQUESTED.
        LOOP AT pt_data_material1 INTO ls_data_material1.
          lf_index_material1 = sy-tabix.
          CLEAR ls_result_ca.
          MOVE pf_material   TO ls_result_ca-matnr.
          MOVE pf_maktx      TO ls_result_ca-maktx.
          MOVE pf_analysis   TO ls_result_ca-analysis.
          MOVE pf_anal_desc  TO ls_result_ca-desc_analysis.
          MOVE ls_data_material1-algbe TO ls_result_ca-desc_property.
    If Logic 'A', move the text from ls_data_material1 to original
    material status
          IF pf_logic EQ c_logic_a.
            MOVE ls_data_material1-agsbe TO ls_result_ca-val_curr_stat.
    If Logic 'B', move the text from ls_data_material1 to "toy"
    material status
          ELSEIF pf_logic EQ c_logic_b.
            MOVE ls_data_material1-agsbe TO ls_result_ca-val_simul_stat.
          ENDIF.  " IF pf_logic EQ c_logic_a.
    Read the lt_data_toy by the Allergen ID (ALGEN)
          CLEAR ls_data_material2.
          READ TABLE pt_data_material2 INTO ls_data_material2
                WITH KEY algen = ls_data_material1-algen BINARY SEARCH.
          IF sy-subrc EQ 0.
            lf_index_material2 = sy-tabix.
    If Logic 'A', move the text from ls_data_material2 to "toy°
    material status
            IF pf_logic EQ c_logic_a.
              MOVE ls_data_material2-agsbe TO ls_result_ca-val_simul_stat.
    If Logic 'B', move the text from ls_data_material2 to original
    material status
            ELSEIF pf_logic EQ c_logic_b.
              MOVE ls_data_material2-agsbe TO ls_result_ca-val_curr_stat.
            ENDIF.  " IF pf_logic EQ c_a.
    Delete record from lt_data_toy, index lf_index_toy
            DELETE pt_data_material2 INDEX lf_index_material2.
          ENDIF.  " IF sy-subrc EQ 0.
          APPEND ls_result_ca TO pt_calc_analy.
    Delete record from lt_data_orig, index lf_index_orig
          DELETE pt_data_material1 INDEX lf_index_material1.
        ENDLOOP.  " LOOP AT lt_data_material1 INTO ls_data_material1.
      ENDIF.  " IF pt_calc_analy IS REQUESTED.
    ENDMETHOD.
    As you can see, I am repeating almost the same code, just changing some items. I am not sure if I can use new parameters (ANY or ANY TABLE) but, my first idea to improve it was to use the field-symbols (and it works ok). The issue is that I have to repeat the assignment lines every same named method of the classes I am changing (I would like to do the assignment into a new method of the superclass). Do you think it is possible or should I give up and proceed with the assignments locally, for each same named method of each class?
    Thanks,
    Daniel.

  • Condition class and calculation type missing for conditions downloaded from

    Hi All,
      I have downloaded all the condition types from R/3 using dnl custcndall
    I have even downloaded the following using r3as
    dnl_cust_cnd
    dnl_cust_prc
    dnl_cust_price
    But I have noticed that for the downloaded condition types, condition class and calculation types are missing. Please suggest.

    I have faced the same issue recently.
    The solution is in adapter object DNL_CUST_CNDALL for table T685 and other tables for T685 in that objet put the filters for condition type
    for ex: KSCHL eq PR00
    This sure will work.
    But you have to set this filter for all tables T685*
    Thanks
    Sarabjeet

  • I have a trial version of Acrobat DC but I dont seem to have a ll the options. Specifically button for froms and calculation fields

    My trail version of Acrobat DC doesn't have a button option or any calculation fields. Is this because this has been taken out of the trial? Regards

    Hi Kevin ,
    I wonder if this is something to do with resolution that the mentioned options disappeared .
    Could you please update on what OS are you using ?
    Also ,from where did you downloaded the Acrobat DC trial ?
    You could try repairing it once and check if that fixes the issue .
    If that does not work you can uninstall it once and then re install it and see if that helps you in any way .
    Regards
    Sukrit Dhingra

  • Add field group and Logical field group for ANLU

    Hi all,
    On my project, the table ANLU is containing many specifics fields.
    I would like to know how I could add a field group and logical field group corresponding to this specifics fields on ANLU, in order to be taking into account on my validation rule ?
    On the GGB0, Asset Accounting / master data, the check point includes the ANLU on the table fields. But, once my rule created, when I want to activate it on the TCODE OACV, the field group proposed don't include data from ANLU (only ANLA and ANLB)
    I found out the TCODE OAVM listing all different field linked to the field group. Does it possible to manage this view ?
    please help me !!

    Hi Rob,
    Can you tell me how can i solve this issue.
    Runtime Errors         MOVE_TO_LIT_NOTALLOWED
    Date and Time          09/11/2007 18:11:01
    Short text
        Assignment error: A constant was meant to be overwritten.
    Error analysis
        The field "<S1>" is to be assigned a new value although the field
        is partially or entirely protected against modifications.
        The following are protected against changes:
        - Character literals or numeric literals
        - Constants (CONSTANTS)
        - Parameters of the category IMPORTING REFERENCE for functions and
        methods
        - Untyped field symbols not yet assigned a field using ASSIGN
        - TABLES parameters if the actual parameter is protected against changes
        - USING reference parameters and CHANGING parameters for FORMs, if the
        actual parameter is protected against changes and
        - Accesses using field symbols if the field assigned using ASSIGN is
        protected (or partially protected, e.g. key components of an internal
        table with the type SORTED or HASHED TABLE) against changes
        - Accesses using references, if the field bound to the reference is
        protected (or partially protected) against changes
        - External write accesses to READ-ONLY attributes,
        - Content of a shared object area instance accessed using a shared lock
        (ATTACH_FOR_READ).
    Thanks
    Ashraf

  • The Apple Excel viewer and calculated fields.

    I'm told over at the Dropbox community that the iOS Dropbox app hooks into an Excel spreadsheet viewer provided by Apple & that I should ask my question here.
    I am using the Dropbox App to view one of my spreadsheets on my iPhone (7.0.4).  The spreadsheet has a calculated date field =TODAY().  When I look at the file on my iPhone I see the date displayed is always the date that I uploaded the file to Dropbox, and it never recalculates to "today's date".
    How can I make the viewer recalculate the spreadsheet?
    Many thanks.

    I think will be better if I expose what I want to do.
    I have a DO with 2 fields that I have to use to send the alert I want. The first one is the total of aprovals, the second one it is the total of denials. Each record have value for aproval and denial and have the time that operation ocurred. So what I want is to know if the total of approval in that hour it is bellow some %, if I have records in a time that it is inside the 3pm hour like 3:01 or 3:45 or 3:57 it counts as 3:00pm. so if the sum of those 3 records it is bellow the % I have to send a alert. I coulldnt make this happen and I tried everything and I m almost thinking that BAM cannot do this.

  • Drop downs and calculated fields

    I am new to  using 'LiveCycle' and have two problems.
    1. I cannot get the a drop down list to use an xml data source. I create the data connection, select the appropriate field to bind to but when I test it absolutely no data is displayed. The xml file has 8 fields, all are text and the number of rows modest (78). If I type the items into the list for the drop down then I get a functioning drop down list. However I need to be able to attach and xml data list to the final version.
    What I am doing wrong?
    2. Having populated that field mentioned above I need to use its value to lookup the other 7 fields from the above mention xml file and display them in text fields to allow the user to edit them.

    hello, please try [[Upgrade your graphics drivers to use hardware acceleration and WebGL|updating your graphics driver]], or in case this doesn't solve the issue or there is no new version available at the moment, disable hardware acceleration in firefox > options > advanced > general.

  • Split PDF and use field name for file name

    I have a pdf file with 333 pages that I will be splitting into 333 separate pfd files.  Each file needs a specific name that corresponds to a number located in the header of each individual page.
    Splitting the pdf is easy, unfortunately I can only use a static name for part of the file name and Adobe assigns the remaining portion with: _Part1.pdf; _Part2.pdf ect....  How can I get the "_Part1" to pull in the number located in the header of each individual page?
    I need to have this done before tommarow morning and there is another PDF which will be 555 files after it is split.
    Thanks for any help!

    Yes,
    I also know Profit Center field from R/3.
    However as I've mentioned....
    I need to ADD the field "Profit Center" in this TAB
    I do not even know if this field "Profit center" that I need to ADD is the same field from R/3.
    <b>You know....</b>
    I found "Profit Center"
    screen number: 0200
    program name: SAPLCRM_1O_MANAG_UI
    structure: ZCRMT_0200_BTX_UI01
    field name: ZZCUSTOMER_I0101
    data element: ZEEW_DATAELEMENT0101
    <b>However...</b>
    If I add this field above, the field does not display in the TAB I want. Meaning this field is not working.
    <b>For Instance:</b>
    In the same TAB (I want to add Profit Center), I have the field with:
    - description name field "Services Revenue"
    By pressing F1/Tech Info, I have:
    screen number: 0200
    Program name: SAPLCRM_1O_MANAG_UI
    Structure: ZCRMT_0200_BTX_UI01
    Field name: ZZCUSTOMER_I0101
    Does anyone has any idea to help me outto fimd Profit Center field?
    many thanks,
    Barb

  • How to diable only one field enabled and other fields disabled for one user group?

    Hi,
    I have a form contains many fields. A group of users can add items using that form.
    As per the user requirement I have created a filtered view and that filtered view can be seen by some other sharepoint user group but as per their further requirement the new sharepoint user group is only allowed to update Remarks field. All other fields
    should be disabled for them.
    In my idea, I have to create multiple forms and in one of it except Remarks field all should be disabled but I am unable to assign multiple forms to a single list.
    Or how to make Remarks field enable to this user group and for other admin user group all fields could be enabled.
    Hope I have expressed my question correctly.
    Any solution would be appreciated.

    There is no Out of the Box way to set permissions on each column, primarily due to the performance impact. The following thread provides some options,
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c0794232-9bab-4cea-91d8-f311a793a863/how-to-set-column-wise-permission-in-sharepint-list-in-sharepoint-2010?forum=sharepointadminprevious
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Show Model, OS and Other Details Info in Reply window for Originator

    When posting a reply in a thread it would be helpful if the Model, OS and Other Details information for the person we are replying to be shown in that window. Right now we have to toggle back to the thread window to check on their information.
    Thanks,

    Kady,
    Thanks for going around and noting people's suggestions. It helps a lot and I personally and most likely everyone else here appreciate all you do for the discussions, along with the other hosts and sysops
    Thank you!
    btabz

  • OPUK - Define Field Selection for WBS - diff bet. Modified and Influence

    Hi All,
    Kindly advise what is the difference between influencing and modifield field's for 'Project Systems > Structures > Operative Structures > Work Breakdown Structures (WBS) > Define Field Selection for Work Breakdown Structures (OPUK),
    Thanks!
    Regards,
    Vivian

    modified field is the field on which the impact is registered i.e hide, mandatoru etc
    Influence is the field that is the reason why the modified field needs to be changed
    for example if you have two project profiles
    then for one project profiel you can have say the resp cost centre mandatory and for the other you can have the resp cost centre hidden
    In this example the project profile is the influencing field and resp cost centre is the modified field

  • Calculated field in qualified table

    Hello
    I have created three very simple calculations i qualified tables. The calculated field as well as the fields that make up the calculation are qualifiers.
    None of the calculated fields are updated!
    I have tried to hit the recalculate button and calculated fields in the main table work without problems.
    Is this a known limitation? What can I do to trigger the update?
    BR
    /Alexander

    Hi,
    This is not the case.
    Suppose in Qualified table, you have 4 fields one Non-Qualifier and three Qualifiers say FNAME, LNAME and FULLNAME all of type text.
    Now for Qualifier Field FULLNAME i define Property Calculated = Yes and In Calculation Expression I write as:
    CONCAT(FNAME,LNAME)
    So on updating Qualifiers Value value of Qualifier Calculated field FULLNAME get updated.
    Suppose intially for a record i have qualifiers value as
    FNAME LNAME
    Mandeep Saini
    FULLNAME = Mandeep;Saini
    when i update value for these two qualifiers for the same record
    FNAME LNAME
    Alexander Isacson
    then value in for Qualifier field FULLNAME get updated to Alexander;Isacson
    i tried this and it is working fine.
    Hope it will Help you,
    Rewards if found Useful....
    Mandeep Saini

  • How to get private fields from super class?

    Hi.
    I must get protected and private fields from a class. I know that sounds werid but I have a very good reason for doing so, ask if you want.
    I have tried the getDeclaredField(String) method, but it apparently doesn't return the fields declared by the super classes.
    What's the smartest solution to this?
    Thank you all.
    edit: note that the superclass hierarchy's length is 3 and that there are several classes at the bottom level.
    Edited by: bestam on Sep 24, 2009 2:05 PM

    bestam wrote:
    I do not claim I have invented a new programming language Sir, you must be mistaken. This is not turing complete.
    This is a language for describing Cards or a game's rules if you want.
    AspectJ isn't Turing complete but AspectJ is still a compiler.
    This is how I have been working :
    - I have implemented the core library in Java (what is a Player, what is an Effect, what is a Card, what is a BuildingCard, what is a Player's Turn and so on)
    - It also includes packages dedicated to service, able to retrieve and send data to the clients via sockets.
    - Then I have "hardcoded" a dozen of specific cards in Java, for testing and validating the core library. I have been doing so by extending the BuildinCard's class for example.
    - But my ultimate goal is not to code thoses 1.000+ cards of the game in Java. I chosed to design a little language so that I would end up writing cards faster. While I'm traversing the syntactical tree representing the card, I feed the card's fields one by one. Some of them are quite primitive, some other are more complex and have a recursive nature for instance.
    Providing detail for how you implemented it doesn't change anything about what I already said.
    Thus, this is not really a compiler as it doesn't transform a text in language A into a text in language B.
    You really need to understand more about what "compilers" and certainly compiler theory do before you decide what they can and cannot do.
    And your statement still does not change what I said.
    Is this wrose than the bean design pattern from JSP ? I'm not sure.
    Bean design? A "bean" has almost zero requirements.
    Aside of that, it's a bit harsh to be told "read the fucking manual" while I have written my first compiler some years ago.Not sure who that was directed. I suggested some reading material on compiler theory.
    If you think that your idea is ideal then knock yourself out. Since I doubt I will end up seeing it in anything that I must maintain it doesn't matter to me. But you did in fact ask what the best solution was.

Maybe you are looking for

  • CRio 9014, 9116 and 9870 - serial write not working

    Hi, I am trying to read string from the text file and write to the serial port on 9870. The string are being read fine, they are getting in the Write_FIFO, the wait on IRQ passes all the bytes to the serial port. BUT I am struck, because there is not

  • HP 400 Mouse - How do I change the batteries please?

    I've got an HP H2F47AA mouse... Help! how do i change the batteries please?

  • Problem creating database with SAP Netweaver 7 sp 12

    Hello all, I have retrieved a new license from the website. The problem that I now have is that when I try to create a table, I am prompted for an access key. I input the developer access key (29671482393151224771) and it doesn't work. Please, does a

  • CreateJavaVM fails with JNI_ENOMEM (-4) even though there is enogh memory

    Hi, I am creating a VM on Win XP using JNI_CreateJavaVM. It fails when I add an option "-Xmx1024M", error code being JNI_ENOMEM (-4). It works with "-Xmx500M". The system has 2GB memory, other java processes (non-JNI) start without problems even with

  • Qualified field merge

    Hello, This is the scenario. We have phones qualified table where we have phone type as Non qualifier which can have values Work or phone and we have phone number as qualifier.All records have Phone type=Work but only few records have Phone type =Wor