Cannot completely disable a dimmed command button

Hi! Everyone,
I thought this topic was solved before, but it comes back to me again.
Please take a look at the code in the attached project.
If the call of "Delay(5)" is placed after "ProcessSystemEvents()" call in the A_Callback() function, B-LED always light up no matter what!? 
Dimming or making button B invisible doesn't disable the command button at all. 
Only when I place the "Delay(5)" call in front of the "ProcessSystemEvents()", the B button will be disabled.
Just by dimming button B, without "ProcessDrawEvents()" and "ProcessSystemEvents()", won't guarantee the button is disabled.
I'm puzzled.  What is the correct way of completely disable a command button?
Does this problem only happen in CVI 6.0?
Solved!
Go to Solution.
Attachments:
DimButtons.zip ‏5 KB

Whether or not you need to call ProcessSystemEvents to ignore clicks on a button depends on what you are doing at the time and when you will undim the control.  The original question came up when the button was being dimmed and undimmed in a callback.
CVI defers processing of events while you are in a callback.  If you're not currently in a callback, a click event will be processed when it occurs.  If the control is dimmed when that click occurs, (again, outside of a callback), the event will be processed and ignored and you don't need ProcessSystemEvents.
Or if you dim the control from within a callback, then click on the control, then exit the callback without undimming the control, the event will be processed with the control dimmed and will therefore be ignored (without needing ProcessSystemEvents).
So the big question is when will you undim the control?  If you undim it at the end of a long callback, then you need to call ProcessSystemEvents.
But if, for example, you open a panel with a control dimmed, and then undim it after some other event, you don't need ProcessSystemEvents to ignore the click.
Let's say you have a panel with a control for the user to select a filename, and a button to print the selected file.  You don't want Print to be active until the file is selected, so it's dimmed initially by default.  In a callback for the filename control, after the user selects a file, you can then undim the Print button without needing to call ProcessSystemEvents.  Any click on the previously dimmed Print button will have already been ignored.

Similar Messages

  • Cannot complete the reduce noise command in cs2.

    "Cannot complete the reduce noise command in cs2 due to program error." Have uninstalled and reinstalled photoshop but same message appears when I click filter>noise>reduce noise. Same thing happens in filter>sharpen>smart sharpen. These 2 filters used to be working. Can somebody help me please.

    try this: http://forums.adobe.com/thread/375776?tstart=0

  • JDev 10 - disable command button depending on which row is selected

    I am using JDeveloper 10, and I have a table which has some data columns and a selection facet with View and Edit command buttons.
    I would like all rows to be viewable. When you click the view event it goes to another .jsp with the view action.
    It does the same thing with the edit action, however I would like to only allow rows which have an EffectiveDate column in the future to be editable.
    Is there some way to disable the edit button when those rows are selected, or to throw a validation error when the edit button is clicked for that row?
    Thanks!
    Jeff
              <af:table value="#{bindings.RateList.collectionModel}" var="row"
                          rows="#{bindings.RateList.rangeSize}"
                          first="#{bindings.RateList.rangeStart}"
                          emptyText="#{bindings.RateList.viewable ? 'No rows yet.' : 'Access Denied.'}"
                          selectionListener="#{bindings.RateList.collectionModel.makeCurrent}"
                          selectionState="#{bindings.RateList.collectionModel.selectedRow}">
                  <af:column sortProperty="RateType" sortable="false"
                             headerText="#{bindings.RateList.labels.RateType}">
                    <af:outputText value="#{row.RateDescription}"/>
                  </af:column>
                  <af:column sortProperty="EffectiveDate" sortable="false"
                             headerText="#{bindings.RateList.labels.EffectiveDate}">
                    <af:outputText value="#{row.EffectiveDate}">
                      <f:convertDateTime pattern="dd-MMM-yyyy"/>
                    </af:outputText>
                  </af:column>
                  <f:facet name="selection">
                    <af:tableSelectOne text="Select and">
                      <af:commandButton text="View" action="view">
                        <af:setActionListener from="#{row.rowKeyStr}"
                                              to="#{requestScope.requestRowKey}"/>
                      </af:commandButton>
                      <af:commandButton text="Edit"
                                        action="edit"/>
                    </af:tableSelectOne>
                  </f:facet>
                </af:table>

    So, I first tried using Chan advice, I added a new editable property from the database and then added Edit buttons to each row in the table with disabled property set to the editable property.
    This correctly displayed buttons which were editable in the correct rows.
    However, I was no longer using the select functionality which passed the rowId of the selected row to the edit page.
    I wasn't able to quickly solve this problem so I tried John's solution.
    I feel really dumb, but after about 20 rereadings it was still completely Greek to me, I have no idea what he was recommending.
    So I added onclick="return editTest()" to the Edit button.
    The I added ID to the relevant locations, and the following javascript to the page, and this is working well enough now.
    (Oh, I display the date in a slightly odd dd-MMM-yyyy format, due to slightly odd customer requirements.)
    I've probably misspelled one of the months, haven't yet finished testing.
    A couple of gotchas I found
    - Do not add onclick="editTest()" or else it will continue processing and allow all rows to be edited.
    - Putting date = document.getElementById('mainFormId:tableId:'+i+':EffectiveDateId'); would work for the original search,
    but after filtering results i and found_it are not equivalent, and date was not found in the page.
               function editTest(){
                  var found_it;
                  var date;
                  for (var i=0; i < document.getElementsByName('mainFormId:tableId:selected').length; i++)  {
                     if (document.getElementsByName('mainFormId:tableId:selected').checked) {               
    found_it = document.getElementsByName('mainFormId:tableId:selected')[i].value;
    date = document.getElementById('mainFormId:tableId:'+found_it+':EffectiveDateId');
    var result = date.innerHTML.split("-");
    var day = result[0];
    if (day.charAt(0) == '0'){
    day = day.charAt(1);
    var month;
    var monthTxt = result[1];
    switch (monthTxt) {
    case 'Jan':
    month=0;
    break;
    case 'Feb':
    month=1;
    break;
    case 'Mar':
    month=2;
    break;
    case 'Apr':
    month=3;
    break;
    case 'May':
    month=4;
    break;
    case 'Jun':
    month=5;
    break;
    case 'Jul':
    month=6;
    break;
    case 'Aug':
    month=7;
    break;
    case 'Sep':
    month=8;
    break;
    case 'Oct':
    month=9;
    break;
    case 'Nov':
    month=10;
    break;
    case 'Dec':
    month=11;
    break;
    default:
    month=11;
    break;
    var year = result[2];
    var today = new Date();
    var effDate = new Date();
    effDate.setDate(day);
    effDate.setMonth(month);
    effDate.setYear(year);
    if (effDate < today) {
    alert ('Sorry, you cannot change a rate with an effective date in the past');
    return false;
    } else {
    return true;

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

  • "Cannot complete command because the extension could not be loaded." with CEP5 Sample

    Hi,
    I have trouble with porting my extension to CEP5. I am getting error "Cannot complete command because the extension could not be loaded." when I open the panel.
    Is there any way to get more info about what happened and why? My extension was properly signed zxp and Extension Managed installed it without trouble.
    Also, to debug the problem, I tried to open the CEP HTML Test Extension - https://github.com/Adobe-CEP/Samples/tree/master/CEP_HTML_Test_Extension_5.0
    I have copied it to "~/Library/Application Support/Adobe/CEP/extensions/com.adobe.CEPHTMLTEST", created .debug file in it (https://gist.github.com/m6k/39a49786b7a85a9e312b), created empty .debug file inside Photoshop CC 2014.app (to suppress signature checking). When I open Photoshop CC 2014, I see test panels listed in extension menu, but when I try to open them, I also get the "Cannot complete command because the extension could not be loaded." error.
    Any hints what i am doing wrong and what can I do to debug this problem?
    Jan

    Hallgrimur, thanks, that is exactly the article I needed!
    My problem was that I forgot about the pref file  "~/Library/Preferences/com.adobe.CSXS.5.plist".

  • "Cannot complete command because the extension could not be loaded" ?

    I have installed a photoshop plugin into photoshop cc. However when I go to windows => extension => photoshop plugin, it shows me "Cannot complete command because the extension could not be loaded". What should I do ?
    Thanks.

    I think you posted on the »wrong« Forum. (edited)
    http://forums.adobe.com/community/labs/extensionbuilder3?view=discussions

  • Get message Cannot complete command because the extension could not be loaded.

    When clicking in CS5 Photoshop menu - "Essentials", "New is CS5 "or "CS LIve", I get a message "Cannot complete command because the extension could not be loaded". I get the same message when attempting to acces frm Window>Extensions> then clicking on one of the listed exteneions.  This is been going on for some time for no apparent reason.  Using version 12.0.4 (x32) iMac OS 10.6.8 - Intel Quad Core.

    I unstalled Photoshop.  Then I installed on another drive.  External.  It did the same thing!!!!  No mini-bridge, or any extentions loading.  I don't know what is wrong.
    I read something somewhere about a Panels file in photoshop.  So I'm looking there.

  • Opening pdf file cannot complete command, not enough memory ram?

    while trying to open pdf file size of 117000 kb, photoshop CS6 cannot complete command, not enough ram memory.

    Yes, the pdf file can be viewed using Acrobat and AI.  But when opening in CS6, it show cannot complete the command, not enough enough memory.  I tried in edit menu>preference->performance -> Increase the Ram also cannot be open.

  • Set JSF Command Button Disabled

    Hello,
    I have a JSF command button, I would like to dynamically change button disabled based on certain condition.
    I tried in the actionListener code in my managedbean
    like
    UIComponent component = event.getComponent();
    component.setRendered(false);However it makes button not visible, couldn't find setDisabled.
    How can I do this?
    Regards

    Hi,
    Basically, you can change the button status: enabled/didasled from JavaScript by changing the button css.
    You can also do this from JSF.
    The commandButton element has the disabled attribute and you can change the status depending on your condition.
    -- <h:commanButton disabled=""
    Please find an example: http://www.roseindia.net/jsf/EnableDisableButton.shtml
    If you use AJAX (ex. a4j) there is the same principle. In backing bean you can check your condition and in jsp you'll change to disabled.
    Hope this helps,
    Sergiu

  • When opening Photoshop I receive "Cannot Complete Command because extension cannot be found"

    I have downloaded the Trial for CC and when I open Photoshop I receive "Cannot Complete Command because extension cannot be found". Please advise on how to fix it.

    Moving this discussion to the Photoshop General Discussion forum.

  • Cannot complete the copy command because no pixels were selected

    When I try to copy a selected area I get the message "Cannot complete the copy command because no pixels were selected? Why is this?

    Are you making your selection on a layer that has something in it?
    Also, if you're just starting out with PSE, you must first select something before you can copy it. If you want to copy a whole image, just press ctrl+A/command+A to select it all.

  • How can I control the enable/disable of command buttons in ADF JSF

    I have been having a great deal of trouble trying to work out how to control the command button such that if the rowset is null then the button is disabled. The trick is that the rowset is not defined by the view where the command button is located. The rowset is defined by a view which has a "view" command button which displays the specific row selected, then this view has a command button that will display the detail rowset of the selected master row, but if there are no detail records I want the button to be disabled. How can I do this in ADF JSF? If I use a backing bean to make the determination prior to the page rendering then how does the backing mean method set the parameter necessary to disable the command button? Any advice or tutorial that I can use is most appreciated. My goal with using ADF JSF effort was to demonstrate that a complex app could be generated with minimum coding, I would like to keep to this concept if possible. Thanks,
    Michael

    Hi Michael,
    You can probably set the Enabled property of the command button using an EL that would evaluate and return true or false based on your requirement.
    Check out these links for more information on using the EL.
    http://radio.weblogs.com/0118231/2006/11/10.html
    http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_dcp006.htm
    -Arun

  • HT204093 I am following the instructions to hyperlink URL to an image in an email, but once I paste the URL, the "ok" button is not highlighted so I cannot complete the task. What is the problem and how do I get around it?

    I am following the instructions to hyperlink URL to an image in an email, but once I paste the URL, the "ok" button is not highlighted so I cannot complete the task. What is the problem and how do I get around it?

    I figured out if I took the http:// off the front of the URL, the "ok" button would highlight, but then link did not work. I tried just linking www.google.com to the image and the link did not work either. What gives?!

  • Analyzer API command to disable Navigate and Open button

    Hi,I would like to pass the parameters to Analyzer Java Web Client to disable Navigate and Open button.Is there any posibility in Analyzer API to do this?Thanks,Grofaty

    Hi,My system is:- Essbase 6.5.3- Analyzer 6.1.1

  • This ipad cannot complete  the activation process press home button and start again

    this ipad cannot complete activation process.this error am getting after restoration of ipad 3  any help
    imei 013316009591665

    Hi jjpatos,
    If you are having issues activating your iPad, you may find the troubleshooting steps outlined in the following article helpful (the article is aimed at iPhones, but should apply to activation issues with iPads as well):
    Get help activating your iPhone
    Regards,
    - Brenden

Maybe you are looking for

  • Some artists don't qappear in browser window for a playlist

    I've been struggling to find a way to browse a large library of classical music. The browser window is a great idea but I can't find a way to add a browser window pane for the Composer tag. So I selected all the tracks with composer=beethoven and mad

  • How can I import auto correct form old version

    How can I import all my auto correct list from Pages into the new version 5, they have all been deleted

  • Text message reply to a single person in an incoming group text?

    I am not figuring out how to reply to just one person in a group text message...Can anyone help please?

  • Can You Guy's Help Me?

    Hey Guys. I am relatively new to indesign and have come a bit unstuck. I have recently taken over the design/marketing role in my office and have been handed a mac exactly how the previous person left it. I have been asked to update some letterheads

  • DISABLING INPUT FIELD

    HI Experts,                I hav used select-options date. I need to disable the high date range (S_DATE-HIGH). so that user can only change the lower limit. pLZ HELP. tHANKS. KHAN