how to refresh the JSF panelgrid whenever data gets updated in db without refreshing the whole page.is there anything can be configured? or i should created a backbean function ? can anyone guide me with a example?
Thanks in advance
Best way is to do so using Push Technology (You can trigger client behavior from the server)
For example PrimePush by Primefaces : PrimePush , but its not perfect yet , supposed to be in 3.5 version (I think)
So for now you can use Primefaces Poll , that way you will check every X seconds if the data was changed and if so, you could update a particular element using the update attribute
Related
So I am trying to set up a very simple gtag trigger and event to fire whenever a user clicks on a particular CSS element, but I just cannot get it working.
I am using click element - contains - dash_pts
When I check out the preview to investigate, I see the following for the trigger which is not firing. However, this doesn't make sense to me - the trigger filter variable DOES contain "dash_pts"... why is it not firing?
I must be doing something dumb somewhere but I'm at a loss, so any help would be greatly appreciated. Also please let me know if there are other details I can include that might help identify the issue. Thanks!
Try to add the dot too:
.dash_pts
and use matches CSS selector instead of contains.
whit gvnix-2.0.0.M1
the filter (automatic input generated) for search in table persist value after submit or close or reload page
I need clear this
Datatables componentes stores that values using the localStorage feature provided your browser.
Use the localStorage.clear() javascript function to clear the values of your component.
Read more about the localStorage here:
https://www.w3schools.com/html/html5_webstorage.asp
Hope it helps,
If you need DT, I recommend you the latest release of Spring Roo, the version RC1.
http://projects.spring.io/spring-roo/
Hope it helps.
DukeScript is quite clever in the way it handle changes to the Model so that code is hot-swapped at runtime, see for example here.
One thing it doesn't seem to handle at Runtime though is changes to the HTML layout. Given it runs in a WebView, a kind of a browse, it would nice just to be able to reload the page without having to stop and restart the app.
So, I've tried adding a "reload" button, but I can't find an easy way to do that after the initialization:
BrowserBuilder
.newBrowser()
.loadPage("pages/index.html")
.loadClass(Main.class).
invoke("onPageLoad", args).
showAndWait();
showAndWait() does what it's supposed to do, it doesn't return until the browser is closed. There doesn't seem any way to act on the underlying instance of a WebView and its thread.
Ha ha, simple but effective solution:
Reload
Note: Toni Epple says NetBeans would just detect the change, no reload needed.
I have a button on a webpage that has the following added programmatically to its “Attributes” property.
btnDeleteNode.Attributes.Add("onclick", "if(confirm('delete this node?')){}else{return false}");
This works fine but now I need to check to see if the user has selected a node in a tree before asking if they want to delete it. If a node isn’t selected I need to tell the user to select one. My question is, can I do this using the above method (I don’t know java script) or should I use a different approach ?
You can set a flag (using javascript) on selection of any node and check the flag here.
You can use a flag or use from Asp Validators
It is possible to add multiple reCAPTCHAS in one form? I tried doing so, even giving the multiple reCAPTCHAS different IDs, but when I load the page in the browser, only one of them is shown.
Is this by design? I need the two reCAPTCHAS because one is for Login, and the other one is for the Register form, which will be shown on the same page.
Thanks!
WT
Only one Cpatcha is supported in a page at any time. What you can do is use AJAX and lod captcha after the form is loaded.
This might of some help.
After a quick google search, it appears that it's not currently possible. One suggestion I saw was to pop up a modal recaptcha just as the user submits the form. ondemandcaptcha for Ruby.
I was initially lead by this thread to believe there is no simple answer, but after digging through the Recaptcha ajax library I can tell you this isn't true! TLDR, working jsfiddle: http://jsfiddle.net/Vanit/Qu6kn/
It's possible to overwrite the Recaptcha callbacks to do whatever you want with the challenge. You don't even need a proxy div because with the overwrites the DOM code won't execute. Call Recaptcha.reload() whenever you want to trigger the callbacks again.
function doSomething(challenge){
$(':input[name=recaptcha_challenge_field]').val(challenge);
$('img.recaptcha').attr('src', '//www.google.com/recaptcha/api/image?c='+challenge);
}
//Called on Recaptcha.reload()
Recaptcha.finish_reload = function(challenge,b,c){
doSomething(challenge);
}
//Called on page load
Recaptcha.challenge_callback = function(){
doSomething(RecaptchaState.challenge)
}
Recaptcha.create("YOUR_PUBLIC_KEY");
It is now possible to do this easily with explicit recaptcha creation. See my answer here:
How do I show multiple recaptchas on a single page?
It's not too difficult to load each Recaptcha only when needed using the Recaptcha AJAX API, see my post here:
How do I show multiple recaptchas on a single page?
the captcha has an img element #recaptcha_challenge_image element , so after you set the recaptcha in one div say "regCaptch",get that img src attr
,set your other captcha div html to the old one html and then set the #recaptcha_challenge_image src to the src you get , here is a working example
var reCaptcha_src = $('#recaptcha_challenge_image').attr('src');
$('#texo').html($('#regCaptch').html());
$('#recaptcha_challenge_image').attr('src',reCaptcha_src);