Disabling BC4J bound text fields

If I have a JTextComponent bound to a database field, and I want to disable to the field, I call myTextField.setEnabled(false).
This works initially, but as soon as the view is refreshed, the box somehow enables itself again. Can anyone explain this for me?
Thank you!
Owen Gibbins

You have to create a subclass of JTextField (which I think is what you are using), which looks something like this:
class MyTextField extends JTextField
protected boolean isReallyEnabled = true;
public boolean isEnabled()
return isReallyEnabled();
public boolean isReallyEnabled()
return isReallyEnabled;
public void setReallyEnabled(boolean b)
isReallyEnabled = b;
To enable/disable the control, you use the 'reallyEnabled' property. The 'enabled' property will now be ignored.
HTH

Similar Messages

  • Problem with Refreshing the data bound text fields

    Folks,
    First of all, this a GREAT product and I am moving my apps from Eclipse to Studio Creator. I am very impessed with it so far.
    I am gone through most tutorials, but can't help resolve the problem that I am having. I have a page, that lists all the users in a table. When you click on any user, it opens up another page that lists the detail of the specific user you have clicked on. This a typical use in most web applications, right?
    In the user detail page, I open it in "Read" only mode, by setting the "setReadOnly" to true for all text field components. Then users can edit it by clicking "Edit" button. Edit button just changes the "setReadOnly" to false, to allow editing. After editing, they can hit the "Save" button to save the changes. In the save button, I call this code:
    public void prerender() {
            try {
                userID=getSessionBean1().getUserID();
                getSessionBean1().getWeb_userRowSetUserDetail().setObject(1,userID);
                getWeb_userDataProviderUserDetail().refresh();
                info("prerender: Refresh called");
            } catch (Exception ex) {
                error("Error in userForm.prerender():"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.prerender():", ex);
            setReadWrite();
    public String btnSave_action() {
            try {
                getWeb_userDataProviderUserDetail().commitChanges();
                getWeb_userDataProviderUserDetail().refresh();
                info("Data Provider Refreshed in SAVE");
                _readOnly=true;
                form1.discardSubmittedValues("saveVForm");
                info("User Updated New:"+userID);
            } catch (Exception ex) {
                log("Error Description", ex);
            return null;
        public String btnEdit_action() {
            try {
                _readOnly=false;
                //info("User ID Edt="+getSessionBean1().getUserID());
            } catch (Exception ex) {
                error("Error in userForm.btnEdit_action:"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.btnEdit_action():", ex);
            return null;
        private void setReadWrite(){
            // Set read-only to true or false for all text fiels
            this.btnEdit.setVisible(_readOnly);
            this.btnSave.setVisible(!_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_email_client.setReadOnly(_readOnly);
            this.user_email_office.setReadOnly(_readOnly);
            this.user_fname.setReadOnly(_readOnly);
            this.user_lname.setReadOnly(_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_password.setReadOnly(_readOnly);
            this.user_password_conf.setReadOnly(_readOnly);
            this.user_phone_cell.setReadOnly(_readOnly);
            this.user_phone_cell_aac.setReadOnly(_readOnly);
            this.user_phone_client.setReadOnly(_readOnly);
            this.user_phone_home.setReadOnly(_readOnly);
            this.user_phone_office.setReadOnly(_readOnly);
        }When the save button is clicked, the database is updated (as I can verify by looking directly into the database), but the data-bound text fields do not display the new value. YES, I am calling refresh() on data provider? I tried to call refresh in both "preRender()" and "Save" button action event, but that did not help either.
    Please note that the save button also changes the "setReadOnly" back to TRUE for all text fields. That means, users view the page in Read-Only mode after saving. (They have to click on "Edit" button again to edit it). I discovered that if I do not set the text field components in "ReadOnly" mode, then they display the updated value of the fields. But if I change setReadOnly to TRUE, then they display the old values (before the save).
    Any idea what I am doing wrong here?
    Thanks

    Here is my experience with it. I have three text
    boxes to be filled out. They are part of a virtual
    form with an add button as the submit. You can fill
    out the 3 and add them and a node is added to a tree
    component. When you click on a node in the tree
    component (the submit to another virtual form that
    the 3 buttons participate in) the text fields should
    be loaded with the values that they where added with.Hard to tell from this explanation, but if the text fields do not participate in a virtual form, then they are not going to get updated when an action in the virtual form happens. Not sure this is your problem. Like I say, hard to tell from this explanation.
    They will not display the values though...having
    nothing to do with read only. If I disable them
    before hand...they display the updated values. If I
    set their value at the top or bottom of prerender,
    they display the change...if I set the value in an if
    conditional that is hit (I have checked many times)
    in prerender, they will not display the values. If I
    set them in the tree handler anywhere, they will not
    display the values. This is very frustrating and is
    wasting tons of my time...I simply want to load the
    text fields based on the tree node that was
    clicked...I have messed with this for hours and it
    certainly does not work.Well, setting them in the tree handler won't work because the tree handler gets called in the page instance that handles the submit and not the page instance that renders the response.
    Posting your prerender code might help. Also, your action handler.
    >
    >
    - Mark

  • Disable button when text field is empty

    Hi
    How can I disable a button in JDialog box when the text field is empty and enable it when the user gives some input.
    Balaap

    You will have to use a keyListener since the use is not able to type into a disabled TextField. Listen for KeyEvents, if you get one enable the TextField a fill it with the char of the pressed key.
    Rommie.

  • ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO

    I WANT TO ADD ITEMS  THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
    AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
    SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
    PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
    INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORM

    Hi Praveen,
    Your form is not shared so I have not been able to access it.  But I have updated mine.  There are now two approaches, one that follows on from the above method and updates each drop down list in each row.  The second updates a separate dataset that the drop down list is bound to.  This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain.  The add button click code is;
    var particulars = xfa.datasets.resolveNode("particulars");
    if (particulars === null)
        particulars = xfa.datasets.createNode("dataGroup","particulars");
        xfa.datasets.nodes.append(particulars);    
    var particular = xfa.datasets.createNode("dataValue","particular");
    particular.value = ItemName.rawValue;
    var boundValue = xfa.datasets.createNode("dataValue","id");
    boundValue.value = BoundValue.rawValue;
    particular.nodes.append(boundValue);
    boundValue.contains = "metaData";
    // find sorted position to insert
    for (var i = 0; i < particulars.nodes.length; i++)
        p = particulars.nodes.item(i);
        if (p.value > particular.value)
          particulars.nodes.insert(particular, p);       
                 break;
    // add to end if greater than all existing items
    if (particular.parent === null)
        particulars.nodes.append(particular);
    // clear source fields
    ItemName.rawValue = null;
    BoundValue.rawValue = null;
    // remerge form data to pick up new item
    xfa.form.remerge();
    And the binding looks like;
    I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
    Regards
    Bruce

  • How do you set default fonts and default text box sizes on bound form fields?

    I am using an existing PDF as a template to build my form in designer.
    I am dragging my objects from the schema window to the form and when I drop it on the form it is way too big - so for every field I do this with I am left to resize and reset the font to every bound object i drop on the page!
    Is there a way to set the default font and the default dimensions of the bound text boxes I am droping on the PDF form page?
    Thanks to anyone who can help!

    iWork '09 DVD set (containing Pages '09 v4.0, Numbers '09 v2.0, and Keynote '09 v5.0) is available from Amazon for USD $20. Apple no longer provides retail store, or OS X App Store downloads. You will need to apply the Apple iWork 9.3 updater afterwards to bring these applications to their n.3 (e.g. Pages '09 v4.3) last versions. You will have an /Applications/iWork '09 folder afterwards.
    I would also launch /Applications/Utilities/Disk Utilities, select your boot drive, and verify/repair permissions — just to be on the safe side for the newly added iWork '09 applicaitons.

  • How to disable the text field in File upload element?

    Hi,
    How can we disable the text field in the "File upload" UI element so that the user won't be able to type the file path there, but he will still be able to browse the file using the Browse button?
    Regards
    Praveen

    Hi Praveen,
    This is not possible with the Web Dynpro File Upload UI element.
    Thanks,
    Samta

  • Disable Backspace when in input text fields

    Im trying to find a way to disable the keyboard backspace
    button from going back a page in the site but allowing it to
    function as a character delete when needed for typing in an input
    text field of a form.
    Strangely this problem only occurs for about a minute after
    the page is opened....after that it then works correctly. You can
    see what I mean by accessing the site's contact page
    www.safetybusiness.co.uk
    I have found two different sets of code to disable the
    Backspace completely, but this then means it doesn't work at all
    when wanting to delete in the text field.
    Method 1:
    <script type="text/javascript">
    if (typeof window.event != 'undefined')
    document.onkeydown = function()
    if (event.srcElement.tagName.toUpperCase() != 'INPUT')
    return (event.keyCode != 8);
    else
    document.onkeypress = function(e)
    if (e.target.nodeName.toUpperCase() != 'INPUT')
    return (e.keyCode != 8);
    </script>
    Method 2:
    <script>
    function checkShortcut()
    if(event.keyCode==8 || event.keyCode==13)
    return false;
    </script>
    <body onkeydown="return checkShortcut()">
    Anyone know how I can overcome this?

    The TextField class has a tab order property. You may want to
    look into this. As for disabling the backspace key, you can grab
    key presses from user input. I'm not 100% on this but you could use
    Flash to test the key being pressed. If backspace is pressed, find
    out the current object with focus (unsure of this part), if it's an
    input box in flash, have flash handle it or if a text box doesn't
    have focus, send it out to javascript to have it handle it.

  • HTMLD_ITEM.DATE_POPUP  - Disabling text field AND Datepicker.

    Hi all,
    Need help with the following.
    I am using APEX 3.2.100.12 (this is in production and won't be upgraded soon).
    I have a report, that creates dynamically date_popups.
    My query goes like this:
    select
    case
    when trunc(ddc_delivery_date) <= trunc(sysdate) then HTMLDB_ITEM.HIDDEN(3,PTD_PA_MONTH_ID) || HTMLDB_ITEM.HIDDEN(4, to_char(SYSDATE, 'DD-MON-RRRR')) || HTMLDB_ITEM.DATE_POPUP(2,ptd_pa_month_id,'','dd-MON-yyyy', 10, 11, 'DISABLED')
    else HTMLDB_ITEM.HIDDEN(3,PTD_PA_MONTH_ID) || HTMLDB_ITEM.HIDDEN(4, to_char(SYSDATE, 'DD-MON-RRRR')) || HTMLDB_ITEM.DATE_POPUP(2,ptd_pa_month_id,'','dd-MON-yyyy', 10, 11, 'onBlur="valiDate(' || rownum || ');"onChange="setFocusItself(' || rownum ||');"')
    end as "Example"
    from Table;
    Let's assume all those names there work as it is.
    The first "when trunc... " should show the date_popup item, but should be shown disabled; which totally happens, but only on the text field; I also need the datepicker to be void or something, and no popup be allowed to show up, something like: "('IP_CLOSED_DATE').parentNode.nextSibling.firstChild.href="javascript:void(0)", which can be used to not allow a popup be displayed.
    The thing is, I've tried to add another parameter (as I've seen it is possible), including words like disabled, void, 0, etc... and none of them work. So I would like to know if anyone has encountered the same issue and has been able to solve it.
    What I need, is not only the text to be disabled but also the popup.
    Thanks a lot!!
    Jorgelina

    Just noticed that you are on apex 3.2 and that JS code relies on JQuery(builtin to Apex 4.0)
    So we ll try another approach and this does not use any JS
    From your report query, I can see that you column has to be read only when <u>trunc(ddc_delivery_date) &lt;= trunc(sysdate)</u>. In this case you want those row's column to be a readonly text-field. So <b>we use a different API in those cases, i.e APEX_ITEM.TEXT instead of APEX_ITEM.DATE_POPUP</b>
    select
        case
        when trunc(ddc_delivery_date) <= trunc(sysdate) then
            HTMLDB_ITEM.HIDDEN(3,PTD_PA_MONTH_ID) || HTMLDB_ITEM.HIDDEN(4, to_char(SYSDATE, 'DD-MON-RRRR')) || HTMLDB_ITEM.TEXT(2, TO_CHAR(<date column>,'dd-MON-yyyy', 10, 11 ,'read_only="read_only"')
        else
           HTMLDB_ITEM.HIDDEN(3,PTD_PA_MONTH_ID) || HTMLDB_ITEM.HIDDEN(4, to_char(SYSDATE, 'DD-MON-RRRR')) || HTMLDB_ITEM.DATE_POPUP(2,ptd_pa_month_id,'','dd-MON-yyyy', 10, 11, 'onBlur="valiDate(' || rownum || ');"onChange="setFocusItself(' || rownum ||');"')
        end as "Example"
    from <table>;
    Note: Change <date column> to the name of the date column whose value has to be shown
    For readonly date row columns, you would see a text field alone, without a date picker

  • Disable a text field

    Hi,
    A non-database text field in a block with 10 rows displayed. I want to programatically enable/disable an instance of this field belonging to the current record. I tried to use set_item_instance_property but there is no enable/disable property in this built-in. Any other way ?
    Regards,
    Suresh

    Suresh,
    As Baig said, you have to set the INSERT_ALLOWED, UPDATE_ALLOWED, NAVIGABLE properties TO PROPERTY_FALSE will work for you. Its almost like disabling the item.
    SET_ITEM_INSTANCE_PROPERTY('<block_name>.<item_name>', CURRENT_RECORD, NAVIGABLE, PROPERTY_FALSE);
    SET_ITEM_INSTANCE_PROPERTY('<block_name>.<item_name>', CURRENT_RECORD, INSERT_ALLOWED, PROPERTY_FALSE);
    SET_ITEM_INSTANCE_PROPERTY('<block_name>.<item_name>', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • How to set Disabled Text field's Background color

    We have an Applet application which we are running with Java Plug-in 1.5.0_11. We have Grey back ground for all the pages. When the text fields are in editable mode the text color is in black. When they are in non editable mode the text color changes to opaque green (with grey background page color) which is hard to read.
    The same application with Java Plug-in 1.4.2_13 did not had this color problem. When text fields were disabled they appeared as dark grey which was easy to read.
    We are using
    import javax.swing.JTextField;
    Is it a bug in newer Java Plug-in? Is there a work around for this?
    Thanks for any help and suggestions

    Solved this myself by writing a programmatic skin and set it to LinkButton's disabledSkin.

  • Background color of disabled text field?

    In my JClient app, the background color of text fields changes when they are disabled (which is good). But I can't seem to figure out where the color it's background is being set to comes from...not from the text field. Maybe somewhere in the look-and-feel? Anyone have any ideas?

    Found the fix for my problem (again, as usual):
    The problem is with the windowsXP look-and-feel. There is a patch, see winlaf:
    https://winlaf.dev.java.net/release_0.3.html

  • How to grap the disable text field values

    Dear All,
    i have a lov,
    in this lov,i create 3 mappings for display those return values in text iput fieldss
    i want to grab those text fields valuess
    and assign those those values to another vo(table)
    those grapping fields are not changed thats y i kept in disable mode
    that time whenever any action is occure then disable field values are gone
    that time i pass only null to vo.
    but i want to grap the value when i kept those fields are in disalbe alsooo
    how can i grap those valuess.

    you have to create item of type form value & create lOV mapping so that the value will not get lost
    Thanks
    --Anil                                                                                                                                                                                                                                           

  • Floating Text Objects Bound to Fields

    Hello!
    I have several floating text objects bound to corresponding fields (text and numeric) and they work fine... expect when I hide the fields and then the bound text in the floating text objects also disappears.
    Did I miss a step?
    Thank you!
    Nicolle

    I'm attempting to do something similar with floating fields in a form letter.  I have set up my form naming the text and floating fields the same, and set the binding to Global.  When I enter text in the "Company_Name" field, which has the java script "xfa.layout.relayout();"in the Exit action, the Company_Name value does not appear where I placed the "Company_Name" floating field in the text block on the same screen.  If I un-hide the floating field, the value is displayed in a text field at the top left corner of the page.
    Here's the link to the form:  Dropbox - Non-Disclosure and Non-Compete Agreement - LC Original.pdf
    Any ideas on how I can get this to work properly?  I have a bunch of similar forms that I have to do.
    These screen shots are for the floating field used in the text box.
    Any help would be appreciated!
    Thanks,
    Dean

  • Problemas, PopUp y Text fields disabled

    Hola,
    Tengo una PopUp, que dentro hay reporte de dos columnas ID, DESCRIPCION,el campo DESCRIPCION, es u link a una url que llama una jascript, que me devuelve los valores del reporte a unos text fields.
    El problema es que uno de los text fields esta disabled por la Conditions y el java no me deja pegar el valor que traigo.
    Alguien tiene alguna idea, o sugerencia Gracias!!!!!
    JP

    Hi Andy,
    Using "disabled" has the effect of turning the colour of the text on any object into shades of gray. There is nothing that you can do about this. There is no css that you can apply to an object that has the disabled attribute set. The nearest you could get would be to create a style class and apply this to the field - but, even with this you can not change the fact that it displays the text in gray (but you can change the font-family and font-size values).
    What you could do is use "readonly" instead which doesn't change the style but just makes the field non-editable.
    Regards
    Andy

  • Problems, PopUp y Text fields disabled

    hello,
    I have a PopUp, that inside is a report of two columns ID,DESCRIPTION. the column DESCRIPTION      
    jascript is or Link to a URL that calls one, that it gives back to the values of the report to text fields to me.
    The problem is that one of text fields this disabled by the Conditions and the Javascript does not let to me stick the value that I bring.
    Somebody has some idea, or suggestion Thanks!
    Juan Pablo

    JaimeRJ wrote:
    Hi, I'm having problems with text fields in full screen.
    I'm aware of the security restriction but Adobe says text fields are disabled only when running in a browser, text fields should be OK when in standalone player or AIR.
    Not the case.
    I'm exporting a .exe file and text fields become immediately disabled when I go to Full Screen. I can't develop the thing in AIR (to use  FULL_SCREEN_INTERACTIVE ) due to company restrictions on installing software. So the standalone exe is the right solution to me, this should be working, but it isn't, please help.
    Hey there,
    The documentation you're referring to says the following:
    "These restrictions are not present for SWF content running in the stand-alone Flash Player or in AIR. AIR supports an interactive full-screen mode that allows keyboard input."
    It mentions nothing about running full screen in a projector executable file which is what you are trying to do. The stand alone flash player is usually an executable file in the flash development environment that is used for testing and debugging flash content for the developer. For distributing your app I would think that there would be good reason to prevent text input in full screen projector files for the security reasons. You should probably look at distributing your intended content some other way or ask for special permission to do AIR. I can't confirm this, but maybe this might be an option: http://www.flashjester.com/?section=tricks_jugglor3
    Hope that helps.

Maybe you are looking for

  • NEED HELP IN USING ALL_TAB_COLUMNS FOR RETRIEVING DATA???

    A table say T1 contains column like Emp_id,Code. and there are several Code like C1,C2,C3. Another table say T2 contains column like Emp_id,C1,C2,C3.Here the value of the code field of the T1 table is now column of the T2 table.And the amount of each

  • Why is the filter gallery greyed out in cs6 student teacher edition

    I have the teacher student edition of cs6 and can not access filter gallery and thus can not find artistic filter  I used to have the full edition cs4 and did have artistic brushes and filter gallery was not an issue .

  • Windows 7 Adobe Air Uninstall problem - Help Needed

    I can't uninstall Adobe Air from my control panel or manually from the cmd prompt [AdobeAIRInstaller.exe -uninstall] I get an error box that says that the Adobe Air Installer has stopped working. Problem signature:   Problem Event Name:    APPCRASH  

  • ASSIGN_LENGTH_0

    I am getting a short dump ASSIGN_LENGTH_0 , program error - Assign with length 0 in program SAPLSNR3 while installing Business content.  I have selected in data flow before and after Can anyone tell what this error relates to.

  • "Delete Keyword" reports nonexistent photos

    iPhoto 7.1.1 ('08). Cmd-K, select Edit Keywords, select Movie, hit Minus to delete. iPhoto says 4 photos will have the keyword removed. That's strange, I don't know of any Movie photos. So I did a Search for keyword Movie: zero. I did a Smart Album o