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.

Similar Messages

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

  • 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

  • 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

  • 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

  • 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

  • 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 Disable a Button Using JavaScript

    Hi,
    I want to disable a button based on a condition. I am using a template based button (button Alternate 3). I am using Theme 3. I have created buttons of type item but when I view the source there is no button name populated in the html. My javascript is not disabling the button.
    Please advice.
    Thanks
    sukarna

    Hi,
    You can't disable an A tag (FireFox, for example, will still let you click the "link").
    What you could do would be to create a second button that doesn't work and only show one of these at a time.
    I have done that here: [http://apex.oracle.com/pls/otn/f?p=35917:30]
    The Button has been based on a custom Button Template. The definition for this is:
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10C"&gt;&lt;a href="#LINK#"&gt;#LABEL#&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#_DISABLED" style="display:none"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/td&gt;
    &lt;td class="t10C" style="padding:1px 4px;"&gt;#LABEL#&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;This actually creates two buttons - the first one, which actually has the link, is visible to start with. The second one, which has no link at all, starts off as invisible.
    Both buttons use the #BUTTON_ATTRIBUTES# setting to get the button name into the ID - though the second button adds "_DISABLED" to this so that it has a unique, but known, ID
    Then it is just a case of calling a function to show one button and hide the other or vice versa:
    &lt;script type="text/javascript"&gt;
    function disableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "none";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "block";
    function enableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "block";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "none";
    &lt;/script&gt;Another possibility is to add the #BUTTON_ATTRIBUTES# to the TABLE tag instead of the A tag in a new button template (based on a copy of the normal Button template). Then, the ID value would be applied to entire "button". You can then make this invisible using:
    $x('BUTTON_ID').style.visibility = 'hidden';The button will be removed from the page as far as the user is concerned, so they can not click the link.
    Andy

  • 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

  • Screen Personas: How to make a round button in Personas?

    Hi Personas Geeks,
    Personas offers limited kinds of controls. Would it be possible to add more "flexible shape" controls, eg, a round button?
    Furthermore, if a special shape control or special effect is needed, how to imlement it? In JS, we can use CSS to manipulate the shape and effects of controls. Is there similar stuff in Personas? 
    Many thanks in advance!
    Dong Zhu

    Buttons have some properties you can change. In particular you can set a corner radius that, when the button is the right size, will produce a round or oval shape. It isn't CSS for sure. If this isn't good enough for you, you can also use an image for the button and control the visual shape completely that way.
    Steve.

  • 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

  • Jsf and javascript to disable a button

    Hi
    is there a way to get the following code to disable the button called next
    when the button "btn" is clicked i call the javascript function myFunc but it does not disable the button called "Next"
    <html>
         <head>
              <title>Personal Info</title>
         </head>
         <body>
         <script type="text/javascript">
         function myFunc()
              document.personalForm.Next.disabled=true;    
         </script>
              <f:view>
                   <h:form id="personalForm">
                   <h:commandButton id="Next" value="Next" action="doSomething" />
                   <h:commandButton id="btn" value="button" immediate="true" onclick="myFunc()"  />
                   </h:form>
              </f:view>
         </body>
    </html>

    You should write Javascript according to the HTML source, not to the JSF code.
    View the generated HTML source and base your JS on that.

  • Disable button using javascript

    Hi,
    I'm sorry if this is a relatively simple problem, but I have tried several things and have searched the forum, but still no luck!
    I am trying to get a button in a form to be disabled or hidden on loading the page and only to become enabled or shown once an 'onclick' event occurs. I already have a javascript function running successfully on the 'onclick' event, so there is no problem with that.
    Preferably I would like the button to be template driven, but I realise that disabling/hiding it may only be possible with an HTML button.
    I have tried the following JavaScript, but it appears to do nothing:
    document.getElementById('P6_OK').disabled=true;
    $x_HideItemRow('P6_OK');
    If the JavaScript is ok it is probably the way I am implementing it into the HTML.
    Thanks
    Lucy

    Hi,
    I'm still having troubles with this (see above). If anyone has successfully managed to disable a button using JavaScript I would be interested in how they did it.
    To clarify, I have tried the following two pieces of script, among others:
    (1) document.getElementById('P6_OK').disabled=true;
    (2) $x_HideItemRow('P6_OK');
    I have read quite a few forum links and followed what others have done, but in vain.
    Thanks for your help
    Lucy

Maybe you are looking for

  • Prepaid voucher credit not being taken &instead credit card being charged

    Ive credited my sons iPad using a prepaid gift card but when he tries to buy a game it keeps taking payment from the credit card I have set up in my name. How do I disconnect? Ive tried logging out of my email but then the value of  £15 from the gift

  • Explain plan for Procedures

    Hi, I know we can generate explain plan for queries using "Explain plan" statement or "Autotrace option". I would like to know how can we generate explain plan for oracle procedures. Thanks in Advance..

  • Can't Start Portal After Install

    After downloading and installing the of evaluation Portal 4.0 SP1, I get the following message upon startup when I enter the system password that I entered during installation: Starting WebLogic Server .... The WebLogic Server did not start up proper

  • Template definition for multiple topics.

    Is there a way to define a template to be used for a large number of topics? I have a project with more than 1000 topics and I'd like to use the same template in all or most of them. I'd rather not have to do it on a topic by topic basis.

  • Js-confirm box with request and passing value: incorrect url

    Hi folks! Scenario: User clicks on link-column field in tablular form, Confirm box pops up with a confirmation message, with "OK" generates a request and should pass a value from the form into an item for further processing. The URL in the column lin