PPR JDev 12.1.2 input text / button

Hi all

I have JDeveloper 12.1.2 and my use case is that the user requests to have a button 'Save' enabled (disabled by default) when they type one key in a text of entry in a table.  At first, I tried the road to javascript using this site: https://blogs.oracle.com/jdevotnharvest/entry/how-to_call_server_side_java_from_javascript.  However, while it does what I want everything I type in the text entry field sometimes gets "crushed" which I assume is due to the appeal of the server.  For example, if I type 1.23 in a text box, a few times is up to 1, or 1.2 and not keep the correct text in the text box.

However, trying to do more reading/research on the topic, I came across a few posts that talked about the help of PPR.  However I don't know if I can possibly use this in my use case.  I understand that the text box must have autosubmit = true and the button must have the id text box in the partial list of triggers, but what I'm missing that will cause the button to go from disabled to enabled by entering in a text?  I can't use the valueChangeListener on the input box as seems only fires when the input field loses focus.

I come to the javascript solution?  No idea why it would just "reset" my text box sometimes?

Thanks for any help / advice anyone can offer.

This is what has been my javascript solution until I experienced my problem:

Column:

<af:column sortProperty="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.name}" filterable="true"
                               sortable="true" headerText="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.label}"
                               id="c6" width="11%"}">
                      <af:inputText value="#{row.bindings.CostPerBushel.inputValue}"
                                    label="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.label}"
                                    columns="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.displayWidth}"
                                    maximumLength="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.precision}"
                                    shortDesc="#{bindings.ChiefScaleOrderVO.hints.CostPerBushel.tooltip}" id="it6"
                                    autoSubmit="true">
                        <af:clientListener method="keyInput" type="keyPress"/>
                        <af:serverListener type="EnableSave" method="#{recordManager.enableSave}"/>-->
                      </af:inputText>
                    </af:column>

JavaScript:

function keyInput(evt){
          var component = evt.getCurrentTarget();
          AdfCustomEvent.queue(component,
                               'EnableSave',
                               {fvalue:component.getSubmittedValue()},
                               false);
         event.cancel();
       }

Bean:

public void enableSave(ClientEvent clientEvent) {
            saveButton.setDisabled(false);
            AdfFacesContext.getCurrentInstance().addPartialTarget(saveButton);
        }
    }

Thanks to Timo lead.  It certainly put me in the right direction.  I only had to change a little bit of what you lead me to in order to work for me to get it.  I needed to activate then an area of text typed in, so using the getSource() method would not work.  Instead however, I substituted with var = AdfPage.PAGE.findComponentByAbsoluteId ("pc1:saveButtonOrder") button that allowed me to get to my button, and then the rest is the same.

So for anyone who stumbles across this is my complete solution (change of javascript, but show all):

Column:

Toolbar:


                      
                      
                    

Column:


                      
                        
                      
                    

JavaScript:

function keyInput(evt){
           var button = AdfPage.PAGE.findComponentByAbsoluteId("pc1:saveButtonOrder");
           button.setProperty('disabled', false);
           AdfDomUtils.addOrRemoveCSSClassName(false,
                                               AdfRichUIPeer.getDomElementForComponent(button),
                                               AdfRichUIPeer.DISABLED_STYLECLASS);
           var buttonDom = button.getPeer().getButtonElement(button);
           buttonDom.setAttribute('disabled', 'disabled');
       }

Tags: Java

Similar Questions

  • How to display the ToolTip when the input text is disable

    How to display the ToolTip when the input text is disable?

    Just checked in FF and IE11, works fine for me (jdev 12.1.3)

    
          
    
    

    Dario

  • Auto increase the lines of input text

    JDev 11.1.1.5.0 BPM SOA

    You need to increase the number of lines of an element of input text automatically according to the data. If the data is large enough to display several lines, or if it is small, display it in a single line.

    You can try putting an EL on the rows attribute, which points to a method of bean when you calculate the number of rows to display:

    public Integer getRows() {}

    BindingContainer links is BindingContext.getCurrent () .getCurrentBindingsEntry ();.

    AttributeBinding attr = (AttributeBinding) bindings.getControlBinding ("myString1");

    Dim str As String = (String) attr.getInputValue ();

    If (str is nothing)

    Return 1;

    int len = str.length ();

    If (len<= 10)="">

    return 2;

    } ElseIf (len<=>

    return 3;

    on the other

    return 4;

    }

    and on the page:

    value = "#{Bindings.myString1.inputValue} '"

    Rows = "#{Page1Bean.Rows}" autoSubmit = "true" / > "

    If the bean is registered under the Page1Bean and the vaule inputText property is bound to "myString1 '.

    Timo

    Post edited by: TimoHahn

  • How to set the width of the input text

    Hello


    I form, which have little input text.the layout of the form is not correct.some input text is so long, it's hard to do in any seizure of text the same length. Some inputtext have varchar2 (1000). How do I?

    Hello

    first of all to mention the jdev version that you are working

    In the input text is property called columns. You can give a value such as 200 or 300 according to your need.

    Try this.

  • How can I set the default value for an input text element?

    Hello

    I have a page where I ask the user to fill out entry texts.
    The input text have links for some parameters of an exported method of the AM via the DataControl.
    Once the user fills the text of entry, he can click a button that executes the method associated with AOS.
    It's ok.

    Now, I want to set default values appropriate (taken from a java method) for some texts of entry on the initial page rendering, for they are virgins.
    How can I do this?
                                <af:inputText value="#{bindings.parameter.inputValue}" label="Method Parameter"
                                              required="#{bindings.parameter.hints.mandatory}"
                                              columns="#{bindings.parameter.hints.displayWidth}"
                                              maximumLength="#{bindings.parameter.hints.precision}"
                                              shortDesc="#{bindings.parameter.hints.tooltip}" id="it15">
                                    <f:validator binding="#{bindings.parameter.validator}"/>
                                </af:inputText>
    
      <executables>
        <variableIterator id="variables">
          <variable Type="java.lang.String" Name="parameter" IsQueriable="false"/>
        </variableIterator>
      </executables>
    
    
  • I need help with dynamic input text

    I am developing a game and I have a problem with my dynamic input text. I am doing my input text appear on other images whenever I click on the button, well, I tried a few solutions I've seen here, but it hasn't really well.
    This is the first code I used:

    Stop();

    function handleClick(pEvent:MouseEvent):void {}

    var myfirstVariable = box1.text;

    Welcome.Text = "Welcome to the game" + myfirstVariable;

    }

    enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);

    This works but only on an image. and this is the code I'm trying to use now:

    Stop();

    var enteredText:String;

    welcome.addEventListener (Event.CHANGE, updateString);

    function updateString(evt:Event) {}

    enteredText = welcome.text;

    }

    enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);

    and on the other images:

    Stop();

    enteredText = welcome_2.text;

    Thank you much for the help ^^

    If you change the images have an another textfield on this new framework, you must set its text property to:

    enteredText = welcome_2.text;<-comment out="" this="" line="" and="">

    welcome_2.text = enteredText;

  • Refresh an input text area

    A popup main user selects the check boxes for a few (3) lines in the list and click on send.
    submit button-> bean managed-> shows second popup.
    In a second window, we have a text entry area where we show "you have selected 3 elements.

    The input text is binding to the managed bean where I put the message "" you selected 3 items".

    It works very well.

    But when I close the second popup and return to the main window and select 5 check boxes and click on submit, it still shows
    "you have selected 3 elements.

    No idea what that can do to show the "you have selected the 5 elements.

    Thank you

    My best off the cuff guess is to change attribute of default ContentDelivery of your popup to Lazy to Lazy (Uncached)

  • Need help: input text

    Hello

    I want to design an application that allows me to do:

    1 - write a website link in an input text

    2-click on a button, then the link is saved in a variable of a

    3. using geturl, the application opens the site in a new window

    I tried this:

    on (release) {
         ch= _root.da;
         getURL(ch, "_blank");
    }
    // "da" the name of the input text

    As a result, when I click on this movieclip, firefox opens in my homepage, not on the input text written website.

    pleaze help.

    If da is the name of the instance of the textfield object, you must target its text property. ch = _root.da.text;

    You should learn not to place the code on the objects and use the code of script instead.  If you give your button an instance name (btn), then in the timeline you would use:

    btn.onRelease = function() {}

    ch = _root.da.text;

    getURL (ch, "_blank");

    }

    Note: The _root reference is not necessary if you are coding in the main scenario

  • Variable input text is converted to HTML

    I have a text box to the entry that has a variable that are entrusted to him.  The user must enter a number, and then he is presented with a button that performs a simple conditional so check the statement.  I noticed that the if statement constantly fails because the variable is going back to HTML format.  Track of the variable looks like this:

    < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONT FACE = "Times New Roman" SIZE = "12" COLOR = "#0066CC" LETTERSPACING = "0" KERNING "0" = > 4 < / POLICE > < /P > < / TEXTFORMAT >

    The variable must be simply number 4 without all the jibberish HTML.  The "render text as HTML" is not on for the input text box.  I am completely baffled and a total loss... any ideas of what's going on here?  Here is the exact code I use...

    CHRONOLOGY

    numA = random (10)

    Numb = random (10)

    playerGuess = "";

    Stop();

    BUTTON

    {We (Press)}

    If (playerGuess == numA + numb) {}

    gotoAndStop ("OK");

    } else {}

    gotoAndStop ("Incorrect");

    }

    }

    Do not use the property of the textfield var.  Assign the textfield instance name and use its text property.  Then move the playerGuess from the var scope to the field in the properties panel and change your code as follows...

    CHRONOLOGY

    numA = random (10)

    Numb = random (10)

    playerGuess.text = "";

    Stop();

    BUTTON

    {We (Press)}

    If (Number (playerGuess.text) == numA + numb) {}

    gotoAndStop ("OK");

    } else {}

    gotoAndStop ("Incorrect");

    }

    }

    Also, it will be best not to put the button code and keep it in the timeline instead.  To do that you must assign an instance name to the button and having your code as follows (say you name the button to "btn"...

    CHRONOLOGY

    numA = random (10)

    Numb = random (10)

    playerGuess.text = "";

    Stop();

    btn.onRelease = function() {}

    If (Number (playerGuess.text) == numA + numb) {}

    gotoAndStop ("OK");

    } else {}

    gotoAndStop ("Incorrect");

    }

    }

  • Setting focus to the input text area

    I use MX 2004 and construction of a simple game where the contribution of users numbers in a dynamic text box. To limit the number of mouse clicks, I'm wanting to set the focus to the input box when that screen/page loads. Right now, we have to click on the area of input text field, enter their choices, then click on the submit button. I just want to type first, then click on the submit button.

    I set a variable to the text box of entry as "answer_box".

    I thought I remember a 'setFocus' or a 'onFocus' in ActionScript once before, but I can't find an example.

    Any help would be great!
    Thank you

    Thanks Rothrock. It worked. The 'Sélection' class allows you to define and control the text box where the insertion point.

    My text entry box is called, "years1.

    In the layer actions, the first line, I put - Selection.setFocus ("years1");

    Works perfectly. Thank you for pointing me in the right direction

  • I can't select the text button in MS Paint. What I am doing wrong?

    I try to ad text to a photo and the button text in MS Paint is garyed out and won't let me select it. What I am doing wrong?

    Maybe the info will be useful...

    The text in the tool palette button to you referring
    the left side of the screen or one of... Display / text toolbar?

    In Vista... Zoom must be set to 100% to make the live button text.

    View / Zoom / Custom / 100%

    If you left click the 'A' in the palette tools and click left/drag
    a box in the position where you want the text... the bar of text tools
    should become alive.

    FWIW... the free Picasa software has better options for adding
    text of photos.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Picasa
    http://Picasa.Google.com/
    (for Windows XP/Vista/7)

    After you download and install Picasa...
    Open the program and double left click
    an image to open the editing functions.

    To add text to the front of the photo...
    choose... Simple retouching / text button...

    "Retouching" features: crop, add text, editing
    http://Picasa.Google.com/support/bin/answer.py?answer=93403

  • I want to accept only Arab characters in the input text

    Hello

    Is it possible to let the user just write in Arabic in the af input text?

    If he enter English tank when you use keyboard ENG that I want to prevent this event and not let him write without error msg and if it helps keyboard AR I want let write

    Thank you.

    You can implement something like this using javascript. You should prevent the addition of English characters of:

    -Keyboard

    -By using ctrl + v (in case you have copied English words)

    -Using right-click + spent (in the case where you have copied English words)

    To do this test to track the following:

    1 - inside af:inputText add 2 clientListener. One to accept only Arabic characters and the other for the deactivation of ctrl + v as:

    
              
              
    
    

    2 - Add af:resource with type = "javascript" and inside this write three functions:

    -an acceptArabic function.

    b disabledPastFunction

    c disabled right click on the page.

    as:

    
    
            = 1560 && k <= 1610) || k == 32)
        {
        }
        else
        {
          evt.cancel();
        }
      }
      ]]>
    
      function disabledPastFunction(evt)
      {
        var k=evt.getKeyCode();
        var e = window.event;
    
        if(e.ctrlKey)
        {
          if (window.event.keyCode == 86)
          {
            evt.cancel();
          }
        }
      }
    
      function dis_rightclickNS(e)
      {
        if ((document.layers || document.getElementById && !document.all) && (e.which == 2 || e.which == 3))
        {
          return false;
        }
      }
      if (document.layers)
      {
        document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown = dis_rightclickNS;
      }
      else if (document.all && !document.getElementById)
      {
        document.onmousedown = dis_rightclickIE;
      }
      document.oncontextmenu = new Function("return false")
    
    
  • Change the color of text button overview

    Hello

    I used text buttons in my project and I want to change the color of overview. How can I do?

    I couldn't find anything in the style!

    Thank you

    Buttons text takes up the style of the buttons system, you can't control them at all.

    Best way would be to replace the text by form buttons buttons, which you can style so that they perfectly resemble text buttons, but you can control the style of the three States. I recommend to do with the object Style (on CP8) Manager.

    Transparent buttons don't have any rollover State, you can also use image buttons but then you must create three different images with proper nouns, such as image buttons you have included in the CP.

  • The input text formatting

    Hello

    I have a requirement for formatting the text entry in a format [(XXX) XXX-XXXX phone number].

    Implementation:
    1.Defined an input text component in the UI.
            <af:inputText id="it2" value="#{pageFlowScope.testAppBean.phoneNumber}" label="Enter Phone number:">
                <f:converter converterId="CustomConverter"/>
            </af:inputText>
    
    2.Implemented custom converter as mentioned below.
    public class CustomConverter implements javax.faces.convert.Converter, org.apache.myfaces.trinidad.convert.ClientConverter{    
        public CustomConverter() {
            super();
        }
    
        public Object getAsObject(FacesContext facesContext,
                                  UIComponent uiComponent, String value) {
            if (value == null || (value.trim().length() == 0))
                         {
                             return value;
                         }
               
                 // format phone numbers to display correctly
               
                   String phone = value.trim();
                   if (phone.length() == 10) {
                       phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
                   }
                   else if (phone.matches("\\d{10}\\s*\\d+")) {
                       phone = phone.replaceAll("\\s+", "");
                       phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
                   }
             
                 return phone;
        }
    
        public String getAsString(FacesContext facesContext,
                                  UIComponent uiComponent, Object value) {        
            
            String phoneNumber = (String)value;
                     if (phoneNumber == null || (phoneNumber.trim().length() == 0))
                      {
                          return "";
                      }
                      String phone = phoneNumber.trim();
    
    
                      if (phone.length() == 10) {
                          phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
                      }
                      else if (phone.matches("\\d{10}\\s*\\d+")) {
                          phone = phone.replaceAll("\\s+", "");
                          phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
                      }
                    
                    return phone;
        }
    
        public String getClientLibrarySource(FacesContext facesContext) {
            return null;
        }
    
        public Collection<String> getClientImportNames() {
            return Collections.emptySet();
        }
    
        public String getClientScript(FacesContext facesContext,
                                      UIComponent uiComponent) {
            return null;
        }
    
        public String getClientConversion(FacesContext facesContext,
                                          UIComponent uiComponent) {
            return null;
        }
    }
    3.Registered in faces-config.xml
     <converter>
        <description>A Converter for phone number</description>
        <converter-id>CustomConverter</converter-id>
        <converter-class>view.util.CustomConverter</converter-class>    
        </converter>
    
    4.Ran the application.
    The question is, at the entrance of text in text box... the custom converter is not called. Can someone help me to convert the text entered in planned phone number format.

    * Note: I expect that for every key stroke... the custom converter is called.

    Kind regards
    Kiran

    Check out this blog https://blogs.oracle.com/jdevotnharvest/entry/get_social_security_numbers_right
    or this example: http://multikoop.blogspot.de/2012/11/adf-smart-input-date-client-converter.html

    Timo

  • Text button works

    Hello!

    I sent to push Distribution text 16 hours ago and haven't receieved it.

    Developer text button works like a charm.

    What is the reason can be here?

    Here's the reason

    http://status.adobedps.com/?p=353

Maybe you are looking for

  • 4.6 Device Manager SP4 - how can I remove an 'Unidentified' empty OS tab

    Hello... I try to delete an empty OS 'Unidentified' tab... it appeard when I did an import and now I want to delete it because there is nothing in this tab. There, can someone help me please... I checked all the tables on the SQL Server, and they are

  • error code 0 x 205 Burn failure insert the blank cd or dvd

    I get this error code when you try to burn discs by default factory, under States details value General Exception was too large or too small for a type of int32 error code 517 DVD disc I tried 4 different DVD including - brands / +, I tried to format

  • 8e5e0152

    Hello, basically yesterday when I tried to sign into my Windows Live Messenger on my laptop, it is came saying that he could not sign in. I clicked on "more information" and then he said: the error code is 8e5e0152. It lets me sign into my account ms

  • defragment disk will not accomplish

    My HP defrag disk utility runs every 20th of the month and never ends even after 2 days.  It is usually suspended around 20% defragmented. I have Windows 7.   Don't know how to solve.  Thank you.

  • error - how to debug?

    Hello I am new to the blackberry development. I am working on an app for BB10. my host is w8 64bits. I get this error when I try to compile my application: do: [Device-Debug] error 2 not the error report more descriptive that I've ever seen.   can so