252 views
in Embedded Wizard Studio by

Hey, 

I have a question related Outline. I have everything set up. I can have maximum total 25 views within the Outline. Now in my application it requires that total number of views changes run time. So i want to make unused views invisible. or disable it somehow. When i try to hide the extra views by using view.Visible=false; or even view.Embedded= false; the views does disappear from the prototype but there is some error :

Runtime Core::View.ChangeViewState (56:3) : Could not post again the signal '@0D671260.updateComponent'. This signal is currently in progress. The operation was ignored to avoid endless signal delivery. The current callstack is shown in the log messages below.

 

This is how i am implementing the UpdateViewState function. Trying to set the required Views and Trying to hide the rest. I have currently 25 inputView in the "array inputs" already embedded in the view. 

 

for ( i =0 ; i<Device.Get_NumberOfAvailableInputs() ; i++)
{
    inputs[i].StatusLED.String=Device.Get_InputStatus( i );
    inputs[i].InputName.String=Device.Get_InputName( i );
    
 }

for ( i =Device.Get_NumberOfAvailableInputs() ; i<25 ; i++)
{
    
      inputs[i].Visible=false;    
}

Thanks for your help in advance. 

Mariam Sohail

1 Answer

0 votes
by

Hello Mariam,

changing the visibility (or Embedded status) of a view controlled by an Outline Box triggers the UpdateViewState method invocation in the component containing the Outline Box. This UpdateViewState method thereupon recalculates the arrangement of all views controlled by the Outline Box.

Should the UpdateViewState method itself change the visibility (or Embedded status) of a view, then this will affect the layout of the Outline Box and thus the UpdateViewState method is invoked again. Theoretically this could lead to an endless situation. Embedded Wizard detects this and ignores the 'recursive' UpdateViewState invocation.

How to fix the problem:

- Change the visibility (Embedded state) of views controlled by an Outline Box always outside the UpdateViewState method.

- If it is inevitable to perform the state changes while processing the UpdateViewState method, implement following trick:

Step 1: In the component containing the Outline Box add a new slot method. Name it e.g. updateOutlineBoxViews.

Step 2: Remove the code responsible for changing the visibility (Embedded state) from the UpdateViewState method.

Step 3: Place this code (from step 2) in the new slot method (from step 1).

Step 4: In the UpdateViewState method add following statement to trigger the slot method execution:

postsignal updateOutlineBoxViews;

I hope it helps you further.

Best regards

Paul Banach

by
Worked like a charm :) Thanks for the detail explanation and a quick fix.

Thanks once again,

Regards,

Mariam

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...