Re: Programmatic DirectLink with updateComponents and parameter

2007-03-05 Thread Jesse Kuhnert

I'm not sure what all of this search/replace/sweep stuff is but basic
updates should work . .. Maybe if you try again with an example I can
understand easier I can help.

p.s. You can use updateComponents="basket_container" or
updateComponents="basket_container, another_container" now if you
want...Support was added in for easier string list expressions.

On 2/21/07, Andreas Pardeike <[EMAIL PROTECTED]> wrote:

Hi,

I've seen some examples on how to generate a DirectLink programmatic but
so far, I couldn't get it to work. Especially because I need it to
update
a component via ajax.

Quick overview: I parse external static html text with fake links and
replace those links with the correct versions. One of them is a [Buy]
button
and it needs to call a listener to add the item to the database and
then it
refreshes the view on the page via ajax.

On my normal Tapestry pages, this looks like:


   
   
   
   


and this works fine. Now, on my "content" page which will read in a
specific
html page via a given name, I do a search/replace sweep and there, I
need to
do the same (the basket component is in my Border).

What I have done is to have a fake_buy component similar to the one
above in
my content page and a property 'item_id' which is referred by
fake_by. I was
able to do this:

setItem_id(linkParam);
DirectLink fakeBuy = (DirectLink)getComponent("fake_buy");
ILink fakeBuyLink = fakeBuy.getLink(getPage().getRequestCycle());
link = fakeBuyLink.getURL();

But I am not sure if this is the right way to do it because I fear side
effects.

Andreas Pardeike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Programmatic DirectLink with updateComponents and parameter

2007-02-21 Thread Andreas Pardeike

Hi,

I've seen some examples on how to generate a DirectLink programmatic but
so far, I couldn't get it to work. Especially because I need it to  
update

a component via ajax.

Quick overview: I parse external static html text with fake links and
replace those links with the correct versions. One of them is a [Buy]  
button
and it needs to call a listener to add the item to the database and  
then it

refreshes the view on the page via ajax.

On my normal Tapestry pages, this looks like:


  
  

  
  


and this works fine. Now, on my "content" page which will read in a  
specific
html page via a given name, I do a search/replace sweep and there, I  
need to

do the same (the basket component is in my Border).

What I have done is to have a fake_buy component similar to the one  
above in
my content page and a property 'item_id' which is referred by  
fake_by. I was

able to do this:

setItem_id(linkParam);
DirectLink fakeBuy = (DirectLink)getComponent("fake_buy");
ILink fakeBuyLink = fakeBuy.getLink(getPage().getRequestCycle());
link = fakeBuyLink.getURL();

But I am not sure if this is the right way to do it because I fear side
effects.

Andreas Pardeike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]