I have a problem with loading different image views in different steps.
I’m creating an app with 2 steps. In each step, I want on the left the user inputs, and on the right some image (pdf or jpg) that “describes” the step.
I’ve created 2 ImageViews
in the Controller:
class Controller(vkt.Controller):
parametrization = Parametrization
def __init__(self):
self.image_dir = Path(__file__).parent / "images"
@ImageView("Cartouche") # for step 1
def get_template_cartouche(self, params, **kwargs):
image_path = self.image_dir / "Cartouche_Bottes.jpg"
return ImageResult.from_path(image_path)
@ImageView("Géométrie") # for step 2
def get_image_geometrie(self, params, **kwargs):
image_path = self.image_dir / "Geometrie.jpg"
return ImageResult.from_path(image_path)
which are called in the Parametrization class:
# Step 1
cartouche = Step("Cartouche", views="get_template_cartouche")
# do stuff
# Step 2
geom = Step("Données du Projet", views="get_image_geometrie")
However when starting the app, in the 2nd step the image loads forever and never actually appears.
It can’t be a problem with the ImageView
definitions: if I remove step 1, step 2 loads properly. I also tried with different combinations of views
arguments:
views="get_template_cartouche" # image 1
views="get_image_geometrie" # image 2
views=["get_template_cartouche", "get_image_geometrie"] # images 1+2
Step 1 image(s) |
Step 2 image(s) |
Result |
---|---|---|
1 | 1 | ![]() |
2 | 2 | ![]() |
1+2 | 1 | ![]() |
1+2 | 2 | ![]() |
1 | 2 | ![]() |
2 | 1 | ![]() |
Does anyone have an idea of why that is?
Thank you,
Remi