Hide a status of the navbar

Hi everyone,
I’m in a situation where i have a navbar that display the value of a status variable into the stock move view.
In this navbar a want to add some option to the selection, but i do not want to see them every time, but just if i am in a specific status.

For example my status are:

DRAFT -> PLANNED -> SHIPPED -> REALIZED -> CANCELED

If i am in status REALIZED i do not want to see CANCELED in the navbar as an available status after REALIZED, i would hide it until something put my stock move in status CANCELED, and only in this situation i want to see the CANCELED status in the navigation bar.

I noticed that the option of a selection have an “hidden” attribute, but is a static boolean and i do not think that i can bind it with the result of an expression…

Is there a way to obtain this result?

p.s.
The only (ugly) solution that i came up with is to create another variable with the same value of the status variable, bind it to a selection with an hidden field, and in the view create 2 navbar for the 2 variables, and hide one based on the status where i’m in.
The problem is that with this solution, i have to create a lot of useless variables, selections and navbar fields, for every status that i do not want to display in various occasions…

Yes , there is no direct way to hide the status on self value change. The solution you tried by creating another is the way todo it, actually you don’t needs to create new variable(field), you can repeat same variable and use ‘selection-in’ operator. Use showIf/hideIf to show hide the correct variable.

Unfortunatly i can’t set the selection-in with an action-attr, it would have been perfect!
But also in this way, your solution is way better then mine!!
Hoping that in future the action-attr will be more powerfull, thank you for the support!!

If this can help, support for changing selection-in attribute with action-attrs have been added in version 5.0.14.

Intresting… Thanks for the info!!

I looked ->here<- in the doc but the selection-in wasn’t written…

Thank you again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.