Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unable to write in textbox/text area

9 views
Skip to first unread message

testols ols

unread,
Dec 11, 2009, 6:23:35 AM12/11/09
to
I have embedded Xulrunner into my native application. The webpage
opens up in xulrunner browser and renders the html page correctly.
However the browser is not letting me to enter text into the text
fields or text area. Is there anything specific required for letting
the user enter text.

testols ols

unread,
Dec 14, 2009, 7:31:31 AM12/14/09
to phni...@gmail.com

*************************************************
Xianzhu Wang to me, dev-embedding

Which version of xulrunner are you using?
If 1.9.2, it seems this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=533245
**************************************************

I put a breakpoint at nsEventStateManager.cpp
function nsEventStateManager::PostHandleEvent
at lines case NS_KEY_DOWN:
case NS_KEY_UP:
and function nsEventStateManager::PreHandleEvent
at line case NS_KEY_PRESS:

But the control is not stopping at breakpoints. Strange.... :(
However the cases concerned with mouse events are caught properly.

Someone please help me.

testols ols

unread,
Dec 15, 2009, 4:03:12 AM12/15/09
to
Still facing the issue :(.
Few findings.
1. If i drag the label text or any other text present in webpage and
drop it into input textbox, the textfield fills properly with the
selected and dragged text.
2. I tried with event handling using following function.
NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress
*progress, nsIRequest *request, PRUint32 progressStateFlags, nsresult
status)
{
if ((progressStateFlags & STATE_STOP) && (progressStateFlags &
STATE_IS_DOCUMENT))
{
nsCOMPtr<nsIDOMWindow> domWindow;
progress->GetDOMWindow(getter_AddRefs(domWindow));
nsCOMPtr<nsIDOMEventTarget> domEventTarget;
domWindow->QueryInterface(nsIDOMEventTarget::GetIID(), getter_AddRefs
( domEventTarget ) );
domEventTarget->AddEventListener(NS_LITERAL_STRING ("onkeypress") ,
this, PR_TRUE);
domEventTarget->AddEventListener(NS_LITERAL_STRING ("mousedown") ,
this, PR_TRUE);
}
}
The app is able to capture 'mousedown' event but not the 'onkeypress'
event.

What could be the issue? Any pointers or guidelines to debug this
issue will be highly appreciable.

testols ols

unread,
Dec 16, 2009, 6:37:29 AM12/16/09
to
One major finding :)
Native application is not forwarding key events to browser window. I
simply dont know the reason as i dont have control over it :(.
Is there any way to push window messages to Mozilla browser directly.
In this way i will ask the application to directly forward all the key
events to browser.
We are able to do the same in Opera through OM_TranslateWindowsMessage
and in IE through TranslateAccelerator function calls.
Again any help is highly appreciable.

testols ols

unread,
Dec 21, 2009, 2:38:45 AM12/21/09
to
Sorry for replying late. Finally problem is fixed as of now :)

While loading any URL through webnavigator, i am now explicitly
activating the browser and giving focus to it.

nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(myWebBrowser));
focus->Activate();

This allowed me to enter text in text box.

Thanks a ton for all those who have helped me in resolving this issue.

0 new messages