tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "F. Da Costa" <daco...@xs4all.nl>
Subject Re: Technique to use tapestry windows as popup and technique to call listener form other page
Date Thu, 01 Jan 2004 16:34:45 GMT
Hi,

Browsing throught he list I saw this posting.
As i am experiencing *exactly* the same same problem as you described I 
thought would would ask whether you got the issue resolved *and* if you did 
, whether you would mind sharing your solution?

I *have* to do this so I figured I might as well ask.

TIA,
Fermin DCG

Konstantin Sharenkov wrote:
> Keywords: popup link action DirectLink ActionLink PageLink
> 
> (
> To tapestry developers:
>  The followed techniques is need on because I don't find how to realize
> this behavior by standard tapestry techniques.
> )
> 
> Situation:
> I have a page with list of items  [list.html].
> When item clicked I want to open popup tapestry window for editing
> [item.html].
> 
> Problem 1. I can't call tapestry window as popup.  
> Problem 2. If I call window as popup I want to set current item for the
> page. I can do it only in event listener. But PageLink is not produce
> event.
> 
> ( 
>   To Tapestry developers: 
>   I think it is good idea implement popup properties for  XXXXLink
> components family
>   like <a href="#" jwcid="@PageLink" page="Help" popup="true"
> popupName="helpWindow"> help </a>
>   or create new component PopupPageLink
> )
> 
> 
> Solution.
> 1.
> Create component on item page and make it invisible.
> <span jwcid="selectItem@DirectLink" listener="select"
> parameters="ognl:0" style="display:none;"/>
> 
> 2. Use following class
> public class TapestryHelper
> {
>     public static String getDirectLinkRef( IRequestCycle cycle, String
> page_name, String link_name, Object params )
>     {
>         IPage page = cycle.getPage( page_name );
>         DirectLink component = (DirectLink) page.getComponent( link_name
> );
>         component.setProperty( "parameters", params );
>         ILink link = component.getLink( cycle );
>         return link.getURL( null, true );
>     }
> }
> 
> 3. Create getter for list.html
>     
>     public String getPopupUrl()
>     {
>         return TapestryHelper.getDirectLinkRef( getRequestCycle(),
>             "item", "select", new Integer( getCurrentItem().getId() ));
>     }
> 
> 4. In list.html use following construction
> <span jwcid="@Foreach" source="list" value="currentItem">
>    <a jwcid="@contrib:PopupLink" herf="ognl:popupUrl" ><span
> jwcid="@Insert" value="ognl:currentItem.name"/> </a>
> <span>
> 
> 5. implements  select() listener for item.html
>     
>    public void selectSurvey( IRequestCycle cycle )
>     {
>         Object[] params = cycle.getServiceParameters();
>         int itemId = ((Integer) params[0]).intValue();
> 
>         setItemId( itemId );
> 
>         cycle.activate( this );
>     }
> 
> End.
> 
> Anybody know hot to implement it more correctly.
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message