You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/01/27 20:51:55 UTC

Prepending (or appending) a fixed string to an ognl expression?

Hi,

Could someone enlighten me as to the correct syntax for adding a string to 
an ognl expression with one small caveat.

I'm looking to produce something like this:
   key = '<span jwcid="@Insert" value="ognl:branchId + xyz"/>';

Its a js line using the ' to signify the js string.
Within the js I use " to delimit the bits that need it.
"xyz" is the *actual* string to be added to branchId (which basically is a 
getBranchId() call).

I tried /'xyz/' but that did not work.

Assuming it is actually possible how do i go about this?

TIA
Fermin DCG


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


Re: Prepending (or appending) a fixed string to an ognl expression?

Posted by "F. Da Costa" <da...@xs4all.nl>.
James Treleaven wrote:
> I like Erik's solution.  :-)
Could no agree more
> 
> But for the record - I am pretty sure that your problems come from js 
> interfering with your quotes, because I have a working tapestry template 
> file (Team.html) that contains:
> 
> <span jwcid="@PageWrapper"
> title="ognl:team.teamname+' '+global.lp.teamlabel+' Page'" 
> banner="ognl:team.teamname+' '+global.lp.teamlabel+' Page'">
> 
> 
> So in a straight up html template file your line would be:
> <span jwcid="@Insert" value="ognl:branchId + 'xyz'"/>
I'm afraid not because the whole thing has to supply its value to a js(?) 
string. Thus enclosing it in ''s. Obviously i'd would have to escape the '.

Thx anyway
> 
> Sorry I can't help you with js ... I don't even know what it stands for. 
>   :-)
> 
Din't know either so that makes two of us ;)

Fermin


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


Re: Prepending (or appending) a fixed string to an ognl expression?

Posted by James Treleaven <ja...@enoreo.on.ca>.
I like Erik's solution.  :-)

But for the record - I am pretty sure that your problems come from js 
interfering with your quotes, because I have a working tapestry template 
file (Team.html) that contains:

<span jwcid="@PageWrapper"
title="ognl:team.teamname+' '+global.lp.teamlabel+' Page'" 
banner="ognl:team.teamname+' '+global.lp.teamlabel+' Page'">


So in a straight up html template file your line would be:
<span jwcid="@Insert" value="ognl:branchId + 'xyz'"/>

Sorry I can't help you with js ... I don't even know what it stands for. 
   :-)

James


F. Da Costa wrote:
> Hi,
> 
> Could someone enlighten me as to the correct syntax for adding a string 
> to an ognl expression with one small caveat.
> 
> I'm looking to produce something like this:
>   key = '<span jwcid="@Insert" value="ognl:branchId + xyz"/>';
> 
> Its a js line using the ' to signify the js string.
> Within the js I use " to delimit the bits that need it.
> "xyz" is the *actual* string to be added to branchId (which basically is 
> a getBranchId() call).
> 
> I tried /'xyz/' but that did not work.
> 
> Assuming it is actually possible how do i go about this?
> 
> TIA
> Fermin DCG
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Prepending (or appending) a fixed string to an ognl expression (SOLVED)

Posted by "F. Da Costa" <da...@xs4all.nl>.
Erik Hatcher wrote:

> I may not be fully following what you're after, but how about this?
> 
> key = '<span jwcid="@Insert" value="ognl:branchId"/>xyz';
Thx, that would most definitely do the trick.


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


Re: Prepending (or appending) a fixed string to an ognl expression?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
I may not be fully following what you're after, but how about this?

key = '<span jwcid="@Insert" value="ognl:branchId"/>xyz';



On Jan 27, 2004, at 2:51 PM, F. Da Costa wrote:

> Hi,
>
> Could someone enlighten me as to the correct syntax for adding a 
> string to an ognl expression with one small caveat.
>
> I'm looking to produce something like this:
>   key = '<span jwcid="@Insert" value="ognl:branchId + xyz"/>';
>
> Its a js line using the ' to signify the js string.
> Within the js I use " to delimit the bits that need it.
> "xyz" is the *actual* string to be added to branchId (which basically 
> is a getBranchId() call).
>
> I tried /'xyz/' but that did not work.
>
> Assuming it is actually possible how do i go about this?
>
> TIA
> Fermin DCG
>
>
> ---------------------------------------------------------------------
> 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


Re: Prepending (or appending) a fixed string to an ognl expression?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Did you really use forward slashes instead of backslashes on xyz, or is that
a typo in your email?

Jamie
----- Original Message ----- 
From: "F. Da Costa" <da...@xs4all.nl>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, January 27, 2004 2:51 PM
Subject: Prepending (or appending) a fixed string to an ognl expression?


> Hi,
>
> Could someone enlighten me as to the correct syntax for adding a string to
> an ognl expression with one small caveat.
>
> I'm looking to produce something like this:
>    key = '<span jwcid="@Insert" value="ognl:branchId + xyz"/>';
>
> Its a js line using the ' to signify the js string.
> Within the js I use " to delimit the bits that need it.
> "xyz" is the *actual* string to be added to branchId (which basically is a
> getBranchId() call).
>
> I tried /'xyz/' but that did not work.
>
> Assuming it is actually possible how do i go about this?
>
> TIA
> Fermin DCG
>
>
> ---------------------------------------------------------------------
> 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