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

Similar Messages

  • 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

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

  • How to disable refresh button in webi reports in BOXI3.1SP2-Java SDK

    Hi all,
    We have integrated Java with BO, here end users will give parameters through java screen. After submitting all the parameters webi reports will opens in separate window.
    Here requirement is end users should pass the parameters from java screen and they should able to save the report in to excel/PDF.
    Refresh/edit buttons should disable/hide in the webi report.
    below is the sample url we are using in the java.
    http://" + CMS + ":8080/ OpenDocument/opendoc/openDocument.jsp?"+ "iDocID=" +ReportID + "&sType=wid&sRefresh=N&sWindow=New&lsSEnter List Name: =+List&token=" + token
    we tried with using &buttonrefresh=hide in above URL.
    Note: We are also having hyperlink reports in the Webi.
    Please provide me inputs to disable refresh button.
    Thanks,
    Subash

    Hi,
    why do not set this over the authorization scheme? Just deny your users the right to refresh/edit the report.
    Regards,
    Stratos

  • 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

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

  • 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 UI Elements using Web Dynpr Java

    Hi Experts,
    I have certain UI Elements in the view layout, and i want to disable it based on conditions. I want only certain users to be able to edit the fields and the other set of users should only be able to view the data in the UI Elements and not EDIT. can any one hlep me out please...
    Thanks in advance.

    HI satish,
    well you can do this by binding the readonly or enable property of the input field to a context attribute of boolean type and then checking in the wddoinit method for the user authentication. If the user is authenticated then you can set the attribute to true.
    Authentication can be done by providing all the users with a role (say enable) for which you want the fields to be enabled and you can check for the roles of the logged in user and if that particular role is pesent there you can enable the fields.
    The following is the code that you can write in your Wddoinit method for the work.
    String strUserName = null;
         boolean rolestrflg = true;
       try {
               IWDClientUser clusr = WDClientUser.getCurrentUser();
                IUser sapUser = clusr.getSAPUser();
         if (sapUser != null) {
                             IUserAccount[] acct = sapUser.getUserAccounts();
              if (acct[0] != null) {
                                       strUserName = acct[0].getDisplayName();
                                   Iterator rolesit = sapUser.getRoles(true);
                   IRoleFactory rfact = UMFactory.getRoleFactory();
                   while (rolesit.hasNext()&& rolestrflg) {
                                                 String roleName = (String) rolesit.next();
                                                 IRole role = rfact.getRole(roleName);
                              if(role.getUniqueName().equalsIgnoreCase("Enable")) // suppose the role for enabling the fields is Enable
                                   wdContext.currentContextElement().setContrl(true);
                                   rolestrflg = false;
                              else
                   wdContext.currentContextElement().setContrl(false);
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    i hope this will solve your problem
    regards,
    Sarbjeet

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

  • Enable/Disable buttons in Portal.

    How are buttons in EP 2004s enabled/disabled?  Not in the toolbar but in the iViews.  Such as Account Sales Area, we had a button "Additional Sales Areas" enabled, but now it has become grayed out.
    Is the enabling/disabling of buttons a PCUI issue that needs to be handled through DynPro or SPRO, or an authorizations issue that needs to be handled in the CRM backend system? 
    In this particular scenario the "Additional Sales Areas" button is also disabled in the GUI, but there are others such as a "print" button where it is only disabled in the PCUI.
    Any help with this or documentation on how to enable buttons would be much appreciated.
    Thanks!

    Buttons are coming from the PCUI applications, check out the following weblog
    People-Centric User Interface (PCUI) - Getting Started...
    'The Book' contains all the details. For enabling/disabling the buttons either you can change in the blueprint tables or use the blueprint application builder.
    Check out the CRM forum you will get all the details

  • Control Enable/Disable of Save/Delete/Modify buttons

    Hi Friends,
    Have some one written a program how to enable disable the buttons on a for. Like i have 4 buttons
    1) Add New
    2) Save
    3) Modify
    4) Delete
    Now i want to control the enable/disable of these butons. Like when a blank record. ADD NEW, MODIFY, DLETE button shuld remain disable and ONLY SAVE button remains Enable. Similarly when there a change in record. MODIFY BUTTON is enabled.
    Similarly other functions. Have someone written the code for this control. I am trying but no desire results.
    Pliz Help,
    Imran

    Hello Imran
    You have to write a code like
    If <condition> the
    set_item_property(button,enable,property<true/false>);
    ELSIF <condition2>
    set_item_property(button,enable,property<true/false>);
    ELSIF <condition3>
    set_item_property(button,enable,property<true/false>);
    ELSE
    set_item_property(button,enable,property<true/false>);
    END IF;
    the condition can be checked :SYSTEM.form_status.
    Regards
    Mel

  • Enable / Disable selection screen block

    Hi, could u pls tell me how do I enable/disable selection screen block written below based on radio button selected??
    Block to be enabled / disabled :
    *----APO Version and RFC destination block
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-013.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(20) text-e11.    "APO Planning Version
    SELECTION-SCREEN POSITION 29.
    SELECT-OPTIONS s_apover FOR w_version NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(20) text-e09.    "APO RFC Destination
    SELECTION-SCREEN POSITION 32.
    PARAMETERS  :  p_aporfc LIKE rfcdes-rfcdest.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b4.
    Radiobuttons :
    Material Type
    SELECTION-SCREEN BEGIN OF BLOCK ss04 WITH FRAME TITLE text-072       .
    PARAMETERS :
         Load only FERTs
           p_FERT  RADIOBUTTON GROUP styp DEFAULT  'X' USER-COMMAND rusr ,
         Load ROH/HALBs
           p_HALB  RADIOBUTTON GROUP styp                                .
    SELECTION-SCREEN END   OF BLOCK ss04                                 .
    Thanx in advance

    Hi
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
    pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
    pa_vkorg TYPE vbak-vkorg MODIF ID abc.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
    SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
    s_date FOR gs_lfa1-erdat MODIF ID def,
    s_augru FOR gs_vbak-augru MODIF ID def,
    s_vbeln FOR gs_vbak-vbeln MODIF ID def.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b3.
    IF pa_rep EQ gc_x.
    LOOP AT SCREEN.
    IF screen-group1 = gc_abc.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_def.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF pa_upd EQ gc_x.
    *For Reprocessing
    LOOP AT SCREEN.
    IF screen-group1 = gc_def.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_abc.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    CLEAR pa_upd.
    ENDLOOP.
    ENDIF.
    REPORT zrich_001.
    PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                            user-command chk,
                p_rad2 RADIOBUTTON GROUP grp1.
    SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
                    s_datum2 FOR sy-datum MODIF ID d2.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_rad1 = 'X'
          AND screen-group1 = 'D2'.
          screen-active = '0'.
        ENDIF.
        IF p_rad2 = 'X'
         AND screen-group1 = 'D1'.
          screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Regards
    Anji

Maybe you are looking for

  • When I attempt to sign in, I get 'server error, please email'. Who do I email?

    1. HP Deskjet 3050 J611 2. Windows 7 3. SERVER ERROR         Oops!  Something just went wrong with our server.            Try refreshing the page. If you see this error more than once, email 4. New printer When I try to sign in to register my printer

  • Problem related to variable substitution

    Dear all , I have a query related to variable substitution : The requirement is that filename should be in the following format : <b>%<store_code>%_%<Date>%</b>_master.xml . I have done the configuration for Store_code in the variable substitution fr

  • F-53 - Payment to more than one vendor

    In F-53 how to pay to more than one vendor. That is I am making a payment of 20,000 but paying two vendors 10,000 each.

  • Cached Form Guide returned by Render Form Guide Service

    I am calling the Render Form Guide Web Service and passing in the form url and data. Even after making several edits to the form guide, the older version of form guide gets returned from the webservice call. How can I tell livecycle to make use of th

  • PostItemCreate Trigger

    Hello All, I have subscribed a custom function to the event oracle.apps.ego.item.postItemCreate.Now If i create an Item through Inventory responsibility the event is getting triggered.But if i create an item through Product Information Management Dat