Archived community.zenoss.org | full text search
Skip navigation
2453 Views 7 Replies Latest reply: Jul 6, 2011 10:40 AM by srhuston RSS
srhuston Rank: White Belt 60 posts since
Apr 3, 2007
Currently Being Moderated

Jun 30, 2011 10:55 AM

Components UI not drawing

I've been working on a ZenPack which will handle reading policies from our Netscreen and displaying them as components on the device.  So far I've got the custom class created, the modeler plugin gathering the data, and everything applying fine.  The UI however is giving me trouble.

 

If I leave off the javascript resource, then a default component UI is drawn and that works fine - it just doesn't display things I want it to, but that at least shows I've got the data in the right places.  As soon as I add the resource, however, I get nothing at all.  Clicking on the component results in a blank screen (shot below) and a JS error which isn't very helpful.  As a side note, the next component I click on gives another JS error ("Cannot call method 'un' of Null") but the one after that works fine, and I can then click any other working component to get the display working properly.

 

Everything created for this zenpack is in http://www.astro.princeton.edu/~huston/zenoss including the pack itself, and HTML versions of the important files.  Please note it is still a work in progress, so there's no performance data collected or graphed yet (that's next once the UI is working), and things haven't been commented too much yet - including attribution to Jane Curry since many of the files were pulled directly from the BridgeMIB zenpack and edited as needed.

 

http://www.astro.princeton.edu/~huston/zenoss/zenoss-netscreen-policies.png

  • Chet Luther ZenossEmployee 1,302 posts since
    May 22, 2007
    Currently Being Moderated
    2. Jul 4, 2011 2:01 AM (in response to srhuston)
    Re: Components UI not drawing

    I grabbed the ZenPack and was able to reproduce the two errors you describe.

     

    The first issue is that your Info object doesn't include the "hasMonitor"

    attribute. You need to remove that from your list of fields

    in NetscreenPolicyPanel in policy.js. You're not using it anyway, so it

    shouldn't be a problem to remove it.

     

    The second issue is that the ComponentGridPanel can't figure out which field

    to use as the "autoExpandColumn" because the "name" field is used by

    default, but you didn't include that in the columns. I would recommend

    adding this line to the configuration for NetscreenPolicyPanel in policy.js.

    Specifically add the following line immediately beneath componentType:

    'NetscreenPolicy'

     

    autoExpandColumn: 'nsPlyName',

     

    While not related to any of the errors you're experiencing I noticed that

    you had commas trailing the last elements of dictionaries and arrays in

    policy.js. This is a common mistake to make when going between Python (which

    allows it) and Javascript (which doesn't.) Chrome and Firefox are tolerant

    of this, but other browsers are not. Specific examples of this include the

    comma after the last elements of the fields list and after the last element

    in each of your column definitions.

  • Chet Luther ZenossEmployee 1,302 posts since
    May 22, 2007
    Currently Being Moderated
    4. Jul 5, 2011 12:29 PM (in response to srhuston)
    Re: Components UI not drawing

    I didn't get that problem. I don't think it's related to any current code

    issues in your ZenPack. It's more likely related to some brokenish objects

    sitting around from earlier development. If you can delete the device you've

    been testing with and recreate it you might have better luck.

  • Almola300 Newbie 1 posts since
    Jul 5, 2011
    Currently Being Moderated
    6. Jul 6, 2011 12:51 AM (in response to srhuston)
    Re: Components UI not drawing

    Well, but I think there is problem in code editing

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points