Schedule dialog button doesn't call actionlistener after migration from PF8 to PF11 - primefaces

I have a problem after migrating from primefaces 8 to primefaces 11.
The submit button for adding events in scheduler doesn't call the actionListener anymore.
With primefaces 8, everything went well.
I tried many things, including: putting the dialog and scheduler in the same form, removing client validation, adding another commandbutton with another actionlistener method but nothing worked.
Do you have any ideas?

Related

Closing Tooltip when new one is opened

I am looking for a possibilty to make a tooltip close automatically when a new one is opened. I am using Primefaces 6.1.
<p:tooltip for="clientName" showEffect="clip" hideEvent="dblclick"
position="bottom">
At the moment it works like this: Mouseover on a label from my datatable and the tooltip opens. When I double click on the label which opened it, the tooltip disappears. But the problem is that I can accidently open like 30 tooltips at the time, just by moving over several datatable entrys.
Short: I only want a single tooltip to be opened at the time. But I dont want the tooltip to close by an MouseLeave event.
Im happy for any suggestions. Thanks.
Use the onShow or onBeforeShow attribute of the tooltip which is according to the PrimeFaces documentation (page 542 on in the 6.1 docs)
onShow
Client side callback to execute after tooltip is shown.
beforeShow
Client side callback to execute before tooltip is shown.
Returning false will prevent display.
In that you can call any javascript (jquery) to hide all other tooltips.
But why not use a showDelay of e.g. 500 ms instead of the defaul 150?

Primefaces make messages or growl modal/confirmable?

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).

Primefaces - <p:spinner> up and down buttons

I am using Primefaces 3.4.1.
Whenever <p:spinner>'s up or down buttons are pressed, I need to know whether up button or down button is pressed.
How can I get it from Java side? Is there any event activated?
Thanks.

Swing component and jdk version issue

I have a combo box. After selecting an item in combo box new JDialog opens.
When i use JDK 1.6_06, I am able
to click on buttons in JDialog
properly.
When i use JDK 1.6_24,
then i need to click anywhere in
JDialog first. Then only clicking on
button works. Firstly i thought this
is some issue with the focus. But
component works fine with JDK
1.6_06. But its a issue only with JDK 1.6_24.
I tried to google it. But didnt find any answer. Does anybody have any idea?
I don't know about the java versions - but putting dialog.setVisible(true) in SwingUtilities#invokeLater solved this issue some time back for me. YMMV.
#All: Aplogize for late reply. I was trying out different scenarios. And i have found that issue is with the threading. It seems that combo box is not yet finished its work, and jdialog is opened. And after that combo box tries to finish its work, so the focus is lost to the parent window. I tried opening dialog in thread:
new Thread() {
public void run() {
// open dialog here
}
}.start();
And it works fine. Now i am planning to open dialog using SwingWorker:
SwingWorker worker = new SwingWorker() {
#Override
protected Object doInBackground() throws Exception {
// TODO Auto-generated method stub
// open dialog here
return null;
}
};
This is also working. Hope this is the right way. Please let me know, if I am doing a right thing.

Primefaces - using dialogs and layouts

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.