Why do some blocks not execute... or did i miss a thing

At the bottom of this block there s a [ListView.Elements = ] statement. During run time it does fire, regardless of where I put it... If I right click and tap Do it, then it works... but not by itself, am I missing something? Is it about the list? or the Listview?

C

What's in global Dx_list?

Can't see a reason for it, Charley.

Simplify a bit, see if that works (these blocks are draggable)

I have simplified it...lol
ABG, It's a list that counts components of a menu item, chicken pot roast eg, chicken, potatoes, carrots etc, and compares them to a defined dietary requirements list, and calculates the percentage of 'compliant' components.
I have used the list view with details etc many times, so the fact that it isn't executing is confusing.
I have placed it in all parts of the event structure, to no avail. I have noticed that sometime AI2 will hiccup from time to time, I am wondering if this one of those times, ghost in the machine, so to speak. :ghost:

I know somebody will ask...

image


Show us the Do It on that block get_list_data.

I have since moved the offending block to a long click on the same button. I tried it in a procedure to no avail, I surrounded it with Alerts, but it never fired. It fires with the long click

What the blocks do is take each component of the menu items, chicken and rice eg, extracts the components, chicken, rice, veggies, salad... etc, and compares each item with a pre-existing diet plan, a list of acceptable food items on a given diet, for example, a mediterranean diet, a diabetic diet, a celiac diet etc (User outs in diet information) and reports back the percentage of acceptable components. For example, the chicken and rice would report back 75% on a vegetarian diet.
It seemed pretty straight forward until I wanted to display the results... :face_with_raised_eyebrow:

You might add a block to refresh that ListView after you have loaded its Elements list.

Also, we have not seen the contents of global currently_open_diet, to verify it is a list of ingredients found in some recipes.

I don't see why your ListView shouldn't refresh, as long as you add that refresh block I mentioned.

I went back and put the block back in at the bottom, and then added the refresh block, nothing. It just does not go. If I long click, and get the information to show, it works, but if I single click back on the same button, it returns to the former list
As it is currently a private app for my family, I am not overly concerned, but if i ever had a publicly available version, it would be nice to get the bottom of this issue.

You never showed us the Long Click event.

I've posted the app in the gallery

Dx_list was made globally after the first time I saw it didn't display ion the Listview

I am guessing you never ran my test blocks in your app?

doing it now, Tim, I've been really busy at work, not had a chance to do much here.
I'll let you know what happens.

Nothing happens, until I longclick on the button, then I see all the random integers set up is the example.
I simplified it further by remove the CreateElement block and adding just random integers to the list, and still nothing until I long click, then get a list of random integers

Try the same in a new aia project

I just checked another Event, when any Button.Click, and a procedure superseding the Dx button is called... the procedures were resubmitted outside of the pertinent IF statement.

I shall go sit in the corner with the required dunce cap on and revisit procedural order 101
:face_with_symbols_over_mouth:

Thanks Tim, ABG and all else that helped bring my thinking into order. Goes to show that no matter how thorough you can be, there is always a tick waiting to trip you up somewhere on the road to successful execution.


the last two procedures, [create_and_view_menu_data] and [recreate_components] accidentally got left outside the IF statement. No errors caught, no mishaps, just a ghost in the machine. Now they are firmly nestled within their appropriate positions, things work as they should.

Lesson learned... :zipper_mouth_face:

I thought there might have been something, somewhere, well done for finding it.