modal jsf view message - jsf

I have a jsf page where a modal opens. If in the modal when you click the ok button I leave the notes field empty an error message should appear.
everything works perfectly except that the modal is closed to print the error message.
This is the modal html code
enter image description here
This is tje javascript code
enter image description here
This is the java code
enter image description here
how can i print the error message leaving the modal open??

Related

Jade and Node.js : no action when click on submit on post method WHAT TO DO NOW

APP.js Snapshot
contact.jade snapshot
Snapshot of Page on Chrome
When I click on Submit button nothing happens control stays on same page.
I am realy stuck at this point, any help will be apprecaited.
Thank you
You need to ensure your button is inside the form tag by indenting it.
form
button
This translates to the HTML
<form>
<button></button>
</form>
which allows the button to know which form it should submit.
As your code stands now it is
<form></form>
<button></button>
For which the button does not have a parent form.
(You similarly need to this for your input's... otherwise they won't be sent to the endpoint.)

Customized error message on loading error of PDF in PDFTron

I am working with PDFTron - WebViewer,
Want to know how to handle PDF loading errors and showing customized message, in case of web-viewer
Regards
Bhupesh
The easiest way to do this right now is to modify the ErrorModal component in the UI and replace the error messages there. You'll need to string match the old message and replace it with your own.
The component is located at ui/src/components/ErrorModal/ErrorModal.js and you'll want to change the onError function.
This link describes more about how to edit and build the UI https://www.pdftron.com/documentation/web/guides/ui/advanced-customization
WebViewer has methods that let you display a modal Warning message box, which can be dismissed with its Confirm button or a click outside the dialog, or you can display a modal Error box which has no dismiss buttons and requires you to hit [F5] to refresh the page.
https://www.pdftron.com/api/web/UI.html#.showWarningMessage
https://www.pdftron.com/api/web/UI.html#.displayErrorMessage
Using these is more straightforward than editing the UI code from the pdftron github repo.

Why does my error message display quickly, then disappear right away

I have a save button on my xpage. I have field edits inside of the button. I did that because when I put the edit in the field validation, it runs when I open a new xpage. Either way though, I have an Error Message control on the form. When I click the save button, it flashes yellow then disappears. Why is this occurring? It's simple code:
if(getComponent("ExpAmt").getValue() == null) {
#WarningMessage("You must enter an Amount for this expense");
return false;
}
Partial refresh message box displays saying:
An error occurred while updating some of the page.
Unable to load http://localhost/DB.nsf/xpForm.xsp?$$ajaxid=view%3A_id1%3A_id3%3A_id4%3ApanelAll status: 0
There is a partial refresh in your ccApplicationLayout that runs onClientLoad. It was immediately refreshing the panel after the page was loaded which caused the flashing effect. Removing this solved the issue.

How can I scroll the browser window?

I am validating my form using an extension pages dialog box. I popup the dialog box with the error message when the user needs to correct input.
The dialog box has an OK button that closes the dialog box and sets focus to the field that needs to be corrected.
var ef = dojo.byId(errorField);
ef.focus();
This is working great except......
I have a group of buttons and a bunch of other components that float to the top of the form.
They are inside a panel with the following CSS.
.PNCToolBar2 {
position:fixed;
top:68px;
left:0px;
width:100%;
height:40px;
color:#fff;
background-color:#F2F2F2;
padding-top:6.0px;
padding-left:15.0px
}
What is happening is that if the failing field is scrolled up under the "button bar" then the browser scrolls a bit to try to get the button into focus but not enough. Depending on how the user had their browser scrolled on the form, all or part of the field in error might still be hidden by the button bar.
Is there a way to first know if the field is at the top of the browser window under the bar and then scoll a bit if it is to make the field appear? If so how?
Try:
dojo.window.scrollIntoView(ef);
If the DOM node represented by ef is not currently on the screen, Dojo will scroll just enough so that it will be.
More info on this method
using javascript you can use the scrollTo() method
http://www.w3schools.com/jsref/met_win_scrollto.asp

Sharepoint web-form submit Thanks Message issue

I have a web-part that includes a simple web form. After submitting the web form, the user sees a thank you or an error message.
It is in a codeBehind on Click_event:
lblMessage.Text = "Your Profile Details were updated successfully";
And code in the asxc file:
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
The problem is that the message doesn't disappear after the page is refreshed.
When you hit F5 this is refreshing the page to it's original state where the label doesn't have any text as you showed. The only way for your label to have that text is to go through the button click event.
Looks like you need to read some info on page life cycles and view
state:
http://rameshsps2010.blogspot.com/2011/06/sp-and-aspnet-page-life-cycle.html
http://nishantrana.wordpress.com/2009/02/14/understanding-web-part-life-cycle/
http://www.sharepointdotnet.com/2012/02/page-lifecycle-events-in-aspnet.html

Resources