Show or Hide Jsf Richfaces modal panel from java bean - java

In JSF Richfaces, I need to show or hide modalpanel and GIF image from bean according to certain functions.
For example, after I have entered all values and click submit means, processing GIF image will be displayed. At the time of completion it gets hidden by using
onclick="#{rich:component('wait1')}.show()",
oncomplete="#{rich:component('wait1')}.hide()"
wait1 is an image file name I have used.
At the time of submitting, I have been validating the required fields.
If its empty, I want to hide the process image and show the modalpanel to get value from user.
How to hide the processing image and display the modal panel to get input from user, from java back bean?
Thanks in advance

I am suggesting you a solution. Create Modal panel with property "showWhenRendered" .
create modalpanel as
<rich:modalPanel id = "idd" autosized="true" width="500" height="50"
showWhenRendered = "#{bean.booloeanvalue}">
</rich:modalPanel>
In Bean, create boolean variable booloeanvalue. If booloeanvalue is true, automatically modalpanel is rendered and came to display.

Related

Java : ADF control value cannot be displyed on browser

binding adf control value to a bean property and run the jsf or jspx file on browser , then value can not be displayed
Here is a vidoe to explain the problem .. would you please have a key
for this . can not execute a lot of work because of this
https://www.facebook.com/mohamed.morsy.71697/videos/1449889981768665/
You will need to wrap the output text inside a group component ( maybe a panel group layout) and set it's partial trigger property with the button Id. This way the panel will listen button actions and is how the text will be updated when you click it.

Unable to close modal plugin on form submit

enter image description hereI am using bootstrap modal plugin for an inquiry form and am using "ng-submit" directive to save the details of the form, but when i click on the submit button the form gets submitted but the modal window does not gets closed. How can i close the modal when details have been submitted.
Please find the image for modal reference.
Thanks for help in advance
For a quick hack around, in your callBackUser() method in controller add the below piece of code,
$('#exampleModal').modal('hide');
Again not advisable to mix jQuery and Angular.
EDIT As per your comments, clear all your form data like this,
$scope.callback.firstName = "";
$scope.callback.useremail= ""
And so on.. for all the fields!

Wicket - confirmation on panel replace / remove to save unsaved data

i have a Wicket SPA web application where i want the user to confirm that on panel panel replace / remove he wants the data entered in the panel saved or not?
My app structur looks like this
<body>
<nav>
<a wicket:id="home">Home</a>
<a wicket:id="documents">Documents</a>
<a wicket:id="user">Users</a>
<a wicket:id="logout">Logout</a>
</nav>
<main wicket:id="panel"></main>
</body>
Now have a addDocumentPanel which is replaced into the wicket:id='panel' when the user clicks somewhere 'Add new Document'. In this panel the user has to fill several fields in a formular. Now when the user clicks on for example Home the addDocumentPanel is replaced by a homePanel. When this happens i want to ask the user if he wants to save unsaved data.
A good place to do it SOLID is the onRemove() function of the Panel but here i dont have any AjaxRequestTarget or other things to ask user either through JavaScript or wickets ModalWindow.
Any ideas how to do it?
Add a behavior to all of the navigation links that when clicked does a simple logic of checking if the form contains any dirty (unsaved) data. I guess this can be done on the client side without a server roundtrip and upon finding the form is dirty, you can show a window.alert dialog to the user.
A more heavy approach is to use your own AjaxLink subclass for the navigation links and in the onClick(AjaxRequestTarget target) handler do the ModalWindow magic. This however causes your links to contain non-bookmarkable urls. If it's not a concern (this is an internal application, not internet facing web site), then this may work as well.

Why does Wicket change the action attribute of a non-Wicket form tag?

In the base template for the pages of my Wicket application, there's a form I don't want Wicket to handle, like this:
<form id="myForm" action="">
<!-- input fields and submit button -->
</form>
I left the action attribute empty to always send it to the current page. On the application's main page, it works, but on other pages, Wicket adds a "../" in the action attribute, which seems to be meant well but is not what I want.
I'm using Wicket 1.4.17. How can I stop or change this behaviour?
The form is meant to enable the user to submit a short message as feedback to the site admin. It appears on every page and the input is collected from the PageParameters in the constructor of my pages' base class. If there is a more Wicket way to do this, I'll appreciate hints, but this should be a) stateless and b) very very simple.
I'd go the Wicket way and write a component for your feedback form which is then inserted into every page. As you have an (abstract) base class for all of your pages, you can simply add it there and it will appear on every page.
In your feedback form component, simply overwrite the onSubmit() method and send the message to the site admin.

JSF Datatable Edit Using Popup Panel

I am using JSF 1.1 with Icefaces 1.8.2
I have datatables which displays my database records.Currently when user wishes to insert or edit a record, edit button is clicked and edit form or creating form is either displayed at the bottom of datatable or in a separate page.
Ideally I would like to display in the edit form or create form just on top of datatable like a panel popup like in the following URL.
http://postimage.org/image/pglvdcck/
How can I do this using JSF or with icefaces?
Any insight into this is highly appreciable.
Thanks
You need to use ICEFaces component ice:panelPopup. Look it up in ICEFaces Demos - Layout panels - Popup panel.
Example - add this to your source (anywhere in the page really, even in a separate included file):
<ice:panelPopup modal="true" visible="#{myBean.editPopupVisible}">
<ice:form>
<ice:input...> some inputs...
... Save/Cancel button
</ice:form>
</ice:panelPopup>

Categories