UI Framework tutorial problem?

Hello all, I’ve been having a problem with the UI framework tutorials;

I’ve been using this tutorial, but when creating a fragment and its controller, I always got this error: org.openmrs.ui.framework.ViewException: *** In view ‘tested’, could not find property ‘encounters’.

The full error can be found here: https://pastebin.com/fH6Yx3B0

I thought that this error was originally caused because I’m a novice programmer, and was probably using the encountersearchcriteriabuilder (ESCB) wrong, so I switched to copying the code directly from the page to see if that caused the problem.

(As a sidenote, the page should probably be updated to include ESCB)

ESCB wasn’t the cause of the error, so I reinserted it into the code. Here is the code (slightly modified for ESCB)

HelloWorld Page: https://pastebin.com/rNjzJgZS

Fragment: https://pastebin.com/XLzwKE6Y

Fragment Controller: https://pastebin.com/hgiW7Syu

I’m not certain why this is happening, but to me it seems that the UI Framework Tutorial I’m using has errors.

It could also very easily be a problem on my end, since I’m very new to this.

Please help explain what is going on, thank you!

Edit: If anyone can also explain how FragmentModels work, that would be very helpful

Hi @bakedkaboose

Is your Fragment placed in src/main/webapp or somewhere else?

my fragment is in src/main/webapp/fragments

cc: @dkayiwa can please help out here.

@bakedkaboose can you upload your changes to github such that we take a look?

here it is: https://github.com/subifire5/openmrs-map-location

@dkayiwa I restarted my laptop and the module began to work. Thank you for your help

1 Like