Form submission in Tap5

2008-11-01 Thread Vinayak Borkar

Hi,

I am trying to build a simple GET based form to implement a search box. 
All the examples (that I could find) seem to focus on forms using POST 
to create new entities.


Is there an example to show simple GET based form requests?

Thanks,
Vinayak

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



Re: Accessing ApplicationStateManager from within a Filter

2008-11-01 Thread Ulrich Stärk
You have to make your Filter a Tapestry service in your module and you have to have a constructor 
parameter which is of type ApplicationStateManager. No need of @Inject inside your Filter.


Uli

Keith Bottner schrieb:

Is it possible to retrieve ApplicationStateManager from within a Filter?

I tried using an @Inject and it always returns null.
I tried placing it in the constructor of the filter but when it is 
accessed it is null.


Is there a recommend way of doing this or is it even advisable?

Thanks in advance for your help.

Keith

-
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]



Re: Form submission in Tap5

2008-11-01 Thread Howard Lewis Ship
Tapestry restricts the Form component, and form submissions, to using POST.

On Fri, Oct 31, 2008 at 10:58 PM, Vinayak Borkar [EMAIL PROTECTED] wrote:
 Hi,

 I am trying to build a simple GET based form to implement a search box. All
 the examples (that I could find) seem to focus on forms using POST to create
 new entities.

 Is there an example to show simple GET based form requests?

 Thanks,
 Vinayak

 -
 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]



Re: Accessing ApplicationStateManager from within a Filter

2008-11-01 Thread Howard Lewis Ship
When you contribute a filter, you need to instantiate it.  Generally
it looks something like:

  public void contributeRequestHandler(OrderedConfigurationRequestFilter
configuration, ObjectLocator locator)
  {
configuration.add(MyFilter, locator.autobuild(MyFilter.class));
  }

The ObjectLocator is a resource of the RequestHandler service that can
be injected into contribute methods for the RequestHandler service and
allows access to other services within the IoC Registry; it also
handle instantiation of objects with injection for you.  So MyFilter
doesn't have to be a service but can still be injected.  Contributing
an object instance to a filter does not do any injection, but
autobuild() does.

In the current .16 snapshot, you can use @Inject on fields of MyFilter
in addition to injection through the constructor.  This was added
because people got confused:  in pages and components you use @Inject
on fields, but in service implementation, 5.0.15 requires that
dependencies be passed through the constructor.  Again, 5.0.16 allows
you to code services and other objects more consistently (but with the
runtime overhead of using reflection to update the private fields).

On Fri, Oct 31, 2008 at 2:41 PM, Keith Bottner [EMAIL PROTECTED] wrote:
 Is it possible to retrieve ApplicationStateManager from within a Filter?

 I tried using an @Inject and it always returns null.
 I tried placing it in the constructor of the filter but when it is accessed
 it is null.

 Is there a recommend way of doing this or is it even advisable?

 Thanks in advance for your help.

 Keith

 -
 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]



Re: [T5] Creating Links At Runtime

2008-11-01 Thread Howard Lewis Ship
a href=${createURL}click me/a

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]



Re: Application hangs

2008-11-01 Thread Howard Lewis Ship
There's a JVM bug that's causing the problem, it is fixed in later
version of JDK 1.6.

See https://issues.apache.org/jira/browse/TAPESTRY-2561 and
https://issues.apache.org/jira/browse/TAPESTRY-2468.


On Fri, Oct 31, 2008 at 6:22 PM, raulmt [EMAIL PROTECTED] wrote:

 Hi,

 I'm load testing my T5 application in a Jboss server. Using jmeter with 50
 threads making an HTTP request to a tapestry page that has medium
 processing, the application stops responding after 5k - 7k requests. It's
 weird because a new request stays waiting for ever, but the server doesn't
 use any cpu... the application server doesn't hangs, because jmx-console or
 web-console for example still responded... only the t5 app stops responding.

 This is my environment:
 Ubuntu Server 8.04
 java version 1.6.0_06
 Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
 Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)
 Jboss 4.2.3.GA-jdk6
 Tapestry 5.0.15

 And Application defaults is configured with page pool hard limit to 60 (the
 other values aren't set).

 Any ideas of what is happening? If more information is needed, please ask me
 to.

 Regards.
 --
 View this message in context: 
 http://www.nabble.com/Application-hangs-tp20276307p20276307.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]



Re: [Tapestry 5.0.15] - Hidding client-side validation

2008-11-01 Thread Howard Lewis Ship
This can be done by monkey patching the Tapestry JavaScript.  You
can have a JS library that overwrites the definitions of some of the
built-in Tapestry functions related to validation.  In this way, you
can prevent the pop up bubbles, or change how the validation messages
are presented to the user.

On Thu, Oct 30, 2008 at 1:36 AM, Antonio Fernández - STAR Málaga
[EMAIL PROTECTED] wrote:

 Hi again !

 Many thanks for you fast asnwer , i tryed your option , but this is not the
 behaviour i want.

 Now the submit action happens when one or more TextFields are empty,
 and with clientValidation=true the submit is not completed.

 I want the behaviour of clientValidation=true, but simply hidding the
 Validation Messages.




 Greetings  Nice Day


 Sven Homburg escribió:

 have a look in the Form component description (parameter
 clientSideValidation)
 http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html

 2008/10/30 Antonio Fernández - STAR Málaga [EMAIL PROTECTED]




 Hi All   Good Morning   :-)

 Is there a way for hidding the JavaScript Validation Messages on the
 Client-Side ?

 Greetings
 Passi

 -
 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]



Re: Application hangs

2008-11-01 Thread raulmt

Thanks Howard, I updated the server to 1.6.0_07 and apparently the problem is
over.

Regards.


Howard Lewis Ship wrote:
 
 There's a JVM bug that's causing the problem, it is fixed in later
 version of JDK 1.6.
 
 See https://issues.apache.org/jira/browse/TAPESTRY-2561 and
 https://issues.apache.org/jira/browse/TAPESTRY-2468.
 
 
 On Fri, Oct 31, 2008 at 6:22 PM, raulmt [EMAIL PROTECTED] wrote:

 Hi,

 I'm load testing my T5 application in a Jboss server. Using jmeter with
 50
 threads making an HTTP request to a tapestry page that has medium
 processing, the application stops responding after 5k - 7k requests. It's
 weird because a new request stays waiting for ever, but the server
 doesn't
 use any cpu... the application server doesn't hangs, because jmx-console
 or
 web-console for example still responded... only the t5 app stops
 responding.

 This is my environment:
 Ubuntu Server 8.04
 java version 1.6.0_06
 Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
 Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)
 Jboss 4.2.3.GA-jdk6
 Tapestry 5.0.15

 And Application defaults is configured with page pool hard limit to 60
 (the
 other values aren't set).

 Any ideas of what is happening? If more information is needed, please ask
 me
 to.

 Regards.
 --
 View this message in context:
 http://www.nabble.com/Application-hangs-tp20276307p20276307.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/Application-hangs-tp20276307p20285796.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-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]



Combine a form and response in same template/Java class

2008-11-01 Thread thermus

I currently have a very simple webapp.  I have a form and return a pageable
grid component based on the form parameters.  Right now, I have the form and
response as separate tml/Java classes.  Everything works fine, but it's
getting to be a pain to keep all of these pieces in order (2 templates and 2
Java classes per query x 10 queries).

I'd like to combine the form with response so I only have to maintain one
tml and one Java class per query.  What is the logic I need in my
class/template to do this?  

So far, my attempts have been unsuccessful.  I tried to add a Persist
boolean and set it to true in the onSuccess method and included an if-else
in the template to render the appropriate piece.  If I just used @Persist, I
couldn't get back to the form to ever load again once it was submitted the
first time.  If I used @Persist(flash), I could reload the form on demand,
but now the grid pager links would take me back to the form (since the
boolean would reset to false).

Does anyone else combine their forms and response pages?  Is this a bad
practice?  It just seems silly to have to keep track of 4 entities for a
simple form/response.  Boy do I miss Perl.
-- 
View this message in context: 
http://www.nabble.com/Combine-a-form-and-response-in-same-template-Java-class-tp20287170p20287170.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]



Pivot table result in Grid component

2008-11-01 Thread thermus

Is there a component available that accepts something equivalent to a Swing
TableModel and renders a pageable and sortable table like the grid
component.  I need something to display a pivot table result so I don't know
the number of columns ahead of time.

Can anyone suggest a way to implement this using the grid component data
model or some alternative?

-- 
View this message in context: 
http://www.nabble.com/Pivot-table-result-in-Grid-component-tp20287217p20287217.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] force a Zone update after page rendering?

2008-11-01 Thread thermus

Were you able to solve this problem.  I'm facing a similar issue.  Can you or
anyone else share your solution if available?


Andy Pahne-3 wrote:
 
 
 I'd like to force a Zone update after page rendering without clicking 
 any links or submitting any forms.
 
 I have the Zone ID, but have no idea how to execute the update or how to 
 connect the update with a listener (like I would if I used an ActionLink).
 
 
 Andy
 
 
 
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--force-a-Zone-update-after-page-rendering--tp19780083p20287279.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]