First I check IF the queryString.Get("gender") isn't null.
Great, it isn't null and there's a price-filter applied so now it renders out the products in the first selectedItems with the gender & price.
Second In the else I say that if there's NO price filtering applied it should check AGAIN if the queryString.Get("gender") exist. If it does, it renders out all products but only those in the selected gender.
Default with NO selected gender if there ISN'T any queryString.Get("gender") applied it looks in bool isMale in the top of the code and takes it default True value. How do I prevent this? How do I make the first bool isMaletrue AND false?
Bool property show True & False items
Hey guys,
I'm trying to display products based on a
boolean.But by default I'd like it to display products in both
trueandfalse.TLDR
I declare my isMale to be
truewhich by default ONLY displays all products which istrue. This is not the point, I also wan'tfalseproducts.I tried writing it like this:
But that returns a error telling me the
Value cannot be null.when no gender is selected.Live example here
EXPLAINING THE CODE:
First I check
IFthequeryString.Get("gender")isn't null. Great, it isn't null and there's a price-filter applied so now it renders out the products in the firstselectedItemswith the gender & price.Second In the
elseI say that if there's NO price filtering applied it should check AGAIN if thequeryString.Get("gender")exist. If it does, it renders out all products but only those in the selected gender.Default with NO selected gender if there ISN'T any
queryString.Get("gender")applied it looks inbool isMalein the top of the code and takes it defaultTruevalue. How do I prevent this? How do I make the firstbool isMaletrueANDfalse?ALL CODE: Prettier code snippet here
I asked the same question on stack overflow. I think I wrote my question a lot better there: See the thread here
The solution to show both true and false products?
Credit's to Thomas Ayoub
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.