Enabling/Disabling menuitems in a JMenu

Hi,
The application I'm developing has a JMenu, like any other Swing app
out there. The menuitems in that JMenu are enabled/disabled according
to the state of the app. I'd like to know which is the best way to
enable or disable the individual JMenuItems from any point in the
app, do I have to hold a global pointer to every JMenuItem in the
app and call setEnable() ? Or can I send a change event which
is captured by a hypothetical enablelistener registered in
every menu item ?
thanks in advance

Okay, here's a skeleton of working with actions and a Document/Listener pattern.
Here are the core classes:
import java.io.*;
import java.util.*;
import javax.swing.*;
public interface DocModel {
    public class Event extends EventObject {
        public enum Type {DOC_OPENED, DOC_CLOSED};
        public Event(DocModel model, Type type) {
            super(model);
            this.type = type;
        public final Type getType() {
            return type;
        private final Type type;
    public interface Listener extends EventListener {
        public void docOpened(Event event);
        public void docClosed(Event event);
    public void addDocListener(Listener l);
    public void removeDocListener(Listener l);
    public void open(File file) throws IOException;
    public void play();
    public void close();
    public JComponent createView();
}You don't have to nest types, but I like to.
Here is an abstract class the lets EventListenerList do all the work (I copyied and pasted the code from the API.)
import java.io.*;
import javax.swing.event.*;
public abstract class AbstractDocModel implements DocModel {
    private EventListenerList listenerList = new EventListenerList();
    protected void fireDocOpened() {
        Object[] listeners = listenerList.getListenerList();
        Event evt = new Event(this, Event.Type.DOC_OPENED);
        for (int i = listeners.length-2; i>=0; i-=2) {
            if (listeners==Listener.class)
((Listener)listeners[i+1]).docOpened(evt);
protected void fireDocClosed() {
Object[] listeners = listenerList.getListenerList();
Event evt = new Event(this, Event.Type.DOC_CLOSED);
for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==Listener.class)
((Listener)listeners[i+1]).docClosed(evt);
public void addDocListener(Listener l) {
listenerList.add(Listener.class, l);
public void removeDocListener(Listener l) {
listenerList.remove(Listener.class, l);
public void open(File file) throws IOException {
fireDocOpened();
public void close() {
fireDocClosed();
Here is a simple implementation with Actions. I didn't have to make the actions DocListeners as well --
that's overkill, I could have adjusted their enabled state in open/play/close, but I wanted to demonstrate
letting listeners keep themselves in synch.
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.text.*;
public class SimpleDocModel extends AbstractDocModel {
    private Document document = new PlainDocument();
    private class OpenAction extends AbstractAction implements DocModel.Listener {
        public OpenAction() {
            super("open");
        public void actionPerformed(ActionEvent evt) {
            try {//find file
                File file = new File("bogus");
                open(file);
            } catch (IOException e) {
                //report it...
        public void docOpened(Event event) {
            setEnabled(false);
        public void docClosed(Event event) {
            setEnabled(true);
    private OpenAction openAction = new OpenAction();
    private class PlayAction extends AbstractAction implements DocModel.Listener {
        public PlayAction()
        {   super("play");
            setEnabled(false);
        public void actionPerformed(ActionEvent evt) {
            play();
        public void docOpened(Event event) {
            setEnabled(true);
        public void docClosed(Event event) {
            setEnabled(false);
    private PlayAction playAction = new PlayAction();
    private class CloseAction extends AbstractAction implements DocModel.Listener {
        public CloseAction()
        {   super("close");
            setEnabled(false);
        public void actionPerformed(ActionEvent evt) {
            close();
        public void docOpened(Event event) {
            setEnabled(true);
        public void docClosed(Event event) {
            setEnabled(false);
    private CloseAction closeAction = new CloseAction();
    public SimpleDocModel() {
        setMessage("empty doc");
        addDocListener(openAction);
        addDocListener(playAction);
        addDocListener(closeAction);
    public void addToToolBar(JToolBar tb) {
        tb.add(openAction);
        tb.add(closeAction);
        tb.add(playAction);
    public void open(File file) throws IOException {
        setMessage("file opened");
        super.open(file);
    public void close() {
        setMessage("closed");
        super.close();
    public void play() {
        setMessage("playing continuously");
    public JComponent createView() {
        JTextField view = new JTextField();
        view.setDocument(document);
        view.setEditable(false);
        return view;
    private void setMessage(String message) {
        try {
            document.remove(0, document.getLength());
            document.insertString(0, message, null);
        } catch (BadLocationException e) {
            e.printStackTrace();
}Are you still with me? Run this code:
import java.awt.*;
import javax.swing.*;
public class SampleApp {
    JFrame frame = new JFrame("Sample App");
    SimpleDocModel model = new SimpleDocModel();
    public SampleApp () {
        JToolBar tb = new JToolBar();
        model.addToToolBar(tb);
        Container cp = frame.getContentPane();
        cp.add(tb, BorderLayout.NORTH);
        cp.add(model.createView(), BorderLayout.SOUTH);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    public static void main(String[] args) {
        new SampleApp();

Similar Messages

  • Enable/Disable JMenu in JFrame on click of button in JInternalFrame

    Hello there. Could anybody help me out of the situation?
    I am trying to enable/disable JMenu of JFrame on click of a button which is in JInternalFrame.
    I want to set JMenu(this is in JFrame).setEnable(true) in ActionPerformed() of JInternalFrame, but JFrame and JInternalFrame are the different classes and I do not know how I can access JMenu in main frame.
    How should I write something like mainframe.menu.setEnabled(true) from internal frame?
    For JInternalFrame window action, there is JInternalFrameListener, but this is not relevant for my situation because I am trying to control on click of a button.
    Can anybody suggest a solution?

    // Main Frame
    public class MainFrame extends JFrame
         public MainFrame()
              InternalFrame l_int = new InternalFrame(this);
                    //try to initiate internal frame like this
         public void activateMenu()
              menuBar.setEnabled(true);
         public static void main(String args[])
              MainFrame mainframe = new MainFrame();
    // Internal Frame
    public class InternalFrame extends JInternalFrame
         private MainFrame m_mainFrm = null;
         public InternalFrame(MainFrame a_objMainFrame)
              //your own code
              m_mainFrm = a_objMainFrame;
         public void actionPerformed(ActionEvent a_objevent)
    if(m_mainFrm != null)
              m_mainFrm.activateMenu();
    }try this.. hope this will help you
    :)

  • Cmfctoolbarcomboboxbutton, how to enable/disable

    Hi,
    I inserted a CMFCToolBarComboBoxButton object in my toolbar. all work fine except enabling and disabling ComboBox according state of my App.
    I used EnableWindow but the control still actived.
    Any idea?
    Tanks.
    My creation code :
    if (wParam == IDR_MAINFRAME24) {
    m_ComboButton = new CMFCToolBarComboBoxButton(ID_MONTH_FILTER, GetCmdMgr()->GetCmdImage(ID_MONTH, FALSE),
    CBS_DROPDOWNLIST);
    CString strMonths, strMonth;
    int i, curPos = 0;
    if (strMonths.LoadStringW(IDS_MONTHS)) {
    i = 1;
    //m_ComboButton->AddItem(_T(""), 0);
    strMonth = strMonths.Tokenize(_T(";"), curPos);
    while (strMonth != _T("")) {
    m_ComboButton->AddItem(strMonth, i);
    strMonth = strMonths.Tokenize(_T(";"), curPos);
    i++;
    m_wndToolBar.ReplaceButton(ID_MONTH, *m_ComboButton);
    CMFCToolBarComboBoxButton * pMonthCombo = CMFCToolBarComboBoxButton::GetByCmd(ID_MONTH_FILTER, FALSE);
    if (pMonthCombo) {
    pMonthCombo->SetCenterVert(false);
    pMonthCombo->SetText(_T("Advanced filter"));
    pMonthCombo->EnableWindow(FALSE);

    Tank you for your help.
    you are right, but a update cammand ui message is not send by CMFCToolBarComboBoxButton object.
    I make a test on my side and mesajflaviu's suggestion really helpful. Using ON_UPDATE_COMMAND_UI macro, I can disable the CMFCToolBarComboBoxButton in the CMFCToolBar. See my test code snippet:
    BOOL m_enable; //use to detect if enable the combo box
    afx_msg void OnUpdateCombo(CCmdUI *pCmdUI);
    ON_UPDATE_COMMAND_UI(IDR_COM, &CMainFrame::OnUpdateCombo)
    void CMainFrame::OnUpdateCombo(CCmdUI *pCmdUI)
    pCmdUI->Enable(m_enable);
    void CMainFrame::OnEditDisable()
    // TODO: Add your command handler code here
    m_enable = FALSE;// use a menuitem to disable the combo box
    ///////create the CMFCToolBarComboBoxButton//////////
    LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM lp)
    UINT uiToolBarId = (UINT)wp;
    TRACE("CMainFrame::OnToolbarReset : %i\n", uiToolBarId);
    switch (uiToolBarId)
    case IDR_TOOLBAR1:
    m_ComboButton = new CMFCToolBarComboBoxButton(IDR_COM, GetCmdMgr()->GetCmdImage(IDR_COM, FALSE), CBS_DROPDOWNLIST);
    m_ComboButton->EnableWindow(true);
    m_ComboButton->SetCenterVert();
    m_ComboButton->SetDropDownHeight(25);
    m_ComboButton->SetFlatMode();
    m_ComboButton->AddItem(_T("OPTION1"));
    m_ComboButton->AddItem(_T("OPTION2"));
    m_ComboButton->SelectItem(0);
    m_wndToolBar.ReplaceButton(IDR_COM, *m_ComboButton);
    break;
    return 0;
    Check the result screenshot:
    Enable:
    Disable: Color is turning yellow and cannot click
    Best regards,
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Howto enable disable menubar items in actionscript

    Hello,
    My problem is that i want to enable/disable buttons in a
    menubar according to the loaded page.
    So what i did was when the user clicks on the menubar, it
    triggers a function. Inside that function there will become a check
    on which page is at front. According to that page i am gonna set
    menuitems on and off.
    Thats the idea i had, so now my problem.
    I first try to create a simple solution like my code beneath.

    I'd suggest changing things around a bit. See if the
    following works for you. The clickHandler() method has the syntax
    you're looking for.
    TS

  • Using XMLLIST - Enable/Disable Menu Items

    I am using XMLList for creating menu items.
    I want to enable / disable menu items based on the permissions to the user.
    Below is the code snippet:
    <fx:XMLList  id="newData">
                                  <menuitem id="item1" label="{resourceManager.getString('taskmgmt', 'taskmgmt.label.newProject')}" />
                                  <menuitem id="item2" label="{resourceManager.getString('taskmgmt', 'taskmgmt.label.projectFromTemplate')}" enabled="false"/>
                        </fx:XMLList>
    private function ItemClickHandler(event:MenuEvent):void
         if(PermissionManager.isAddPermitted("WTM_PROJECT_PLANNING")){
                                                           ProjectAssignmentModel.projectAssignmentFlag=false;
                                                           if(event.item.@label == resourceManager.getString('taskmgmt', 'taskmgmt.label.newProject')){
                                                                     clearModel();
                                                                     dispatchEvent(new SwitchViewEvent(SwitchViewEvent.SWITCH_VIEW_EVENT,false));
    protected function newMenuButton_clickHandler(event:MouseEvent):void
                                            if(! PermissionManager.isAddPermitted("WTM_PROJECT_PLANNING")){
                                                      newData.item1.enabled = false;
                                            else
                                                      menuList.dataProvider = newData;
                                                      menuList.show(event.stageX + 5 , event.stageY + 5);
                                                      mode = CREATE;
    Based on the permission, I want to dynamically enable / disable the "New Project" button.
    Can someone provide information how to achieve this ?
    Further update on this, it is giving the following error while running of the application:
    "TypeError: Error #1089: assignment to list with more than one item is not supported"

    Resolved by using the correct Data Provider and iterating through the list

  • Enable/disable fields in Workspace form

    Okay here is my scenario. I need to disable some fields on a form depending on which user logs onto workspace to open the same form.
    1. User1 logs onto workspace and opens leave request form, fields at the top of the form are enabled for the user to fill out, bottom fields which are for leave request administrator to fill out are disabled but visible.
    2. User1 fills out top portion of leave request form and completes form. Workflow sends form to leave request administrators "To do" list in Workspace.
    3. Administrator opens up submitted form in Workspace and sees User1's filled out data on the form and the bottom fields are now enabled for administrator to approve or dissaprove. Bottom fields only include two check boxes, two text fields and one date field.
    Now how is this done? I am sure their maybe scripting involved? if so what is it and at what events in the form? Is this whole process done in the form or through Admin UI or Workebench as well? Please help!!!!!!!!!

    Hi Rahat,
    You can use the same form and enable/disable some fields according to the user's role with only little scripting. Review the steps the below:
    1-First place a hidden field ("user_role") in your form
    2-Insert a script object into your form onder "Variables" in object hierarchy and write a script for enabling/disabling the fields (regarding the value of "user_role")
    3-On the initialize and change events of the "user_role" call your script object
    4-On your process design, put a SetValue service before User tasks. In the asssignment you should set the desired user_role to the form, so that the script is triggered in your form and the fields are enabled/desiabled
    Fro further needs on your form or process design you can contact us from: http://www.kgc.com.tr/company_Contact.html
    Oguz
    http://www.kgc.com.tr

  • Enable/disable/defaulting the radio button in tabular Form

    Hi friends,
    I have one radio button column in my tabular form with 3 values for it.
    <li>FC
    <li>BC
    <li>EC
    I need to enable/disable the radio buttons according to the position of the user.
    If the position of the user is CEO means,
    then FC radio button has to be checked defaultly and also for him he needs to have BC and EC radio buttons to be enabled.
    If the position of the user is between(1-4) grades means,
    then FC radio button has to be disabled, but BC radio button has to be checked defaultly and also for him he needs to have EC radio buttons to be enabled.
    If the position of the user is between(4-6) grades means,
    then FC, BC radio button has to be disabled, but EC radio button has to be checked defaultly.
    How i can achieve this radio button enabling/disabling and defaulting it dynamically according to the user.
    Where i need to specify this kind of restriction inorder to work for me in my application.
    Brgds,
    Mini

    Hi Bob,
    thanks for your reply first, and your suggestion too.
    I tried in the below manner on the lov definition of my radio button and it hide/shown according to the user who logs into the application.
    SELECT 'FC' d, 'FC' r FROM DUAL WHERE lower(:APP_USER) = (select lower(user_name) from apps.xxhy_ams_details_v where upper(job_name) = 'CEO')
    UNION ALL
    SELECT 'BC' d, 'BC' r FROM DUAL WHERE lower(:APP_USER) IN (select lower(user_name) from apps.xxhy_ams_details_v where grade_name
    BETWEEN 1 and 4 OR lower(:APP_USER) = (select lower(user_name) from apps.xxhy_ams_details_v where upper(job_name) = 'CEO'))
    UNION ALL
    SELECT 'EC' d, 'EC' r FROM DUALBut how i can check the radio button defaultly according to the user who logs in .
    <li> If the employee with the position CEO logs into the application means, he needs to have FC to be checked defaultly.
    <li> If the employee with the grade between(1-4) logs into the application means, he needs to have BC to be checked defaultly.
    <li> If the employee with the grade between(5-12) logs into the application means, he needs to have EC to be checked defaultly.
    Note:
    Instead of hide/show the radio buttons defaultly whether it is possible to enable/disable the radio button according to the user who logs into the application.
    Brgds,
    Mini...

  • Enable/Disable Column in a Advanced Bean Table

    Hi,
    I have 2 columns that needs to be enabled/disabled on a standard oa page PO Lines summary page.
    I went through couple of blogs/forums and found 2 approaches :-
    Approach 1
    1) Extended the standard VO POLinesMerge.
    2) Added a attribute column DeriveDisplayFlag of type VARCHAR2 . This call a database function and will return Y or N
    3) Added a attribute of type ShowAdditionalColumn boolean. the get method of this attribute returns TRUE if DeriveDisplayFlag is 'Y' otherwise returns FALSE.
    4) created a substitution for the custom VO
    5) uploaded the substitution to mds.
    6) copied the xml/class files to $JAVA_TOP/..
    7) Bounced entire middle tier
    8) using personalization, entered a SPEL command on the rendered property. I know rendered will hide/show the column but for time being I just want this to work.
    But this fails :-
    oracle.apps.fnd.framework.OAException: Message not found. Application: FND, Message Name: FND_VIEWOBJECT_NOT_FOUND. Tokens: VONAME = XXPBPoLinesMergeVO; APPLICATION_MODULE = oracle.apps.po.document.server.DocumentAM;
    I am not aware how to get around this. Can someone help please?
    Approach 2
    1) steps 1 to 6 from Approach 1.
    2) trying to extend controller class OrderLinesTableRNCO. But have couple of questions. This iis a advanced bean table so how should i reference individual record and the column that i need to disable/enable ?
    Conceptual questions
    Also, when i am entering a new record at what point in time the 2 new attribute will derive its value? the 2 attributes are dependent on the Item number column but i have not created a dependency between the attributes and Item# column.
    Will the controller logic fire for every column while i am entering a new record?
    Thanks.

    Hi Anil,
    Thanks for the response. I have given up that i will get reply on this post.
    I have done the substitution and upload the jpx to umsing importer.
    But you are correct may be i might have done something wrong. Can you please help me. I can send you the files if you can review and let me know it will be great.
    Also, will this approach work since PO Lines is a advanced bean table ?
    One of the experts suggested to use Bound values. I am not sure how to implement it though?
    I have went and told back to my business team that I am not able to do this so now they have asked me to enable/disable columns based on a dff value on po header. I thought this will be easier by extending the controller class on PO Lines table but that too is not working.
    Can you help me please ?
    Here is my code to extend the controller class :-
    package xxpb.oracle.apps.po.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;
    import oracle.apps.fnd.framework.webui.beans.table.OAColumnBean;
    import oracle.apps.fnd.framework.webui.beans.table.OASortableHeaderBean;
    import oracle.apps.fnd.framework.webui.beans.table.OATableBean;
    import oracle.apps.po.document.order.webui.OrderLinesTableRNCO;
    public class XXPBOrderLinesTableRNCO extends OrderLinesTableRNCO
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAAdvancedTableBean tableBean =
    (OAAdvancedTableBean)webBean.findIndexedChildRecursive("LinesTableRN");
    OAMessageLovInputBean poLineLov =
    (OAMessageLovInputBean)tableBean.findIndexedChildRecursive("XXPBSecondaryUOMLOV");
    poLineLov.setDisabled(false);
    }

  • Enable/disable textbox depending on list option, list is dependent on Radio

    Hi,
    I'm trying to enable/disable text_box which is dependent on select_list option, select_list is dependent on radio_button.
    I'm able to enable/disable select_list using radio_button options, but I'm unable to handle text box which is again dependent on this SELECT_LIST item.
    under html header page:-
    <script type="text/javascript">
    function disableOnValue(o)
    if (o.value == 'Y')
    document.getElementById('P86_Select_list_item').disabled = false;
    else
    document.getElementById('P86_Select_list_item').disabled = true;
    document.getElementById('P86_text_box_item').disabled = true;
    </script>
    <script type="text/javascript">
    $(document).ready(function()
    $('#P86_Select_list_item').change(function()
    if($(this).val() == 'Other')
    $('#P86_text_box_item').attr("disabled", false);
    else
    $('#P86_text_box_item').attr("disabled", true);
    </script>
    under Region_Source of the region, whose Display point :- <b>Before Footer</b>
    <script type="text/javascript">
    if(document.getElementById('P86_radio_button_0').checked == true)
    {disableOnValue(document.getElementById('P86_radio_button_0'));}
    else
    {disableOnValue(document.getElementById('P86_radio_button_1'));}
    </script>
    and under Radio_button item, HTML Form Element Attributes :- <b>onchange="javascript:disableOnValue(this);"</b>
    also same way under text_box item , HTML Form Element Attributes :- <b>disabled</b>
    any help
    Deep

    Thanks for replying Ben,
    I have kept an example into apex workspace
    workspace:- DEEPAPEX
    username:- [email protected]
    password:- walubu
    application "Javascript" page 1
    I'm able to enable/disable Select_list item & Text_box item with the help of Radio_button item(depending on user select yes or no option of the radio button)
    But after selecting Yes option of the radio_button, only when user select "Other" option of the Select_List item the Text_box should be enabled otherwise it should be disabled for any of the options of the Select_list item.
    I hope you understand my point.
    Deep

  • Enabling / Disabling graphs and opening a new Front Panel Window

    Hi,
      I have a simple application of showing 12 analog signals on 12 different graphs placed vertically in aligned position. I have to develop a user interface so that if user wants to display signal no. 1, 4 and 6 out of total 12 signals, he should make selection using check boxes and click a re-draw button. It should result in opening a separate window with these three signals displayed as separate graphs aligned vertically and adjusted to fit window size. Similarly later user can change his selection of displaying signals (from same acquired data) say 1, 3, 5, 6, 8, 9, 11 & 12 and click Redraw button. It should result in opening a new Window showing all these signals as separate graphs which are aligned vertically and resized to fit the window. Now I have two major issues in this context.
    1) I have been searching LabView help to locate a way to open a new window for this purpose but I failed to locate any way for it. As per my limited knowledge, it seems that we cannot have multiple "Front Panel" windows in Labview.
    2) For the graph I could not locate a control to enable/disable a graph so that it appears or vanishes. Is there any way to achieve it?
    I shall appreciate your valuable advice. I shifted from "Lab View Signal Express"  to "Lab View" in order to achieve this user interface design but I am still not successful in finding a good solution for this application.
    Regards
    Mnuet

    Hi Mnuet,
    You can do what was said above. Here is a KB on dynamically loading VIs. It looks something like this.
    Dynamically loaded VIs are loaded at the point in code while running, as opposed to being loaded when the parent VI is loaded into memory like normal subVIs. You can make a reference to them and then control the front panel appearance, their run status, etc with property nodes and invoke nodes.
    Jeff | LabVIEW Software Engineer

  • Need help with OA Framework. Enable/Disable LOV dynamically

    Hello,
    I am new to OA Framework. My requirement is as follows;
    The page should have a field with parameter org code (LOV). When the user selects an org and click GO button, the page should display all the inactive items (which have no Sales order or work order for last 2 years). In the table region, user selects single record or multiple records by a check box. The selected records should be processed after clicking a submit button in the table region. The process is, calling an API to change the status of the item to Inactive or some other status. The status should be determined by the user by selecting a LOV within the table region. I could create LOV based field for org code and could display the data on the page. I have been trying to display the LOV for item status , I have created a LOV under table region under table components > table actions. I could open the LOV and select a value, but the value is not defaulting to the field on the page. Somebody please help me with a suggestion or if you have the code for a similar kind of requirement please share with me.
    Also, need some suggestion on how to enable and disable LOV dynamically. I want to display the 2 LOV's in different regions. I want to enable the LOV for Item Status only after the org code is selected and the page populated after the user clicks GO button.
    Thanks in Advance…..

    Hi,
    I could open the LOV and select a value, but the value is not defaulting to the field on the page.pls check the LOV mapping ,this might be wrong.
    to enable/Disable LOV dynamically ,u need to use PPR,please check the lab solution exercise create employee chapter to learn to implement PPR functionality.
    Thanks
    Pratap

  • Does anyone know how to enable/disable a dropdown menu in Forms at runtime?

    Is there a way how to disable/enable dropdown menu for menus that have multiple sub levels in Oracle Forms? I am trying to use the set_menu_item_property function but this takes 'menu.item' format for the first argument. I am trying to enable/disable a menu item in the form of 'menu.item.subitem' and was not able to do it using this function. If anyone knows a different function or method, please reply. I have shown an example below.
    Setup -> Software -> Front Page
    From the above example, I can enable/disable Software using set_menu_item_property function. But, how do I enable/disable the Front Page menu in Oracle forms at runtime?
    Thanks
    Edited by: user480347 on Aug 24, 2010 3:37 PM

    Yes you are on the right track. You need to pass then complete menu name to set_menu_item_property
    Immediate_parent menu.item_name e.g
    For example you have menu like this
    Id like
    A1    A10 > A1010
    Home > Input > Form 1
    A1    A10 > A1020
    Home > Input > Form 2 To disable Form 2 you must pass menu name as
    A10.A1020Hope it helps

  • 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 report parameter control at runtime in SSRS

    Hi,
    I am using SSRS 2012. I want to enable/disable or hide/show parameters based on another parameter selection.
    I have a 3 parameter, Parameter 1 says which parameter need to show either Parameter2 or parameter3 in the parameter panel. i don't find any expression to show/hide option.
    Appreciate your help.
    Paramesh G

    However if you want parameters to enable disable then that functionality can be obtained by using cascading parameters
    ie make parameters  2 and 3 dependent on 1
    So for that created two datasets which will provide values for parameters 2 and 3
    Check allow null values for both the parameters
    Set default value as NULL for both parameters
    then for dataset use queries like
    SELECT ...
    FROM ..
    WHERE @Parameter1 = 'Parameter2'
    SELECT ...
    FROM ..
    WHERE @Parameter1 = 'Parameter3'
    This will make sure parameter2 or 3 gets enabled with required values based on what you choose for parametr1
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to enable / disable SSRS Parameter

    Hi
    I want to enable a parameter called "start date" (type is date) when another (value from dropdown) parameter is selected
    Say for an example, i have below 3 parameters
    1. drop down which 2 values called "vtextbox","vdate"
    2. start (data type is date)
    3. finish (data type is date)
    when i select "vdate"value from the dropdown 2nd and 3rd parameters has to be enable
    similarly when i select "vtextbox" value from the dropdown 2nd and 3rd parameter has to disable
    I have searched many forums every one says this is not possible in report manager interface
    But this is possible in custom code
    please make a note all three parameters are independant
    It would be great if any one provide the custom code for same
    Regards
    Santosh

    Hi itsmesantosh1982,
    According to your description, you want to use a parameter to control enable/disable other two parameters. Right?
    In Reporting Services, when we create a parameter, this parameter has been enabled. The only way you want to disable the parameter is deleting it. In this scenario, disable the two parameter is same as selecting all values in these two parameters. So
    we can just modify the default values in 2nd and 3rd parameter instead of using cascading parameter. We can create a dataset, put in the query below:
    IF @Param='vtextbox'
    select distinct startdate from [table]
    else
    select '[value]'
    The [value] can be any value which is not existing in [table]. So when you select 'vtextbox', the default value will be all values in the table. If you select 'vdate', it will need you to select value automatically because the return value is not existing
    in the table. This can be an effective workaround for your requirement.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

Maybe you are looking for