Quantcast

get textbox value in c++

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

get textbox value in c++

YuLo
I have a dialog window.
In javascript I can get textbox value by
document.GetElementById('f1').value.

in c++ GetNodeValue method of textbox DOM element returns empty string.

Now I use
<textbox id="f1" oninput="this.setAttribute('value', this.value);"/>
then I can get element attribute.

I suppose there is direct way to get the value in c++

GetTextContent, GetUserData return nothing.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: get textbox value in c++

Neil-4
YuLo wrote:

>I use
><textbox id="f1" oninput="this.setAttribute('value', this.value);"/>
>then I can get element attribute.
>
>I suppose there is direct way to get the value in c++
>  
>
QI to nsIDOMXULTextBoxElement and call GetValue.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: get textbox value in c++

YuLo
Thank you Neil, it work good.

Once again I deal with XUL tags and have no clue how to get value from them in C++.
I tried similar way seeking for some kind of nsIDOMXUL...Element to QI to it but have not found any.
This time I tried to get value from <datepicker> element in C++ without success.
May be you can offer me where can I find information about xul elements interfaces and their dependencies to make QI to needed interface.

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: get textbox value in c++

Neil-4
YuLo wrote:

>I tried to get value from <datepicker> element in C++ without success.
>May be you can offer me where can I find information about xul elements interfaces and their dependencies to make QI to needed interface.
>  
>
Use the following steps to find out which interfaces, if any, a given
XUL element provides:

   1. Find the CSS for the element in xul.css and look for the
      -moz-binding property, in this case datetimepicker.xml#datepicker
   2. Open the binding file and search for the binding (the name is the
      part after the #, so datepicker in this case)
   3. In the binding, look for e.g. <implementation
      implements="nsIDOMXULControlElement">
   4. If you don't find an implementation in the binding, look for an
      extends attribute which refers to the parent binding

In this case the parent of datepicker is datetimepicker-base but that
doesn't implement any interfaces either. The parent of
datetimepicker-base is basecontrol which implements the control element
interface. Unfortunately that interface only provides the tabindex and
disabled attributes, so there's no way to get the value.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: get textbox value in c++

YuLo
On Monday, March 31, 2014 12:58:33 PM UTC+4, Neil wrote:

> YuLo wrote:
>
>
>
> >I tried to get value from <datepicker> element in C++ without success.
>
> >May be you can offer me where can I find information about xul elements interfaces and their dependencies to make QI to needed interface.
>
> >  
>
> >
>
> Use the following steps to find out which interfaces, if any, a given
>
> XUL element provides:
>
>
>
>    1. Find the CSS for the element in xul.css and look for the
>
>       -moz-binding property, in this case datetimepicker.xml#datepicker
>
>    2. Open the binding file and search for the binding (the name is the
>
>       part after the #, so datepicker in this case)
>
>    3. In the binding, look for e.g. <implementation
>
>       implements="nsIDOMXULControlElement">
>
>    4. If you don't find an implementation in the binding, look for an
>
>       extends attribute which refers to the parent binding
>
>
>
> In this case the parent of datepicker is datetimepicker-base but that
>
> doesn't implement any interfaces either. The parent of
>
> datetimepicker-base is basecontrol which implements the control element
>
> interface. Unfortunately that interface only provides the tabindex and
>
> disabled attributes, so there's no way to get the value.
>
>
>
> --
>
> Warning: May contain traces of nuts.

Thank you Neil,
so, as far as I understand there is no way to know what user selected
in datepicker in the c++ program?
Is it really?
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: get textbox value in c++

Neil-4
YuLo wrote:

>Thank you Neil,
>so, as far as I understand there is no way to know what user selected
>in datepicker in the c++ program?
>Is it really?
>  
>
Perusing the code, it seems as if the value attribute might contain the
current value of the datepicker. You would have to call the standard DOM
GetAttribute method and parse the result yourself.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Loading...