• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WOSubmitButton calling a URL in a new browser window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOSubmitButton calling a URL in a new browser window


  • Subject: Re: WOSubmitButton calling a URL in a new browser window
  • From: Ryan Klems <email@hidden>
  • Date: Tue, 18 Dec 2007 17:01:08 -0700

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 &amp; 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 & -> &amp; 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 & -> &amp; to avoid it change this to <wo:string value="$previewURL" escapeHTML="$false" />


-Ryan

_______________________________________________
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


  • Follow-Ups:
    • Re: WOSubmitButton calling a URL in a new browser window
      • From: Edgar Klein <email@hidden>
References: 
 >WOSubmitButton calling a URL in a new browser window (From: Edgar Klein <email@hidden>)
 >Re: WOSubmitButton calling a URL in a new browser window (From: Edgar Klein <email@hidden>)

  • Prev by Date: Re: Wosid suppression broken in 5.4?
  • Next by Date: Re: Wosid suppression broken in 5.4?
  • Previous by thread: Re: WOSubmitButton calling a URL in a new browser window
  • Next by thread: Re: WOSubmitButton calling a URL in a new browser window
  • Index(es):
    • Date
    • Thread