Enable / Disable a button Based on a value

Hi all,
How can i enable or Disable a Button Based on some input Text value.
Here is the ADF Code fragment:
*<af:switcher id="customActionButtons"*
*facetName="#{actionAvailable.isCustomActionButtons}">*
*<f:facet name="true">*
*<af:panelGroupLayout layout="horizontal" id="pgl10">*
*<af:commandToolbarButton actionListener="#{invokeActionBean.setOperation}"*
*text="#{wf:getResourceValue('APPROVE', 'bindings.customActions')}"*
*disabled="#{!bindings.APPROVE.enabled}"*
*action="#{invokeActionBean.invokeOperation}"*
*partialSubmit="false"*
*visible="#{wf:isCustomActionAvailable('APPROVE', 'bindings.customActions')}"*
*id="ctb2">*
*<f:attribute name="DC_OPERATION_BINDING"*
*value="bindings.APPROVE"/>*
*</af:commandToolbarButton>*
*<af:inputText value="#{bindings.input.inputValue}"*
*label="#{bindings.input.hints.label}"*
*required="#{bindings.input.hints.mandatory}"*
*columns="#{bindings.input.hints.displayWidth}"*
*maximumLength="#{bindings.input.hints.precision}"*
*shortDesc="#{bindings.input.hints.tooltip}"*
*id="it1">*
*<f:validator binding="#{bindings.input.validator}"/>*
*</af:inputText>*
I have highlighted the Button and Input text in Bold.
Any suggestions,
Thanks,
karthik

you need to set the autosubmit property for the text field to true. and set the partial trigger for the the button to that input text id.
and set the rendered property for the button based on the input text value.
same idea is exist in this link:
http://groundside.com/blog/GrantRonald.php?title=conditional_rendering_of_jsf_fields_depe&more=1&c=1&tb=1&pb=1
Edited by: M.Jabr on Feb 7, 2011 1:26 AM

Similar Messages

  • Disabling a button based on attribute value

    Hi,
    I have written a function in ViewObjectImpl. I need to call it on a specific condition,that is, if a particular value for an attribute doesn't exist in the table. How can I achieve this?
    Thanks & Regards

    Hi,
    There are couple ways to achieve this.
    1. Enable the button only when there is a specific value exist in table.
    You can write a method in your impl, that check if there are any matching rows in table and return true or false. Bind the disabled property to an attribute in your backing bean, execute the impl method in backing bean and let the property (which you bound to the disabled property of the button) hold the return value (true or false). Call this method appropriately based on your need.
    2. Execute the method always and check the matching row in button.
    In the impl method itself, you can check the table if the matching rows exist or not. If exists, then continue the execution of the method, else do nothing.
    -Arun

  • Enabling/Disabling a button in Web appl. based on exception in a Query

    Hi all,
    I am wondering whether we can grey out a button in the web applic. designer based on whether a report has an exception showing.
    So now we can enable or disable a button, so at runtime, when the web app runs, and a condition is visible in the analysis item table, then the button (save for example) should be disabled, otherwise if there are no exceptions then it should be enabled.
    I am thinking Javascript, but not sure how to read the exceptions in a web apps query?
    Thanks for any help forwarded.
    Regards
    SMS

    Hi Sumit,
    just add one more attribute of type wdy_boolean, and bind this attribute to readonly property of button by coding.
    then as per your cell value set the attribute value, below is the some sample code.
    METHOD wddoinit .
      DATA: lv_node TYPE REF TO if_wd_context_node,
            lt_mara TYPE ig_componentcontroller=>elements_mara,
            wa_mara TYPE ig_componentcontroller=>element_mara.
      SELECT matnr
             ersda
             ernam
             mtart
             matkl
             meins FROM mara INTO CORRESPONDING FIELDS OF TABLE lt_mara
                                     WHERE meins = 'GM' OR meins = 'CCM'.
      SORT lt_mara BY meins.
      lv_node = wd_context->get_child_node( name = wd_this->wdctx_mara ).
      LOOP AT lt_mara INTO wa_mara.
        IF wa_mara-meins = 'GM'.
          wa_mara-readonly = 'X'.
        ELSE.
          wa_mara-readonly = ' '.
        ENDIF.
        MODIFY lt_mara FROM wa_mara TRANSPORTING readonly.
        lv_node->bind_structure(  SET_INITIAL_ELEMENTS = ABAP_FALSE
                                  new_item = wa_mara ).
      ENDLOOP.
      lv_node->bind_table( new_items = lt_mara ).
    ENDMETHOD.
    Regards
    Srinivas

  • RESOLVED - iExpense: Disable Submit Button based on checkbox not working

    Hi,
    We have a requirement for a checkbox in iExpense Review form(FinalReviewPG) where there should be a checkbox stating the terms and policies are met etc. Unless the user checks the checkbox the SUBMIT button shouldnt be enabled. I am creating the custom checkbox using personalisation in the page with initial/unchecked value as N and checked value as Y. This is created at SITE level.
    Now I have also created a custom controller extension xxButtonCO to extend the standard ButtonsCO controller which should do the disable/enable of the button OIESubmit. I ported this controller to the custom top and have extended the controller to both OIE Expenses Entry Flow function and Internet Expenses responsibility. But the checkbox though visible is not affecting the SUBMIT button. Also funnily, I save the controller class as xx.oracle.apps.ap.oie.webui.xxlcButtonCO and click apply only to see this concatenated to apps.ap.oie.webui.xxlcButtonCO / Function.
    Is that causing an issue? Also, sometimes I just run into an arbitrary NULL pointer exception and other times it says oracle.apps.fnd.framework.OAException: Could not create Java class. I have verified the class file not java file is in correct directory and has right permissions.
    What could possibly be wrong here?
    Edited by: 865082 on Jun 15, 2011 5:33 AM
    Edited by: 865082 on 20/06/2011 22:21

    Hi Kali,
    Many thanks for your response. I have quit trying to run this page directly from the instance and am now trying to do this firsly from the JDeveloper. The same issue is occuring from that end as well. My checkbox value is not getting recognised in the code. The checkbox is added to the Business Expenses tab and the intial/unchecked value is N while the checked value is Y. I am trying to control the submit button in the buttonbar based on the checkbox value using the following command
    OAMessageCheckBoxBean cbbean = (OAMessageCheckBoxBean)webBean.findChildRecursive("XXReviewCheck");
    where XXReviewCheck is the checkbox ID. However the print statements show that the cbbean is null. It is definitely calling the controller and trying to figure out the value. The value is just not coming to this section. Any ideas?

  • Enable/disable operation buttons according to the selected row in table?

    Hi,
    I used JDev 11.1.1.2.0
    On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
    I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
    The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
    Table code like:
    <af:table value="#{bindings.VO1.collectionModel}" var="row"
    rows="#{bindings.VO1.rangeSize}"
    emptyText="#{bindingsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.VO1.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.VOCriteriaQuery.queryDescriptor}"
    queryListener="#{bindings.VOCriteriaQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.VO1.collectionModel.selectedRow}"
    selectionListener="#{bindings.VO1.collectionModel.makeCurrent}"
    rowSelection="single" id="resId1">
    Operation buttons code like:
    <af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
    Any suggestion will be great help.
    Thanks,
    zeroxin

    Hi,
    create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
    #{bindings.statusField.inputValue=='value'}
    Frank

  • Use rich:fileUpload/ to enable/disable my buttons with checking file names

    Hello!
    I need to upload some files with using <rich:fileUpload>,and i did it but i need to check file names for some reasons and enable or disable upload button but my problem is that when i open my modal panel and click add button of <rich:fileUpload> and then add upload button of <rich:fileUpload>(not my upload button but upload button wich <rich:fileupload> has) i check file name but the button is not enable/disable until i close my modal panel and open it agin,so i need to know how to modify my code to make it work?
    <rich:modalPanel  id="uploadFile" autosized="true" resizeable="false">
                    <f:facet name="header">
                     <h:panelGroup>
                         <h:outputText value="uploadFiles"></h:outputText>
                     </h:panelGroup>
                 </f:facet>
                 <h:form>
                      <rich:fileUpload  maxFilesQuantity="#{uploadBean.maxUploadFiles}" allowFlash="true" fileUploadListener="#{uploadBean.uploadListener}" immediateUpload="false"/>
                             <table>
                                <tr>
                                     <td><h:commandButton disabled="#{!uploadBean.xlsNameValid}" rendered="#{!uploadBean.admin}"  action="#{uploadBean.upload}" value="upload" /></td>
                                     <td><h:commandButton action="#{uploadBean.clearFiles}" value="cancel" id="cancel"/></td>
                                </tr>           
                           </table>
                 </h:form>
                 <rich:componentControl for="uploadFile" attachTo="cancel" operation="hide" event="onclick"/>
              </rich:modalPanel>

    No the problem is that file is being checked on server side, but if file is invalid the button Upload(my button ,not standart rich:fileUpload) must be disbaled,and shown,but i have to close this modal panel and open it again to see my button enabled/disabled

  • Screen Personas 2.0 Enable/Disable script button in Javascript

    Hi,
    Has anyone tried enabling or disabling script buttons on a flavor using Javascript. I have two script buttons,
    The first one (Button1) searches for a contract based on the contract id provided by the user in a text box. (So, the script triggers the transaction me33k, fetches and displays the relevant fields in the flavor)
    Now, based on whether the contract is present in the system the user needs to click another script button (Button2) which will allow him to create an order. Currently the button is disabled (ScriptButton.IsEnabled = false in the Properties menu).
    In the Button1 script towards the end, I need to enable Button2 is a contract is found. So in the Button1 script, at the final step I try to calculate in JS and write the following JS code,
    var args.btn2id = document.getElementById("Personas/blahblahblah");
    args.btn2id.disabled = false;
    But this is never works. And I have noticed that the control id does not return the control object in Javascript (so, args.btn2id is always null) and I tried removing the '/' and various other options.
    Has anyone ever tried to enable/disable buttons in Personas? Is it even possible?
    Abhijeet

    You don't have access to the Personas control properties from JavaScript to dynamically change them.
    About the only thing that comes to mind is Tobias' method to hide the script button if you want to disable it.

  • Enable/disable lov button in a multi-row bloc

    Hi all,
    I have a form in which there is a multi-row block with some lov buttons related to some items,
    in query mode, user should not be able to modify item, item property update_allowed is set to false, that worked, but user is able to modify item when he clicks on the lov button...so i want to disable the button for query records and for record in (insert or new), button should be enable,
    i tried some tips but don't work, do you have any idea
    Thanks for your help.

    Hi,
    Can you suggest some methods to enable/disable LOVs in my search query? I have a customized VC which performs search and I need to enable/disable the LOVs depending on requirement.
    Abhishek

  • Enable/Disable a button

    I was wondering how could i disable a button until another
    action has been accomplished before enabling a button. Is there
    anyone that could help me on this?

    This might help - it's a script I picked up somewhere a few
    years ago that disables a button once it's been pushed, then if the
    page has not been submitted after a few seconds, it will flash an
    alert to the user telling them to hold their horses. It's helped
    cut down on people resubmitting things.
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function disableForm(theform) {
    if (document.all || document.getElementById) {
    for (i = 0; i < theform.length; i++) {
    var tempobj = theform.elements
    if (tempobj.type.toLowerCase() == "submit" ||
    tempobj.type.toLowerCase() == "reset")
    tempobj.disabled = true;
    setTimeout('alert("Your form is being submitted. The process
    will finish in a few seconds.")', 3000);
    return true;
    else {
    alert("Your form is being submitted. The process will finish
    in a few seconds.");
    return false;
    // End -->
    </script>

  • Enable/Disable a link based on a column value

    Hi Team,
    I am Using Jdev 11.1.1.5.0.
    I have a link button named 'register'on first page by clicking on to which will navigate to next page where i will get the option of selecting for the courses through checkboxes.
    When all the checkboxes are checked by clicking on the submit button i am able to update the checkboxes value in the backend and able to navigate to the first page.
    I can count that all the checkboxes are checked.
    My requirement is if all the checkboxes are checked i wanted to disable the register button other wise keep it as enable.
    The data on the first page and second page are joined using a view link.
    the data on the first page contains employee records and the data on the second page contains record for the courses selected for the corresponding employee.
    Please let me know what is the correct approach for it.
    Kindly guide me in it.
    Thanks,
    Ajay

    Which scope is the bean defined in?
    You can put the bean in pageFlowScope. This way it can be accessed from both pages. Now you implement a method in the bean which returns the count or better a method which make the decision if all check boxes are checked and returns true if yes and false otherwise.
    The signature of the method looks like
        public boolean isAllChecked()
            // calculate if all marks are checked
            return true;
        }and in your page you access the method on the disabled property like
                  <af:commandButton text="commandButton 1" id="cb1"
                                    disabled="#{pageFlowScope.YUOT_BEAN.allChecked}"/>Timo

  • How to enable/disable a button in Photoshop panel?

    Anyone know how you'd create the proper code in a Photoshop extension panel so that certain buttons in the panel could be enabled or disabled dynamically as needed? 

    Hi Sonunew2flex,
    Write one public function in main application file as below...
    // In main application file
    public function changeButtonDisableStatus(bool:Boolean):void
         yourNuutonId.enabled = bool;
    //In your hear renderer do this
    if(cb.selected=true)
       Application.application.changeButtonDisableStatus(true);
    else
       Application.application.changeButtonDisableStatus(false);
    Thanks,
    Bhasker

  • ENABLING/DISABLING of buttons

    Hi,
    I have two buttons in my application. One is submit and other is redirect. I wanted the second button to be enabled only on click of the first one. Can any one help me on this please?
    Thanks in advance
    Akhil

    Take a look at this thread Disable button using javascript
    It has a link to some examples which should help you.
    Chris

  • How do i show a button based on the value of another button (value is greater then 0)

    I'm am building a form in indesign, and just want to add a visual icon next to buttons when they are filled out... check mark next to a drop down list... so the list have values and i want the check mark (button) to show only when the value of the drop list is greater then 0... can this be done?... easily?....
    thank you!

    Hey Gilad D,
    its been a while since i have been back to this project…..
    now i have time to dedicate to this to get it done….
    if you don't mind i really could use a little help..
    i want to start again and give you the full scope of what i am trying to do, i don't have any real hard files yet...
    its pretty simple (in theory)..
    So i don't know what you do for work, but i work in an environment that has some pretty lazy sales people,
    so i want to create a pdf that steps them through a bunch of questions that they have to answer...
    my thought was, lets break this out into sections…
    so section one has three questions, if they answer all three, then they get a checkmark and section 2 appears
    which would have a few questions in it… etc….
    there would be some easy cross referencing and excel type calculations,… and a few, if you answer yes then another field gets auto filled..etc….
    can acrobat handle this?… or am i wasting time thinking it can?...
    i primarily work on mac's but we do have a PC with live cycle...
    thoughts?….
    thank you,
    ely

  • Custom Install of Acrobat, how to enable / disable Office plugin based on User group membership

    Hi,
    Just configuring Adobe Acrobat X (10.1.5) on Citrix Xenapp 6.5 (Win 2k8 R2)
    I've set up a cusom install and have already removed the context menus and a few other bits and bobs.
    I wondered if it was possible to essentially add the Office plugins in but only for certain users.
    I've removed the plugins successfully by turning off the 5 / 6 features (IE, office , outlook etc)
    Now I just wondered what files / registry entries I could create on login (using Group policy preferences etc) which will add the plugins back in.
    Thanks
    Chris

    okay no replies yet but I've just removed the office / IE features for now, adding the context menu items in for specific users is working good enough at the moment. if anyone does know how to do this just reply to this at any point i'll pick the mail up.
    thanks

  • How to enable /disable a command Button based on a table's selectOne choice

    Hi everyone.
    I am using JDeveloper 10.1.3.3 and wish to enable / disable a commandButton based on the user's selection of the selectOne radio button.
    The idea is that a row of a table may have an associated document so I want to enable or disable the button that downloads it based n the current row selected.
    I have followed the advice on problem with table I defined my selectOne component as follows :
    <af:tableSelectOne text="#{res['tables.selectionFacet.title']}"
        autoSubmit="true"
        attributeChangeListener="#{backing_browseCVs.onSelectionChange}">The function inside the backing bean looks like this
        public void onSelectionChange(AttributeChangeEvent attributeChangeEvent)
            // access the faces context
            FacesContext fc = FacesContext.getCurrentInstance();
            // get value of the expression #{row.hasCVDocument} that indicates
            // if a document has been added
            ValueBinding vb =
                fc.getApplication().createValueBinding("#{row.hasCVDocument}");
            Boolean hasDoc = (Boolean)vb.getValue(fc);
            // enable the doownload button accordingly
            downloadCVDocBtn.setDisabled(!hasDoc);
        }My problem is that the method never fires. I have placed a breakpoint at the first line but it is never reached.
    Any advice will be most welcome.
    Thanassis

    Hi,
    You might need to add 'dataProvider' part in the expression language in your selectionListener:
    #{bindings.CVList.currentRow.[b]dataProvider.hasCVDocument}
    #{bindings.CVList.currentRow} returns an instance of ViewRowImpl which does not have 'getHasCVDocument()' method, but does have:
    Object getCurrentRow()
    method, which returns objects from your CVList list, which do have getHasCVDocument() method...
    Expression language is resolved through reflection, so when you write:
    #{processScope.someClass.someReferencedClass.someAttribute} it is something like:
    Get someClass from processScope map, then:
    someClass.getSomeReferencedClass().getSomeAttribute()
    It's a bit more complex but you get the idea.
    Vladimir

Maybe you are looking for

  • G5 will not boot up.  Is this a hard drive crash?

    When I turn on my computer I hear the startup chime but it never gets past a gray screen with gray apple in the center with a spinning ball. After about five minutes, one of the fans also begins to go berserk and is very loud. I read that about a gra

  • Accessing WebDynpro ABAP application from external network

    Hi All, I have developed one application in webdynpro ABAP. Now my requirement in to access this application through internet. I dont want to use portal to run application. Is it possible to access through internet ?

  • No reply got while sending a message

    Environment: SCO Unixware 7.1.1, Tuxedo 6.5, Windows 98(client) While the client sends a message(photo) which size is near to or over 16K Bytes, to the server, the client gets no reply. Seems the server can not get the request. Does anybody know the

  • How to call other execs from java application

    What is the best way to make a call to execute an external executable written in another language (i.e. c++ or ada95) from within a java application?

  • Has anybody seen this issue?

    Hey guys, I've searched along the forum and seen many helpful hints and tips so thanks to all the guys whose ideas I have used and not thanked them for. Anyway down to business; My internet, for the most part, is very good. It's 802.11n, I'm using a