Hello, please help me

My project is base on Java. I use XULRunner to open a XUL frame (within support of SWT).
Now I am trying to get the value of a textbox for example (which user has put). But I only can get the default value, not the one which user has put. My code look like this.

    public void loadValues() {
        try {
            nsIDOMWindow window = browser.getWindow();
            nsIDOMDocument document = window.getDocument();

            Set ids = values.keySet();
            Iterator itIDs = ids.iterator();
            while( itIDs.hasNext() ) {
                String id = (String)itIDs.next();
                nsIDOMElement element = document.getElementById(id);
                if(element != null) {
                    String value = element.getAttribute("value");
                    values.put(id, value);
                }
            }
        } catch(Exception err) {
            err.printStackTrace();
        }
    }

I dont want to use the nsIDOMXULDocument, because there are too many kind of document (html documemt for example). My goal is get the values without knowing the document type. But even I want to get the nsIDOMXULDocument, It throws an exception of QueryInterface.

Could you please give me some hint to get the value of a control which is put by user.

Thank you very much!


New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to