ClickToEdit available to the form

Version 12.1.2

Is there a way to implement the features of clickToEdit on the fields in formatting as in the tabular presentation?
I have a bunch of text as "ReadOnly" fields, and I would like to make editable field when a user clicks on it.

For example, an input field "comment" with text inside, is initially displayed read-only, and I would like the user to be able to click on the

field to make it editable.
Any suggestions on how I can get this behavior?

Thank you very much.

1. the behavior is implemented on the panelFormLayout component in the sample. This however can be changed to any other parent component now fields

2. the clientComponent on all fields property must be set to 'true' for listeners of client work in read-only

3. 2 clientListeners manage click behavior and the ESC key, you can switch from a current field of editable in read-only

4. a server roundtrip is required for switching between editable and read-only, because dependning on the State, the ADF Faces component renders with different

HTML allowing direct manipulation of the DOM cannot be used


    
     

       function setEnabled(clickEvent){
         var srcComponent = clickEvent.getSource();
         srcComponent.focus();
         if(srcComponent.getReadOnly() == true){
           AdfCustomEvent.queue(srcComponent.getParent(), "switchReadOnly",{readOnly : false, compId : srcComponent.getId()}, false);
         }
       }

       function setReadOnly(escKeyEvent){

         var keyCode = escKeyEvent.getKeyCode();
         if(keyCode == AdfKeyStroke.ESC_KEY){
          var srcComponent = escKeyEvent.getSource();
          if(srcComponent.getReadOnly() == false){
            AdfCustomEvent.queue(srcComponent.getParent(), "switchReadOnly",{readOnly : true, compId : srcComponent.getId()}, false);
          }
         }
       }
     
      
        
          
          
              
              
                
                  
                  
                
              
                
                
              
              
                
                
              
              
                  
                  
                  
                
                
              
              
                
              
            
          
          
          
          
        

      

    
  

The Java Code is

 public void onSwitchReasdOnly(ClientEvent clientEvent) {
        UIComponent panelFormLayout = clientEvent.getComponent();
        String textFieldComponentId = (String) clientEvent.getParameters().get("compId");
        Boolean readOnlyState = (Boolean) clientEvent.getParameters().get("readOnly");

        UIComponent uiInputField = panelFormLayout.findComponent(textFieldComponentId);
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();

        List childComponents = panelFormLayout.getChildren();
        for(UIComponent child : childComponents){
            if (child.getId().equalsIgnoreCase(uiInputField.getId())){
                //set readOnly to false
                uiInputField.getAttributes().put("readOnly", readOnlyState);
                adfFacesContext.addPartialTarget(uiInputField);
            }
            else{
                //only update component if its readOnly state changes and ifthe component
                //is an editable value holder

                if( child instanceof EditableValueHolder &&
                    ((Boolean)child.getAttributes().get("readOnly")) == Boolean.FALSE){
                    child.getAttributes().put("readOnly", true);
                    adfFacesContext.addPartialTarget(child);
                }
            }
            FacesContext fctx = FacesContext.getCurrentInstance();
            ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
            erks.addScript(fctx, " var comp = AdfPage.PAGE.findComponentByAbsoluteId('"+uiInputField.getClientId(fctx) +"'); comp.focus()");
        }
    }

Frank

Warning: The code above is shared as is. It's not supposed to be impeccable or the quality of the production. Also, this code is not supported by customer

Tags: Java

Similar Questions

  • Interested in the purchase of image # 88739192, pictures are available in the form of psd files?

    Interested in the purchase of image # 88739192, pictures are available in the form of psd files?

    The files are all either .jpg or .ai.

  • Not available in the form/triggers section GETFORMATTRIB()

    Hi all

    I wonder why the DAL - GETFORMATTRIB() function returns nothing when used in a trigger / image of the form.

    Attribute values are defined on all forms well in advance and why they cannot be made available before Gendata()? Any reason?

    Thank you!

    Navin

    The shape attributes and metadata are part of the content of the form stored in the library resource. The trigger process is not actually load the form of the library resource and therefore doesn't have access to the content in the form. The normal procedure is that trigger decide to register the form based on your data extract and then the form is loaded in the library. After you add the form, you can then check the attributes and metadata assigned to the form.

    I guess - with a few improvements - there may be some attributes that are defined in the file list form (Group) for a given form that could be accessed during the firing process, but as a general rule, no one wants that the drop in performance of the loading of the library forms that may not become part of the transaction. Therefore, all the attributes defined in the form itself will be unavailable before the outbreak.

  • Display the places available in the form of events

    By default, the allocated seats is 1 in the form results, but what do you do if a user wants to book 2 or more seats in the user form. Understand you can add a field, but how it would be recognized as an allocation of seats in form results? Thank you

    On a form of event there is no field that you add to seats, unless you want that filled a reason any.

    When a form is on reservation, this creates a booking rather than the norm of the case that made a web form. There he seat assignment. This is based on the seat assignment field that you add to the web when form on a booking page layout.

    Doc for this is here:
    http://docs.BusinessCatalyst.com/user-manual/modules/Events/Booking-multiple-seats-for-an-event

  • (Beginner) Impossible to validate the behavior of the form access

    I made html for about a month (and Dreamweaver so long too)

    In my first attempt to use Javascript, I cut and pasted many validation scripts Online and nothing has ever worked during their use in several fields. Then, I tried the behavior of the form validate exactly as described in a book by Dreamweaver and found the form to validate option is grayed out.

    The form is simple. I have two drop-down lists and a "submit" button. One of the lists is built using PHP. I tested the form without validation and it works fine.

    I also tried to add a new form and the validate option is available. It is as far as I'm away.

    I'm looking for some information as to why the option is grayed out. Who can tell me why the other scripts did not work.

    Thanks in advance for any ideas.

    ==============================

    Thanks for your help Murray,

    When I say 'By the Book' I speak somewhat metaphorical. But the steps I mentioned are in Teach Yourself Dreamweaver of the Sam in 24 hours (a popular book by a popular editor).

    Similarly, if (using the toolbar for simplicity and accuracy) you create a form, add a text field inside, and then add a button "submit" on the inside, you can select the button in design mode and then the option validate form will be available.

    But more specifically, you can click anywhere in the body and the option is available and can be applied to any form on the page.

    When I add the other shapes on the page, the option validate form is available for them, but never available for the form that I originally listed here.

    Also, I have validated all the tags.
    ============================

    Now, before this announcement, I did several tests and found the answer. This function performs the validation of TEXT fields.

    Mystery solved!

  • Adobe form cc is not available in the German iTunes store?

    I just tried to download Adobe form cc, but told me that it is not available in the German iTunes store? Is this true? When will it be available? In which countries is it available?

    My understanding is that Adobe product licenses, but does not control, Apple sells Adobe programs via Apple store... then you might want to ask Apple

    If I'm wrong, you can also ask Adobe directly (it is an open forum so that everyone can post & response, not a direct link to Adobe)

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">
    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • Distribute the form is not available

    Hello

    Since I've updated my adobe acrobat I can't use the shape option to distribute in live cycle designer ES4.

    Can you help me please?

    Kind regards

    Simply open the form in Acrobat a distribute the form.

    The menu in the designer item was only a shortcut to the Acrobat menu item but can be is no longer available.

  • I'm filling out a form that is available on a site. When I click on the option to fill out and submit the form 'online' a pdf document is displayed in chrome with the following text "to display all of the content of this document, you need a later version

    I'm filling out a form that is available on a site. When I click on the option to fill out and submit the form 'online' a pdf document is displayed in chrome with the following text

    «To display all of the content of this document, you need a later version the viewer PDF.» You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html for further support, go to www.adobe.com/support/products/acrreader.html"

    Needless to day, I installed the latest version. I even reinstalled using the link in the message, but nothing helped. Whenever I click on the link to go forward, I get the same message. Question: (i) is it my PC/software (Vista), (ii) is the site where I'm trying to submit the form, or (iii) is it the software acrobat reader. Note that I used successfully the last version to fill out and sign forms.

    It is none of them. It's Chrome, which is ignoring Adobe Reader and showing the message.

    Solution: just save the document (with the message) to your desktop. Then open it in Adobe Reader. The 'real' should then display.

  • JHeadstart - how to configure the form to be modal window in the style of table-form available?

    JHeadstart release 11.1.2 Relase

    When you use the Application JHeadstart Editor, I chose "table-form" style of layout for the field.

    Issue. When the field editing either way, by clicking on the edit button, which will be the user to the form, is it possible to have the form opens in a modal window?  If Yes, where and how configure this option?

    Summary: currently, the flow is as follows: field displays in a table.  The user clicks on the button Edit and screen refreshes the field in a form.  What I want is to have the form to be displayed as a modal window with the table in the background.

    Thank you.


    I think you could do this with 2 different versions of the JHS group.  A configured as 'table' and set up the other as a 'form '.  Then, add a groupLink item in the table to open the form in a modal popup.  (you might even be able to link the group to itself, but then you will need to do some adaptations to prevent it to generate the default table-form link)

  • Other forms will be available for the slideshow thumbnails (circles, diamonds, etc...)?

    I want my jQuery thumbnails to be something other than a square or a rectangle, or even turn the square is a rhombus. Will it be possible?

    There are no plans for this in the immediate future, but you can achieve this effect with a background image of the form you want and then turning vignettes on the [none] fill color (or the color of the background of the page).

  • Is it possible to return to the synchronization of the former in Firefox, as new synchronization does not work.

    As new synchronization does not work for me, despite the setting it in total compliance with the Mozilla Web site and no one took the trouble to answer the previous post today, is it possible to return to the synchronization of the former?

    To the best of my knowledge, the synchronization of the former is no longer available.

    If you post some details on the problems you are having with the sync, we can try to solve your problem.

  • In Thunderbird/Tools/Options/Composition/spelling, language drop-down-box is not available, and the language line is empty.

    The drop-down-box languages chose is display of pale color that this option is not available. Clicking on it does nothing. In addition, no language appears in the language line. Not being able to use the drop-down-box fact by following the instructions for the installation of a dictionary that is impossible.

    I installed the dictionaries in Firefox, but they do not appear in Thunderbird.

    Here, I am very confused.

    You say "I installed the dictionary in Firefox, but they do not appear in Thunderbird. They should not... they are two different applications. Your last response still puzzles me.

    "I downloaded the dictionaries, but they do not appear in"Download more dictionaries"that takes a link you to a web page list of dictionaries available for Thunderbird." So I simply do not understand what your expect to see, maybe something you have downloaded in a browser window? I really don't understand.

    Some dictionaries come in the form of modules https://addons.mozilla.org/en-US/thunderbird/search/?q=dictionary & appver = 31.0 & platform = windows and must be installed as such.

  • How to create the new library of Photos to iCloud without it merging with the former?

    I started my iCPL in January 2015. It is now 104 Gb/8000 photos. In a year I need to upgrade my plan of storage iCloud.

    So I think I would make the existing one a regular photo library, and start a new photo library iCloud.

    If I start a new library now and make the iCPL, merge it with the existing iCPL. I want to replace the existing in iCloud.

    I could do (I think): -.

    1. make the existing a non-iCPL and rename it.

    2. create a new lib Photos and make the library system iCloud.

    3. the new library (empty) will download and merge with the former in iCloud, so it contains now 8000 photos of the original lib.

    4. delete all the 8000 photos in the new.

    5. start put new photos in the photo library now empty iCloud.

    Is there a better way? I do it too difficult?

    I can see what I've described above taking a long time to settle on all devices, even if I can avoid 30 day waiting by removing the deleted record recently.

    Thank you

    You use "Optimize Mac Storage" on your Mac? Then, you will need to make sure that all the photos to download to your Mac before you copy your current library corresponding to your backup disk and start deleting iCloud.  Is there enough free storage on your Mac to do this?

    I would also like to than my thin iCloud library. My iCloud library has only my favorite photos of many years, I want on all my devices as well as the most recent photos that I'm still trying. Because the iCloud library must be the library system, only in iCloud library photos are available in the media for other applications browser, so I keep all the photos here that I can use in other applications.

    What I do to save bandwidth and download time is to have two libraries:

    1. A large library where I keep all the photos I want to keep - it's my photo archives. This library is on an external drive that is supported by Time Machine and is currently still an Aperture library.
    2. A smaller library iCloud in my pictures folder.

    I import new photos first to the iCloud library, remove all the bad moves that do not need archiving, then I export the originals at the library of the archives.

    And then I start editing the photos in the library to iCloud and learn by removing and keeping only the best photos.

  • Satellite P100: Why the graphics card Nvidia 7900 is not available in the United Kingdom?

    Why nvidia 7900 GPUs is not available in the p100 to the United Kingdom? Europe & Middle East the 7900gs is available in the continent. The 7900 gtx in the States is available.

    Why?

    Hello

    I put t believe that it of not possible to buy a P100 with the graphics card Nvidia 7900 to the United Kingdom. If you can't buy it forms mobile phone dealer in your city, so I'd check the shops online cell phone.
    I studied a little bi and found these P100 units with the graphic card nVidia 7900.

    Satellite P100-426; P100-194; P100-191; P100-196; P100-215; P100-222

    I found three different cards which were delivered with the P100:
    NVIDIA GeForce Go 7900; GeForce Go 7600 and Intel 945GM Express

    Anyway, the P100 is a new laptop and eventually you can't buy it in every store, but in my opinion several times this unit should be available in the United Kingdom with the GeForce Go 7900

  • The appearance has changed, and even the Start button is no longer a circle but the former rectangle that says start after the installation of an update.

    I recently installed an update of Windows for Vista.  The appearance has changed and even the Start button is no longer a circle but the former rectangle that says start.  How can I get the old look back with on the uninstallation of the update?  Thank you

    Original title: updates

    Hello

    It seems that the update was for graphics, as it changed the appearance

    If the update is the problem, you will need to remove it or download and reinstall the graphics driver from your computer or the manufacturer of the graphical Web site map.

    _________________________________________

    Read this information about updates:

    Microsoft gives sometimes you updates for the 3rd party hardware: graphics, network cards, etc.

    You should only get the latest drivers for them to real hardware manufacturer's website, as Microsoft normally does nor those have the most recent drivers available as Microsoft relies of the 3rd party hardware Manufactuer to provide.

    But unfortunately, the only way to know which is the update of the problem is to install them one by one, until you find the 'wrong' for your installation.

    You can do a system restore to get back until it has been installed (which is NOT the best way to remove an update) or follow this method:

    'Remove an update'

    http://Windows.Microsoft.com/en-us/Windows-Vista/remove-an-update

    When you have found the issue of update of the list of updates which is presented > then right click on the update problem > select Hide update > and it will not be available to you once again

    "How to hide or show an update of Windows Vista"

    http://www.Vistax64.com/tutorials/72491-Windows-Update.html

    "How to hide or restore the updates of Windows hidden in Windows 7 and Windows 8"

    http://www.SevenForums.com/tutorials/24376-Windows-Update-hide-restore-hidden-updates.html

    _____________________________________________

    Here's how to chanage update settings, if you think it is necessary to:

    "Understanding Windows Update and Extras in Windows Vista and Windows 7.

    http://www.bleepingcomputer.com/tutorials/Windows-Vista-updates-and-extras/

    Or the other of these two update settings will give you the chance to see what you want to install through Windows updates;

    Download updates but let me choose whether to install them - if you select this option, Windows will download the updates on your computer, but not install them automatically. If you want to install updates, then you must install them manually. You should only select this option if you have a reason to not install updates automatically. Only advanced users should use this option.

    Check for updates but let me choose whether to download and install them - if you select this option, you'll be alerted when there are new updates available for download and install. You can then choose to download and install the updates that you want. This option should really be reserved for people who know exactly which updates they need, or those who have little access to the Internet.

    But remember you normally only have problems with hardware 3rd party drivers. Other updates are to improve the Performance and security of your system

    See you soon.

Maybe you are looking for