Re: WOSubmitButton calling a URL in a new browser window
Re: WOSubmitButton calling a URL in a new browser window
- Subject: Re: WOSubmitButton calling a URL in a new browser window
- From: Edgar Klein <email@hidden>
- Date: Tue, 18 Dec 2007 17:08:15 -0700
On 18-Dec-07, at 5:01 PM, Ryan Klems wrote:
On Dec 18, 2007, at 3:39 PM, Edgar Klein wrote:
Hi,
On 18-Dec-07, at 11:41 AM, Edgar Klein wrote:
I was searching the internet but didn't find anything on this
topic, however, I cannot imagine that no one ever tried to do
s.th. similar.
I have to call an external URL from my application and I'd like to
call it by clicking on a WOSubmitButton (reason: consistency of
design b/c I already have other two submit buttons). How would I
do that? Do I have to use java script, or is there an obvious and
easy WebObjects solution for the problem?
in another thread Galon (thanx) gave a very similar example that
I've been using to solve my own problem. My solution looks like:
<wo:AjaxSubmitButton
value="$localizer.ShopLookAndFeelEditPage.PREVIEW"
onClick="newWindowScript()"/>
<script>
function newWindowScript() {
newWindow = window.open('<wo:string value="$previewURL" />',
'newWindow');
newWindow.focus();
}
</script>
Where $previewURL is a method in my java file returning a String
containing the correct URL. Now, this almost seems to solve my
problem b/c now I have the problem of the characters b/c the & will
be interpreted and replaced as & in the URL. This is quite bad
b/c my URL happens to be a DirectAction URL.
Do you have a solution for that problem? Any hints, tipps, or
suggestions will be appreciated :)
In regards to the & -> & conversion, in this case it is due to
the <wo:string value="$previewURL" />, since it is not specified, it
assumes the escapeHTML = true, so it will escape the & -> & to
avoid it change this to <wo:string value="$previewURL"
escapeHTML="$false" />
I tried that before, but I made a _very_ stupid mistake by
misspelling :-! Sorry for that and thank you for the help :)
Cheers,
Edgar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden