I'm using PF 5.1.5 and made some composite components with dialogs which all should be modal and appended to body (so the dialog is really modal). This works when I use dialogs in plain pages, but not if I use them in composite components. I think because the #(body) tag references to the composite component itself? Anyone got a solution?
Related
I am using antd tabs and I have 2 tabs on my page. Both load at the same time but I want only the first tab to load on mount and onchange of tab the other tab should be rendered. I am unable to achieve this functionality.
Is there a way to resolve this issue?
According to the documentation, the default for the forceRender prop on the Tabs.TabPane component in your code should be false.
The prop is used to: Forced render of content in tabs, not lazy render after clicking on tabs:
https://ant.design/components/tabs/
On what basis are you assessing that the content is not lazy rendered? Perhaps you can share some code.
Beyond this, you may want to handle more complex rendering within your component tabs using state.
I hope this helps.
Prerequisites:
- JSF 2.1
- Primefaces 5.2
- Glassfish 3.1
Story:
I need my user to confirm FacesMessages of the errortype before he is allowed to keep working. For this i need some sort of modal message or dialog.
Question:
Is there some way of makeing a p:messages or a p:growl modal and confirmable?
What i've tried so far:
I've created a modal dialog which contains a p:messages component and a button to confirm/close the dialog again. The problematic with this solution is, that i have a lot of cases errormessages are shown and i have to open the dialog for each one individually. Besides that some errormessages are created by validators, some by the "required"-flag and some directly in the code. This makes it even harder to cover all cases. Id prefer to put the function into the component which displays the message (growl or messages).
In a <p:dialog> there is an attribute called closeOnEscape="true" which allow to close the dialog by pressing the esc key.
I didn't find any similar thing in Dialog FrameWork attributes, according to primefaces documentation.
Is there a way to achieve this using DF ?
Thanks for help.
Look at the Primefaces hotkey component: http://www.primefaces.org/showcase/ui/misc/hotkey.xhtml
This component is a very convenient and helpful way to auto generate javascript which listens for "onkeyup" events.
<p:hotkey bind="esc" handler="PF('myDialogName').hide();" />
I'd like to add support to removing the widgets from p:dashboard via dragging the panel out of dashboard, such as in WordPress admin panel.
I've found out the examples of dragging the widgets between 2 dashboards, but in my case I need to have callback when the element is dragged out of dashboard, no matter where. The widget would be than removed. However, I couldn't find any example for such behaviour.
What components/tools to use to implement such functionality? I'm using PrimeFaces 3.4.
Use draggable component with dashboard keyword;
<p:draggable for="widget" dashboard=":dbForm:dashboard"/>
And check this solutions on forum page of primefaces: Dashboard Drag and Drop
Hope it'll help you.
Good Luck!
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has
<p:layout>
I use a lot of dialog in my application and before the newest version of primefaces came out there was no way to display a dialog with a modal on top of the layout without putting the dialogs outside of the tags.
So I did just that. The issue I am having now is I am noticing that constructors and postcontructs are being called when my application is loaded. This is because the view with the layout is being loaded and therefore all my dialogs are being loaded.
I don't want these constructors being called until I am actually dealing with the appropriate views in my application.
I have been testing the appendToBody attribute on the
<p:dialog>
tag but it seems really buggy. Everything works fine on the initial rendering of a view. I can open a dialog close it etc and it works fine. If I navigate away to another view and then come back to the initial view and open the dialog, everything is running off the page. The dialog window is in the correct place but the content is not.
My question is 1. Is there a way I can have the dialog windows outside of my layout as a child of the
<h:body>
without having all the managed bean constructors associated with them initiated when the application loads?
Or does anyone know how to fix the alignment issue when using the appendToBody tag? Thanks.
When using layout and dialog, I usually place my dialogs outside of the layout as a direct child of the body element. I have a special ui:insert part in my page template for this.
appendToBody was added to make this easier, if it doesn't work well for you, give this approach a try. I know modal dialogs and layout can work this way.
without having all the managed bean constructors associated with them
initiated when the application loads
Maybe the managedbean gets loaded when your dialog is rendered.
Try rendering the dialog only after the button click, perhaps byputting rendered="#{mybean.flagLoadMyDialog}" on the dialog, and set the flagLoadMyDialog when the button is clicked using ajax.
Also remember to ajax-update the dialog after the button click.