cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
724
Views
5
Helpful
2
Replies

Force leafrefed leaf to prepopulate in NSO web gui

u.avsec
Spotlight
Spotlight

Hi all.

Let's say I have something like this:

      leaf global-bw {
        type string;
      }

      list cpe {
        key 'device';

        leaf device {
          type leafref {
            path "/ncs:devices/ncs:device/ncs:name";
          }
        }

        leaf bw {
           type leafref {
                path "../../global-bw";
          }
          mandatory true;
        }

Talking about native NSO web GUI; is there any way possible to force global-bw number to be displayed upfront in the bw box  when I'm filling out cpe list entry? Currently manual selection from a drop-down has to be done.

 

If there is a way, subquestion to this would be if a custom typedef of either leafref or string can be defaulted into prepopulating global-bw.

To me it seems that it is not possible on either account, but I would prefer to be proven wrong.

 

Thanks.

1 Accepted Solution

Accepted Solutions

u.avsec
Spotlight
Spotlight

Found the answer to my case:

        leaf bw {
          type string; 
          tailf:default-ref '../../global-bw';
        }

only slight annoyance is that global-bw value is automatically populated with () like so:

 

Capture.JPG

 It is just cosmetics though.

View solution in original post

2 Replies 2

u.avsec
Spotlight
Spotlight

Found the answer to my case:

        leaf bw {
          type string; 
          tailf:default-ref '../../global-bw';
        }

only slight annoyance is that global-bw value is automatically populated with () like so:

 

Capture.JPG

 It is just cosmetics though.

So that is how all default values are presented in the UI - it is the same if you use the default statement as well. It indicates that it is there implicitly but not explicitly.