Java ZK+Javascript JQuery Galleria IO FullScreenMode - java

i am using Galleria plugin for JavaScript i need show the image in full Screen modei have checked the APIand have a method.
.enterFullscreen( [callback] )
returns Galleria
This will set the gallery in fullscreen mode. It will temporary manipulate some document styles and blow up the gallery to cover the browser screen. Note that it will only fill the browser window, not the client screen (javascript can’t do that).
API
i am using ZK Framework responding to a button click using this code.
public void imageZoomer()
{
Clients.evalJavaScript("$('#galleria').data('galleria').enterFullscreen(function() {alert('full screen mode');})");
}
but nothing happens i have also try using
Clients.evalJavaScript("imageZoomer()");
and a javascript function like this
function imageZoomer()
{
alert('before');
$('#galleria').data('galleria').enterFullscreen(function(){alert('full screen mode');})
alert('after');
}
the above function is called but nothing happens but if a try this code on firebug console
$('#galleria').data('galleria').enterFullscreen(function(){alert('full screen mode');})
it works smoothly what i am doing wrong thanks a lot.

finally i could solved my issue using a xmhtml button in ZK and responding onClick event using JQuery i couldn't solve my issue using ZK button here is my code i hope i really helps somebody.
<div xmlns:h="xhtml">
<h:button onclick="$('#galleria').data('galleria').toggleFullscreen();">Full Screen. </h:button>
</div>
best regards..

Related

Vaadin: How to navigate without reloading the page?

I have to navigate between my components and I use a custom button like this:
button.addClickListener(click -> {
UI.getCurrent().navigate(ClassToNavigate.class);
});
The url does refresh in the search bar but it only shows a black page, I've to hit F5 to see the component in my parent layout.
My only fix is to add:
UI.getCurrent().getPage().reload();
...which reloads the page after navigating to the URL, and that breaks the UX in my opinion, however... when using a BeforeEnterEvent on a class and using the method:
forwardTo(ClassToNavigate.class);
redirects perfectly... although I can't have BeforeEnterEvent for every menu button I have, I can't see why forwardTo() works perfectly and navigate() doesn't.
Is there a way to navigate without having to reload the page? And without using RouterLink which I can't because I'm already using a custom component.
Thanks in advance!

How to get the data from one browser window to other window in gwt?

First of all i would like to say that i have gone through all the posts which are similar to my query but i have some different requirement.
In our project we are using gwt to develop the modules, in one of our module, we have "Edit" button which opens a new browser window which includes 'CKEditor'.
We are modifying the data in ckeditor comes(by url) from gwt widget .
The Window opens by using following code snippet(JSNI) in my gwt widget:
private static native BodyElement getBodyElement(String url) /*-{
var win = window.open("url", "win", "width=940,height=400,status=1,resizeable=1,scrollbars=1"); // a window object
return win.document.body;
}-*/;
The newly opened window have the html form which is with ckeditor.
So here i am closing new window once my form has been submitted but i want the edited text to be displayed in old window.
How can i achieve this requirement?
If you can use HTML5, it should be quite easy. Use Messaging.
Take a look here:
Cross-document messaging
With the reference of the newly opened window, yu can establish a communication between both windows.

To close webengage or clickdesk poup using selenium webdriver

I got a webengage or clickdesk alert popup but that is intermittent, so I can't check everytime or wait for it to load, everytime I enter a new webpage because that would make my test case run very slow. Is there any workaround for it ( may be blocking it).
For WebEngage, all you got to do is call the respective clear() methods for the products being used on the site (to get rid of the corresponding UI components), as underneath:
webengage.feedback.clear();
webengage.notification.clear();
webengage.survey.clear();
However, this would only work when WebEngage has loaded on the page. If you'd like to completely disable loading of WebEngage products, insert this code in head tag of the page you are testing:
var window._weq = {};
_weq['webengage.defaultRender'] = false;
You can do a lot more cool stuff like the above using our JavaScript API: http://docs.webengage.com/api/js-api-v-4.0.html
Avlesh | CEO, WebEngage
If you are using ClickDesk on your website and would like to delete the Proactive rules which pop up the chat window randomly, then these can be deleted or edited to change the frequency from this link on your ClickDesk Dashboard - https://my.clickdesk.com/#proactive.
In case, you do not want the chat widget to show up at all until clicked on a text link or an image link then, you can add our Custom image link or text link code on your website, this would enable the chat widget only when clicked on it. You can find this link here - https://my.clickdesk.com/#departments/default.
If you have further questions or concerns with regards to ClickDesk, you can visit our website www.clickdesk.com and chat with one of our agents online.
Thanks
Mike Evans
ClickDesk Corporation

How to show the content of a log file in new window when we click on a link in spring mvc

My main goal: When i click the link, a new browser window should be opened and displays the content of entire log file. And the window should not have an address bar and navigation buttons (Back, Forward).
Is there any approach to do this in Spring-MVC project?
Here is what i am doing now:
When i click the link, the controller will be called with a parameter logName.
Now the controller have access to get any kind of details of the log file like content, path, etc... I am setting all these details to an object and sending back to JSP.
Here i am not sure how to open a new window and display the content of the log file in that window.
Please suggest me an approach on this!!
It would be very helpful for me if you can share me with some examples...
Spring or JSP have nothing to do with it, the only way to force user's browser to open a link in a new tab is to use client-side Javascript. window.open() allows configuring the popup to hide certain interface elements (see all options in the documentation)
Your code would look something like:
<input type="button" value="Show Log" onclick="showLog(logName)">
function showLog(logName) {
var url = "/path-to-your-controller.html?logName=" + logName;
window.open(url, "LogPage", "toolbar=no,location=no,menubar=no");
}
However, I don't think using a customised browser popup is a good solution; it's been disappearing from the web for a reason. It would be more elegant to fetch raw data using AJAX and display it in a JS popup: it wouldn't interfere with user's page navigation (you tagged the question with jQuery, you could use jQuery UI for that).
What is more, I wouldn't be surprised if window.open wasn't supported by all browsers in the same way† - something to keep in mind if you're targeting a wider audience.
† seems that Chrome ignores location=no, for instance

Reload JSP page after an Excel file has been downloaded

I have a link in my JSP page, where the user uses it for downloading an Excel File. When the user clicks on the link, the controller goes to a java script function where I display a moving image(like progress bar) and then it will be redirected to Action Classes. After executing the java code, a pop up window appears asking the user to open/save the file.
As the page is not getting refreshed, the progress bar keeps on running and I am not able to hide it.
Does anyone have an idea how to resolve this using Javascript as I dont have much idea on Jquery.
Thanks in advance.
function generateRnDFootPrint(){
progressBar.showBar(); // progress bar appears
location.href='<%= contextPath %>/saveMTP.do?method=getRnDFootPrintReport&orgCode=<%=orgCode%>&orgId=<%=orgId%>';
}
Try the following....i just add a line at the end of the function:
function generateRnDFootPrint(){
progressBar.showBar(); // progress bar appears
location.href='<%= contextPath %>/saveMTP.do?method=getRnDFootPrintReport&orgCode=<%=orgCode%>&orgId=<%=orgId%>';
setTimeout(function(){progressBar.hideBar();},2000);
}
I hope it does the trick.....in the case it does not, then you should have a function that hide the bar and call it, like in the commented line ;)
Saludos.
What you can do is give an id to the download link
<a id="download-link" href="your_value_here">Download Link</a>
In JavaScript
var link=document.getElementById("download-link");
link.onclick=function(){
progressbar.hide();
}
And if you want jQuery version
$("#download-link").click(function(){
progressbar.hide();
});

Categories

Resources