Modal launch button with actionlistener - jsf

I've been trying to use a f:setPropertyActionListener on a Bootstrap modal launch button but it doesn't work at all. Tags a and button don't support it so I don't know what to do now.
I need to set an id of an item in a bean I have when I push the modal launch button, so I can then confirm delete that item using the modal.
I've searched here and on other sites and I've found a lot of solutions to my specific problem using Javascript but I have no idea about that :/
Thanks in advance.

Related

Primefaces Dialog Framework and Growl messages

I'm using Primefaces 6.1 Dialog Framework. I'm wondering if there's a way to use a general growl for nested dialogs.
I could use a growl in one of the child dialogs but it displays the messages inside the boundaries of the iframe and not on the top-right corner of the window.
Here's an example:
main.xhtml > dialog1.xhtml > dialog2.xhtml
So, I'm in main, then I open dialog1 to view some data and then dialog2, which is kind of a tiny CRUD page.
When there's an error in this last page, I want to display the error message on the top-right corner of the WINDOW (not the iframe), just like it would do in the main page.
I don't know if it's a bug/issue or I'm just dumb, but I'm running out of ideas. Is there a way to accomplish this?
Thanks in advance!
(I can't provide the code now, but if it's really neccesary i'd edit this a put a simple example).

Chrome Extension, trigger click on the icon

I searched on Google and StackOverflow, and I was not able to find a solution to my problem (to my greatest surprise).
I'm looking to display the popup, exactly like when the user click on the icon of my extension, but via javascript.
The idea behind it is simple : On a specific page, I inject a button and add an event listener on it ("click"). When the user click on that button, I'd like to display the tooltip, simple as that :)
... but I can not find anything related to it. Any idea ?
Thank you in advance.
Opening the popup is impossible without user interaction. For good reason too, remember that no one likes popups that open themselves. What you can do is inject your popup onto the site the user is at, through a content script.
https://developer.chrome.com/extensions/content_scripts
As per your description,
On a specific page, I inject a button and add an event listener on it ("click"). When the user click on that button, I'd like to display the tooltip, simple as that :)
I think what you need is just chrome.pageAction, it's similar to browserAction, while represents actions that can be taken on the current page, but aren't applicable to all pages.

How can I open a dialog when the page is opened

In one of our page we have a search button that open a search dialog so that the users can search and import some data from a remote system.
Now got I new requirement that this same dialog must be showed every time the page is opened - but only when the page will be used to create a new registry, in the update mode it should be showed only if the user click the button.
I've already tried some things, I can call the dialog by MB using Primefaces engine as below:
RequestContext.getCurrentInstance().execute("dialogArmaBos.show()")
This command Works great for the button case, but I can get it working when the page opens. If I try to use in the PostConstruct nothing happens.
I tried also <f:event type="preRenderView" ... with <f:metadata ... but nothing changes too.
Is there some way to make it?
According to the fabulous PrimeFaces documentation There is a visible attribute. Quote from the docs:
visible false Boolean When enabled, dialog is visible by default.
So simply use an EL in that attribute to have it show on pageload
<p:dialog visible="#{myBean.createMode}"... >
and have a boolean field in that bean that returns true if in creation mode.
For the rest you can show/hide it with the client-side api if needed

Pagination inside bootstrap modal window

I am using the bootstrap modal window as data picker. But when having more results to pick displaying pagination. I want to load the next pages inside the same modal window when clicking on the pagination.
Can I do it in generic way like when any link clicked inside a modal window to load the content inside the same modal window, or do I need to implement this for each link separately using AJAX feature?
Please refer this three links: There will help you for sure.
Reference-1
Reference-2
Reference-3
You could change $('modal-body').html() on click.
The modal shows/hide without changing or reloading content. So you will have to restore the original content on hide maybe.
Use $('#myModal').on('hidden.bs.modal', function () {} to restore your original content.

How to create a popup for edit button in JSF page in jDeveloper 12c?

How to create a popup for edit button in JSF page in Oracle jDeveloper 12c?
There is nothing special about JDeveloper 12c when it comes to working with popups. You can see a sample here that automatically migrates to 12c:
http://andrejusb.blogspot.co.uk/2009/11/crud-operations-in-oracle-adf-11g-table.html
Drag and drop popup onto the form from component palette. Design as needed. Make note of popup ID. D&D Operation (from component palette) > Show Popup Behavior onto button. Set popup id to id of previously created popup. Select method to launch, like action. Google is your friend here. Search "ADF Popup" - lots of hits, like this. Remember to upvote those of us who take time to help you here.

Resources