Dynamically create b:window object(s)

Hi,

I'd like to create some b:window objects dynamically based on user events (eg. mouse clicks), is there a way to do that?

I know that I can create an empty window and render its contents later, but here I need to create an unknown amount of windows (totally up to the user, ie. it opens a window when user clicks a link, opens another one when s/he clicks on another link, etc.). Each window will contain its own content.

Another question is when I create a b:window object inside a b:window, it only appears inside the parent window, which means it can not be moved out of it. Is there a way to go around it?

Thank you in advance.

-rahx

Dynamically create b:window object(s)

One last question:

How can I assign some value to a (global) variable when a user clicks a link so I can access it from somewhere else? Does s:variable work inside , if not, what's the workaround?

Thank you.

-rahx

Dynamically create b:window object(s)

Hi,

Use a global variable and the assign action within your event handler:

        <s:variable b:scope="global" b:name="clicked" b:select="'no'"/>
        <a href="http://www.backbase.com" target="other"> click me
            <s:event b:on="command">
                <s:task b:action="assign" b:target="$clicked" b:select="'yes'"/>
            </s:event>
        </a>
        <br/>
        <a> did you click?
            <s:event b:on="command">
                <s:task b:action="alert" b:value="{$clicked}"/>
            </s:event>
        </a>

Hope this helps,

Menzo

Dynamically create b:window object(s)

Thank you for the reply.

I'm at work right now and can't test it, but I'll try it out when I get back home later today.

-rahx

Dynamically create b:window object(s)

Yes, you can render windows into a container as follows:


Window Title

window contents

New Window

code sample not visible

I need to know how to dynamically create windows. So I searched the forum and found this posting. Unfortunately neither IE nor FF show the code sample in Jeff Brownlee's posting, so I still have no clue how to do it.

solved

Sorry for bothering - I found a sample in the explorer demo.

Dynamically create b:window object(s)

It worked!!

Thank you so much for your help, both of you.
You saved my day ;)

Also I'm wondering whether I can display HTML contents (say, a web page) inside a window object, if so, how can I achieve that? So far, all I can get is some escaped HTML code (< etc)...

Thank you again for your help!

-rahx