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
:)

Similar Messages

  • How can i Print (with the printer) a JFrame by clicking a button?

    i have a jframe with image and lables on it...
    how can i send it to print by clicking the mouse i mean what to write at the ActionListener?
    Thanks!

    What to search? What do you mean "what to search". I suggested you search the forum using "printerjob" as the keyword.
    Or search the forum using "printing". Think up you own keywords. Read some postings and get some ideas. All the information is in the forum if you look hard enough to find it.

  • How to go one jFrame to another JFrame after click on button?

    I am having two frames loginFrame.java and UserinfoFrame.java.
    In loginFrame.java to click on login button i want to goto UserinfoFrame
    (LogInSuccessPanel).
    private void bnLoginActionPerformed(java.awt.event.ActionEvent evt) {                                       
    // TODO add your handling code here:
    int loginCounter=0;
    this.remove(jPanel2);
    LogInSuccessPanel login = new LogInSuccessPanel();
    this.add(login);
    update();
    //if(evt.getSource()=="login")
    // while(loginCounter <= 5)
    if(!login(jTextField1.getText(), new String(jPasswordField1.getPassword()))) {
    loginCounter++;
    System.out.println("UserName : "+jTextField1.getText()) ;
    System.out.println("Password : "+jPasswordField1.getPassword());
    if(loginCounter >= 6) {
    System.out.println("Unable to Login");
    connectToDB();
    if(jTextField1.equals("UserName"))
    //Check Whether username is existing in DB
    private void connectToDB() {
    try{
         Class.forName("com.mysql.jdbc.Driver");
    Connection con= DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
    Statement stmt = con.createStatement();
    ResultSet rset = stmt.executeQuery("SELECT UserName from login table");
    jTextField1.setText("Connected to the Database. Fetching Values from login Tables.\n");
    StringBuffer allRowValues = new StringBuffer();
    int counter=1;
    if (rset.next())
    //allRowValues.append("ROW " + counter + ": Username = " + rset.getString(1) + " & Password = " + rset.getString(2) + "\n");
    //counter++;
    System.out.println(" LOGIN SUCCESSFUL ");
    System.out.println("Username : " + rset.getString("username"));
    System.out.println("Password " + rset.getString("password"));
    System.out.println(" LOGIN SUCCESSFUL ");
    else
    System.out.println(" LOGIN FAILED ");
    // .setText(allRowValues.toString());
    rset.close();
    stmt.close();
    con.close();
    } catch (SQLException ex) {
    System.out.println("Connection Error = " + ex.toString());
    ex.printStackTrace();
    }catch(ClassNotFoundException e){
         System.out.println("Error in loading class" + e);
    private boolean login(String name, String pwd) {
    int count=0;
    if(count<=5)
    count++;
    return true;
    else return false;
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Login().setVisible(true);
    Thanks and regards

    search results for
    login
    http://onesearch.sun.com/search/onesearch/index.jsp?charset=UTF-8&qt=login&rf=0&rt=1&site=dev&nh=10&cs=0&col=developer-forums&dftab=siteforumid%3Ajava57&chooseCat=javaall&subCat=siteforumid%3Ajava57

  • 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();

  • Enable disable toolbar items on click on any checkbox,radio button,text box.

    Hi Friends,
    I am create application in eclipse RCP E4 and now i am trying to Enable disable toolbar items on click on any checkbox, radio button, text box .
    Please Help me friends....

    Hello friend my proble is solve and now i am sharing my solution ....
    I am create RCP application and view side any listener click event fire time apply this code
    IEvaluationService evaludationService = (IEvaluationService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IEvaluationService.class);
    evaludationService.getCurrentState().addVariable("noOfRowsChecked", noOfRowsChecked);
    evaludationService.requestEvaluation("com.jobsleaf.propertytester.canDeleteItem");
    and add plug in extension and create property tester class means listener property tester class side apply this code
    IEvaluationService ws = (IEvaluationService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IEvaluationService.class);
    Integer integer = (Integer) ws.getCurrentState().getVariable("noOfRowsChecked");
    if (integer != null)
    if (integer.intValue() > 0)
    return true;
    I hope useful above code when use property tester in eclipse RCP

  • Subelements of a disabled JMenu are not cleared

    Hi All!
    Subelements of a disabled JMenu are not cleared from screen when the frame is repainted.
    Please go thru the sample code below & comments following code:
    //Subelements of a disabled JMenu are not cleared from screen
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    class MyFrame extends JFrame implements ChangeListener {
    JMenuBar menuBar;
    JMenu menu;
    JTabbedPane tp;
    MyFrame() {
         super();
         addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);
         setTitle("JMenuItems of a JMenu are not cleared if JMenu is disabled.");
         setSize(600, 500);
         createMenu();
         JPanel panel = new JPanel();
         tp = new JTabbedPane();
         tp.addTab("One", new JLabel(" One will go here "));
         tp.addTab("Two", new JLabel(" Two will go here "));
         tp.addChangeListener(this);
         panel.add(tp);
         getContentPane().add(BorderLayout.CENTER, panel);
         getContentPane().add(BorderLayout.NORTH, menuBar);
         private void createMenu()
              menuBar = new JMenuBar();
              JMenu fileMenu = new JMenu("File");
              fileMenu.add(new JMenuItem("New"));
              fileMenu.add(new JMenuItem("Open"));
              fileMenu.add(new JMenuItem("Close"));
              menuBar.add(fileMenu);
              menuBar.add(new JMenu("Edit"));
              menuBar.add(new JMenu("Search"));
              menuBar.add(new JMenu("View"));
              JMenu menuProblem = new JMenu("Menu");
              menu = new JMenu("Child Menu");
              menu.add(new JMenuItem("Menu Item 1"));
              menu.add(new JMenuItem("Menu Item 2"));
              menu.add(new JMenuItem("Menu Item 3"));
              menuProblem.add(menu );
              menuBar.add(menuProblem);
         public void stateChanged(ChangeEvent e)
              int index = tp.getSelectedIndex();
              if( index == 0)
                   menu.setEnabled(true);
              else
                   menu.setEnabled(false);
    public class MenuDemo
         public static void main(String args[]) {
              MyFrame frame = new MyFrame();
              frame.setVisible(true);
    Comments:
    Use JDK 1.3 and run the application. When user clicks on Menu and clicks on Child Menu, sub elements are shown and if user clicks on Tab Two, Menu Items are not cleared because it's parent menu is disabled. The same application works fine in Jdk 1.4.1.
    I am searching for BUG ID from Sun's bug database. If any one of you have a work around solution for this problem or bug id, kindly post the same at the earliest.
    Thanks in advance,
    Sandesh

    HI
    so theres a price difference so what you do is create a GL called the price difference GL if you have one thats  fine make sure you post the price difference into the price difference GL account created you can create GL account in FS00, the other way is to set a tolerance limit set the tolerance limit to 10%.
    hope this solves your problem
    regrds
    Vignesh

  • 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

  • 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 the 'display PDF in browser' via a script after Reader 9 is installed

    So we have Reader 9 already installed on the machine, but we need a simple way that a user can click on a shortcut in the start menu to reconfigure how the PDF is opened - either from within the browser or outside of the brower.
    In Reader 7, I was able to use this:
    msiexec.exe /i {AC76BA86-7AD7-1033-7B44-A71000000002} Remove=ReaderBrowserIntegration /norestart /qb-!
    msiexec.exe /i {AC76BA86-7AD7-1033-7B44-A71000000002} ADDLOCAL=ReaderBrowserIntegration /norestart /qb-!
    which works well after the fact that Reader 7 is installed on the machine.
    For Reader 9, things have changed, and have tried this:
    msiexec.exe /i AcroRead.msi /qn DISABLE_BROWSER_INTEGRATION=YES
    msiexec.exe /i AcroRead.msi /qn DISABLE_BROWSER_INTEGRATION=NO
    The above don't work, nor if I run a repair instead of an install.  I also tried to modify the HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\Originals\bBrowserIntegration then following in up with the appropriate msiexec command and that didn't work
    No, asking users to go to the options and enable/disable the setting isn't ideal unfortunately as it requires too many clicks
    Anybody have any suggestions on this?

    Try this forum:
    http://forums.adobe.com/community/acrobat/acrobat_enterprise_install

  • Button enable/disable in Master-Detail table

    I am using JDeveloper 11.1.1.3.0 and I have a page fragment (.jsff) which includes a Master-Detail table and the Master table has 3 buttons that get enabled/disabled based on the specific string within a column say, if the column has value, 'DRAFT', the buttons should be enabled. In all other cases, the buttons should be disabled.
    The above mentioned scenario works in cases where the table has more than one row in the table; but in two cases the buttons don't get enabled even though the column has 'DRAFT' as its value:
         1. when the table first loads with the data populated in the table; clicking on the first row doesn't trigger the buttons, clicking on any other row triggers the buttons
         2. when there is only one row in the table
    To resolve this, I tried looking at the logs for any specific information regarding the buttons getting enabled or disabled. I couldn't find info on setting up a breakpoint for the commandbutton and the disabled property which would enable me to determine whether it is being triggered as soon as the table gets populated or not.
    How can I get the buttons to work per my requirements? Also, can I set breakpoints for the button and/or evaluate disabled property's EL expression?
    Thanks in advance.

    Navaneeth:
    The buttons are part of panelCollection which exists in panelHeader. As the below code demonstrates,
    1. Buttons are defined in the toolbar (t2) in panelCollection (pc1)
    2. Each buttons' partialTrigger is set to the table (md1)
    3. Tables' (md1) partialTrigger is set to the toolbar (t2).
    <af:panelHeader text="#{viewcontrollerBundle.HISTORIC_PANEL_SPECS__TESTER_S}" id="ph2">
            <af:panelCollection id="pc1" styleClass="AFStretchWidth">
              <f:facet name="menus"/>
              <f:facet name="toolbar">
                <af:toolbar id="t2" partialTriggers="t2">
                  <af:commandButton actionListener="#{bindings.promotePanelSpec.execute}"
                                    text="#{viewcontrollerBundle.PROMOTE_PANEL_SPEC}"
                                    id="cb1" icon="/Images/up16.png"
                                    partialTriggers="md1"
                                    disabled='#{bindings.Status!="DRAFT"}'
                                    immediate="true"/>
                  <af:commandButton text="#{viewcontrollerBundle.ADD_TESTER_SPEC}" id="cb2"
                                    partialTriggers="md1"
                                    icon="/Images/action_add.gif"
                                    actionListener="#{bindings.CreateWithParams.execute}"
                                    action="addTestSpec"
                                    disabled='#{bindings.Status!="DRAFT"}'/>
                  <af:commandButton actionListener="#{PanelSpecTesterSpec.deleteTesterSpec}"
                                    text="#{viewcontrollerBundle.REMOVE_TESTER_SPEC}"
                                    id="cb3" partialTriggers="md1 ::pc2:t1"
                                    icon="/Images/delete.png"
                                    disabled='#{bindings.Status!="DRAFT"}'/>
                </af:toolbar>
              </f:facet>
              <f:facet name="statusbar"/>
              <af:table id="md1"
                        rows="#{bindings.PanelSpecTesterSpecView1.rangeSize}"
                        fetchSize="#{bindings.PanelSpecTesterSpecView1.rangeSize}"
                        emptyText="#{bindings.PanelSpecTesterSpecView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                        var="row"
                        value="#{bindings.PanelSpecTesterSpecView1.collectionModel}"
                        rowBandingInterval="0"
                        selectedRowKeys="#{bindings.PanelSpecTesterSpecView1.collectionModel.selectedRow}"
                        selectionListener="#{bindings.PanelSpecTesterSpecView1.collectionModel.makeCurrent}"
                        rowSelection="single" partialTriggers="::t2"
                        filterVisible="true" displayRow="selected"
                        filterModel="#{bindings.ProductIdPanelSpecVersionToolNameQuery.queryDescriptor}"
                        queryListener="#{bindings.ProductIdPanelSpecVersionToolNameQuery.processQuery}">
                <af:column headerText="#{bindings.PanelSpecTesterSpecView1.hints.ProductId.label}"
                           sortProperty="ProductId" sortable="true" id="c39"
                           filterable="true">
                  <af:outputText value="#{row.ProductId}" id="ot28"/>
                </af:column>
                <af:column headerText="#{bindings.PanelSpecTesterSpecView1.hints.Status.label}"
                           sortProperty="Status" sortable="true" id="c43"
                           filterable="true">
                  <af:outputText value="#{row.Status}" id="ot40"/>
                </af:column>
              </af:table>
         </af:panelCollection>
    </af:panelHeader>The fact that the above code works when there are multiple rows tells me that buttons are having trouble reading the first row of the table.
    Also, I changed the displayRow property for the table from "selected" to "first" but no luck either.

  • Shared Variable Engine Buffering Enable/Disable

    Hello -
    I am running into a problem where I am seeing a read of data that seems to be lagging the writing of the data. The reading and writing functions are utilizing the same shared variable - a control to write to it and an indictor to display it somewhere else. The indicator is lagging by one value, ie. scrolling up the value from 1,2,3,4.. will yeild in a display of 0,1,2,3, lagging by one. I am writing/reading to/from a value in a PLC using an OPC server, binding the variables to the control/indicator.
    I am assuming it is the buffering which is causing this, but I can not seem to find where the buffering is enabled/disabled.
    Has anyone seen this behaviour before? Also, where do you configure the Shared Variable Engine to disable buffering?
    Thank you in advance for your help -
    John
    PS> One other note, Datasocket binding of the control/indicator does not yield any problems.

    John,
    Buffering is configured in the main window of the shared variable (double click on the shared variable in the project).  Also, you will see this behavior if you have the RT FIFO enabled and you're using the variable on a Real Time target. 
    I would also recommend taking a look at this white paper which covers the workings of the shared variable:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/5b4c3cc1b2ad10ba862570f2007569ef
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

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

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

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

  • Screen Personas 2.0 Enable/Disable script button in Javascript

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

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

  • Enabling \ Disabling of Cut,Copy,Paste image(.gif) on tollbar,

    Hi,
    I am having one problame in Enabling \ Disabling of Cut,Copy,Paste image(.gif) on tollbar,
    On Mouse Click of component on panel these images should enable\disable( like normal cut,copy,paste function.)
    can any body help me on that.
    Thanx,

    I am having one toolbar in a class and a component in other class and i want to enable & disable cut,copy,paste images in toolbar according to comp id.

Maybe you are looking for

  • Kernel panic after 10.5.6 update

    Hi all, A few hours after updating to Mac OS X 10.5.6 yesterday, I got a kernel panic (trace below). If I recall correctly, only Mail and Safari were open at the time. This is my 2nd kernel panic in the one month since own a new Macbook. What worries

  • How to get the x1,y1 and z1 coordinates out of an sdo_geometry object?

    Hello, i have stored several boxes into an sdo_geometry object like the following: mdsys.sdo_geometry(3003,null,null, mdsys.sdo_elem_info_array(1,1003,3), mdsys.sdo_ordinate_array(x1,y1,z1,x2,y2,z2) now i would like to get the x1,y1,z1 coordinates fr

  • JTable's multiLine problem!!!

    I want to use JTextArea as table's editor,but,there are only JtextFiled,JComboBox,Jcheckbox in DefaultCellEditor class ,there is not JTextArea,How to do?please help me!!!thanks!!!

  • Virus, Malware, Opera in my Mac OS folder. is this normal?

    I find this odd. I have found Opera in my OS file. 1 i have never knowingly download opera 2 nor have i knowingly installed it 3 why would it not be in the apps folder? any ideas?

  • Change plugin target from CS 5.5 to CS 5.0

    Hi all, I would like to ask, what steps I should proceed to support both versions of InDesign cs 5.0 and 5.5? Iam using cs 5.5 SDKs on mac os, should I add something in resource files? Thanks in advice