You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by MissOvenMitts <ch...@gmail.com> on 2014/09/25 01:04:53 UTC

JQWicket - Modal/Dialog to an External URL, Or Something Like It?

Good afternoon everybody!

Can one point a dialog in JQWicket to an external URL (or just in Wicket in
general..)? E.g. can I have a link that opens a modal dialog showing
"https://www.google.com/" in it, or something like that?

I keep seeing this example over and over, but it's to some internal text
you've set up on the page rather than an external site.

Java:
        final DialogWebMarkupContainer dialog = new
DialogWebMarkupContainer(
                "dialog", new DialogOptions().modal(true).resizable(false));
        add(dialog);

        add(new AjaxLink<Void>("dialog.open1") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                dialog.open(target);
            }
        });

HTML:
TestExternal <br/>
<div wicket:id="dialog" title="Basic dialog">
	<p>This is the default dialog which is useful for displaying information.
The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

I'd appreciate any help greatly! Thanks!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/JQWicket-Modal-Dialog-to-an-External-URL-Or-Something-Like-It-tp4667681.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: JQWicket - Modal/Dialog to an External URL, Or Something Like It?

Posted by MissOvenMitts <ch...@gmail.com>.
Thanks so much! That worked like a charm. I hadn't thought of it at all
before!

HTML:
Open the dialog 
<div wicket:id="insideDialogBox">
<iframe wicket:id="insideDialogIFrame" style="border: 0px; " width="100%"
height="100%"></iframe>
</div>


JAVA:
        final DialogWebMarkupContainer insideDialogBox = new
DialogWebMarkupContainer(
                "insideDialogBox", new DialogOptions().modal(true)
                        .resizable(true).width(960).height(400));
        insideDialogBox.add(new AttributeModifier("title", new
Model<String>(
                (popupDialogTitle))));
        add(insideDialogBox);

        WebMarkupContainer insideDialogIFrame = new WebMarkupContainer(
                "insideDialogIFrame");
        insideDialogIFrame.add(new AttributeModifier("src", new
Model<String>(
                (url))));
        insideDialogBox.add(insideDialogIFrame);

        AjaxLink<Void> linkToOpenDialog = new
AjaxLink<Void>("linkToOpenDialog") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                insideDialogBox.open(target);
            }
        };
        add(linkToOpenDialog);

Again, thank you SO much for taking the time to help me out! It's greatly
appreciated.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/JQWicket-Modal-Dialog-to-an-External-URL-Or-Something-Like-It-tp4667681p4667699.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: JQWicket - Modal/Dialog to an External URL, Or Something Like It?

Posted by mscoon <ms...@gmail.com>.
Hi,

You could simply put an iframe inside your dialog div:

<div wicket:id="dialog" title="Basic dialog">
        <iframe src="..."/>
</div>

In case the url is dynamic you can attach the iframe to a wicket component
and use an attribute modifier to set the src attribute.

On Thu, Sep 25, 2014 at 2:04 AM, MissOvenMitts <
chantal.lucette.davis@gmail.com> wrote:

> Good afternoon everybody!
>
> Can one point a dialog in JQWicket to an external URL (or just in Wicket in
> general..)? E.g. can I have a link that opens a modal dialog showing
> "https://www.google.com/" in it, or something like that?
>
> I keep seeing this example over and over, but it's to some internal text
> you've set up on the page rather than an external site.
>
> Java:
>         final DialogWebMarkupContainer dialog = new
> DialogWebMarkupContainer(
>                 "dialog", new
> DialogOptions().modal(true).resizable(false));
>         add(dialog);
>
>         add(new AjaxLink<Void>("dialog.open1") {
>             @Override
>             public void onClick(AjaxRequestTarget target) {
>                 dialog.open(target);
>             }
>         });
>
> HTML:
> TestExternal <br/>
> <div wicket:id="dialog" title="Basic dialog">
>         <p>This is the default dialog which is useful for displaying
> information.
> The dialog window can be moved, resized and closed with the 'x' icon.</p>
> </div>
>
> I'd appreciate any help greatly! Thanks!
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/JQWicket-Modal-Dialog-to-an-External-URL-Or-Something-Like-It-tp4667681.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>