Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
WildeKurt  
#1 Posted : Wednesday, April 20, 2016 5:00:49 PM(UTC)
WildeKurt

Rank: Newbie

Groups: Registered
Joined: 4/18/2016(UTC)
Posts: 8
United States
Location: Dallas, TX

I'd like to be able to dynamically change the color of say a label's text color based on some condition. Is this possible. The only possiblility I can see is something called 'browser css class.' Can I set up different classes and use XPath to select them possibly?
bbv  
#2 Posted : Wednesday, April 20, 2016 6:48:51 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 487

Was thanked: 83 time(s) in 83 post(s)
No need to use Browser CSS class, unless you design it for execution in browser and you are required to use CSS.

Simply click the Text Color property and then click XPath toolbar button above to enter your XPath statement.
WildeKurt  
#3 Posted : Wednesday, April 20, 2016 7:02:11 PM(UTC)
WildeKurt

Rank: Newbie

Groups: Registered
Joined: 4/18/2016(UTC)
Posts: 8
United States
Location: Dallas, TX

I see! Not immediately evident as if no xpath has been entered, it shows the pallet icon to the righ in the Syles and Properties pane. Works fine though. Thanks
WildeKurt  
#4 Posted : Wednesday, April 20, 2016 11:47:54 PM(UTC)
WildeKurt

Rank: Newbie

Groups: Registered
Joined: 4/18/2016(UTC)
Posts: 8
United States
Location: Dallas, TX

Another item I'm having difficulty with: I have a repeating table on which I'm mapping the text color based on the items 'state'. However, it only seems to evaluate on the first item. In otherwords it'll be blue unless the first item regardless of the number of total items is active.

Quote:

if ($HTTP1/json/item/state/active = true()) then
if ($HTTP1/json/item/state/acked = true()) then 'blue'
else
'red'
else
'black'
bbv  
#5 Posted : Thursday, April 21, 2016 9:33:36 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 487

Was thanked: 83 time(s) in 83 post(s)
This is because you are using XPath which always starts from the beginning of the tree.

Within a repeating or dynamic table you are in a context of the element which was used to build the table. So, for example, if you have built your repeating table with element $HTTP1/json/item, then you should address the elements within this table with a relative path

Code:

if (state/active = true()) then
	if (state/acked = true()) then 'blue'
	else
		'red'
else
	'black'
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.