Cut the decimal value in the input text

Hi all

JDeveloper version: iam using jdev version 11.1.1.6.2

I need to cut the decimal when the user enters a decimal value.

IAM a table with one column as editable.

For example:-If the user enter 123,53 in the editable column, tab press ENTER key press or move to the next row, I want this value to be changed like 123.

Guide me on how to do this. I tried with VO/OT Format, convert number, nothing helps me.

Reg,

Lakshmi.

USE IT FOR YOUR NEED...

that assumes that you have a table in which a column is ok SALARY, then add a ValueChangeListener on data from this column and AutoSubmit = true and also immediate = true and then write the code in valueChangeEvent as below...

public void decimals (ValueChangeEvent valueChangeEvent)

{

RichInputText sal = (RichInputText) valueChangeEvent.getComponent ();

s oracle.jbo.domain.Number = (oracle.jbo.domain.Number) valueChangeEvent.getNewValue (); for Type conversion

int a = s.intValue ();

sal.setValue (new oracle.jbo.domain.Number (his));

RequestContext adfContext = RequestContext.getCurrentInstance ();

adfContext.addPartialTarget (sal);

}

DO it this way, I hope that the problem will be solved.

Tags: Java

Similar Questions

  • 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>
    
    
  • 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 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

  • How to detect if the cursor is no longer within the input text area

    Hello.

    My question today is:

    How to detect (in AS3) if the cursor is no longer within the input text area?

    I tried to mouse events, events, events in text but without success.

    Any ideas?

    Concerning

    If you have a textfield of entry with the instance name it '...

    it.addEventListener (FocusEvent.FOCUS_OUT, focusOutHandler);

    function focusOutHandler(evt:FocusEvent):void {}
    trace (evt. Target.Name);
    }

  • With the help of value in an input text for the calculation in a Variable area

    I have a project where I ask the user to fill out their name in a box entry and two-digit age in another area of text entry.  Later in the project, I want to ask them to think when they were 6 years and how they would describe themselves right there.  (the project is about self-awareness).  To make it as pleasant as possible, I thought it would be nice to say. "(Name variable), think to (years since 6) years, when you were about 6 years old'."  I'm unable to get the variable 'Since 6 years' work and I would like to know if it's possible.

    • I set up the variable text box as "v_age".
    • I've implemented a variable like "v_age6" with the value "6".
    • I implemented the variable result as "v_result_age6".
    • I have set up a standard action with a mathematical expression which reads "v_result_age6 = v_age - v_age6.

    The variable output does not appear on the scene in overview of project mode, and I think it's because there is only a single variable with a value assigned in the equation.  The variable "v_age" doesn't have an assigned value because it is a text entry area.

    Is it possible to use a value typed in a user as a variable to do math with?

    Thank you.

    Welcome to the forum,

    Each TEB has an associated variable, its generic name is the same as the BER. But you better match your variable with the most significant name to the ETB. Take a look at this old real blog post, always to news (though perhaps the screenshots are little bit outdated):

    http://blog.lilybiri.com/timesaving-Tip-Create-associated-variable-for

    BTW: you have no need to create an additional variable to number 6. This action would have done as well:

    Expression v_resultage6 = v_age - 6

    How you trigger the action, by what event?

    http://blog.lilybiri.com/events-and-advanced-actions

    Lilybiri

  • 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

  • Height of the input text box...

    Hi all

    Is there a way to dynamically get the size of an input text throught javascript box? For example, I have an < input type = "text" id = "myBox" size = "50" >, and I would like to get the height of the text box with the id "myBox" through javascript dynamically.

    Thanks in advance!

    Daverms wrote:
    > Hi,.
    >
    > You can not retrieve the height of the text box since there are actually no 'height' attribute is available for theand also the width is represented as an attribute of "size".

    a text box CAN have HEIGHT and WIDTH set in style = attribute.
    If so, you can get these values with
    document.getElementById("yourid").style.height and
    document.getElementById("yourid").style.width

    However, WITHOUT setting the height and width in the style = attribute, that you can't
    get the default width/height of a textbox
    --

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com

  • 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")
    
    
  • Cutting the image text

    Hello

    I'm cutting a word after having extended the type to create forms.

    Screen shot 2014-05-15 at 23.49.33.png

    When I click on the button "-" before (second to the left, the top line)

    He reduced only to the H:

    Screen shot 2014-05-15 at 23.49.42.png

    Why is there that and not cut the word off the gray below?

    Thanks for your help!

    Opacity mask inverted Jacob will work, or if you want a clipping mask, here's a way...

    1. draw a rectangle the size of your raster image. Place it in front of the image, by aligning the two.

    2. position your text describes where you want it cuts the image, then select it, as well as the rectangle and choose object > compound path > make.

    3 select the transparent/rectangle path of text with image and choose object > clipping mask > make.

  • How to check the answer in the input text area

    Hey, I have a project for school on the colons and semicolons. As part of it, I want to make a box of text input that puts the answer to a question in the player then clicks on a button that controls the input box, and if its correct goes to a correct screen so bad it goes to a screen that is incorrect. Unfortunately I do not know how to do someone help me. Thank you!

    var answerA:Array is ["the correct answer to the question 1', 'address 2', '3 ', answer...];.

    var questionA:Array = ['question 1', "Q2", "q3",...];

    var currentQuestion:int = 0;

    checkAnswer.addEventListener (MouseEvent.CLICK, checkF);

    function checkF(e:MouseEvent):void {}

    {if (answer_tf. Text is answerA [currentQuestion])}

    as much as goto

    }

    }

    increment currentQuestion somewhere

    Check if the quiz is completed.

  • 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

  • How TEB can remember the input text value?

    Hi all

    I wanted to know if there is a way a published course may recall the text that has been typed in BER even after the re-opening of the course.

    Simply put: html course Open-> typed in TEB {Hello}-> exit course-> classes-> reopen TEB appears {Hello}.

    Best regards

    Mirza

    I don't think there is another way, unless an expert Javascript has a solution.

  • ADMN-&gt; activities-&gt; export cut the extended text Attritue


    I use ADMN-> activities-> export to export my attrributes extented staging of the production environment and quality assurance, the attribute type is Qualitative, the style is unique select _Radio buttons. the text of the option button (stored in the table comextendedattributequalityml) cut during the export process. I checked the table of database production and QA, it can contain up to 500 characters. I tried 2 attributes, it has been cut to 103th characters, it has been cut to the 108th characters. This means that the first characters 103 or 108 have been copied to the table of produciton and QA in comextendedattributequalityml. Is it a bug or any configuration change, we can change the size of the export.

    Thank you

    Maybe it's a bug because of the value of table meta information does not not in the actual column size.

    select  c.tablename, p.columnname, p.dbType, p.maxlength, p.pkid from orclassmetainfo c
    inner join  orpropertymetainfo p on p.fkORClassMetaInfo = c.pkid
    where c.tablename = 'comextendedattributequalityml' and columnname = 'Quality';
    

    The fix can be just a simple script that updates the maxlength field in the table metadata information and a restart of the application with container of distance communication.

  • How to cut the big text in several small files of text file?

    Hi all

    I got a big text file.  Notepad could not open it.  I want to cut it into several small files-texts so that I can open and check it out.  I use "set the file position" and 'set the size of the file', but it still gives me the part of the start file.  I would like to, say, four small files, in the first quarter, the sencond quarter, in the third quarter and in the fourth quarter to each file.

    How? Seems very simple question. I miss...

    Many thanks for any help.

    Anne

    Hi Anne,.

    Just read the blocks of the file in a loop...

Maybe you are looking for