New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreach breaks UDMuButton #947
Comments
@mylabonline can you give me some code example Sent from my P20 Pro using FastHub maybe i don't understand you i just check does 2 simple examples, and they work.
|
I used your example above in a new page and it did work but only when using a static page (-Content) when using a dynamic page the JSON output is displayed. Working with static page
Not working with Dynamic Page - But if you change the UDMUButton to a UDButton it works, and if you remove the foreach from the MuButton it also loads. Im running UD 2.5.2 btw :)
|
thanks for the examples will check that out So i take your example page and it working for me. |
@AlonGvili I found the issue - I pulled apart my entire UD and found that on the main dashboard.ps1 I am pulling in all the pages dynamically using this
But now if I take out that line of code and specify the pages individually, the MUButton works as expected in the above example, but all my dynamic content like $Session:Variables and loaders no longer work..... 👎
Looks like if I want to use the new Material Buttons I will need to redesign my entire UD |
try to change the & to . ,
we try very hard that if you using the new materialUI components you do not need to change your dashboard code. try the above code and let me know |
@AlonGvili When changing the & to a . makes no difference. Its something with the foreach loop - see below reproduce steps. I have also put this into an Azure Web app so you can see the output (broken)- https://udtestsiteazure252.azurewebsites.net/test/test I created a brand new UD with this test page as the only page and I'm getting the same results. dashboard.ps1
pages/test.ps1
But if I change the $Pages variable to this it works
or this
|
I will take a look at this tonight |
try this, I tested it and its working
|
@AlonGvili that did the trick! For educational purposes, why does this work and not the other? All I gather is the placement of the foreach...? thanks for all your help!! much appreciated. |
No problem, it was fun to fix, and for your question, I'm still thinking it a scope issue but I'm not 100% sure. i need to Dig deeper into this issue |
If it working for you , please close this issue. thanks. |
I am converting some of my UD buttons to Material buttons and found that for the OnClick events that have foreach loops I get the JSON output of the button on the page instead of the Material UI button.
But If I remove the foreach loop from the scriptblock the button loads fine.
The button and foreach work as expected when using New-UDButton.
Thanks!
The text was updated successfully, but these errors were encountered: