Discussions related to Visual Prolog
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

WebBrowser + HtmlDocument + select one option in a list

Unread post by Tonton Luc »

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 :idea:
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

...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 ?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

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         .
Post Reply