You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kai Michael Bodach <ka...@condat.de> on 2004/01/19 17:17:49 UTC

The right way to use a custom object as service parameter?

Hi group,

I try to use a custom object as service parameter in a *.script. I thought
the SerializableAdaptor would be
the right and so I used the "X" prefix for my URL construct. But I get the
following java.io.Exception:
"Cannot interpret {0} as a modified Base64 character."

Here is a snipplet of my *.script:

function ${functionName}(key)
{
  var newWindow = window.open(
  	"${URL}" + "&amp;sp=" + key + "&amp;sp=" + "O${PAGE}",
  	"RessourceInfoPage",
  	"titlebar,resizable,scrollbars,width=800,height=600");
  
  newWindow.focus();
}

and this is the corresponding html output snipplet:

function ri_raiseInfoPage_RessourceInfo(key)
{
  var newWindow = window.open(
 
"/app?service=direct/1/RessourceManager/ressourceTable.$PopupRessourceInfoPa
geLink" + "&sp=" + key + "&sp=" +
"Ode.mmicha.poc.resourcemanager.ui.tapestry.test.RessourceInfo@2d5534[Ressou
rceInfo]",
  	"RessourceInfoPage",
  	"titlebar,resizable,scrollbars,width=800,height=600");
  
  newWindow.focus();
}

Is there any mistake in my URL construct or do I anything incorrect???
Or may I write my own Adaptor for my object. (the type of the object is
IPage)
And with the first service parameter (it's simply an Integer) it works all
correct.

Thanks for help.

-kmb

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: The right way to use a custom object as service parameter?

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The basic rule of Tapestry  is that you don't build URLs, Tapestry does.  Specifically, Tapestry
engine services. Trying to second guess what Tapestry will generate is a bad idea, because it can
change between releases.

Your script should obtain the external service from the engine and use it to construct the URL,
which can be passed to your script as an input symbol.

Check the code for ExternalLink to see how to do this properly.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://jakarta.apache.org/tapestry/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Kai Michael Bodach [mailto:kai.michael.bodach@condat.de] 
> Sent: Monday, January 19, 2004 11:18 AM
> To: 'tapestry-user@jakarta.apache.org'
> Subject: The right way to use a custom object as service parameter?
> 
> 
> Hi group,
> 
> I try to use a custom object as service parameter in a 
> *.script. I thought
> the SerializableAdaptor would be
> the right and so I used the "X" prefix for my URL construct. 
> But I get the
> following java.io.Exception:
> "Cannot interpret {0} as a modified Base64 character."
> 
> Here is a snipplet of my *.script:
> 
> function ${functionName}(key)
> {
>   var newWindow = window.open(
>   	"${URL}" + "&amp;sp=" + key + "&amp;sp=" + "O${PAGE}",
>   	"RessourceInfoPage",
>   	"titlebar,resizable,scrollbars,width=800,height=600");
>   
>   newWindow.focus();
> }
> 
> and this is the corresponding html output snipplet:
> 
> function ri_raiseInfoPage_RessourceInfo(key)
> {
>   var newWindow = window.open(
>  
> "/app?service=direct/1/RessourceManager/ressourceTable.$PopupR
> essourceInfoPa
> geLink" + "&sp=" + key + "&sp=" +
> "Ode.mmicha.poc.resourcemanager.ui.tapestry.test.RessourceInfo
> @2d5534[Ressou
> rceInfo]",
>   	"RessourceInfoPage",
>   	"titlebar,resizable,scrollbars,width=800,height=600");
>   
>   newWindow.focus();
> }
> 
> Is there any mistake in my URL construct or do I anything incorrect???
> Or may I write my own Adaptor for my object. (the type of the 
> object is
> IPage)
> And with the first service parameter (it's simply an Integer) 
> it works all
> correct.
> 
> Thanks for help.
> 
> -kmb
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org