Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Weird behavior using JS to make buttons visible

Avatar

Level 3

I have several dynamic forms that I have created in Designer ES. On all of them I have several buttons that are set to "invisible". I wrote some JavaScript that (if the data in a certain field = true) loops through all of the elements in the form and sets all buttons to visible. So here's the relevant part of the JS:

if (Ultra_Form.Page1.Hidden_Fields.tbd4.rawValue == "true") //if true, then show the buttons
{
    switch (oNode.ui.oneOfChild.className)
    {
        case "button":
            oNode.presence = "visible";
}

I implemented this on a dynamic form and it worked (and still works) perfectly. I have done several more dynamic forms since then using this same procedure (same buttons and JS), but on these forms the buttons will not show up no matter what. While trying to figure the problem out, I did an app.alert on the button presence right before and right after the oNode.presence = "visible" line of code. Every time the alerts say that the button is "invisible" right before I set the button to visible and "visible" right after. But despite the JS saying that the buttons are now visible, the buttons never show up on the form. I checked the "arrangement" of the buttons and they are the foremost element.

Any ideas anyone? This is extremely frustrating.

- Nate D

2 Replies

Avatar

Level 10

Can you able to send the from to LiveCycle9@gmail.com so I can have a look at it..

Thanks

Srini

Avatar

Level 3

Looks like I figured this out. Apparently the form that wasn't working was saved as static (I thought it was saved as dynamic). I resaved and that seems to work.