T5 PageRedirectExeption

2009-12-17 Thread Marcel Sammut

What is the equivalent to throwing a PageRedirectException in T3, T4 in T5?

I have a page that has some context activation handler that does validation
of the page context parameters, and if not valid, redirects to a different
page.  I did this in previous versions of Tapestry using the
PageRedirectException class, but not sure what to use in T5.

Thanks,
Marcel
-- 
View this message in context: 
http://old.nabble.com/T5-PageRedirectExeption-tp26831529p26831529.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



T5 Page Engine

2009-12-16 Thread Marcel Sammut

Greetings,

I'm trying to create an engine in tapestry which is capable of determining
which page to display and can also provide parameters.  I currently have a
tapestry 3 application which does this via the old
tapestry.engine.AbstractService.

What I've come across so far is using a Dispatcher which is contributed
before the PageRenderDispatcher that resolves the page name to be displayed
with the parameter values needed.  My web pages will contain links (\a
href...) that points to a given url which matches the Dispatchers name.  Of
course, the dispatcher checks the page name and if matches processes and
determines the page name, otherwise normal dispatching occurs.

My problem is when the dispatcher is dispatching a request, how can I
redirect to a page and inject objects needed by the page?

My page html:

\a href=/mywebapp/mydispatcher?someparameter='somevalue'My Link\/a

Java - Tapestry Dispatcher


Public class MyDispatcher implements Dispatcher

  nbsp;private ComponentSource componentSource;

  nbsp;Public MyDispatcher(ComponentSource componentSource) {

nbsp;nbsp;this.componentSource = componentSource;

  nbsp;}

  nbsp;@Override

  nbsp;public boolean dispatch(Request request, Response response) throws
IOException {

nbsp;nbsp;String path = request.getPath();

nbsp;nbsp;if (mydispatcher == path) {

  nbsp;nbsp;nbsp;nbsp;String pageName =
functionThatWillGetPageNameFromRequestParameters(request, response);

  nbsp;nbsp;nbsp;nbsp;Component page =
componentSource.getPage(pageName);

  nbsp;nbsp;nbsp;nbsp;/** Want to inject objects/parameters

  nbsp;nbsp;nbsp;nbsp;*** And render/display this page
component [cycle.activate(page) in T3]

nbsp;nbsp;}

nbsp;nbsp;return true;

nbsp;}

}



I'm not sure if this is the correct approach and am trying to port some T3
applications over to T5.  
Any ideas or thoughts on how to convert a T3 AbstractService would be
useful.

Cheers,

Marcel


-- 
View this message in context: 
http://old.nabble.com/T5-Page-Engine-tp26823567p26823567.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


[T5] MVC Issues

2008-11-26 Thread Marcel Sammut

I'm having some issues porting some old T3 applications and am stumped with
the Ajax implementation.  For the most part I've got the basics working, but
I'm having problem with some MVC dynamics. Is it possible to create a link
at runtime via ComponentResources and specify a zone for the action so that
the form is not posted when the action is invoked?
Example .tml:
lt;t:block t:id=selectionListgt;
  lt;t:mycomponent t:model=modelA ...gt;lt;/t:mycomponentgt;
lt;/t:blockgt;
lt;form t:id=filterInputs t:zone=searchZonegt;
  ...
  lt;t:actionlink t:id=executeSearch
t:zone=searchZonegt;searchlt;/t:actionlinkgt;
lt;/formgt;
lt;t:zone t:id=searchZonegt;
  lt;t:delegate to=prop:selectionListgt;lt;/t:delegategt;
lt;/t:zonegt;

The MyComponent is a component where the model (an actual parameter) may
provide a link using the componentResources.createEventLink() method to the
component to be rendered.  Of course the java class exposes the
SelectionList block.  As you can see I do have an actionlink in the template
which, because of the zone parameter, does not submit the form when the
action is invoked.

The model is a regular POJO and is not a component, but is part of the
Render phase.  I'm still trying to get my head around conversion of old T3
applications, so I'm open to new design approaches in terms of how T5
handles MVC.

Cheers,
Marcel
-- 
View this message in context: 
http://www.nabble.com/-T5--MVC-Issues-tp20711681p20711681.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[t5] actionlink callback

2008-11-22 Thread Marcel Sammut

Greetings,
Is it possible to provide an ActionLink component with a callback which is
invoked after the action event is completed?

I have an ActionLink which is used to initiate an AJAX call using a Zone. 
I'd like to be able to call a JavaScript function on click as well as once
the action event is completed.  I am able to call a function using the
onclick of the inner component of the actionlink
ex: t:actionlink t:id=myFunction t:zone=myZone ... /t:actionlink

I've been able to use the OnEvent mixin on TextField to use the
onCompleteCallback property to call a post JavaScript.  However, when
doing so on an ActionLink, nothing happens.
ex. t:actionlink t:id=myFunction t:zone=myZone
t:mixins=t5components/OnEvent event=action
onCompleteCallback=afterFunction .../t:actionlink

Can this be done in the Java class event handler for the event?  I've tried
different techniques, but nothing seems to work.  Any ideas how to provide
event callbacks in T5 (5.0.16)?

Cheers,
Marcel
-- 
View this message in context: 
http://www.nabble.com/-t5--actionlink-callback-tp20641626p20641626.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] actionlink context

2008-11-20 Thread Marcel Sammut

Greetings,
I have a form that contains a single input text box and an actionlink
component.  The action link is an event handled by a method in the
implementing java class.  What I'd like to be able to do is in the event
handler, be able to access the value entered in the input field.  This is
pretty much a search function, where the event handler executes a search
based on the input value.  This is being done in AJAX so the search needs to
execute without a full page refresh.

.tml
input type=text value= id=criteria/
t:actionlink t:id=searchExecute context= /

.java
@OnEvent(value=searchExecute)
void searchExecute() {
  // need something like
  Stirng value = getValue(critieria)
  ...
}

Is there anyway to access the value for the criteria input field in the
searchExecute method?  I tried looking at the
Request.getParameter(criteria), but that returned null.

Thanks,
Marcel Sammut
-- 
View this message in context: 
http://www.nabble.com/-T5--actionlink-context-tp20597202p20597202.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] actionlink context

2008-11-20 Thread Marcel Sammut

Thanks,  I've heard of this in 5.0.16 but not sure how to use it.  In my
actual implementation, I am creating the link via
ComponentResources.createEventLink.  Can I still use that method to create
the LinkSubmit?
Also, looking at LinkSubmit API, it states that this link will submit the
form.  Will this not trigger a page refresh though?  If the input field is
within the form, how do I obtain the value on the event handler?  Will all
the form field's be posted to the method?  I don't understand how using the
LinkSubmit differs from EventLink in this case?

Thanks,
Marcel


Thiago H. de Paula Figueiredo wrote:
 
 Em Thu, 20 Nov 2008 05:53:34 -0300, Marcel Sammut [EMAIL PROTECTED]  
 escreveu:
 
 .tml
 input type=text value= id=criteria/
 t:actionlink t:id=searchExecute context= /

 .java
 @OnEvent(value=searchExecute)
 void searchExecute() {
   // need something like
   Stirng value = getValue(critieria)
   ...
 }
 
 I suggest you to use a Form and and a LinkSubmit (new in 5.0.16) instead  
 of an ActionLink to do that.
 
 -- 
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 Consultor, desenvolvedor e instrutor em Java
 http://www.arsmachina.com.br/thiago
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--actionlink-and-accessing-context-tp20597202p20606712.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] Persistent fields may not be updated until after the page has finished loading

2008-11-20 Thread Marcel Sammut

I had the same problem when moving to 5.0.16.  It was pretty simple for me,
since what I was doing was initializing my persistant variables in the
declaration.  What I did was move the initialization to the SetupRender
phase of the cycle.

Hope that works for you too.
Cheers,
Marcel


Eric Ma wrote:
 
 Why was this restriction introduced in 5.0.16?  It completely breaks our
 application.  If the benefit is marginal, can we roll back to the original
 behavior?  Or alternatively, what is a better practice under 5.0.16?  
 
 Thanks,
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Persistent-fields-may-not-be-updated-until-after-the-page-has-finished-loading-tp20587662p20606832.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Delegate Rendering

2008-11-12 Thread Marcel Sammut

Greetings,
Is it possible to use the Delegate component such that the delegation of the
rendering be given to a method in the page, or to a rendering class instead
of a Block or Component?  In the example below, can the onDelegatemethod be
used to render the contents (ie. return a stream or use the MarkupWriter) of
the delegate?

The old T3 Delegate component was used this way, but I'm not sure how to do
the same in T5.  I have my own IRender interface (similar to T3) that is
returned to the delegate component.  For Example:

MyPage.tml
t:delegate to:onDelegate /t:delegate

MyPage.java
public void onDelegate(MarkupWriter writer) {
  writer.element(table);
  ...
}

Any thoughts or suggestions?
Thanks,
Marcel
-- 
View this message in context: 
http://www.nabble.com/-T5--Delegate-Rendering-tp20471932p20471932.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] Ajax And Zones

2008-11-07 Thread Marcel Sammut

So am I dead in the water here?  Sounds like this functionality isn't
supported in T5?  Seems strange that Tapestry 5 requires an INPUT field to
be contained within a Form, and AJAX uses Zones, and you can not combine the
two.  So basically, AJAX functionality in T5 should only be used with
straight text and HTML, no input fields.

In my situation, the AJAX component doesn't contain a Form, but the
components container may, so how do you use AJAX Zones with forms...for
example, dynamic content.

Thanks,
Marcel


Thiago H. de Paula Figueiredo wrote:
 
 Em Fri, 07 Nov 2008 04:49:05 -0300, Inge Solvoll [EMAIL PROTECTED]  
 escreveu:
 
 Isn't this the same problem I ran into some weeks ago? Forms not  
 supported in zones?
 
 My experience says that you can put a Form inside a Zone, but you cannot  
 put a Zone around some fields inside a Form (hence the No object of type  
 org.apache.tapestry5.services.FormSupport is available from the  
 Environment message).
 
 -- 
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Ajax-And-Zones---Missing-FormSupprt-tp20373776p20389729.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Ajax And Zones

2008-11-06 Thread Marcel Sammut

Greetings,
I have a component which displays a header and body contents, where the
contents are collapsed via AJAX support.  The component is a DIV which wraps
a table that contains the header, AJAX block and Zone.  There is an
ActionLink which is used to invoke the AJAX method that returns the AJAX
block to be rendered in the Zone via a delegate component.  The basic AJAX
concept was derived from the following example:
http://202.177.217.122:8080/jumpstart/examples/javascript/ajax

Everything is ok and the contents are not rendered when the AJAX ActionLink
is invoked.  That is done by returning null from the event handler.  The
problem occurs when the event handler returns the AJAX block to be rendered
again (i.e.: expand the contents).  Note, that the component itself is
wrapped within a form on the page.  I recieve the following error after the
AJAX method exists and returns a valid Block component:

No object of type org.apache.tapestry5.services.FormSupport is available
from the Environment.  Available types are
org.apache.tapestry5.RenderSupport,
org.apache.tapestry5.ValidationDecorator,
org.apache.tapestry5.internal.services.ClientBehaviorSupport,
org.apache.tapestry5.services.Heartbeat.

Here is my template:
div xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
table
tr
td t:actionlink t:id=updateState 
t:zone=ajaxZoneId ${stateImage}
/img/t:actionlink  /td
/tr
tr
td
t:block t:id=ajaxBody
t:body/t:body
/t:block
t:zone t:id=ajaxZoneId
t:delegate to=ajaxBody/t:delegate
/t:zone
/td
/tr   
/table
/div  

Java:
public class Header {
@Parameter(required=false)
private boolean collapsed=false;

@Inject
@Property
private Block ajaxBody;

@Inject
@Property
private Request request;

@Persist
private boolean isCollopsed = collapsed;

Object onActionFromUpdateState() {
if (!request.isXHR()) return null;

Object body = null;

if (isCollopsed)
return ajaxBody;

isCollopsed = !isCollopsed;
collapsed = isCollopsed;

return body;
}

}

-- 
View this message in context: 
http://www.nabble.com/-T5--Ajax-And-Zones-tp20373776p20373776.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] Creating Links At Runtime

2008-11-03 Thread Marcel Sammut

I'm aware of the large gap between 3 and 5 and may require some redesign on
my part.  That is why I'm using native tapestry links.  In 5.0.15, the
ComponentResources class has the createActionLink deprecated in favor of
createEventLink.  There are only 2 difference between ActionLink and
EventLink according to the API, the way it is controlled and the way it is
triggered.  

I do want to use an EventLink in my situation, and do this through
ComponentResources.createEventLink().  The tutorials show you how to use the
ActionLink in a template, whereas in my case, the component is created via
Java code.  Perhaps I do not understand what the context argument in the
createEventLink() method is used for.  I believe that the first argument
would be the name of the method to invoke?  How do you identify the handler
of the event when creating the EventLink?  Tutorials show this binding done
through the @OnEvent annotation and specifying the event name via the
component attribute in the annotation or the id attribute of the
element.

How would I bind these properties using a pure Java implementation?  My
previous T3 components never had a template file, and rendered purly in
Java.

Thanks
- Marcel



Peter Stavrinides wrote:
 
 Hi Marcel
 
 Tapestry 5 is not like 3, most of the boilerplate code is gone, it appears
 to me that you are trying to do too much... have you gone through the
 tutorials yet? I think you will be pleasantly surprised how simple yet
 powerful T5 is. You also haven't quite grasped the difference between
 ActionLink and EventLink and PageLink (it sounds like you want an
 EventLink)
 
 cheers
 Peter
 
 Thanks!
 I seem to be able to render the anchor component based on the Link being
 created from the ComponentResources.createActionLink().  However, the
 action
 does not seem to be fired when I hook up the event using the @OnEvent
 annotation.  The anchor is rendered using the MarkupWriter.element()
 method
 using the Link object to define the href attribute.
 
 Note, that the creating and rendering of the action anchor is done purely
 in
 Java...no template.
 
 My anchor renders the following url:
 mypage.pagelayout/activate Activate 
 
 There is a page called Home/MyPage and on this page is a component called
 PageLayout which is an extension of my Layout component.  In the
 PageLayout
 component, I have my activate event handler as follows:
 @OnEvent(component=activate)
 public Object activate() {
   ...
 }
 
 Any idea why the activate event is not being called and how I can hook the
 event to the action?
 
 Thanks Once Again.
 Marcel
 
 
 Howard Lewis Ship wrote:
 
  ${createURL} click me 
 
 You just have to provide getCreateURL() as a wrapper around
 ComponentResources.createActionLink().
 
 You don't instantiate a component, just @Inject the ComponentResources.
 
 On Fri, Oct 31, 2008 at 5:24 PM, Marcel Sammut [EMAIL PROTECTED] wrote:

 Thanks for the quick response.  My delima is that I need to have a
 reference
 to the link in the .tml template.  I was hoping to just use a pure Java
 implementation to let the developer configure the menu via code.
 In order to do this, I believe I have to inject the ComponentResources
 object of my container when instantiating the AbstractLink component. 
 Any
 idea to do that?

 Thanks,
 Marcel


 Robert Zeigler wrote:

 Why not just use ComponentResources.createActionLink and
 ComponentResources.createPageLink?

 .tml:
  $somelink Link Text
 .java:

 @Inject
 private ComponentResources resources;

 public String getSomeLink() {
return
 resources.createPageLink(mypage,true,contextValue1,contextValue2,...);
 }


 Robert

 On Oct 31, 2008, at 10/315:04 PM , Marcel Sammut wrote:


 Greetings,
 I'm looking at porting my 3.0 tapestry web application to v5 and I'm
 trying
 to build a menu component which accepts a parameter of type
 ArrayList that
 contains a list of AbstractLink objects.  These items get rendered
 in a menu
 layout etc.  The page that this menu component exists on will
 create, at
 runtime, the set of desired menu item and pass them to the menu
 component.

 This sounds straight forward, however, I am unable to determin how to
 instantiate, for example, a new instance of a ActionLink.  In the
 previous
 version (3.0), I simply rendered the anchor myself and generated the
 URi in
 a custom implementation.  I was hoping that in T5, I would be able
 to use
 the internal Link components since they do pretty much what I was
 doing in
 3.0.

 Is there a way, in code, to create a new ActionLink component and
 have it
 act as the model for another component to be rendered?

 Your thoughts are much appreciated.
 - Marcel
 --
 View this message in context:
 http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20274715.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Re: [T5] Creating Links At Runtime

2008-11-03 Thread Marcel Sammut

Thanks for all your support.  

I managed to figure out what I was doing wronge and got it working.  A fix
to the way I was using ComponentResources.createEventLink() as well as
updating my @OnEvent to use value parameter instead of component did the
trick.

Cheers,
Marcel


Howard Lewis Ship wrote:
 
 It is subtle and powerful, and you missed one minor detail.
 
 On Mon, Nov 3, 2008 at 1:57 PM, Robert Zeigler [EMAIL PROTECTED] wrote:
 
 As a follow-up:

  Tutorials show this binding done
 through the @OnEvent annotation and specifying the event name via the
 component attribute in the annotation or the id attribute of the
 element.


 This is not quite correct.
 The component attribute of the @OnEvent annotation identifies which
 /component/ generates the event, but not which event is generated.
 It's the value attribute that specifies which event to listen to:

 .tml:
 t:eventlink t:id=mycomp event=myeventClick Me/t:eventlink

 .java:
 @OnEvent(value=myevent,component=mycomp)
 void someHandler() {
 }
 
 
 This will not be called because EventLink triggers the provided event not
 on
 itself, but on its container.  Omit the component attribute for this to
 work
 as written.
 
 


 Or, if you prefer convention-over-configuration:
 .java:
 void onMyeventFromMycomp() {
 ...
 }

 Or even:
 void onMyevent() {
 ...
 }

 
 This will work because it intercepts the event notification fired on the
 page (the container of the EventLink instance).
 
 I've been asked which to use: EventLink or ActionLink.  I think, possibly,
 if I had created EventLink first, I would not have created ActionLink.
 
 That being said, ActionLink is useful when you have many one-off
 components
 with individual logic on each ... it's easier since you specify (in the
 template) a unique component id, which you would do anyway.  You just have
 to match that id against an event handler method name.
 
 EventLink is when you have multiple components in the template that should
 trigger the same behavior.  You can usually omit the component id, but you
 have to carefully coordinate the event name in the template and in the
 Java
 class (either inside the @OnEvent annotation, or
 as part of the event handler method name).
 
 
 
 

 HTH,

 Robert


 On Nov 3, 2008, at 11/31:07 PM , Robert Zeigler wrote:

  Hi Marcel,

 The binding of the listener to the event is done automatically by
 tapestry
 based either on the @OnEvent annotation or by naming convention.

 The context argument is simply used to allow for additional information
 to
 be encoded into the url which will be provided to the handler in the
 form of
 method parameters.
 For example:

 .html:
  ${myLink} My Link 

 .java:
 @Inject
 private ComponentResources resources;
 public Link getMyLink() {
  return resources.createEventLink(myevent,value1);
 }

 @Inject
 private ComponentSource componentSource;

 Object onMyevent(String name) {
   //do something interesting. Here, we look up a page based on the page
 name provided in name.
   return componentSource.getPage(name);
 }


 And that's it.  Now when you click MyLink, the onMyevent method will
 be called, passing in value1 as the value of the name parameter.

 * The values in context will be converted to and from strings via the
 ValueEncoder service  contributions.
 * Events always bubble in T5, so your handler has to be either at the
 level of the component which has the link, or in a class that wraps that
 component.  That is, suppose the following page structure:

 page x
  - component a
   - event link, event is foo.
  - event link, event is bar.

 The handler for the foo event must be in either component a or in page
 x. The handler for bar must be in page x.  A handler for the bar
 event
 in component a won't be called by clicking the event link of page x.

 HTH,

 Robert


 On Nov 3, 2008, at 11/312:05 PM , Marcel Sammut wrote:


 I'm aware of the large gap between 3 and 5 and may require some
 redesign
 on
 my part.  That is why I'm using native tapestry links.  In 5.0.15, the
 ComponentResources class has the createActionLink deprecated in favor
 of
 createEventLink.  There are only 2 difference between ActionLink and
 EventLink according to the API, the way it is controlled and the way it
 is
 triggered.

 I do want to use an EventLink in my situation, and do this through
 ComponentResources.createEventLink().  The tutorials show you how to
 use
 the
 ActionLink in a template, whereas in my case, the component is created
 via
 Java code.  Perhaps I do not understand what the context argument in
 the
 createEventLink() method is used for.  I believe that the first
 argument
 would be the name of the method to invoke?  How do you identify the
 handler
 of the event when creating the EventLink?  Tutorials show this binding
 done
 through the @OnEvent annotation and specifying the event name via the
 component attribute in the annotation or the id attribute of the
 element.

 How would I bind these properties using a pure

Re: [T5] Creating Links At Runtime

2008-11-01 Thread Marcel Sammut

Thanks!
I seem to be able to render the anchor component based on the Link being
created from the ComponentResources.createActionLink().  However, the action
does not seem to be fired when I hook up the event using the @OnEvent
annotation.  The anchor is rendered using the MarkupWriter.element() method
using the Link object to define the href attribute.

Note, that the creating and rendering of the action anchor is done purely in
Java...no template.

My anchor renders the following url:
mypage.pagelayout/activate Activate 

There is a page called Home/MyPage and on this page is a component called
PageLayout which is an extension of my Layout component.  In the PageLayout
component, I have my activate event handler as follows:
@OnEvent(component=activate)
public Object activate() {
  ...
}

Any idea why the activate event is not being called and how I can hook the
event to the action?

Thanks Once Again.
Marcel


Howard Lewis Ship wrote:
 
  ${createURL} click me 
 
 You just have to provide getCreateURL() as a wrapper around
 ComponentResources.createActionLink().
 
 You don't instantiate a component, just @Inject the ComponentResources.
 
 On Fri, Oct 31, 2008 at 5:24 PM, Marcel Sammut [EMAIL PROTECTED] wrote:

 Thanks for the quick response.  My delima is that I need to have a
 reference
 to the link in the .tml template.  I was hoping to just use a pure Java
 implementation to let the developer configure the menu via code.
 In order to do this, I believe I have to inject the ComponentResources
 object of my container when instantiating the AbstractLink component. 
 Any
 idea to do that?

 Thanks,
 Marcel


 Robert Zeigler wrote:

 Why not just use ComponentResources.createActionLink and
 ComponentResources.createPageLink?

 .tml:
  $somelink Link Text
 .java:

 @Inject
 private ComponentResources resources;

 public String getSomeLink() {
return
 resources.createPageLink(mypage,true,contextValue1,contextValue2,...);
 }


 Robert

 On Oct 31, 2008, at 10/315:04 PM , Marcel Sammut wrote:


 Greetings,
 I'm looking at porting my 3.0 tapestry web application to v5 and I'm
 trying
 to build a menu component which accepts a parameter of type
 ArrayList that
 contains a list of AbstractLink objects.  These items get rendered
 in a menu
 layout etc.  The page that this menu component exists on will
 create, at
 runtime, the set of desired menu item and pass them to the menu
 component.

 This sounds straight forward, however, I am unable to determin how to
 instantiate, for example, a new instance of a ActionLink.  In the
 previous
 version (3.0), I simply rendered the anchor myself and generated the
 URi in
 a custom implementation.  I was hoping that in T5, I would be able
 to use
 the internal Link components since they do pretty much what I was
 doing in
 3.0.

 Is there a way, in code, to create a new ActionLink component and
 have it
 act as the model for another component to be rendered?

 Your thoughts are much appreciated.
 - Marcel
 --
 View this message in context:
 http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20274715.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


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




 --
 View this message in context:
 http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20275943.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20286038.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Creating Links At Runtime

2008-10-31 Thread Marcel Sammut

Greetings,
I'm looking at porting my 3.0 tapestry web application to v5 and I'm trying
to build a menu component which accepts a parameter of type ArrayList that
contains a list of AbstractLink objects.  These items get rendered in a menu
layout etc.  The page that this menu component exists on will create, at
runtime, the set of desired menu item and pass them to the menu component.

This sounds straight forward, however, I am unable to determin how to
instantiate, for example, a new instance of a ActionLink.  In the previous
version (3.0), I simply rendered the anchor myself and generated the URi in
a custom implementation.  I was hoping that in T5, I would be able to use
the internal Link components since they do pretty much what I was doing in
3.0.

Is there a way, in code, to create a new ActionLink component and have it
act as the model for another component to be rendered?

Your thoughts are much appreciated.
- Marcel
-- 
View this message in context: 
http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20274715.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] Creating Links At Runtime

2008-10-31 Thread Marcel Sammut

Thanks for the quick response.  My delima is that I need to have a reference
to the link in the .tml template.  I was hoping to just use a pure Java
implementation to let the developer configure the menu via code.
In order to do this, I believe I have to inject the ComponentResources
object of my container when instantiating the AbstractLink component.  Any
idea to do that?

Thanks,
Marcel


Robert Zeigler wrote:
 
 Why not just use ComponentResources.createActionLink and  
 ComponentResources.createPageLink?
 
 .tml:
  $somelink Link Text 
 .java:
 
 @Inject
 private ComponentResources resources;
 
 public String getSomeLink() {
return  
 resources.createPageLink(mypage,true,contextValue1,contextValue2,...);
 }
 
 
 Robert
 
 On Oct 31, 2008, at 10/315:04 PM , Marcel Sammut wrote:
 

 Greetings,
 I'm looking at porting my 3.0 tapestry web application to v5 and I'm  
 trying
 to build a menu component which accepts a parameter of type  
 ArrayList that
 contains a list of AbstractLink objects.  These items get rendered  
 in a menu
 layout etc.  The page that this menu component exists on will  
 create, at
 runtime, the set of desired menu item and pass them to the menu  
 component.

 This sounds straight forward, however, I am unable to determin how to
 instantiate, for example, a new instance of a ActionLink.  In the  
 previous
 version (3.0), I simply rendered the anchor myself and generated the  
 URi in
 a custom implementation.  I was hoping that in T5, I would be able  
 to use
 the internal Link components since they do pretty much what I was  
 doing in
 3.0.

 Is there a way, in code, to create a new ActionLink component and  
 have it
 act as the model for another component to be rendered?

 Your thoughts are much appreciated.
 - Marcel
 -- 
 View this message in context:
 http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20274715.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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

-- 
View this message in context: 
http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20275943.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Customizing BeanEditForm Layout

2008-10-29 Thread Marcel Sammut

I've been able to extend and customize the layout and order of a BeF using
the parameter element.  However, when I try and customize the Submit
button, the parameter element doesn't seem to work.  I've read/seen that
you can specify the label of the button via the submitlabel parameter of the
BeF, but I need to do more than just the label.
For example, how would I add an ActionLink component right beside the submit
button?  Below is my template for the beaneditform (v5.0.15):

t:beaneditform t:id=loginForm t:object=loginForm
submitlabel=message:submit 
  t:parameter name=password
label t:type=Label for=password style=width:110px;/label
input t:type=PasswordField t:id=password
t:value=loginForm.password/input
  /t:parameter
  t:parameter name=submit
label t:type=Label for=submit style=display:none;/label
input t:type=Submit value=message:submit /input
t:actionlink t:id=switchDisplay ${message:label-change}
Link/t:actionlink
  /t:parameter
/t:beaneditform

Thanks,
Marcel S.
-- 
View this message in context: 
http://www.nabble.com/-T5--Customizing-BeanEditForm-Layout-tp20232850p20232850.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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