Discussions related to Visual Prolog
Tonton Luc
VIP Member
Posts: 204 Joined: 16 Oct 2001 23:01
Post
by Tonton Luc » 16 Dec 2013 14:27
Hi,
To select index 10 in an html list, I've trying to use this code but any event is generated :
Code: Select all
setProperty( "selectedIndex" , comDomains:: variant ( comDomains:: string ( "10" ) ) ) ,
The index label number 10 appear correctly in the select tag, but normally, if the user select it manually via IE, a second select is refreshed. I can't mimic this action.
Any
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 17 Dec 2013 9:50
The webBrowser control is an "empty" shell that loads other components for different kinds of documents (PDF, Excell, ...). HTML is handled by the MSHTML component, which is a huge component. In the MSHTML compoment the HTML is maintained as in a DOM (Document Object Model).
The DOM can be manipulated programatically either using the MSHTML componet or from within the HTML page itself using JavaScript.
Regards Thomas Linder Puls
PDC
Tonton Luc
VIP Member
Posts: 204 Joined: 16 Oct 2001 23:01
Post
by Tonton Luc » 17 Dec 2013 10:10
...and I'm looking for how to select programmatically an element in a list choice from MSHTML ?
Here is a part of my code :
Using setProperty, the value of index 10 appear in the html lbox but it not really selected. So, how to select programmatically from MSHTML ?
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 20 Dec 2013 9:16
Sorry, this is outside my area. I think you should look for similar functionality in JavaScript/DOM/HTML
references/examples/explanaitions.
Mozilla Developer Network (MDN) is an excellent source for knowledge about all such WEB oriented stuff:
Regards Thomas Linder Puls
PDC
Tonton Luc
VIP Member
Posts: 204 Joined: 16 Oct 2001 23:01
Post
by Tonton Luc » 12 Mar 2014 13:40
Here is the good code :
Code: Select all
predicates
onLst_mquesDoubleClick : listBox :: doubleClickListener .
clauses
onLst_mquesDoubleClick( Source ) :-
if Idx = Source : tryGetSelectedIndex ( ) and not( isErroneous( choix_mq) ) and not( isErroneous( tout) ) then
Item = tout: item ( comDomains:: variant ( comDomains:: string ( "make_id" ) ) , comDomains:: variant ( comDomains:: integer ( 0 ) ) ) ,
Item2 = comInterface:: new ( Item , comMemory:: release ( ) ) ,
DDD = iHTMLSelectElement_import:: newQuery ( Item2 ) ,
DDD : set_SelectedIndex ( Idx + 1 ) ,
XXX = iHTMLElement3_import:: newQuery ( Item2 ) ,
_Val = XXX : fireEvent ( "onchange" , comDomains:: variant ( comDomains:: null ( ) ) ) ,
stdio:: write ( "Val = " , Val ) , stdio:: nl
end if
.