Xml list selection in IE11

Discussion and feedback on Construct 2

Post » Sun Jan 12, 2014 12:32 pm

Hi, I played around with the Xml example in c2 and was just about to share the work in the Capx Example section. When I discovered, for unknown reasons, list selection won't work in IE 11. We can't have this not to work. What might the problem be?!

In the Capx I tried the change "on selection changed" to "on clicked" and even "system -> Every tick". But that's not it.

CapxMonumental2014-01-14 13:59:47
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Sun Jan 12, 2014 2:58 pm

You might need to loop through the sub-nodes of "book" and append each value to your text object.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Mon Jan 13, 2014 11:03 am

I thought about that, but what if you have hundreds of books, swords and other stuff you want listed. That would not be an option. My example works fine in both Chrome and Firefox. I want it to be available to IE users and highly customizable so it earns it's place in the Capx Example section.

ramones: I guess I have to bury IE in a pet cemetery
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Mon Jan 13, 2014 1:29 pm

IE11 seems to support 'On selection changed' just fine. The first text box updates so the trigger is working. It looks like IE11 doesn't understand that particular piece of XPath.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Jan 13, 2014 3:57 pm

Just read this: http://www.w3schools.com/xpath/xpath_syntax.asp. Do not paste the link, I quote: "IE5 and later has Implemented That [0] Should be the first node, but According To the W3C standard it should have been [1]!"
So I guess you are right IE has not implemented XPath properly >.<

IE is now a dead end. I will add a "do not use IE" warning before I share the capx, still might be useful.

Thanks!
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Mon Jan 13, 2014 6:13 pm

You could work around it by detecting MSIE (or Trident for IE11) in the user agent string and offsetting the index accordingly.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Jan 13, 2014 7:50 pm

This is what I meant by looping through the child nodes:


That works in IE11 so I guess the index starts at 1 there.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Tue Jan 14, 2014 1:54 pm

Almost done!

Let's say you have weapons or armor instead of books and you want to view statistics in different text boxes. ramones / * (black magic) presented the last node in one text box. In the second you can show any node.

Thanks plenty for all your help!

Download and test the example at the top of this thread.
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Tue Jan 14, 2014 10:17 pm

It's only showing the last node because you're using 'set text' instead of 'append' so it's overwriting all but the last node.

Here's one way to show different stats in different text boxes...
Give each text box a 'name' variable that matches each node name and then just loop through the nodes, pick the text object with the matching name and set it's value.



xmlExampleEdit.capx (r156)
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest