Re: form and select component
Maybe the following will help? http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/select1 http://jumpstart.doublenegative.com.au/jumpstart/examples/component/subformcomponent1 Cheers, Geoff On 27/10/2012, at 4:29 AM, nhhockeyplayer nashua wrote: > > Ok I got the select to operate now with... > > onchange="galleryForm.submit()" > > funny thing... the gallery renders the proper amount of objects based on > whats selected... but my darn select event handler never gets called i > cannot get a break point in it or a log statement out of it > > oh well...onward > > I am historically an DECWindows XWindows buff... babied by the MIT boys back > in the day... but this is endless challenging fun > > From: nhhockeypla...@hotmail.com > To: users@tapestry.apache.org > Subject: RE: form and select component > Date: Fri, 26 Oct 2012 09:04:19 -0400 > > > > > > Ok, I am stubborn.. because it worked fine in T4 without the form. > > But it is housed within a form... from the Home.tml... the form just isnt > apparently visible inside the code of my widget. > > Home.tml > > > > >collectionType="coachClass" >itemsPerPage="itemsPerPage" >tableColumns="tableColumns" >cursor="cursor" >/> > > > > onchange="this.form.submit()" should work > > ok I will get out the firebug and see what gives inside the dom > > Best regards > and thanks... KEN > > From: nhhockeypla...@hotmail.com > To: users@tapestry.apache.org > Subject: RE: form and select component > Date: Fri, 26 Oct 2012 00:37:24 -0400 > > > > > > t:clientId="itemsPerPageSelect" id="itemsPerPageSelect" >t:model="literal:5,10,15,25,50,100,250,500,1000,5000,1" >t:value="itemsPerPage" > > onchange="obj=document.getElementById('itemsPerPageSelect');Event.fire(obj,'change');" > >/> > > this one doesnt invoke the handler either > > but I changed handkler to the following > >@Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", > "clientId=itemsPerPageSelect" }) >private Select itemsPerPageSelect; > >@OnEvent(value = EventConstants.VALUE_CHANGED, component = > "itemsPerPageSelect") > >public void onValueChangedItemsPerPageSelect(int value) >{ >} > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: form and select component
Ok I got the select to operate now with... onchange="galleryForm.submit()" funny thing... the gallery renders the proper amount of objects based on whats selected... but my darn select event handler never gets called i cannot get a break point in it or a log statement out of it oh well...onward I am historically an DECWindows XWindows buff... babied by the MIT boys back in the day... but this is endless challenging fun From: nhhockeypla...@hotmail.com To: users@tapestry.apache.org Subject: RE: form and select component Date: Fri, 26 Oct 2012 09:04:19 -0400 Ok, I am stubborn.. because it worked fine in T4 without the form. But it is housed within a form... from the Home.tml... the form just isnt apparently visible inside the code of my widget. Home.tml onchange="this.form.submit()" should work ok I will get out the firebug and see what gives inside the dom Best regards and thanks... KEN From: nhhockeypla...@hotmail.com To: users@tapestry.apache.org Subject: RE: form and select component Date: Fri, 26 Oct 2012 00:37:24 -0400 this one doesnt invoke the handler either but I changed handkler to the following @Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", "clientId=itemsPerPageSelect" }) private Select itemsPerPageSelect; @OnEvent(value = EventConstants.VALUE_CHANGED, component = "itemsPerPageSelect") public void onValueChangedItemsPerPageSelect(int value) { }
Re: form and select component
On Fri, 26 Oct 2012 11:04:19 -0200, nhhockeyplayer nashua wrote: Ok, I am stubborn.. because it worked fine in T4 without the form. T5 is not T4. T5 is a complete rewrite, not sharing any code with T4, so don't expect stuff to work in the same way. But it is housed within a form... from the Home.tml... the form just isnt apparently visible inside the code of my widget. Home.tml onchange="this.form.submit()" should work Again, use the right thing, use event listeners, not onXXX. You seem to be really stubborn to do things the non-recommended way . . . :P -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: form and select component
Ok, I am stubborn.. because it worked fine in T4 without the form. But it is housed within a form... from the Home.tml... the form just isnt apparently visible inside the code of my widget. Home.tml onchange="this.form.submit()" should work ok I will get out the firebug and see what gives inside the dom Best regards and thanks... KEN From: nhhockeypla...@hotmail.com To: users@tapestry.apache.org Subject: RE: form and select component Date: Fri, 26 Oct 2012 00:37:24 -0400 this one doesnt invoke the handler either but I changed handkler to the following @Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", "clientId=itemsPerPageSelect" }) private Select itemsPerPageSelect; @OnEvent(value = EventConstants.VALUE_CHANGED, component = "itemsPerPageSelect") public void onValueChangedItemsPerPageSelect(int value) { }
Re: form and select component
Why isnt this sufficient? It refuses to invoker the event handler. I've already told you that it won't work and why, in this same thread why, so I don't think I need to repeat it here. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: form and select component
Am 26.10.2012 02:32, schrieb nhhockeyplayer nashua: Folks, Do I really NEED to have a form with my components ? I know its unorthadox... but I would like to skip the form if possible to keep this lightweight and just use onchange="this.form.submit()" when it gets selected. For that concrete question: ask yourself, why you need a form to call "this.form..."... Probably many of you (who ask questions on the Tapestry list) should learn a little bit basics about html and javascript, too. It's not enough to write java code, you should understand what the template code does, too. Your question about select isn't a tapestry issue or question, it's a basic html issue; well... if you want, call it a slightly sophisticated html issue, but that's it. If you're not sure how it works server side, first make sure which client side html code is generated (e.g. using Firebug), and work out, if and how communication with your server side tapestry application works. You will find, that this.form.submit() would trigger a builtin javascript function on a form element, but that form element doesn't exist, because it has to be an ancestor of your select - and therefore you would have needed the form element in your template as well. That's basics, sorry. Probably Tapestry makes development too easy, if these basics are ignored. regards Peter - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: form and select component
this one doesnt invoke the handler either but I changed handkler to the following @Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", "clientId=itemsPerPageSelect" }) private Select itemsPerPageSelect; @OnEvent(value = EventConstants.VALUE_CHANGED, component = "itemsPerPageSelect") public void onValueChangedItemsPerPageSelect(int value) { }
RE: form and select component
as you can tell I like to keep things petite and simple onchange="Event.fire(this,'change');" ? From: nhhockeypla...@hotmail.com To: users@tapestry.apache.org Subject: RE: form and select component Date: Thu, 25 Oct 2012 23:49:20 -0400 @Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", "clientId=itemsPerPageSelect" }) private Select itemsPerPageSelect; @OnEvent(value = EventConstants.VALUE_CHANGED, component = "itemsPerPageSelect") public Object onValueChangedItemsPerPageSelect() { ... } Why isnt this sufficient? It refuses to invoker the event handler. I am beating this thing to death with ID's I figured I would at least get a break point.
RE: form and select component
@Component(id="itemsPerPageSelect", parameters = { "value=itemsPerPage", "clientId=itemsPerPageSelect" }) private Select itemsPerPageSelect; @OnEvent(value = EventConstants.VALUE_CHANGED, component = "itemsPerPageSelect") public Object onValueChangedItemsPerPageSelect() { ... } Why isnt this sufficient? It refuses to invoker the event handler. I am beating this thing to death with ID's I figured I would at least get a break point.
Re: form and select component
On Thu, 25 Oct 2012 22:32:42 -0200, nhhockeyplayer nashua wrote: Folks, Hi! Do I really NEED to have a form with my components ? Short answer: yes. Long answer: ys. :P The Form component is the one who actually invokes the form field components logic that handles form submissions, so no, you can't have Tapestry's form field components without a surrounding Form. On the other hand, nothing prevents you to create your own Select-like component that doesn't need a Form to work and (optionally) submits a hidden form or triggers some server-side event. I know its unorthadox... Almost all of the unorthodox things you've asked so far were the wrong way of doing something and the orthodox way was the recommended one. but I would like to skip the form if possible to keep this lightweight What's the weight you think the Form component adds? and just use onchange="this.form.submit()" when it gets selected. You can do that with the Form component. Anyway, don't use onchange, use Prototype's Event.observe() or the corresponding function in jQuery or your JS framework of choice instead. Do the right thing. Leave bad things behind. :) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
form and select component
Folks, Do I really NEED to have a form with my components ? I know its unorthadox... but I would like to skip the form if possible to keep this lightweight and just use onchange="this.form.submit()" when it gets selected. Can I guarantee my handler will be invoked and the select value persisted across requests (provided I do it right). I have yet to see my handler get invoked on selection. I am wondering if the dependencies between select and form are too substantive to bypass the form and operate the select with the javascript submit. Thanks for any clarification. Best regards and thanks... KEN
Form and Select
Hi, It should be a simple problem but I tried to solve it without success. So, mainly, I have javabean used to fill and store a form. The form consist on 2 Select box and 3 String fields. Home.html Why do I need to create an object to store the current value? I want to store the current value in searchCriteria.requester/searchCriteria.language. If I replace by I don't have the error but the searchCriteria.requester is null when I submit!! What is the best way to use this @Select @Option component? Home.java /** The AppSettings */ public abstract ApplicationSettings getAppSettings(); public abstract void setAppSettings(ApplicationSettings appSettings); /** The search criterias */ public abstract SearchCriteria getSearchCriteria(); public abstract void setSearchCriteria(SearchCriteria searchCriteria); /** List of the requesters */ public abstract List getRequesters(); public abstract void setRequesters(List requesters); /** List of the languages */ public abstract List getLanguages(); public abstract void setLanguages(List languages); /** * Initialized appSettings at the loading process, beginning of the render [EMAIL PROTECTED] event The Tapestry loading page event */ public void pageBeginRender(PageEvent event) { ApplicationSettings appSettings = getAppSettings(); setRequesters(appSettings.getRequesters()); setLanguages(appSettings.getLanguages()); SearchCriteria searchCriteria = getSearchCriteria(); if (searchCriteria == null) { searchCriteria = new SearchCriteria(); searchCriteria.setRequester((Requester)getRequesters().get(0)); searchCriteria.setYear("2006"); searchCriteria.setNumber("1"); searchCriteria.setVersion("**"); searchCriteria.setPart("**"); searchCriteria.setLanguage((Language)getLanguages().get(0)); } setSearchCriteria(searchCriteria); } SearchCriteria.java private Requester requester = null; public Requester getRequester() { return requester; } public void setRequester(Requester requester) { this.requester = requester; } private String year = null; public String getYear() { return year; } public void setYear(String year) { this.year = year; } private String number = null; public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } private String version = null; public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } private String part = null; public String getPart() { return part; } public void setPart(String part) { this.part = part; } private Language language = null; public Language getLanguage() { return language; } public void setLanguage(Language language) { this.language = language; }