How to get Popup window in struts2 without using javascript code - struts2

How to get an pop up window in a struts2 program , I am not using any JavaScript code. Is it possible to get a pop up window using Struts2 code

If you want to display a popup box then you could use javascript to do it. Also its WAY EASIER to do it using javascript.
It would be something like this -
alert("This text will be displayed in the alert box!");
As with struts2 , you could use javascript by adding the javascript inside the <script> tag.
Hope this helps!
Cheers :)

Related

What's wrong with jquery document ready function working with jquery mobile?

Above is just some test code for me to learn how to program with backbone and jqm.
Initially, I think it's always better to start running my code when the document is ready, so I wrap backbone view creation logic in the document ready function: $(function(){ }). But the page is just not showing like a mobile app.
So I tried and tried, and I found when I remove the document ready function part, the page will be displayed correctly, exactly like a mobile app.
What's wrong with document ready function here?
Please help.
I guess that you are applying some Backbone manipulation for elements like #homepage which is trying to manipulate by JQM too. That's why you don't have any problem if you remove the document ready function. You can do this Backbone code inside JQM page event functions.
JQM page events. So the other code works after the pages are rendered by JQM.

In Dart, is there an equivalent MessageBox functionality as in C# using WinForms

I know there is a MessageBox class in the isolate library but that is not what I need. I am looking for the pop-up style messagebox functionality found in desktop windows apps (i.e. WinForm apps) where you ask a simple confirmation question and the user can click a yes or no button in response. Is there an equivalent in Dart, if not can anyone suggest some alternatives?
You can display a message box easily with :
window.alert('test');
don't forget this in the top of your file:
import 'dart:html';
This will behave like the alert function in JavaScript. If you want to add buttons (other then the default "ok" button) to your message window, then you will need to make a custom window, which would not be very hard. You create an element which you add to your document body. This element should be absolute positionned. Adding an overlay in front of your document will be useful to prevent user clicks on the page.
this is in javascript, but it is useful to know what to do with dom and css :
http://raventools.com/blog/create-a-modal-dialog-using-css-and-javascript/

Hightlighting a particular text dynamically on the screen using smartGwt

I Have an implemented a search screen , like hows it done in the windows but im not able to highlight the text for which search was made.
i tried to use window.find () but its not available in smartgwt
If I were with such request I would probably go for a jsni function and some sort of code like this one..... or using javaScript text higlighting jQuery plugin. I don't think there is neither in gwt or smartgwt such a feature...

jQueryUI dialog (modal form) demo code not working

I'm extremely new to jQuery, although not new to javascript in general. I'm trying to use the UI dialog widget. I've downloaded a .min.js file containing the dialog widget and a few others, and already have the core .min.js.
I copied the demo code directly from the UI doc for modal form and pasted it into a plain html file. Clicking the button does not work; nothing happens.
Can anyone tell me if there's something else I need to do to use the demo code? And how do I go about debugging this jQuery stuff in Chrome? (I do have FireBug Lite installed; just haven't quite figured out how to use it for jquery.)
I can post pieces of code if anyone can tell me something specific to look for, but the entire html file, simple as it is, is over 100 lines. Here's a link to my sample.
$( "#create-user" ).button is not a function
it is supposed to be
$( "#create-user" ).click(function(){.....
Judging from the .button() call, you forgot to include a reference to jQuery UI.

How can I do a messagebox in asp.net mvc?

I've been trying to do a messagebox in a controller in asp.net mvc, but every time I type MessageBox or MsgBox it doesn't give me the option to import a namespace...
What can I use that would be similar to a MessageBox?
the MessageBox functionality is provided by the System.Windows library which is not available in the ASP.NET MVC context, since your site is running within a browser.
Instead, you should use a javascript library to show a message box.
You could use the following in order to display a message box
alert('Hi there')
Message box can be shown using Javascript, you can write your own HtmlHelper for this or have a partial which takes the message as input and diplays it, in this way you can reuse your partial
you could render out a script tag as a actionresult that has
alert('{0}'); where the placeholder is you message
I suggest using the jQuery UI dialog. It's incredibly easy to use, very powerful, and really easy to style.

Resources