Best pratice on disabling fields?

Hi,
   I'm using jdev11R1. I'm having one jspx page named(firstpage.jspx). this page is on unboundedTF.
I want to disable more than 15 fields on a single hit of button. but here each and every developer has different approach to do this.
can any one of the expert says which one is best approach?
Developer 1 Approach:
1. saying that bind the all fields in your bean.
2. Inside button actionlistener bindvar.setDisabled(true).
2. add partial target programmatically.
Developer1 saying his Advantage on his view:
1. ADF traditionally Approach (create bindings). Apart from that i no need to any other stuff
Developer 2 Approach:
1.  I'll create 15 variable in your bean return type should Boolean along with getter setter.
2.  i'll have a common method public void endis(Boolean bool) {this.setVar(bool);}
3.  Inside button actionlistener i'll call endis(true);
4. add partial target programmatically.
5. last step in all fields i have to use el expersion like #{scopetype.beanname,var}
Developer2 saying his Advantage on his view:
1. Java traditionally Approach(getter setter).
2. In future if i there is a change in requirement like
    - no need to disable all the fields. just some fields.
    - repeat same thing some other buttons.
    ultimately no need to re-write fully .little bit effort only needed.
Developer 3 Approach :
1. I have a pageFlowScope variable inside the actionlistener AdfFacesContext.getCurrentInstace.getPageflowScope.put('disable','y');
2. go to all fields have el expression like #{pageFlowScope.disable eq 'y' ? true : false}
Developer3 saying his Advantage on his view:
1. No need of binding and no need of variable declaration, getter and setter in bean. just piece of code
Developer1 perspective saying that following:
   --Developer2 doing having lot of code for disabling the fields.
   --Developer3 not best approach. because oracle docs saying that pageflowscope only for BTF. But pageflowscope works in unboundedTF also.
Developer2 perspective saying that following
  --Developer1 binding the each and every variable into the bean for disabling the fields. default binding take care of framework why should i do?
  --Developer3 anyhow it will create getter and setter for that by the framework. if scope value lost all will fails.
Developer3 perspective saying that following
  --Developer1 binding the each and every variable into the bean for disabling the fields. default binding take care of framework why should i do?
  --Developer2 having lot of code for disabling the fields.
"from the bottom line of developer discussion i conclude.
each and every one saying I'm the best. but each and every approach has own strength and weakness."
My question will be
1.Is there any other approach apart from these three?
before answering the second question. have these things in mind.
   point1. simple and re-usable all developer.
   point2. resource usage(memory allocation).
   point3. less time to do this job. here after.
2.please suggest which Best Approach in all of the prespective?
-edited lately, please go through again,
thanks,

Developer 1 Approach:
Developer1 saying his Advantage on his view:
1. ADF traditionally Approach (create bindings).
Since when is this the traditional approach? Never bind components to a bean if it's not really necessary! As you have other solutions this one is out of the race.
Developer 2 Approach:
Developer2 saying his Advantage on his view:
1. Java traditionally Approach(getter setter).
2. In future if i there is a change in requirement like
    - no need to disable all the fields. just some fields.
    - repeat same thing some other buttons.
    ultimately no need to re-write fully .little bit effort only needed.
Yes, but how likely is it that you have to change the fields to enable/disable?
From my point of view you put in a lot of effort for something you don't know if it will happen at all. Even if you know it's coming it would be easier to build groups and use the group variable to enable/disable the fields. You can then change a field from group a to group b without much programming.
Developer 3 Approach :
Developer3 saying his Advantage on his view:
1. No need of binding and no need of variable declaration, getter and setter in bean. just piece of code
You don't even need the code in the actionListener as you can use a setPropertyListener for this. The question here is why putting the variable into page flow scope? We don't know the use case to answer this. Generally you should not put anything in pageFlowScope if it's not needed outside the page. This we don't know. PageFlowScope is a broad scope, so you should think about using a smaller scope if possible.
4. Solution: put all the fields into one layout container. Write a method in a bean method to which enables/disables all input Fields of a given container Something like this
    // toggle disable of all the child uicomponents inside the given uiComponent
    private void toggleDisableInputItems(AdfFacesContext adfFacesContext, UIComponent component) {
        List<UIComponent> items = component.getChildren();
        for (UIComponent item : items) {
            toggleDisableInputItems(adfFacesContext, item);
            if (item instanceof RichInputText) {
                RichInputText input = (RichInputText) item;
                input.setDisabled(!input.isAutoSubmit());
                adfFacesContext.addPartialTarget(input);
            } else if (item instanceof RichInputDate) {
                RichInputDate input = (RichInputDate) item;
                input.setDisabled(!input.isAutoSubmit());
                adfFacesContext.addPartialTarget(input);
There are probably more solutions. I would stick with 3 or 4 depending on the use case.
Timo

Similar Messages

  • Best pratices for ODI interfaces

    I was wondering how everyone is handling the errors that occur when running an interface with ODI.
    Our secinaro:
    We have customer data that we want to load each night via ODI. The data is in a flat file and a new file is provided each night.
    We have come across an issue where a numeric field had data that was non numeric in it ... so ODI created a bad file ... with the bad record in it .... and an error file with the error message. We then had some defined constraints that forced records into the E$ table.
    My question is how does everyone handle looking for these errors. We would like them to just bereported to one place ( an oracle table ) so when the process runs we can just look at the one table and then act on the issues.... as shown above ODI puts errors in two different places... DB ones in a flat file and user defined in the E$ tables.....
    I was wondering if anyone has come across this issue and might be able to tell me what was done to handle the errors that occurr .. or what the best pratices might be for handling these errors?
    Thanks for any assistance.
    Edited by: 832187 on Sep 29, 2011 1:18 PM

    If you have got few fields affected by conversion problem you could try insert an ODI constraint or you could modify LKM to load bad file if present.

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • How to disable fields in Table control???

    Hi
    How to disable fields in Table control??? I want to disable particular row in table control when enter datas are correct.lets take as example ME41 or ME51 table control.
    Can anyone tell how to do disable in this table control
    Points will be rewarded if its helpful.
    Thanks
    senthil

    If you want to disable the row then you can use
    in pbo module create a module in side loop,
    loop at itab with control tc.
    module change_screen.
    endloop.
    in module,,,,,
    loop at screen.
    if condition.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    Regards
    Vijay

  • Best practice for "Quantity" field in Asset Master

    Hi
    I want to know what is the best practice for "Quantity field" in asset master. It should be made displayed only or required field in Asset Master creation.
    Initially I made this field as required entry. So user entered 1 quantity. At the time of posting F-90, he again entered quantity. So my quantity in asset master got increased. Hence i decided to make that field display only in asset master creation.
    Now i made that field as display only in asset master creation. At the time of posting F-90, that quantity field is not coming only. I check my field status group for posting key as well as GL account. Its optional field. Inspite of that user is able to make entry in F-90. Now quantity field is '0' only in asset master even though there is some value in asset.
    Please help what is the best practice wrt quantity field. Should be open in asset master or it should be display only.

    Hi:
               SAP Standard does not recommend you to update quantity field in asset master data.  Just leave the Qty Field Blank , just mention the Unit of Measure as EA. While you post acquisition through F-90 or MIGO this field will get updated in Asset master data automatically. Hope this will help you.
    Regards

  • Using Javascript to disable field "Planned"

    Hi every one,
    I want to use javascript to disable "Planned" checkbox in Project Server 2013 because we want that user can not see this planned time and be confused with the Project Server's automatic changes for the planned time.
    <script type="text/javascript">
    document.getElementById("Ribbon.ContextualTabs.MyWork.Home.ShowHide.PlannedWork-Medium-checkbox").checked = false;
    </script>
    I found this code in this subject :
    http://social.technet.microsoft.com/Forums/projectserver/en-US/0beeed2d-bebc-4217-981a-41b1252c7cc2/disable-field-planned-in-timesheet?forum=projectserver2010general
    But I don't understand where to use it. If i create a custom webpart with this code, I've got a null exception when the page is loading.
    So, can you help me ? Maybe I need to use it in an other file ?

    Hi Patmol6,
    Basically, to add javascript to a PDP (or timesheet page for instance), 
    edit the page
    add the content editor webpart
    set it as hidden
    copy paste the code
    Note that you can also point from the content editor webpart to a js file embedding the javascript code
    Here are few examples (some are in PS2007, but the process is similar): 
    http://epmsource.com/tag/content-editor-webpart/
    http://badalratra.wordpress.com/2013/05/04/how-to-disable-pdp-custom-fields-using-javascript/
    http://badalratra.wordpress.com/2013/02/03/javascript-code-to-add-custom-descriptions-underneath-project-field-on-the-pdp-page/
    http://epmcorner.wordpress.com/tag/content-editor-web-part/
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • What is the best way to declare field length 500 in internal table?

    Hi all,
    what is the best way to declare field length 500(constant value allways) in internal table?
    I am trying to send data from internal table to file format, and I have a field in internal table with 500 length (constant value always). So how do I can declare and append this field value to table?
    Thanks
    Murali

    Hi.  Please see the following example program, notice how I am filling the field with the constant value.
    report zrich_0001.
    *       CLASS lcl_main DEFINITION
    class lcl_main definition.
      public section.
        types: begin of ttab,
                fld1(500) type c,
               end of ttab.
        data: itab type table of ttab.
        data: xtab type ttab.
        methods: constructor,
                 write_itab.
    endclass.
    *       CLASS lcl_main IMPLEMENTATION
    class lcl_main implementation.
      method constructor.
    <b>
        xtab-fld1 =
          'This is one part of the total string which needs to be really' &
          ' long and this is a constant and we need to move it to a work' &
             ' area and then append it to the internal table which has a' &
              ' field with a length of five hundred characters'.
        append xtab to itab.</b>
      endmethod.
      method write_itab.
        loop at itab into xtab.
          write:/ xtab-fld1.
        endloop.
      endmethod.
    endclass.
    data: o_main type ref to lcl_main.
    start-of-selection.
      create object o_main.
      call method o_main->write_itab.
    Regards,
    Rich Heilman

  • Why I cannot process a disabled field when using htmldb_item

    I have a report that has this in the select statement
    case when c.sec_lic_status in (1,2,7,505,1002,1004,1005) then
    htmldb_item.text(2,sum( distinct a.fee_variable),8,20)
    else
    htmldb_item.text(2,sum( distinct a.fee_variable),8,20,'disabled')
    end "Quantity 1"
    The above shows correctly. If there are 2 records one field is disable and the other is enabled.
    I have a process that fires on submit - after Computations and Validations. But the records don't changed when updating the enabled one.
    In debugging and writing to a file using the UTL_FILE package, I'm able to pinpoint that the disable fields are the problem.
    Is there a trick on manually processing disabled fields?
    I've found that when I uncheck the show box in the report, I cannot use the fields either. This is not a problem, just another comment.
    My main problem is what do I have to do to manually process a disabled field.
    Thanks for your help, comments, pointers, or anything that could help me or give me ideas.
    juan

    Juan - HTML items with the disabled attribute are not POSTed with the form so your after-submit processes never see them. Try 'readonly="readonly"' instead. Others may be able to suggest how to also give those cells a greyed-out appearance.
    Scott

  • ADF Faces & BC: Best pratices for project layout

    Season greetings my fellow JDevelopers!
    Our software group has been working with ADF for around 5 years and through the years we have accumulated a good amount of knowledge working with JDeveloper and ADF. Much of our current application structure has been resurrected in the early days of JDeveloper 10 where there were more samples codes floating around then there were "best pratice" documentation. I understand this is a subjective topic and varies site to site, but I believe there is a set of common practices our group has started to identify as critical to streamlining a development process(reusable decorated ui components, modular common biz logic, team development with svn, continuous integration/build, etc..). One of our development goals is to minimize dependency between each engineer as everyone is responsible for both client and middle layer implementation without losing coding consistency. After speaking with a couple of the aces at the last openworld, I understand much of our anticipated architectural requirements are met with JDeveloper 11(with the introduction of templates, declarative components, bounded task flows, etc..) but due to time constraints on upcoming deliverables we are still about an year away before moving on with that new release. The following is a little bit about our group/application.
    JDeveloper version: 10.1.3.4
    Number of developers: 7
    Developer responsibilties: Build both faces & bc code
    We have two applications currently in our production environments.
    1.A flavor of Steve Muench's dynamic jdbc credentials login module
    2.Core ADF Faces & BC application
    In our Core ADF Faces application, we have the following structure:
    OurApplication
         -OurApplicationLib (Common framework files)
         -OurApplicationModel (BC project)
              -src/org/ourapp/module1
              -src/org/ourapp/module2
         -OurApplicationView (Faces project)
              public_html/ourapp/module1
              public_html/ourapp/module2
              src/org/ourapp/backing/module1
              src/org/ourapp/backing/module2
              src/org/ourapp/pageDefs/
    Total Number of Application Modules: 15 (Including one RootApplicationModule which references module specific AMs)
    Total Number View Objects: 171
    Total Number of Entities: 58
    Total Number of BC Files: 1734
    Total Number of JSPs: 246
    Total Number of pageDefs: 236
    Total Number of navigation cases in faces-config.xml: 127
    Total Number of application files: 4183
    Total application size: 180megs
    Are there any other ways to divide up this application? Ie: module specific projects with seperate faces-config files/databindings? If so, how can these files be "hooked" together? A couple of the aces has recommended that we should separate all the entity files into its own project which make sense. Also, we are looking into the maven builds which should remove those pesky model.jpr files that constantly gets “touched”. I would to love hear how other groups are organizing their application and anything else they would like to share as an ADF best pratice.
    Cheers,
    Wes

    After discussions over the summer/autumn by members of the ADF Methodology Group I have published an ADF Coding Standards wiki page that people may find useful:
    [http://wiki.oracle.com/page/ADF+Coding+Standards]
    It's aimed at ADF 11g and is intended to be a living document - if you have comments or suggestions please post them to the ADF Methodology google group ( [http://groups.google.com/group/adf-methodology?hl=en] ).

  • Disabling fields in subscreen

    Hi,
    I have a main screen '9970' and subscreen '7300'.
    The subscreen '7300' is also a subscreen of some other screen say '9000'.
    Now I need to disable the fields of '7300' only when it is called from the main screen '9970'. When i disable in fields in PBO of subscreen , then it will be disabled in screen '9000' also.
    Is there any way to disable fields of subscreen from the main screen '9970'.
    I tried the following in PBO of main screen
    LOOP AT SCREEN.
    If Screen-name = 'SCRAREA1'.
                SCREEN-INPUT = '0'.
          MODIFY SCREEN.
          ENDLOOP.
    ENDLOOP.
    ps: call subscreen SCRAREA1 using <prog-name> <screen-no>
    SCRAREA1 is the name of the subscreen area.
    But the above code is not capturing the subscreen area name at all..
    Anyone please suggest..
    Thanks
    Hemalatha

    Hi,
    In The main screen 9000 and 9970 pass the screen number to a global variable before calling subscreen 7300.
    In PBO of 7300 chek the variable to know if it has been called from the desired main screen say 9970. If yes disable it and pass another indicator say dibale  = X.
    Return to main screen.
    In the PBO of the Main screen check the variable DISABLE and grayout the fields you want.
    IMPORTANT.
    If you are doing CALL SCREEN 7300 from 9000.And then a LEAVE TO SCREEN from 7300 after processing, you will not go to the PBO of 9000. Control will execute the flow logic of 9000 after the CALL SCREEN statement.
    Let me know if any issues.
    Thanks,
    Vivekanand

  • Need to Disable field in Table maintenance generator

    Hi Frds,
    I have created a custom table .But i stuck at one point. In the TMG one field is User ID and next field is filled with Full name of this User ID(made it noneditable). To get user name i implement '01' event in TMG. and its working fine. But when i change the user ID in the row ramdamly the user name is not updated. its because Event not trigger.
    Please help me by giving valuable suggestion either of two query.
    1) When any row field value get change. Which TMG event trigger and capture the changed row
    2) How can i make field disable once it get filled and saved.
    Thanks
    Imran

    Hi,
         When you create any entry in TMG event get occurred is 05 and if you are changing any row content than you have to use 01. And if you want to disable fields ,double click on overview screen number which is you have given when you created TMG and than it opens flow logic of screen than click on Element List tab and uncheck the fields which you wants dsiable in input column as i am attaching screenshot have a look at it.
    in this user ID is unchecked.
    Regards,
    Shahezad

  • How to set a value to a disabled field in an B1 screen ?

    Hi,
    Can anyone tell me how to set a value to a disabled field in an existing screen.
    For example , I want to set a value to the Paid/Credited field in the Sales - A/R Invoice screen, which is a disabled field.
    I tried setting the field as enabled but it throws an error.
    Thanks in advance
    Mina

    It depends on the business process required for generating the invoice.  (What is this process just now?)
    I can think on quite a few ideas, but can't be sure if any of them will match your specific requirements.  I'll list a few here and see if any of them might work, or at least generate some new ideas for you. (Unfortunately you can't change an existing payment object to add an invoice to it at a later date, nor is the reconciliation process exposed through the SDK.  This limits your options a bit.)
    1) Is there a need for a separate delivery and invoice?  Would skipping the delivery process and using the standard Invoice + Payment screen work for you?  Stock would be issued, invoice created and payment matched directly to invoice without any work.
    2) This might apply if the invoice is simply a one for one match with the delivery.  Rather than just generate a payment in the delivery screen, generate the invoice and a payment at the same time.  The standard invoice screen will then show it as paid.  You can control the dates on the invoice raised through DI code.
    3) Where do you write the Paid Amount to?  How is it not available in the invoice screen?  Put it somewhere accessible and write it to the user field.
    John.

  • Disable field highlighting?

    Good Morning,
    Working on a form that will be distributed to a number of users.  The form utilizes a lot of scripts to highlight fields that require attention.  The form works/shows well when the preset "highlight fields" is turned off (currently done manually).
    Is it possible to disable field highlighting using a script or by changing the preferences so that when the document is opened, the form fields are not highlighted?  During testing, the "highlight fields" option is turned on by default on other users machines.  I searched on the Internet and came across the following:
    Layout: Ready event
    app.runtimeHighlight = False
    Can this be used and if so, where would it be entered (hopefully not in every field).
    Thanks

    Thanks for the response.
    Form is created using Adobe Acrobat 9.  I put the code in the page properties of the the first page of the document as an action.  Doesn't seem to work.
    Any other suggestions?

  • How to disable field Order quantity

    Hi everyone
    I want to disable field item order quantity at line item level on the transaction VA02, can anybody help me on this?
    im using the user exit MV45AFZZ to make other modifications in the program, can i use the same user exit or any other alternative?

    The logic that you need to place should be something similar to below:
    IF SY-TCODE = 'VA02' AND SCREEN-NAME = 'RV45A-KWMENG'.
       SCREEN-INPUT = 0.
    ENIF.
    Hope this helps.
    Kind Regards
    Eswar

  • What is the best practice to "Disable Smartlists"

    What is the best way to "disable" smarlists.
    For example: i have company A, company B, and Company C as the vendors.
    Vendor (account) (smartlist) --- i can choose A, B, or C
    However: i don't want users to choose vendor C because they are not our vendors anymore. I don't want deleted it because i have previous projects that used vendor C. what is teh best approach for this?
    Thanks

    Hi!
    Can't you just delete that entry (for the vendor C) from the smartlist?
    If I understand correctly, Planning stores the entry value to essbase for current member combination. So it does not delete any previously stored data.
    kind regards,
    user 637777

Maybe you are looking for

  • AP Credit Memo error

    Hello, I'm creating a AP Credit Memo but wouldn't like to match, while entering manually the Oracle Forms allows me to create lines with out PO_NUMBER,PO_LINE_NUM but where as from Interface it is rejecting with  " No PO Line Num " as Reason. But if

  • Double Click on Keyboard shortcut does not work

    I want to change a keyboard shortcut. I have a Norwegian keyboard and the key combination for change active window in an application (multiple mail messages or Word documents) is not available. The Keyboard shortcut is set to ' - on my keyboard the

  • Script_!

    hi, how to create box for my invoice info window (, name, city...) in sap script , and beckround grey.

  • Problem with HttpSessionBindingListener

    Hi I have a problem with HttpSessionBindingListener. The sesion timeout in web.xml is 10 min. I open sesion 1 at 10:00 am I open sesion 2 at 10:05 am The valueUnbound method is called twice at 10:15 am The problem is that the valueUnbound is fired on

  • Call function in an applet

    Hello, I novice in Java and Iwould like to know why the configuration function is not is started when the "configuration button" is press : import java.awt.*; import java.applet.*; import java.net.*; import java.io.*; import java.lang.*; import java.