Re: [T5.1] How To Send HTTP Error as Response?

2010-02-18 Thread Roy112





"You can try to use this  http://soft-net.net/SendHTTPTool.aspx send http
tool  to send your http request and view the http response and code"
-- 
View this message in context: 
http://old.nabble.com/-T5.1--How-To-Send-HTTP-Error-as-Response--tp27551789p27650534.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



Re: Activation context for a component?

2010-02-18 Thread Nathan Kopp
Hey... I did a little follow-up on this and decided to create an "event-safe
loop" that can restore the state of the loop variable using the page
activation context.  It's not quite perfect, but it's good enough for my
needs right now.  For my application, the resulting code ended up looking
much cleaner than the version that used only the event's context to restore
the state.

It works like this:
1) Replace your  component with   You should specify the
t:id parameter... you'll need to know it for step 3.
2) Provide an encoder for the loop value. This parameter is optional for
 but required for .  However, only toClient() needs to
be implemented.
3) Annotate your loop value with @LoopValue("loopid") instead of @Property,
where "loopid" is the t:id specified for the .

The  component stores the state, and @LoopValue creates a
special getter that can restore the state.

Unfortunately, there are some additional requirements that I'd like to
remove:
1) The loop source cannot be initialized by lifecycle methods (e.g.
@BeginRender), since they won't get called.
2) You must include "@Inject ComponentResources res;" in your component in
order for the code generated by @LoopValue to compile.
3) The underlying page must provide simple (one-line) boilerplate
onPassivate and onActivate methods, which can be provided by inheriting from
a superclass.
4) Care must be taken if you want to also use the page activation context
for other purposes.

So far, this is working very well for my application.  I haven't tested its
compatibility with the formEncode feature of the normal Loop component.  If
other people are interested, I'm willing to share the source code... but I
probably won't have time to provide much support.

-Nathan


On Tue, Feb 16, 2010 at 11:08 PM, Nathan Kopp wrote:

> Probably the tip I needed was this:
>
> "When using an EventLink inside a loop, be sure that your event handling
> method does not refer to any loop variable either directly or indirectly.
>  Especially be cautions of referring to parameters that may have been bound
> to any loop variable or a field of a loop variable.  If you avoid referring
> to such parameters in the eventlink's event handler (and pass the
> information to that method using the context instead), Tapestry will not
> attempt to process the parameter binding, and therefore no problem will be
> caused by the null loop variable."
>
> I would have found this most easily if it were located in the primary
> documentation for either EventLink or Loop in the component reference.
>
> Tapestry's stack trace actually did a good job highlighting the offending
> line of code, once I figured out what was happening.
>
> Personally, I think it would be great if there would be a way for the Loop
> component to automatically encode loop state into something like the page
> activation context and then automatically restore that point-in-time state
> when processing the eventlink request.  It would work like a blend of the
> page activation context and the formState functionality already in the Loop
> component.  However, this feature isn't really necessary as long as
> developers use the action context and avoid the "gotcha" that I ran into.
>
> -Nathan
>
>
>
> On Tue, Feb 16, 2010 at 10:45 PM, Kalle Korhonen <
> kalle.o.korho...@gmail.com> wrote:
>
>> Nathan, since you invested considerable amount of time debugging a
>> case that seems to be just a standard event bubbling behavior, do you
>> think that there is anything you'd think the framework or somebody
>> could do to make the logical error in your code more visible? I know
>> Tapestry documentation has often been blamed and while "everything is
>> there", it's scattered - if you knew what you are looking for, you'd
>> find it. But on the other side, I don't know how to make it better and
>> I'm sure you can see now why the old-timers annoyingly enough just
>> kept repeating the same message. So, is this just a case of having to
>> learn the tricks of the trade or is there something we could
>> collectively do to improve things?
>>
>> Kalle
>>
>>
>> On Tue, Feb 16, 2010 at 7:18 PM, Nathan Kopp 
>> wrote:
>> > For future reference... this in fact turned out to be a bug in my code.
>> >  Under normal circumstances Tapestry will NOT attempt to perform
>> parameter
>> > bindings when processing the EventLink.  However, I accidentally left a
>> line
>> > of code in my event handling method which referenced one of the
>> parameters
>> > which was bound to the loop variable.  The line of code was purely
>> > unnecessary, but it is what caused Tapestry to process the bindings, and
>> > thus trigger a null pointer exception.  Once I removed that line of
>> code,
>> > Tapestry was able to execute my method without any exceptions.  Many
>> thanks
>> > to those who offered the recommendations that eventually led me to
>> locate my
>> > bug and resolve the problem.
>> >
>> > -Nathan
>> >
>> >
>> >
>> > On Tue, Feb 16, 2010 at 9:32 AM, Nathan Kopp > >wr

exceptions sometimes are omitted completely

2010-02-18 Thread Yury Luneff
Hello!

I'm  fighting  with  my app for features now. There is a problem about
valueencoders  and  such and i guess this problem should report as any
kind  of  exception  - either the beautiful one done by tapestry or at
least stacktrace in log window.

But tapestry chooses neither. Just empty page and that's all.

Sometime  ago  this  also  happened  a  lot  - one mistake in property
binding  and  you get the right exception sometimes, but sometimes you
get completely nothing.

"Debug" in log4j doesn't quite help here.

Did  anyone  meet  that  behavior?  It  is  very  unpleasant  to debug
something  with  empty pages and no exceptions (log4j, btw, is set for
error level as default which should do exceptions).


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



Re: Hosting Apache Tapestry5.1 on GAE (Google Application Engine)

2010-02-18 Thread Kalle Korhonen
On that note, I also recently deployed Tynamo's conversation example
to GAE (see http://tynamo.org/tapestry-conversations+guide and
http://tapestry-conversations.tynamo.org/), it was pretty
straight-forwarded. It's all mavenized and naturally, the source is
available for others to look at.

Kalle


On Wed, Feb 17, 2010 at 7:21 AM, Muhammad Mohsen  wrote:
> I'd like to share my experience regarding the issue. I'm not a tapestry guru
> but I just fought my way through hosting it on google application engine.
>
> Here is my blogpost about hosting tapestry5.1 on Google application
> engine
> You'll find the application's link it but here it is
> again
> .
>
> Please note that it has absolutely NOTHING but registering, logging in and
> logging out !
> That's as much as I've gone with tapestry so far. I had nothing in mind to
> do !
>
> Enjoy :)
>
> --
> Muhammad Mohsen Hussien
> Jr. Java Software Engineer
> HP Enterprise Services
>

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



t5: tml css code completion in Intellij 9

2010-02-18 Thread Angelo Chen

Hi,

This might be a out of topic question, sorry. I notice that css codes
embedded in tml file does not have code completion in the IDEA 9, it used to
be working in IDEA 8, any idea how to enable it? thanks.
-- 
View this message in context: 
http://old.nabble.com/t5%3A-tml-css-code-completion-in-Intellij-9-tp27649141p27649141.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



Re: [T5.1] Log4j and Application Development/Production Mode

2010-02-18 Thread Juan E. Maya
Hi Everton, I usually do this kind of things (Properties that change between
environments) using maven profiles + and maven resource filtering as
explained here:
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

It's not a Tapestry way but u could find it useful.


On Thu, Feb 18, 2010 at 7:13 PM, Everton Agner
wrote:

> Hi,
>
> There is any T5 Elegant way so I can automatically switch between distincts
> Log4J configurations related to Development/Production Mode? We have the
> @Symbol "productionMode", so I believe there is some way I can achieve that
> using this information...
>
> I saw something like that on an old Struts 1.3 application, so there was a
> log4j.properties file on the project and, on the Deployment Server, other
> log4j.properties (and some weird conf to make it works). So, I could work on
> DEBUG mode on the Development environment, and in ERROR mode on Deployment
> environment without having to change.
>
> I don't want to do that here, though...
>
> Any help would be appreciated.
>
>
> Thanks!
>
> Everton
>
>
>
>
>  
> 
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>


[T5.1] Log4j and Application Development/Production Mode

2010-02-18 Thread Everton Agner
Hi,

There is any T5 Elegant way so I can automatically switch between distincts 
Log4J configurations related to Development/Production Mode? We have the 
@Symbol "productionMode", so I believe there is some way I can achieve that 
using this information...

I saw something like that on an old Struts 1.3 application, so there was a 
log4j.properties file on the project and, on the Deployment Server, other 
log4j.properties (and some weird conf to make it works). So, I could work on 
DEBUG mode on the Development environment, and in ERROR mode on Deployment 
environment without having to change.

I don't want to do that here, though...

Any help would be appreciated.


Thanks!

Everton



  

Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: Renaming resource files

2010-02-18 Thread Ulrich Stärk
Could you try to enable fr_FR in your list of supported locales and see if users with the fr_CA 
locale set then get the french validation messages?


Uli

On 18.02.2010 16:49 schrieb Lionel Touati:

Hi List,

Lots of validation messages do have both language and country part of their 
name. It makes lots of sense for some countries, but for fr it means that 
tapestry default to en for locale such as fr_CA or fr_BE where if the file name 
did not include the country, it would default to fr, which is better I think.

Is this a bug ?

Thanks for letting me know

L.


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



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



Re: t5: form and zone

2010-02-18 Thread Thiago H. de Paula Figueiredo
On Thu, 18 Feb 2010 13:40:08 -0200, Angelo Chen  
 wrote:



Hi,


Hi!


in the following code, the 'infoblock' will be rendered when the form is
submitted, but I'd like the 'infoblock' to be rendered before submitting  
as well, how to achieve this? Thanks.


Use the Delegate component:






  < t:form t:id="info"  zone="zone1">

  < input t:type="textfield" t:id="temp" t:value="tempvalue"
 t:label="temp"/>
  < input type="submit" value="Update" name="submit"/>
  < t:errors/>
  < /t:form>

  < t:zone t:id="zone1" />

  < t:block t:id="infoBlock">
  < /t:block>

   Block onSuccess() {
return infoBlock;
}






--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Sócio, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Renaming resource files

2010-02-18 Thread Lionel Touati
Hi List,

Lots of validation messages do have both language and country part of their 
name. It makes lots of sense for some countries, but for fr it means that 
tapestry default to en for locale such as fr_CA or fr_BE where if the file name 
did not include the country, it would default to fr, which is better I think.

Is this a bug ?

Thanks for letting me know

L.


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



t5: form and zone

2010-02-18 Thread Angelo Chen

Hi,

in the following code, the 'infoblock' will be rendered when the form is
submitted, but I'd like the 'infoblock' to be rendered before submitting as
well, how to achieve this? Thanks.


  < t:form t:id="info"  zone="zone1">

  < input t:type="textfield" t:id="temp" t:value="tempvalue"
 t:label="temp"/>
  < input type="submit" value="Update" name="submit"/>
  < t:errors/>
  < /t:form>
  

  < t:zone t:id="zone1" />
 

  < t:block t:id="infoBlock">
  < /t:block>

   Block onSuccess() {
return infoBlock;
}



-- 
View this message in context: 
http://old.nabble.com/t5%3A-form-and-zone-tp27637837p27637837.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



Re: ZoneUpdater and Zone Race-Condition

2010-02-18 Thread kamiseq
you can add mixins to your "a" tags that will get id of the link and href
generated by tapestry, then you can call server from client like any other
resource from your own code. no magic there.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


2010/2/18 Dominik Gätjens 

> I'm hoping there will be a nice solution, too.
>
> But in the meantime is there any documentation about Tapestrys
> client-side-behaviour? Because i can't imagine what you mean with:
>
> "you can hack it whit your own implementation of the page request through
> prototype or jquery it is straight forward."
>
>
> -Original Message-
> From: kamiseq [mailto:kami...@gmail.com]
> Sent: Wednesday, February 17, 2010 3:38 PM
> To: Tapestry users
> Subject: Re: ZoneUpdater and Zone Race-Condition
>
> ok, good point but you can hack it whit your own implementation of the page
> request through prototype or jquery it is straight forward. but I would
> like
> to hear from someone more experienced in T5 as well.
>
> pozdrawiam
> Paweł Kamiński
>
> kami...@gmail.com
> pkaminski@gmail.com
> __
>
>
> 2010/2/17 Dominik Gätjens 
>
> > to abort the ajax call sounds very very good. But i don't know where i
> can
> > do this in Tapestry because Tapestry does the whole AJAX XMLHttpRequest
> > thing
> >
> > -Ursprüngliche Nachricht-
> > Von: kamiseq [mailto:kami...@gmail.com]
> > Gesendet: Mittwoch, 17. Februar 2010 15:15
> > An: Tapestry users
> > Betreff: Re: ZoneUpdater and Zone Race-Condition
> >
> > maybe instead of timestamp you may try to return json/xml with pattern as
> > key and data as value, so you will match key with what you actually are
> > looking for. why can't you just abort the request if new char has been
> hit
> >
> > http://javascript.about.com/library/blajax11.htm
> > 
> >
> >
> http://www.bennadel.com/blog/1002-XMLHttpRequest-Object-Has-An-Abort-Method.htm
> >
> > <
> >
> http://www.bennadel.com/blog/1002-XMLHttpRequest-Object-Has-An-Abort-Method.htm
> > >jquery
> > :
> >
> >
> http://stackoverflow.com/questions/600494/jquery-automatically-abort-ajaxrequests-on-page-unload
> >
> > <
> >
> http://stackoverflow.com/questions/600494/jquery-automatically-abort-ajaxrequests-on-page-unload
> > >maybe
> > you should wait few seconds after last char has been entered to give a
> time
> > to enter next time before you send request
> >
> > pozdrawiam
> > Paweł Kamiński
> >
> > kami...@gmail.com
> > pkaminski@gmail.com
> > __
> >
> >
> > On 17 February 2010 14:00, Dominik Gätjens  > >wrote:
> >
> > > Hello,
> > >
> > >
> > >
> > > I'm using the ZoneUpdater mixin from
> > >
> >
> http://tinybits.blogspot.com/2009/05/update-zone-on-any-client-side-event.htmltosendan
>  event at every keyup event on a textfield.
> > >
> > > This event triggers a webservice-method to fetch some data into a zone.
> > >
> > > if u type "ab"  the a fires an event and starts to rerender the Zone
> with
> > > getData("a"). This takes a long time about 30-40 seconds. The second
> > event
> > > getData("ab") is much faster about 1 second. So what happen ist hat you
> > see
> > > the result from getData(ab) in the Zone and after a few seconds it
> > changes
> > > to the result of getData(a).
> > >
> > >
> > >
> > > I need any chance to abort the first request or to return the the data
> of
> > > the second (getData(ab)) request again.
> > >
> > >
> > >
> > > I tried to cache the last result with a timestamp in the Session. But
> it
> > > looks like that @Persist fields are restored at page actiavation and
> > don't
> > > reflect any changes made in the session.
> > >
> > >
> > >
> > > Here ist the important code:
> > >
> > >
> > >
> > > 
> > >
> > >   > > event="keyup" t:zone="ligen"/>
> > >
> > >  
> > >
> > > 
> > >
> > >
> > >
> > > 
> > >
> > >  
> > >
> > >  ${liga.key}
> > >
> > >  
> > >
> > > 
> > >
> > >
> > >
> > >  @Property
> > >
> > >  private Liga liga;
> > >
> > >  @Property
> > >
> > >  @Persist
> > >
> > >  private String key
> > >
> > >
> > >
> > >
> > >
> > >  public Object onKeyup(String value) {
> > >
> > >key = value;
> > >
> > >return new MultiZoneUpdate("ligen", ligen.getBody());
> > >
> > >  }
> > >
> > >
> > >
> > >
> > >
> > >  public List getLigen() {
> > >
> > >if(key==null || key.equals("")) return new
> ArrayList();
> > >
> > >List list = ligaDAO.getLigenByKey(key);   //may need a
> > lot
> > > of time
> > >
> > >if(list==null){
> > >
> > >  list =  new ArrayList();
> > >
> > >}
> > >
> > >return list;
> > >
> > >  }
> > >
> > >
> > >
> > >
> > >
> > > Dominik
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional comma

Re: Help : Dynamically Generated Checkboxes

2010-02-18 Thread gdinBeli

Thanks, just what i needed!

Josh Canfield wrote:
> 
> Something like this.
> 
> You'll want is an ordered list of NewsLetterType. Ordered because you
> are going to access them by index.
> 
> @Property
> private List types;
> 
> @Property
> private int typeIndex;
> 
> public boolean getTypeChecked() {
>   NewsLetterType t = types.get(typeIndex);
>   return subscriber.types.contains(t);
> }
> 
> public void setTypeChecked(boolean checked) {
>   NewsLetterType t = types.get(typeIndex);
>   if ( checked ) subscriber.types.add(t);
>   else subscriber.types.remove(t);
> }
> 
>  ${type.name} 
> 
> 
> I didn't compile this code so there are bound to be typos, but it
> should get you started.
> 
> 
> Josh
> 
> On Wed, Feb 17, 2010 at 2:08 AM, gdinBeli  wrote:
>>
>> Hi, I'm new to Tapestry5 and I'm try to create checkbox list which will
>> change dynamically. Here is the thing: I'm making a newsletter modul. I'm
>> using tapestry5 and hibernate. So I have something like this : Subscriber
>> which has Set, also I've NewsletterType with
>> Set, so please instruct me how to make a component (in
>> tapestry5) which will be list of NewsletterTypes represented by checkbox
>> list.  I 'd use on subscriber's registration page. I want to have
>> functionality , when I change the number of NewsletterTypes so changes my
>> checkbox list on page subscriber/registration.  Example of how this
>> should
>> look can be found on numerous sites. e.g. https://adage.com/register.php
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Help-%3A-Dynamically-Generated-Checkboxes-tp27621521p27621521.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
>>
>>
> 
> 
> 
> -- 
> --
> http://www.bodylabgym.com - a private, by appointment only, one-on-one
> health and fitness facility.
> --
> http://www.ectransition.com - Quality Electronic Cigarettes at a
> reasonable price!
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Help-%3A-Dynamically-Generated-Checkboxes-tp27621521p27636706.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



RE: ZoneUpdater and Zone Race-Condition

2010-02-18 Thread Dominik Gätjens
I'm hoping there will be a nice solution, too.

But in the meantime is there any documentation about Tapestrys 
client-side-behaviour? Because i can't imagine what you mean with:

"you can hack it whit your own implementation of the page request through 
prototype or jquery it is straight forward."


-Original Message-
From: kamiseq [mailto:kami...@gmail.com] 
Sent: Wednesday, February 17, 2010 3:38 PM
To: Tapestry users
Subject: Re: ZoneUpdater and Zone Race-Condition

ok, good point but you can hack it whit your own implementation of the page
request through prototype or jquery it is straight forward. but I would like
to hear from someone more experienced in T5 as well.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


2010/2/17 Dominik Gätjens 

> to abort the ajax call sounds very very good. But i don't know where i can
> do this in Tapestry because Tapestry does the whole AJAX XMLHttpRequest
> thing
>
> -Ursprüngliche Nachricht-
> Von: kamiseq [mailto:kami...@gmail.com]
> Gesendet: Mittwoch, 17. Februar 2010 15:15
> An: Tapestry users
> Betreff: Re: ZoneUpdater and Zone Race-Condition
>
> maybe instead of timestamp you may try to return json/xml with pattern as
> key and data as value, so you will match key with what you actually are
> looking for. why can't you just abort the request if new char has been hit
>
> http://javascript.about.com/library/blajax11.htm
> 
>
> http://www.bennadel.com/blog/1002-XMLHttpRequest-Object-Has-An-Abort-Method.htm
>
> <
> http://www.bennadel.com/blog/1002-XMLHttpRequest-Object-Has-An-Abort-Method.htm
> >jquery
> :
>
> http://stackoverflow.com/questions/600494/jquery-automatically-abort-ajaxrequests-on-page-unload
>
> <
> http://stackoverflow.com/questions/600494/jquery-automatically-abort-ajaxrequests-on-page-unload
> >maybe
> you should wait few seconds after last char has been entered to give a time
> to enter next time before you send request
>
> pozdrawiam
> Paweł Kamiński
>
> kami...@gmail.com
> pkaminski@gmail.com
> __
>
>
> On 17 February 2010 14:00, Dominik Gätjens  >wrote:
>
> > Hello,
> >
> >
> >
> > I'm using the ZoneUpdater mixin from
> >
> http://tinybits.blogspot.com/2009/05/update-zone-on-any-client-side-event.htmltosend
>  an event at every keyup event on a textfield.
> >
> > This event triggers a webservice-method to fetch some data into a zone.
> >
> > if u type "ab"  the a fires an event and starts to rerender the Zone with
> > getData("a"). This takes a long time about 30-40 seconds. The second
> event
> > getData("ab") is much faster about 1 second. So what happen ist hat you
> see
> > the result from getData(ab) in the Zone and after a few seconds it
> changes
> > to the result of getData(a).
> >
> >
> >
> > I need any chance to abort the first request or to return the the data of
> > the second (getData(ab)) request again.
> >
> >
> >
> > I tried to cache the last result with a timestamp in the Session. But it
> > looks like that @Persist fields are restored at page actiavation and
> don't
> > reflect any changes made in the session.
> >
> >
> >
> > Here ist the important code:
> >
> >
> >
> > 
> >
> >   > event="keyup" t:zone="ligen"/>
> >
> >  
> >
> > 
> >
> >
> >
> > 
> >
> >  
> >
> >  ${liga.key}
> >
> >  
> >
> > 
> >
> >
> >
> >  @Property
> >
> >  private Liga liga;
> >
> >  @Property
> >
> >  @Persist
> >
> >  private String key
> >
> >
> >
> >
> >
> >  public Object onKeyup(String value) {
> >
> >key = value;
> >
> >return new MultiZoneUpdate("ligen", ligen.getBody());
> >
> >  }
> >
> >
> >
> >
> >
> >  public List getLigen() {
> >
> >if(key==null || key.equals("")) return new ArrayList();
> >
> >List list = ligaDAO.getLigenByKey(key);   //may need a
> lot
> > of time
> >
> >if(list==null){
> >
> >  list =  new ArrayList();
> >
> >}
> >
> >return list;
> >
> >  }
> >
> >
> >
> >
> >
> > Dominik
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Cross Validation in dynamic Forms

2010-02-18 Thread Stephan Windmüller
Dominik Gätjens wrote:

> Thank you Stephan this works perfect and it was a big step in my
> understanding of Tapestry. Do you mind if i create a wiki articel out
> of your code example?

Of course not. I would have done it myself but did not find the time.

Regards
 Stephan

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



AW: AW: Cross Validation in dynamic Forms

2010-02-18 Thread Dominik Gätjens
Thank you Stephan this works perfect and it was a big step in my understanding 
of Tapestry. Do you mind if i create a wiki articel out of your code example?

-Ursprüngliche Nachricht-
Von: Stephan Windmüller [mailto:stephan.windmuel...@cs.tu-dortmund.de] 
Gesendet: Mittwoch, 17. Februar 2010 16:23
An: users@tapestry.apache.org
Betreff: Re: AW: Cross Validation in dynamic Forms

Dominik Gätjens wrote:

> I read this thread but don't understand it. Do you have a code example for me?

The setup is complex. Follow these steps and let me know if there is
anything unclear:

1. Save controlNames of all fields

If your field has the id "myField", use this code:

-

private Map controlNames;

void onValidateFromMyField(Object value) {
if (controlNames == null) {
controlNames = new HashMap();
}

controlNames.put(paper, myField.getControlName());
}

-

Object is the current value you are iterating over, depending on your
page. Verify in onValidateForm that all controlNames are set.


2. Create your own component SimpleField:



public class SimpleField implements Field {

private String controlName;

public void setControlName(String controlName) {
this.controlName = controlName;
}

public String getControlName() {
return this.controlName;
}

[...]
}



Put it in your tml and inject it in your page code.


3. Use both in onValidateForm

Check the submitted values in onValidateForm. If a field should be
marked, set the controlName of the simpleField and record an error for it.

HTH
 Stephan

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


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