RE: Newbie questions

2009-09-03 Thread Martin Torre Castro

Thank you very much Thiago. 

EventContext is working ok when I'm sending data from the page to the same 
page. But if I send data from another page and I'm setting the EventContext 
parameters as before is show an error:

method onActivate signature: (Lorg/apache/tapestry/EventContext;)V) Illegal 
constant pool index


Do I have to set the onActivate parameters one by one as I usually did or is 
better to make a setContext method in the page receiving the data? If so, how 
do I implement the setter? With a constructor of ArrayEventContext? 


   Thank you very much again. I really aprecciate the help of all you guys. 
It's saving my life!

_
Con Vodafone disfruta de Hotmail gratis en tu móvil. ¡Pruébalo!
http://serviciosmoviles.es.msn.com/hotmail/vodafone.aspx

Re: Newbie questions

2009-09-03 Thread Thiago H. de Paula Figueiredo
Em Thu, 03 Sep 2009 08:40:53 -0300, Martin Torre Castro  
mad...@hotmail.com escreveu:



Thank you very much Thiago.


You're welcome!

EventContext is working ok when I'm sending data from the page to the  
same page. But if I send data from another page and I'm setting the  
EventContext parameters as before is show an error:


method onActivate signature: (Lorg/apache/tapestry/EventContext;)V)  
Illegal constant pool index


This is a compilation or class manipulation issue. Try recompiling your  
application.
It looks like you're trying to receive an array of EventContext in your  
onActivate method: that's not correct. It should be  
onActivate(EventContext context).
The context value can't be an EventContext (something I guess it's fixed  
in the next Tapestry version).


Do I have to set the onActivate parameters one by one as I usually did  
or is better to make a setContext method in the page receiving the data?


If you use a method other than onActivate to recevie data, it's a valid  
choice, but you're not using the activation context.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Newbie questions

2009-09-03 Thread Madtyn
Hi. I made the mvn clean and tried again to run the app but the same
error keeps on.

/* on the FindSocios page */-

showSocios.setSocioSearchType(socioSearchType.toString());  //LINE 122
the stacktrace leads to here, the only hint I have
showSocios.setDateSearchType(dateSearchType.toString());
showSocios.setCatSearchType(catSearchType.toString());

switch(socioSearchType) {
   case ALL:
   return showSocios;
   case BYLOGIN:
   showSocios.setLogin(login);
   return showSocios;
   case BYDNI:
   showSocios.setDni(dni);
   return showSocios;

/* on the ShowSocios page*/--

The onActivate() signature when receiving is:





void onActivate(EventContext context) throws ParseException {

  this.idServ = context.get(Long.class, 3);
  this.login= context.get(String.class, 5);
  this.dni= context.get(String.class, 6);
...and so on
}

java.lang.VerifyError
(class: es/udc/madtyn/gimnasio/web/pages/show/ShowSocios, method:
onActivate signature: (Lorg/apache/tapestry5/EventContext;)V) Illegal
constant pool index
Stack trace:
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.init(InternalComponentResourcesImpl.java:85)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.init(ComponentPageElementImpl.java:589)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.init(ComponentPageElementImpl.java:602)
org.apache.tapestry5.internal.services.PageElementFactoryImpl.newRootComponentElement(PageElementFactoryImpl.java:266)
org.apache.tapestry5.internal.services.PageLoaderProcessor.loadRootComponent(PageLoaderProcessor.java:412)
org.apache.tapestry5.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:390)
org.apache.tapestry5.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:210)
org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:99)
org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:51)
org.apache.tapestry5.internal.services.ComponentSourceImpl.getPage(ComponentSourceImpl.java:79)
es.udc.madtyn.gimnasio.web.pages.find.FindSocios._$read_inject_page_showSocios(FindSocios.java)
es.udc.madtyn.gimnasio.web.pages.find.FindSocios.onSubmitFromBusquedaForm(FindSocios.java:122)

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



Re: Newbie questions

2009-09-03 Thread Madtyn
   More than one select. The problem is that the model of the select
is an Enum made by myself. As I explained, when I did the conversion
to String and used the parameter by parameter onPassivate()-onActivate
way of doing it, it worked. But using the EventContext is going to get
me more than nervous :-(.




2009/9/3, Joshua Martin josmar52...@gmail.com:
 Are you trying to pass the value of a Select to another page?


 On Thu, Sep 3, 2009 at 5:14 PM, Madtyn mad...@gmail.com wrote:

   I'm experimenting and trying all kinds of things and I think the
 problem I have is when passing Enums to the EventContext. Although I
 do before the Enum - String conversion and then set the String value
 in the destination page and return as a String  in the onPassivate,
 when I get the String value before converting it to Enum again, this
 makes something fail.

   I can't understand why it did work when I didn't used the
 EventContext and why it does fail now.


   Anyone does know about an efficient way to pass the Enums from the
 select component on the first page to the EventContext to the second
 injected page?

   I know I could use a @Persist annotation, but it involves some
 details I would prefer avoiding. Some sample code would be great.

 Thanks to everyone

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




 --
 _

 Joshua S. Martin


 CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
 contains information that may be confidential, protected by the attorney
 client or other legal privileges, and or proprietary non public information.
 If you are not an intended recipient of this message or an authorized
 assistant to an intended recipient, please notify the sender by replying to
 this message and then delete it from your system. Use, dissemination,
 distribution, or reproduction of this message and or any of its attachments
 (if any) by unintended recipients is not authorized and may be unlawful.


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



Re: Newbie questions

2009-09-02 Thread Thiago H. de Paula Figueiredo
Em Wed, 02 Sep 2009 16:30:44 -0300, Martin Torre Castro  
mad...@hotmail.com escreveu:


 Hello, I have some doubts I can't solve about passing values  
between pages and don't understand as I wish.Maybe you could help me.


Hi!

1.-When I've got more than one onActivate() for a page with different  
kinds of arguments, for example:

[...]

Use a single onActivate(EventContext context) method. It will be invoked  
with any number of parameters. EventContext.getCount() will give you the  
number of parameters and EventContext.get(Class typeToConvert, int index)  
will return the parameter values.


2.-About catching the values from selects and texfields, I've seen some  
code using attributes on Java with _attributeName linking these  
variables to the values on the html components. This is a convention on  
Tapestry that makes it to find automatically the so _named fields or I'm  
missing something?


This _fieldName is a field naming convention that Howard, the framework  
creator and main committer, used to follow. Tapestry doesn't treat  
underscored-prefixed fields differently from non-undescored-prefixed ones.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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