Editing particular pattern in an input text in ADF

Hi,
I have a requirement in ADF like the user should be able to editable only a particular pattern.
Example:
Name: Chandramohan
Hobbies: My hobbies are {}, {}, {}
In the above hobbies filed( say textarea or input text), the user should be able to replace only the {} with some text, not other text like 'My hobbies are'.
Kindly suggest some ideas.
Edited by: 875628 on Jul 27, 2011 11:29 PM
Edited by: 875628 on Jul 27, 2011 11:30 PM

Hi,
Have you tried this with javascript?
Here is a basic solution (which takes care only for the first {} - you can enhance it to fulfill your requirement).
                <af:inputText label="Label 1" id="it1" value="My hobbies are {}, {}, {}" clientComponent="true" >
                <af:clientListener type="keyPress" method="validateValue" />
                </af:inputText>
                <af:resource type="javascript">
                function validateValue(evt){
                    var inputTxt=document.getElementById('it1::content');
                    var startPos = inputTxt.value.indexOf("{");
                    var endPos = inputTxt.value.indexOf("}");
                    var cursorPos = inputTxt.selectionStart;
                    if (cursorPos &lt; startPos || cursorPos > endPos) {
                    alert("Cannot Edit");
                    evt.cancel();
                </af:resource>-Arun

Similar Messages

  • [ADF Faces] set cursor position to the first column input text in ADF table

    How do i set the cursor position to the first column input text when i Insert a blank row?
    My idea is to implement using javascript. document.setfocus() but how do i do it from the backing bean code? or how do i install custom js to call document.setfocus()?
    any ideas?
    Message was edited by:
    user450391

    Did you try by iterating the selected row?
    Bind the table with the managed bean and then try with below code:
    RichTable empTable;
    RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();   
    Iterator selectedEmpIter = selectedEmps.iterator();
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter = bindings.findIteratorBinding("EmpView1Iterator");
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    while(selectedEmpIter.hasNext()){
       Key key = (Key)((List)selectedEmpIter.next()).get(0);
       Row currentRow = empRSIter.getRow(key);
       System.out.println(currentRow.getAttribute("Ename"));

  • Compare two input text in adf

    Hi
    i used the Build JDEVADF_11.1.1.4.0
    I want to make compare  validation between two  input text  Are equal or not . same Thing when i create new email i must enter the password and re enter password if not   equal  he give me message

    Hi,
    for a validation String, you can put autosubmit=true and in the valuechangeListener make the comparation.
    How to compare two Strings in java? http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java

  • Left Align for the input text in ADF

    Hi,
    When I drag and drop the data control in my jsp page, Automatically all the fields are aligned at the center of the page. But I want to align the input text fields to the left of the page. I have only valign which will give me top, bottom and center options.
    Is there any property which will help me in aligning it left?
    Please help me.
    Thanks,
    Haripriya.S

    I think you forgot to close the rowLayout tag.
    <afh:rowLayout binding="#{backing_test.rowLayout1}" id="rowLayout1" halign="left">
    <af:panelForm binding="#{backing_test.panelForm1}" id="panelForm1">
    <af:inputText value="#{bindings.direccion.inputValue}"
    label="#{bindings.direccion.label}"
    columns="#{bindings.direccion.displayWidth}"
    id="inputText1">
    </af:inputText>
    </af:panelForm>
    </afh:rowLayout>

  • Readonly Input Text in ADF

    Hi,
    I've two questions below,
    1. I want to create an ADF input text , which looks like a normal textbox but user cannot input anything in it(same as <input type="text" readonly="true">) . Is there any way to have an input text like that by using adf component? ( I do not want to use disabled="true" because it looks very different and cannot add an error message to that component if it's disabled)
    2. I know JSF input text can work as required in #1 by using <h:inputText id="it4" readonly=true/>. But if I use JSF input text , its css style looks very different to other af:inputText on the pages. Is there any way to apply ADF CSS style class to <h:inputText id="it4" readonly=true/>
    Thank you for your help!

    Hi Ajay,
       what Sireesha trying to say don't wake up the thread which are slumbering.
    Reason, Besides you wont get any chances reply in this thread.some one may ignore it ah old one. so better to avoid that get your answer in faster means please be clear with your question. then there you may hook up this thread. you can say i referred this thread. but no luck.
    Thanks.

  • Validation on Disabled input text

    it seems <af:validateRegExp cannot work inside a <af:inputText disabled='true'>, is there any easy way to have this client side validation on a disabled input text in ADF?

    I am wondering if you could create a transient attribute in the EO that displays the data from the attribute. The "real" attribute would not be disabled, and would then validate.
    You then display the transient attribute on the form, and it would be non-update-able since it is transient.
    You could then place entity level validation on the entity (instead of on the attribute) since it is based on a second value in your form. Haven't tested it, but it would seem to be a solution.
    Stuart

  • How to use multiple patterns for masking/format the input text

    Hi All,
    I am using Jdeveloper 11.1.1.5 and i have a requirement where i need to format my input Text value in these below patterns:-
    Format
    Example
    AA9A 9AA
    EC1A 1BB
    A9A 9AA
    W1A 1HQ
    A9 9AA
    M1 1AA
    B33 8TH
    A99 9AA
    AA9 9AA
    CR2 6XH
    DN55 1PT
    AA99 9AA
    For Example :-  If user puts value as EC1A1BB, it should automatically changed to EC1A 1BB
                                 if user puts value as W1A1HQ, it should be automatically changed to W1A 1HQ and so on..
    If it could have been one format , i might have followed this :- https://blogs.oracle.com/jdevotnharvest/entry/get_social_security_numbers_right
    But for multiple patterns i am not able to get through to the proper solution.
    Is there any way to achieve this ? Please suggest.
    Regards,
    Shah

    For the validation you should be able to use one regular expression where you add the logical or (|)  (check the doc http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) between the groups. If none of the patterns matches you have an error.
    For the for formatting I'm not sure you can use only one expression.
    I suggest to write one method which does the checking on and the formatting may be using an array of patterns to check and iterate the patterns in a loop. Once you found a match you can read the needed format from another array (or an other dimension if you prefer to use a multidimensional array).
    Timo

  • I want to make a textfield non editable with blinking cursor,and the text is input from a custom keypad

    I want to make a textfield non editable with blinking cursor,and the text is input from a custom keypad....
    Please Help me.
    I want to make a numpad of my own from which i can set the text but i want the user to tap in between the text..

    You seem to stop the while loop to run the following code, then the program ends. Are you running this using the "continuous run" button????
    You need one big while loop containing the acquisition, then you build up the history data in a shift register. Clicking "save" will save the data, but not stop the loop.
    Why did you place a time-control in the FOR loop??? This is just post-processing so it should just do it without any delays. I don't understand the logic in the FOR loop. You are appending arrays, but then you delete the first element at each iteraction constantly trimming data from the beginning of the appended array. Then you autoindex at the output tunnel heavily duplicating all data. Ths make s no sense!
    Can you explain how you want you data saved?
    Message Edited by altenbach on 12-16-2005 11:20 AM
    LabVIEW Champion . Do more with less code and in less time .

  • Can we hide the real value of input text box and show other value in ADF?

    Hi All,
    I have a table in which i have one the column as "Quantity" and text box as "quantity" :-
    <af:column sortProperty="quantity" filterable="true"
    sortable="true" headerText="Quantity" id="c3"
    width="60"
    rendered="#{row.bindings.booleanFlag.inputValue != 'E'}"
    filterFeatures="caseInsensitive">
    <div align="center">
    *<af:inputText value="#{row.bindings.quantity.inputValue}"*
    label="#{bindings.queryProductResponseType.hints.quantity.label}"
    required="#{bindings.queryProductResponseType.hints.quantity.mandatory}"
    columns="#{bindings.queryProductResponseType.hints.quantity.displayWidth}"
    maximumLength="#{bindings.queryProductResponseType.hints.quantity.precision}"
    shortDesc="#{bindings.queryProductResponseType.hints.quantity.tooltip}"
    id="it5" partialTriggers="it19"
    readOnly="#{row.activeYN == 'N'}">
    <f:validator binding="#{row.bindings.quantity.validator}"/>
    <af:validateRegExp pattern="^[1-9]+[0-9]*$"
    messageDetailNoMatch="Quantity must be in whole number format."/>
    </af:inputText>
    </div>
    </af:column>
    Now when the user will enter say 400 in input text box "quantity" , the value should be divided in the same row to other column text box say "conversion" which holds the value as 40 , so if the division doesn't give any remainder(means remainder =0 ) means real value(400/40) = 10 then it should set the value of input text box "quantity" as 10 but the user should be able to see 400 which he/she entered before, as we want to send the 10 as request but we have to show 400 to the user and if remainder goes greater than 1 than it should show an error.
    I have to implement this in value change listener of the text box as i need to calculate the real value each time for a row.
    How should i implement this ?
    Thanks .
    Thanks.

    Thanks timo,
    But can you give me full details how should i implement this as i am newbie to ADF. I have found the data control in Data controls tab in left hand side and right click on it -> edit definition -> but it does not give me the option to add attribute , it just give me the option to edit the existing attribute. Can you explain me how to add the transient attribute and how to implement it ? Any sample code snippet ?
    Thanks.
    Edited by: user13644804 on May 15, 2011 10:09 AM
    Edited by: user13644804 on May 15, 2011 10:09 AM

  • How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text?

    How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text? Please help! I'm technologically challenged.

    Most forms (99% or more) are created for simple text input, where you cannot change anything.
    The creator of the form could allow Rich Text input (which allows you to change font, text size, color, etc.), but frankly I have never seen such a form, and I wouldn't know how they look.  But I'm sure they would show some kind of controls to alter the text appearance.

  • Can i set the content of input text in a form layout in the uix page center

    Hi
    i have a simple question, how can i set the content of an input text in a form layout in the .uix page center?
    i saw in the page properties but i didn't found.
    thank you for your help.
    Edited by: Islem on 19 déc. 2008 00:22

    Sirrick,
    If I understand your question correctly, you want to programmatically set how many array elements (clusters) to show. You can do this with the Array properties: Number of Rows and Number of Columns. Please see the attached VI.
    Zvezdana S.
    National Instruments
    Attachments:
    Array_Elements.vi ‏20 KB

  • How to pass the currency of particular company code into a text variable.

    Hi
    I want to pass the currency of particular company code into a text variable.
    The company code is selected by the user using Input variable "0S_COM_M".
    I have created a text variable "ZD_CURR" with processing type customer exit.
    I have written the following abap code but its not working.
    DATA : LV_CURR type /BI0/OICURRENCY.
      WHEN 'ZD_CURR'.
        IF I_STEP = 2.
          CLEAR  XTAB.
          READ TABLE I_T_VAR_RANGE INTO XTAB WITH KEY VNAM = '0S_COM_M'.
          SELECT SINGLE CURRENCY FROM /BI0/PCOMP_CODE INTO LV_CURR WHERE COMP_CODE =  XTAB-LOW.
          L_S_RANGE-LOW = LV_CURR.
          L_S_RANGE-SIGN = 'I'.
          L_S_RANGE-OPT  = 'EQ'.
          CLEAR E_T_RANGE.
          APPEND L_S_RANGE TO E_T_RANGE.
        ENDIF.
    Pls let me know how to resolve this issue or what modification can be done to this code.
    Is there a way where we can debug customer exit code for variables.
    Thanks.

    Hi.
    You should debug your code to check behaviour of it.
    Just set external breakpoint (or create checkpoint via tc SAAB) and run your query.
    You may run query via RSRT.
    Regards.

  • Using input text that's in a MC

    Hi all -
    Tearing my hair out on this, and it seems like it shouldn't be that difficult.
    I've got an input text box (opAnswerTxt) that I've added to a movie clip (questAns) using AS3:
    questAns.addChild(opAnswerTxt);
    That's fine -- I'm able to type text into the text field. Now I need to trace this text. (Ultimately, I will want to capture the text in a variable and then reuse the text in a dynamic text field, but just tracing to make sure I can get the text first.)
    I added a button (opSaveBtn) - also to the MC - and added an event listener to the button:
    questAns.addChild(opSaveBtn);
    opSaveBtn.addEventListener(MouseEvent.CLICK, saveOpInput);
    but can't seem to trace the input text. Here's what I'm using:
    function saveOpInput(me:MouseEvent):void
      trace (opAnswerTxt.text);
    My output is the original default text I have in the text box, rather than the text I just typed in.
    When I add the input text box to the stage, rather than to the MC, it works fine.
    Note: I've tried targeting the instance -- see the following -- but I get an error.
    trace (questAns.opAnswerTxt.text);
    Also tried trace (MovieClip(root).questAns.opAnswerTxt.text) and that didn't work either.
    Can anyone help?
    Thanks!
    Miriam

    Thanks for your quick response. You may be right on this. The MC (and child text box and button) are all within a loop that's parsing an external XML file.
    Basically, I'm trying to create a "form". The questions are in the external XML file (so they can be updated by the customer later). I've got a loop that's parsing the XML file and creating an MC for each question element it finds. Each MC has a question text field (dynamic - populated from the XML), an answer text field (the input text field), and a save button. Here's the code:
    for (var i:int = 0; i < opLen; i++)
    //declare variables - the XML is loaded in the first frame - this all works fine
    var opQuestionElement:XML = opQuestion[i];
    var opQuestText:String = opQuestionElement;
    var opQuestionsElement:XML = opQuestions[i];
    var opQuestNum:int = opQuestion[i];
    //add container to hold each q&a
    questAns = new qAndAMC();
    questAns.width = 575;
    questAns.height = 200;
    questAns.x = 0;
    questAns.y = 0 + i * questAns.height;
    containerOp.addChild(questAns);
    questAns.name = "Q&A #" + (i+1);
    //add question text
    var opQuestionTxt:TextField = new TextField();
    opQuestionTxt.multiline = true;
    opQuestionTxt.wordWrap = true;
    opQuestionTxt.defaultTextFormat = qTextFormat;
    opQuestionTxt.embedFonts = true;
    opQuestionTxt.htmlText = (i+1) + ". " + opQuestText.toString();
    opQuestionTxt.width = 545;
    opQuestionTxt.x = 5;
    opQuestionTxt.y = 10;
    questAns.addChild(opQuestionTxt);
    opQuestionTxt.name = "OpQuestTxt " + (i+1);
    trace(opQuestionTxt.name);
    opQuestionTxtFieldList.push(opQuestionTxt);
    //add answer input text box;
    var opAnswerTxt:TextField = new TextField();
    opAnswerTxt.type = "input";
    opAnswerTxt.multiline = true;
    opAnswerTxt.wordWrap = true;
    opAnswerTxt.background = true;
    opAnswerTxt.backgroundColor = 0xFFFFFF;
    opAnswerTxt.border = true;
    opAnswerTxt.defaultTextFormat = qTextFormat;
    opAnswerTxt.embedFonts = true;
    opAnswerTxt.width = 545;
    opAnswerTxt.height = 110;
    opAnswerTxt.x = 10;
    opAnswerTxt.y = 60;
    opAnswerTxt.text = "Here's some text";
    addChild(opAnswerTxt);
    //add save btn
    opSaveBtn = new saveButton();
    opSaveBtn.x = 522;
    opSaveBtn.y = 188;
    opSaveBtn.buttonMode = true;
    questAns.addChild(opSaveBtn);
    opSaveBtn.addEventListener(MouseEvent.CLICK, saveOpInput);
    function saveOpInput(me:MouseEvent):void
      trace (opAnswerTxt.text); //This currently traces "Here's some text", rather than what I type in
    The two things I need to solve are:
    1. I want to be able to "save" the input text in each of the input fields, so if the user navigates away from this frame, the text they input last time isn't lost. Ideally, I'd like all of the input text fields to display whatever text they entered last time -- but they should still be an input field so they can edit the text if they want.
    2. I want to be able to print (or save to a text file) ALL of the question and answer text fields. I believe I need to create a separate print job MC for this?
    Any help you can give would be greatly appreciated!!
    Miriam

  • Trying to auto commit after input text value change

    Hello, I have created a page that contains an input text box. When the user changes something in the input text box, I want to fire off a commit operation.
    As of now, I have valueChangeListener of the inputText set to a method on my managed bean which then grabs the commit operation from my bindings container and executes it.
    At that point, I would expect the changes to a the input text box to be saved after a user modifies it. However, it doesn't seem to be working, because when I refresh the page, the mod I made to the text is not there. The input text still reflects the text that was there before I made a change.
    Anyone know what's happening here?? And how I can make it work?

    Hi Timo,
    Thanks for the response. I tried that, and my commit function in my bean was getting called, but the data still wasnt "REALLY" getting saved.
    I had to bind my input text to a property in managed bean, and call
    inputText.processUpdates(FacesContext.getCurrentInstance());
    doCommit(); // method that simply calls the commit method in my binding container, and does a few other things.
    For simplicity I just bound the panel that all my input components were child of. In this case it was a DecorativeBox. So I bound the DecorativeBox to my bean and just did
    decBox.processUpdates(....)
    doCommit();
    That way all my child input components were updated before the commit took place. That seemed to do the trick nicely (-;
    Edited by: Fonz Desselle on Mar 25, 2013 11:42 AM

  • How to insert a date picker input text field in a JSF Jsp page

    Hi,
    I have to develop an application using generic facets, unfortunately I am not supposed to use ADF Faces components given by Oracle.
    Now my requirement is, on JSP page an input text field which holds a DATE value is required, it should also have a Date Picker Calendar adjacent to it.
    Could you pls shed some light on this issue and help me out.
    Thanks
    ~Siva(ji)

    <HTML>
    <script language="JavaScript" type="text/javascript">
    <!--
    var pUpWidthc = 300; //Change the pUpWidthc to your requirements.
    var scrAvailc = 400;     //Change to your available screen width. You see in
    //this eBooks' middle frame, the frame width is
                                                                //equal to 410 . So whether your using frames or
                                                                //or a full 800 pixel screen, you must calculate
                                                                //your available screen width.
    var PopUpC = document.getElementById("pUpc");
    document.write('<div id="pUpc" style="visibility:hidden;z-index:4;width:'+pUpWidthc+';position:absolute;"></div>');
    function cstmPup(objC,c){
    popUpC = document.getElementById("pUpc");
    popUpC.innerHTML = c.innerHTML
    popUpC.style.left = getPos(objC,"Left");
    var scrNeedc = getPos(objC,"Left") + pUpWidthc;
    if (scrNeedc > scrAvailc){
    //The number 10 below is an extra offset x value applied when the
    //definitional popup box positions beyond your screen width. You
    //can change this number to fine tune your "beyond screenwidth" positioning.
    var scrOffsetC = getPos(objC,"Left") + pUpWidthc - (scrAvailc);
    popUpC.style.left = getPos(objC,"Left") - (scrOffsetC - 0);
    popUpC.style.top = getPos(objC,"Top") + objC.offsetHeight;
    popUpC.style.visibility = 'visible';
    fill();
    function fill()
         var noOfRows=7,noOfCols=7,i=0,j=0,day=1,x;
    var d1=FirstDayOfWeek(7,2008);
    //40     
         for(i=1;i<noOfRows;i++)
              x=document.getElementById('myTable').insertRow(i);
              for(j=0;j<noOfCols;j++)
                   var y=x.insertCell(j);
                   if( ( i==1 && j<d1))
                   y.innerHTML="";
                   else if(day<=DaysInMonth(7,2008)){
                   y.innerHTML=day;
                   day++;
    //document.write(FirstDayOfWeek(7,2008));
    function FirstDayOfWeek(m,y)
    var i;
    var dow = 6;
    //document.write("Hello");
    for (i=1583; i<y; i++)
    dow += (LeapYear(i)) ? 2 : 1;
    for (i=1; i<m; i++)
    dow += DaysInMonth(i,y);
    return dow % 7;
    function DaysInMonth(m,y)
    // m is the month number (1,2,3,...12), y is the year number (four digits)
    switch (m)
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12: return 31;
    case 2: if (LeapYear(y))
    return 29;
    else
    return 28;
    default: return 30;
    function LeapYear(y)
    return (y % 4==0) && ((y % 100!=0) || (y % 400==0));
    function getPos(objC,sPos){
    var iPos = 0;
    while (objC != null) {
    iPos += objC["offset" + sPos];
    objC = objC.offsetParent;}
    return iPos;
    function hPopUpc(){
    popUpC = document.getElementById("pUpc");
    popUpC.style.visibility = 'hidden';
    //-->
    </script>
    <BODY
    <button id="c1" onclick="cstmPup(c1,pUpCstm)">Custom PopUp</button>
    <'div' id="pUpCstm" style="display:none;">
    <'div' id="myid" align="left" style=" width:100%; height:100%; background:#cccccb; border:1px solid black; border-top:1px solid white; border-left:1px solid white; padding:10px; font:normal 10pt tahoma; padding-left:18px "> <b>Rich Message Boxes</b>
    <hr size="1" style="border:1px solid black;">
         <div style="width:220px; font-family:tahoma; font-size:80%; line-height:1.5em"><br>
              <table border ="1" id="myTable">
                   <TR>
                        <TD> SUN </TD>
                        <TD> MON </TD>
                        <TD> TUE </TD>
                        <TD> WED </TD>
                        <TD> THU </TD>
                        <TD> FRI </TD>
                        <TD> SAT </TD>
                   </TR>
              </table>
         <br><br>
         </div>
         <br>
         <div>
    <button tabindex="-1" onclick="hPopUpc()" style="border:1px solid black; border-left:1px solid white; border-top:1px solid white; background:#cccccc ">Close Message</button>
    </div>
    <?BODY
    </HTML>
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri

Maybe you are looking for