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 16:39:34 -0700
Hi,
On 18-Dec-07, at 4:12 PM, Galen Rhodes wrote:
Yea, but something tells me he's still using 5.3.
sorry for not telling, but I'm using WO 5.4. And this cannot be a
DirectActionURL generating issue b/c my method just returns a plain
Java String. In other words, if I returned "http://www.apple.com" the
called URL would be s.th. like
http://www.apple.com/?wosid=5VEhVaWrkpGyX8JxaLrLug
(see posting in thread w/ subject: Wosid suppression broken in 5.4?)
This is really strange and still have no solution for this problem :/
Thanx and cheers,
Edgar
-- Robert Heinlein --
On Dec 18, 2007, at 6:07 PM, Mr. Pierre Frisch wrote:
Actually this was fixed in 5.4.
/**
* Builds a complete URL from its components for a direct action.
This methods always return a complete URL.
*
* @param requestHandlerPath
* Action that need to be accessed
* @param queryDictionary
* Query dictionary to append
* @param isSecure
* Generate https or http protocol
* @param entityEscapeQueryDict
* true if you want the query dictionary generated as
foo=bar&baz=blah as opposed to foo=bar&baz=blah
* @return page URL
*/
public String directActionURLForActionNamed(String
requestHandlerPath, NSDictionary<String, Object> queryDictionary,
boolean isSecure, boolean entityEscapeQueryDict)
Pierre
--
Pierre Frisch
email@hidden
On Dec 18, 2007, at 14:48, Galen Rhodes wrote:
I think this may be the old directActionURLForActionNamed(...)
bug. In your method that generates the URL, try this:
return directActionURLForActionNamed("MyAction",
paramDict).replace("&", "&");
See if that does the trick.
--
Galen Rhodes
email@hidden
On Dec 18, 2007, at 5: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 :)
Thanx,
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
_______________________________________________
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
_______________________________________________
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