SithasoDaisy: Mashy Teaches TailwindCSS using b4x (with eBook)

Mashiane

Expert
Licensed User
Longtime User
Creating Cards - Part 7
  • pgbasiccards7

1697403026519.png


1697403109383.png


Creating Cards - Part 8
  • pgbasiccards8

1697403053410.png


1697403123494.png


Creating Cards - Part 9
  • pgbasiccards9


1697403481672.png


Creating Cards - Part 10
  • pgbasiccards10
1697404186027.png


Creating Cards - Part 11
  • pgbasiccards11


1697405179696.png
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
 

Mashiane

Expert
Licensed User
Longtime User

Mashiane

Expert
Licensed User
Longtime User
Cascading Selects on the Property Bag

B4X:
Private Sub BuildPage
dettagliorigo.AddPropertySelect("pizza", "pizza", "", "", True, "left", mapPIZZA) 'how to get the change?
dettagliorigo.AddPropertySelect("size", "Size", "", "Size", True, "", CreateMap()) ' NO size ELEMENT INTO MAP (combo element)
End Sub

When the pizza changes, feed the size select with different items.

One can do this on the show method and with a change event.

On the change event, one uses the _ChangePropertyBag event. This returns a map of all the property bag properties.

The methods to update / read a property bag value starts with SetProperty??? or GetProperty???

SetPropertySelectMap - will update a select based on key value pairs
SetPropertySelectMap1 - will update a select based on key value pairs with an options to add --Nothing Selected-- blank option.
SetPropertyItemsListSort - will update a select based on a list that will be sorted. The list will be made a map with the values of the list as key value pairs
SetPropertyItemsOptions / SetPropertySelectOptions - will update a select based on delimited string. The delimited string should be like a|b|c|d|e
SetPropertyItemsList - will update a select based on a list. The list will be made a map with values of the list as key value pairs


Clearing a property bag select.

SetPropertySelectClear(?)

Adding an item to a property bag select

SetPropertySelectAddItem(?, ?, ?)

Set a property bag value

SetPropertyValue(?, ?)

Get a property bag value

a = GetPropertyValue(?)

Solution

B4X:
dim spizza as string = pb.GetPropertyValue("pizza")
select case spizza
case "a"
    dim sizem as map = createmap("s":"Small", "m":"Medium")
    pb.SetPropertySelectMap("size", sizem)
case "b"
...
case "c"
...
end Select
'change the size to be medium
pb.SetPropertyValue("size", "m")
 
Top