RE: FormFragment checkbox not working
You have many @Persist annotations which I think are unnecessary. As a rule, if it's in the database, you don't need to store it in the session. Instead, pass an id (or ids) in the URL via the page activation context and look up the entities each time. There's a caveat to this rule that you often need to store the user id in the session for security reasons (you can't trust a url). In earlier versions of tapestry, you needed flash persistence for errors since the state is not stored in the DB and tapestry did a redirect after post. In later versions of tapestry this is not required since it does not redirect after post for validation errors.
Re: FormFragment checkbox not working
On Tue, 21 May 2013 12:02:01 -0300, Nomen Nomanum wrote: Here is the code to see how this could be achieve public Object getChoosenOne() { if(first==true){ zona.getBody(); return firstBlock; } else if(second== true) { zona.getBody(); return blokLokaciji; } else zona.getBody(); return null; } This method is a mess. Why do you call zona.getBody() and then return a Block? Just return the block. In addition, you're not doing AJAX (your ActionLinks don't have a zone parameter), so you don't need the Zone at all. -- 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: FormFragment checkbox not working
Here is the code to see how this could be achieve dgdgdgdg fsfsf dgdgde gdgdgd @InjectComponent private Zone zone; @Persist(PersistenceConstants.FLASH)// will keep your data consistent during just one page life cycle. private boolean first,second; @Inject private Block firstBlock, secondBlock; public void onActionFromFirst() { first= true; second=false; } public void onActionFromSecond() { first = false; second=true; } // you could easily implement that once ticked, sets mod to true, false otherwise. public Object getChoosenOne() { if(first==true){ zona.getBody(); return firstBlock; } else if(second== true) { zona.getBody(); return blokLokaciji; } else zona.getBody(); return null; }
RE: FormFragment checkbox not working
OK, remove completely annotation @Persist, since you don't need it, if you want that behavior.
Re: FormFragment checkbox not working
component does not work because of table tag works without it. On Mon, May 20, 2013 at 9:45 AM, Nikola Vulovic wrote: > behaviour is completely the same with and with out > (PersistenceConstant.FLASH) > > > On Sun, May 19, 2013 at 11:10 PM, Nikola Vulovic wrote: > >> formfragment is shown when checkox "renew" is not checked >> >> >> >> On Sun, May 19, 2013 at 5:28 PM, Nikola Vulovic wrote: >> >>> tml file >>> >> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"; >>> xmlns:p="tapestry:parameter"> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Add new expense form >>> >>> >>> >>> >>> >>> >>> >>> (*): >>> >>> >>> >> value="recepientValue"/> >>> >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:id="purposeOfPayment" value="purposeOfPaymentValue"/> >>> >>> >>> >>> (*): >>> >>> >>> >> value="currencyValue"/> >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:type="TextField" t:id="amount" value="amountValue"/> >>> >>> >>> >>> >>> : >>> >>> >>> >> t:mixins="triggerfragment" >>> fragment="f1"/> >>> >>> >>> >> hide="fade"> >>> >>> >>> Calculate payment from >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:id="dateOfPayment" value="dateOfPaymentValue" /> >>> >>> >>> >>> >>> Repeat payment every >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:id="number" value="numberValue"/> >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:model="literal:day,week,month,year" t:value="timeUnitValue"/> >>> >>> >>> >>> >>> Calculate payment until >>> >>> >>> >>> >>> (*): >>> >>> >>> >> t:id="endDate" value="endDateValue" /> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Select currency form >>> >>> >>> >>> >>> >>> >>> >>> (*): >>> >>> >>> >> value="tableCurrencyValue"/> >>>
Re: FormFragment checkbox not working
behaviour is completely the same with and with out (PersistenceConstant.FLASH) On Sun, May 19, 2013 at 11:10 PM, Nikola Vulovic wrote: > formfragment is shown when checkox "renew" is not checked > > > > On Sun, May 19, 2013 at 5:28 PM, Nikola Vulovic wrote: > >> tml file >> > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"; >> xmlns:p="tapestry:parameter"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Add new expense form >> >> >> >> >> >> >> >> (*): >> >> >> > value="recepientValue"/> >> >> >> >> >> >> (*): >> >> >> > value="purposeOfPaymentValue"/> >> >> >> >> (*): >> >> >> > value="currencyValue"/> >> >> >> >> >> (*): >> >> >> > t:type="TextField" t:id="amount" value="amountValue"/> >> >> >> >> >> : >> >> >> > t:mixins="triggerfragment" fragment="f1"/> >> >> >> >> >> >> Calculate payment from >> >> >> >> >> (*): >> >> >> > t:id="dateOfPayment" value="dateOfPaymentValue" /> >> >> >> >> >> Repeat payment every >> >> >> >> >> (*): >> >> >> > t:id="number" value="numberValue"/> >> >> >> >> >> (*): >> >> >> > t:model="literal:day,week,month,year" t:value="timeUnitValue"/> >> >> >> >> >> Calculate payment until >> >> >> >> >> (*): >> >> >> > t:id="endDate" value="endDateValue" /> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Select currency form >> >> >> >> >> >> >> >> (*): >> >> >> > value="tableCurrencyValue"/> >> >> >> >> >> > value="Select Currency"/> >> >> >> >> >> >> >> >>
RE: FormFragment checkbox not working
Try adding @Persist(PersistenceConstant.FLASH) to your renew and see how would it behave. From: getibi...@outlook.com To: users@tapestry.apache.org Subject: RE: FormFragment checkbox not working Date: Sun, 19 May 2013 20:53:42 +0100 Pozdrav Nikola! Could you be more specific about what troubles you? From the code, it looks more-less just fine. What is it supposed to do? Date: Sun, 19 May 2013 17:28:02 +0200 Subject: Re: FormFragment checkbox not working From: nivuk...@gmail.com To: users@tapestry.apache.org tml file http://tapestry.apache.org/schema/tapestry_5_3.xsd"; xmlns:p="tapestry:parameter"> Add new expense form (*): (*): (*): (*): : Calculate payment from (*): Repeat payment every (*): (*): Calculate payment until (*): Select currency form (*): List of your expenses [Grid here] remove payment List of expenses from trusted List of all clients in your home Page class /* * To change this template, choose Tools | Templates * and open the template in the editor. */package rs.edu.fit.cs230web.pages; import java.util.List;import logic.ws.Client;import logic.ws.ClientType;import logic.ws.ClientWebService;import logic.ws.Expens
Re: FormFragment checkbox not working
formfragment is shown when checkox "renew" is not checked On Sun, May 19, 2013 at 5:28 PM, Nikola Vulovic wrote: > tml file >xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"; > xmlns:p="tapestry:parameter"> > > > > > > > > > > > > > > > > > > > > > > > Add new expense form > > > > > > > > (*): > > > value="recepientValue"/> > > > > > > (*): > > > value="purposeOfPaymentValue"/> > > > > (*): > > > value="currencyValue"/> > > > > > (*): > > > t:type="TextField" t:id="amount" value="amountValue"/> > > > > > : > > > t:mixins="triggerfragment" fragment="f1"/> > > > > > > Calculate payment from > > > > > (*): > > > t:id="dateOfPayment" value="dateOfPaymentValue" /> > > > > > Repeat payment every > > > > > (*): > > > t:id="number" value="numberValue"/> > > > > > (*): > > > t:model="literal:day,week,month,year" t:value="timeUnitValue"/> > > > > > Calculate payment until > > > > > (*): > > > t:id="endDate" value="endDateValue" /> > > > > > > > > > > > > > > > > > > > > > > > > > > Select currency form > > > > > > > > (*): > > > value="tableCurrencyValue"/> > > > > > value="Select Currency"/> > > > > > > > > > > > > > > > List of your expenses > > > t:row="gridLine" >t:rowsPerPage="10" t:pagerPosition="both" > > t:exclude="moneyId,moneyIO,moneyNextDate,moneyFinishDate,moneyTs,cliCl
RE: FormFragment checkbox not working
Pozdrav Nikola! Could you be more specific about what troubles you? From the code, it looks more-less just fine. What is it supposed to do? Date: Sun, 19 May 2013 17:28:02 +0200 Subject: Re: FormFragment checkbox not working From: nivuk...@gmail.com To: users@tapestry.apache.org tml file http://tapestry.apache.org/schema/tapestry_5_3.xsd"; xmlns:p="tapestry:parameter"> Add new expense form (*): (*): (*): (*): : Calculate payment from (*): Repeat payment every (*): (*): Calculate payment until (*): Select currency form (*): List of your expenses [Grid here] remove payment List of expenses from trusted List of all clients in your home Page class /* * To change this template, choose Tools | Templates * and open the template in the editor. */package rs.edu.fit.cs230web.pages; import java.util.List;import logic.ws.Client;import logic.ws.ClientType;import logic.ws.ClientWebService;import logic.ws.ExpenseWebService;import logic.ws.Money; import org.apache.tapestry5.PersistenceConstants;import org.apache.tapestry5.annotations.Persist;import org.apache.tapestry5.annotations.Property;import org.apache.tapestry5.annotations.Se
Re: FormFragment checkbox not working
tml file http://tapestry.apache.org/schema/tapestry_5_3.xsd"; xmlns:p="tapestry:parameter"> Add new expense form (*): (*): (*): (*): : Calculate payment from (*): Repeat payment every (*): (*): Calculate payment until (*): Select currency form (*): List of your expenses [Grid here] remove payment List of expenses from trusted List of all clients in your home Page class /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package rs.edu.fit.cs230web.pages; import java.util.List; import logic.ws.Client; import logic.ws.ClientType; import logic.ws.ClientWebService; import logic.ws.ExpenseWebService; import logic.ws.Money; import org.apache.tapestry5.PersistenceConstants; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.annotations.SessionState; import org.apache.tapestry5.beaneditor.Validate; import org.apache.tapestry5.ioc.annotations.Inject; /** * * @author nikola */ public class Expenses { @SessionState @Property private Client client;