[Rife-users] Struggling with template
Hi, I have the following template: div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div I use the following code: int nrofSeats = reservation.seats().length; for( int i = 0; i nrofSeats; i++ ) { int seatId = seats[i].getId(); processEmbeddedElement( mTemplate, .SeatEntry, String.valueOf( i ) + _ + String.valueOf( seatId ) ); mTemplate.appendBlock( seatDetailsList, seatEntry ); } mTemplate.setBlock( seatList, seatList ); I expect to get a table with a header row and a row for each SeatEntry (3 in my example). But I get first a row of the last SeatEntry and then the table with only the header. In another example I do not have the extra ${v seatList/} and ${b seatList} construction, use the same code (without the final setBlock of course) and everything and that displays as expected. What am I doing wrong? or is that what I try to accomplish not possible? ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Struggling with template
Hi, which version of RIFE are you using? On 29 May 2006, at 10:44, apdewith wrote: Hi, I have the following template: div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div I use the following code: int nrofSeats = reservation.seats().length; for( int i = 0; i nrofSeats; i++ ) { int seatId = seats[i].getId(); processEmbeddedElement( mTemplate, .SeatEntry, String.valueOf( i ) + _ + String.valueOf( seatId ) ); mTemplate.appendBlock( seatDetailsList, seatEntry ); } mTemplate.setBlock( seatList, seatList ); I expect to get a table with a header row and a row for each SeatEntry (3 in my example). But I get first a row of the last SeatEntry and then the table with only the header. In another example I do not have the extra ${v seatList/} and ${b seatList} construction, use the same code (without the final setBlock of course) and everything and that displays as expected. What am I doing wrong? or is that what I try to accomplish not possible? ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] array/multiple beans from form submission
Hi Geert, Actually, what you can do if you really want to isolate and componentize the handling of these beans, you can use embedded elements and provide it with a data object during processEmbeddedElement (which will be each bean). This is only supported in 1.5 though. Indeed, I am using embedded elements for this, and on 1.5 too; I had, however, been using the method of forcing the embedding element to implement an XXXBeanProvider interface to store an instance of the item to be processed by the embedded element, but this new method is more elegant; I saw a mention of it in the changelist for 1.5, but it did not make sense until now... sweet! What this means then is I have to iterate over the quantities sent, and push them into the bean instances, and then just pass these on to the embedded elements and do validation on those. Would have been nicer if we could do a getSubmissionBeans(BeanType.class) call in this regard, but this shd work for me now. Thanks, Emmanuel -- Benjamin Disraeli - Nurture your minds with great thoughts. To believe in the heroic makes heroes. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] array/multiple beans from form submission
Geert, the embedded elements and do validation on those. Would have been nicer if we could do a getSubmissionBeans(BeanType.class) call in this regard I don't really follow, how would that work? there's already a getSubmissionBean(BeanType.class) implementation... which prepulates a bean with param values... I was just thinking aloud on if we could have a getSubmissionBeans(BeanType.class) imp where a ListBeanType is returned instead, as happens to be what, in a sense, I am trying to achieve here. Cheers, Emmanuel -- Benjamin Disraeli - Nurture your minds with great thoughts. To believe in the heroic makes heroes. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Struggling with template 2
Hi, I discovered that another part of the template is causing the unexpected behaviour: div ${v reservationDetails}${/v} ${b reservationDetails} ${v ELEMENT:.ReservationDetails:/} ${/b} /div div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th themreservationId/em/th themfirstName/em/th themlastName/em/th thembirthDate/em/th themstreet/em/th themzip/em/th themcity/em/th themcountry/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div If I remove the first div block (the ReservationDetails embedded element is not processed in my example) then the display of the second div block is as expected in case the SeatEntry embedded elements are processed. If I move the first div block to after the seatList then this does not display as expected if the ReservationDetails embedded element is processed. The example is about a tabbed form and depending on the current tab either the ReservationDetails embedded element is processed or the SeatEntry embedded elements are processed in processElement of the embedding element.. Any clue why this happening? Regards, Adriaan. de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Struggling with template 2
So you have two times the seatList value and blocks at different locations in the template with different content. On 29 May 2006, at 11:57, apdewith wrote: Hi, I discovered that another part of the template is causing the unexpected behaviour: div ${v reservationDetails}${/v} ${b reservationDetails} ${v ELEMENT:.ReservationDetails:/} ${/b} /div div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th themreservationId/em/th themfirstName/em/th themlastName/em/th thembirthDate/em/th themstreet/em/th themzip/em/th themcity/em/th themcountry/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div If I remove the first div block (the ReservationDetails embedded element is not processed in my example) then the display of the second div block is as expected in case the SeatEntry embedded elements are processed. If I move the first div block to after the seatList then this does not display as expected if the ReservationDetails embedded element is processed. The example is about a tabbed form and depending on the current tab either the ReservationDetails embedded element is processed or the SeatEntry embedded elements are processed in processElement of the embedding element.. Any clue why this happening? Regards, Adriaan. de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Struggling with template
Hi, Good to know that people are trying to help! Thanks! I am using the 1.5M version This is what I expected: (see my second post how I accomplished it) script language=JavaScript1.2 function toggleDisplay( id ) { with (document.getElementById( id ).style) { if (display == none) display = else display = none; }} /script div div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th themreservationId/em/th themfirstName/em/th themlastName/em/th thembirthDate/em/th themstreet/em/th themzip/em/th themcity/em/th themcountry/em/th thnbsp;/th /tr tr class=even id=seatEntryShowRow0 style=display: ; td width=1%0/td td width=1%41/td td width=1%13/td tdfirstName/td tdlastName/td tdbirthDate/td td/td td/td td/td td/td td nowrap width=10% form action=/tbs/browseReservations name=seatEntry0_41_13 input name=submission type=hidden value=seatEntry /input name=submissioncontext type=hidden value=LkJyb3dzZVJlc2VydmF0aW9uczo6YnJvd3NlUmVzZXJ2YXRpb25zOi5TZWF0RW50cnk6MF80MV8xM14uU2VhdEVudHJ5 / input type=hidden name=se_id value=0 / input type=hidden name=se_seatId value=41 / input type=hidden name=se_reservationId value=13 / input id=seatEntryShowBtn type=button value=Edit name=seatEntryAction onClick=toggleDisplay( 'seatEntryShowRow0' ); toggleDisplay( 'seatEntryEditRow0' ); return false; style=display: / input type=submit value=Remove name=seatEntryAction / /form /td /tr tr class=even id=seatEntryEditRow0 style=display: none; form action=/tbs/browseReservations name=seatEntry0_41_13 input name=submission type=hidden value=seatEntry /input name=submissioncontext type=hidden value=LkJyb3dzZVJlc2VydmF0aW9uczo6YnJvd3NlUmVzZXJ2YXRpb25zOi5TZWF0RW50cnk6MF80MV8xM14uU2VhdEVudHJ5 / td width=1%input type=hidden name=se_id value=0 /0/td td width=1%input type=hidden name=se_seatId value=41 /41/td td width=1%input type=hidden name=se_reservationId value=13 /13/td tdinput type=text name=se_firstName size=12 value=firstName //td tdinput type=text name=se_lastName size=12 value=lastName //td tdinput type=text name=se_birthDate size=8 value=birthDate //td tdinput type=text name=se_street value= //td tdinput type=text name=se_zip size=6 value= //td tdinput type=text name=se_city size=12 value= //td tdinput type=text name=se_country size=12 value= //td td nowrap width=10% input type=submit value=Save name=seatEntryAction onClick=toggleDisplay( 'seatEntryEditRow0' ); toggleDisplay( 'seatEntryShowRow0' ); return true;/ input type=button value=Cancel name=seatEntryAction onClick=toggleDisplay( 'seatEntryEditRow0' ); toggleDisplay( 'seatEntryShowRow0' ); return false;/ /td /form /tr tr class=odd id=seatEntryShowRow1 style=display: ; td width=1%1/td td width=1%42/td td width=1%13/td tdfirstName/td tdlastName/td tdbirthDate/td td/td td/td td/td td/td td nowrap width=10% form action=/tbs/browseReservations name=seatEntry1_42_13 input name=submission type=hidden value=seatEntry /input name=submissioncontext
Re: [Rife-users] array/multiple beans from form submission
Hmm that shouldn't be too hard to add. Maybe you could take a crack at it ;-) On 29 May 2006, at 11:48, Emmanuel Okyere wrote: Geert, the embedded elements and do validation on those. Would have been nicer if we could do a getSubmissionBeans(BeanType.class) call in this regard I don't really follow, how would that work? there's already a getSubmissionBean(BeanType.class) implementation... which prepulates a bean with param values... I was just thinking aloud on if we could have a getSubmissionBeans(BeanType.class) imp where a ListBeanType is returned instead, as happens to be what, in a sense, I am trying to achieve here. Cheers, Emmanuel -- Benjamin Disraeli - Nurture your minds with great thoughts. To believe in the heroic makes heroes. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Strange MySQL-Problem w/ RIFE/Crud
Hi guys, just to give you a short update on what happened since my last Mail to this list: The decision was made to use PHP for the frontend and RIFE/Crud for the administration interface. Both are almost ready now, but there's a bug in the admin interface we can't get rid of. The error message is attached. This problem occurs only after Tomcat has been running for awhile. A restart fixes this problem temporarily. Basically looks like RIFE is trying to keep some connection alive, while MySQL times out. Please note, that we currently still use RIFE 1.4, so sorry if this is fixed in 1.5. Another thing: Personally, I've really fallen in love with RIFE. The frontend will soon be ported to RIFE, also and will then be released as an OpenSource Online Shop. First Pre-Release is scheduled somewhere in the late third quarter 2006 if everything goes well. And someone has asked me to write a book on RIFE and OpenLaszlo, so I'll think about that, too. Best Regards, Stefan Thomas Title: Uwyn RIFE - errors occurred Uwyn RIFE Errors occurred while processing the request. com.uwyn.rife.database.exceptions.TransactionBeginErrorException Error while beginning the transaction. atcom.uwyn.rife.database.DbConnection beginTransaction ( DbConnection.java : 892 ) atcom.uwyn.rife.database.DbQueryManager inTransaction ( DbQueryManager.java : 2780 ) atcom.uwyn.rife.crud.elements.admin.Browse processElement ( Browse.java : 55 ) atcom.uwyn.rife.engine.ElementContext processContext ( ElementContext.java : 587 ) atcom.uwyn.rife.engine.RequestState service ( RequestState.java : 217 ) atcom.uwyn.rife.engine.Gate handleRequest ( Gate.java : 416 ) atsun.reflect.GeneratedMethodAccessor23 invoke ( unknown ) atsun.reflect.DelegatingMethodAccessorImpl invoke ( DelegatingMethodAccessorImpl.java : 25 ) atjava.lang.reflect.Method invoke ( Method.java : 585 ) atcom.uwyn.rife.servlet.RifeFilter doFilter ( RifeFilter.java : 127 ) atorg.apache.catalina.core.ApplicationFilterChain internalDoFilter ( ApplicationFilterChain.java : 202 ) atorg.apache.catalina.core.ApplicationFilterChain doFilter ( ApplicationFilterChain.java : 173 ) atorg.apache.catalina.core.StandardWrapperValve invoke ( StandardWrapperValve.java : 214 ) atorg.apache.catalina.core.StandardValveContext invokeNext ( StandardValveContext.java : 104 ) atorg.apache.catalina.core.StandardPipeline invoke ( StandardPipeline.java : 520 ) atorg.apache.catalina.core.StandardContextValve invokeInternal ( StandardContextValve.java : 198 ) atorg.apache.catalina.core.StandardContextValve invoke ( StandardContextValve.java : 152 ) 17 more ... com.mysql.jdbc.CommunicationsException Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1905) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2988) at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4913) at com.uwyn.rife.database.DbConnection.beginTransaction(DbConnection.java:882) at com.uwyn.rife.database.DbQueryManager.inTransaction(DbQueryManager.java:2780) at com.uwyn.rife.crud.elements.admin.Browse.processElement(Browse.java:55) at com.uwyn.rife.engine.ElementContext.processContext(ElementContext.java:587) at com.uwyn.rife.engine.RequestState.service(RequestState.java:217) at com.uwyn.rife.engine.Gate.handleRequest(Gate.java:416) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.uwyn.rife.servlet.RifeFilter.doFilter(RifeFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at
Re: [Rife-users] array/multiple beans from form submission
Quoting Geert Bevin: there's already a getSubmissionBean(BeanType.class) implementation... which prepulates a bean with param values... I was just thinking aloud on if we could have a getSubmissionBeans(BeanType.class) imp where a ListBeanType is returned instead, as happens to be what, in a sense, I am trying to achieve here. Hmm that shouldn't be too hard to add. Maybe you could take a crack at it ;-) Then there really _would_ be bidirectional templates ! And there's plenty of Javascript out there for clicking to add a new row to a table. Then table/list editing could be done 100% locally before POST'ing it. my 0,02e fred ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Struggling with template 2
Hi Adriaan, yes, but I see that you have the seatList value twice in there, as well as the seatList block, with different content. For RIFE, only the last block will provide the content (it overrides the previous one). And both values will display the same content unless you assign them to another block and clear them in the meantime. Am I correct to identify this? If this is the case, your problem probably lies there. Try using different names. Best regards, Geert On 29 May 2006, at 12:21, apdewith wrote: Hi Geert, I have two div blocks. I want their content to be filled (via processEmbeddedElement) and displayed depending on a tab. So it is either the reservationDetails or the seatList. But if the reservationDetails is before the seatList the seatList does not display properly. If on the other hand the seatList is before the reservationDetails the reservationDetails do not display at all. I hope this explains. (I am using 1.5M) Regards, Adriaan de With // // ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] array/multiple beans from form submission
Quoting Geert Bevin: Hmm that shouldn't be too hard to add. Maybe you could take a crack at it ;-) Then there really _would_ be bidirectional templates ! And there's plenty of Javascript out there for clicking to add a new row to a table. Then table/list editing could be done 100% locally before POST'ing it. Not really sure I'm following you :-/ It's always possible that I'm full of balonie :) How does Javascript fit in this picture, or how does this interact with bidirectionality? Rife Forms are truly bidirectional, and can use HTML field validation too. Rife also makes it easy to append to Value tags, in order to generate HTML tables with N rows. But is it possible to generate a Form with N rows, by appending additional rows, where each row is another instance of the same bean type ? That would make it possible to have N-record Forms that are bidirectional and that use HTML field validation. Then the next logical step is to attach some JS that adds an (N+1)th record at the end of the Form. Is this making any sense ? Isn't this more or less what is under discussion, or did I manage to miss the point entirely ? BR fred -- F.Baube* Georgetown/MSFS/1988 * Think pangalactically. fbaube#saunalahti.fi * Act locally. gsm +358 41 536 8192 * wmd 60°11'10.8N 24°57'36.9E ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
Simple question, which version of MySQL and Connector/J are you using? Upgrading them to the latest versions might help. On 29 May 2006, at 12:09, Stefan Thomas wrote: Hi guys, just to give you a short update on what happened since my last Mail to this list: The decision was made to use PHP for the frontend and RIFE/Crud for the administration interface. Both are almost ready now, but there's a bug in the admin interface we can't get rid of. The error message is attached. This problem occurs only after Tomcat has been running for awhile. A restart fixes this problem temporarily. Basically looks like RIFE is trying to keep some connection alive, while MySQL times out. Please note, that we currently still use RIFE 1.4, so sorry if this is fixed in 1.5. Another thing: Personally, I've really fallen in love with RIFE. The frontend will soon be ported to RIFE, also and will then be released as an OpenSource Online Shop. First Pre-Release is scheduled somewhere in the late third quarter 2006 if everything goes well. And someone has asked me to write a book on RIFE and OpenLaszlo, so I'll think about that, too. Best Regards, Stefan Thomas Uwyn RIFE Errors occurred while processing the request. com.uwyn.rife.database.exceptions.TransactionBeginErrorException Error while beginning the transaction. at com.uwyn.rife.database.DbConnection beginTransaction ( DbConnection.java : 892 ) at com.uwyn.rife.database.DbQueryManager inTransaction ( DbQueryManager.java : 2780 ) at com.uwyn.rife.crud.elements.admin.Browse processElement ( Browse.java : 55 ) at com.uwyn.rife.engine.ElementContext processContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestState service ( RequestState.java : 217 ) at com.uwyn.rife.engine.Gate handleRequest ( Gate.java : 416 ) at sun.reflect.GeneratedMethodAccessor23 invoke ( unknown ) at sun.reflect.DelegatingMethodAccessorImpl invoke ( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Method invoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilter doFilter ( RifeFilter.java : 127 ) at org.apache.catalina.core.ApplicationFilterChain internalDoFilter ( ApplicationFilterChain.java : 202 ) at org.apache.catalina.core.ApplicationFilterChain doFilter ( ApplicationFilterChain.java : 173 ) at org.apache.catalina.core.StandardWrapperValve invoke ( StandardWrapperValve.java : 214 ) at org.apache.catalina.core.StandardValveContext invokeNext ( StandardValveContext.java : 104 ) at org.apache.catalina.core.StandardPipeline invoke ( StandardPipeline.java : 520 ) at org.apache.catalina.core.StandardContextValve invokeInternal ( StandardContextValve.java : 198 ) at org.apache.catalina.core.StandardContextValve invoke ( StandardContextValve.java : 152 ) 17 more ... com.mysql.jdbc.CommunicationsException Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully (MysqlIO.java:1905) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket (MysqlIO.java:2351) at com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:2862) at com.mysql.jdbc.MysqlIO.sendCommand (MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect (MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL (Connection.java:2988) at com.mysql.jdbc.Connection.setAutoCommit (Connection.java:4913) at com.uwyn.rife.database.DbConnection.beginTransaction (DbConnection.java:882) at com.uwyn.rife.database.DbQueryManager.inTransaction (DbQueryManager.java:2780) at com.uwyn.rife.crud.elements.admin.Browse.processElement(Browse.java: 55) at com.uwyn.rife.engine.ElementContext.processContext (ElementContext.java:587) at com.uwyn.rife.engine.RequestState.service(RequestState.java:217) at com.uwyn.rife.engine.Gate.handleRequest(Gate.java:416) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.uwyn.rife.servlet.RifeFilter.doFilter(RifeFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext
[Rife-users] Struggling with template 2
Hi Geert, In the second div block I have a seatList value, a seatList block, a seatDetailsList value and a seatEntry block so there is no naming problem afais Adriaan de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] array/multiple beans from form submission
Fred, Hmm that shouldn't be too hard to add. Maybe you could take a crack at it ;-) Then there really _would_ be bidirectional templates ! And there's plenty of Javascript out there for clicking to add a new row to a table. Then table/list editing could be done 100% locally before POST'ing it. Not really sure I'm following you :-/ It's always possible that I'm full of balonie :) How does Javascript fit in this picture, or how does this interact with bidirectionality? Rife Forms are truly bidirectional, and can use HTML field validation too. Rife also makes it easy to append to Value tags, in order to generate HTML tables with N rows. But is it possible to generate a Form with N rows, by appending additional rows, where each row is another instance of the same bean type ? That would make it possible to have N-record Forms that are bidirectional and that use HTML field validation. Then the next logical step is to attach some JS that adds an (N+1)th record at the end of the Form. Is this making any sense ? Isn't this more or less what is under discussion, or did I manage to miss the point entirely ? You are pretty much on the money with what the discussion is about; it's not possible to 'generate' a form in the manner you mention here, but you can sort of 'simulate' that; what I am doing on the petstore app for instance, requires that every cart item be shown as part of the cart form... this in itself is something rife easily allows you to do by having a a value placeholder and blocks that you can iteratively process and append per bean instance... the added complexity comes in because as per the cart reqts, I have to have a quantity textfield that allows the user to update qty per item. rife currently supports a getSubmissionBean(BeanType.class) method which allows you to easily get an instace of the bean returned from teh form, and do validation against that... it would be nice (and I might have to look into this) to be able to make a similar call, only this time to retrieve a list/array of the beantype you require. Currently, I am sending back parameters in my submission; like: submission name=process param name=id / param name=iid / param name=quantity / /submission and using getParameterIntValues(paramString) call in my Element implementation to iterate over these values and recreate the beans just as I would have expected a call to a proposed getSubmissionBeans to have worked. We might hv to think this through and see if it's possible/feasible to implement something of the sort as a feature of the framework. Cheers, Emmanuel -- Benjamin Disraeli - Nurture your minds with great thoughts. To believe in the heroic makes heroes. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
Hi Geert, Geert Bevin wrote: sadly this isn't the first time the issue was brought up and afaik it's a problem with MySQL themselves and their view on connection pooling. More info: http://article.gmane.org/gmane.comp.java.rife.user/1434 We don't use MySQL in production and rely pretty much on PostgreSQL and Oracle, where no problems appear wrt at all. RIFE doesn't do anything that JDBC doesn't allow you. I really would like to find a way to once and for all find a workaround for this issue. I vaguely remember that Keith switched to PostgreSQL though. Hmm, interesting. With the Java version of the frontend we planned to switch to PostgreSQL anyways, but for now, we use a homemade database abstraction layer for the frontend. Written by me a long, long time ago, when I didn't see the light. ;) So, I'll make a Cronjob that tells Tomcat to reload the webapp, until I finish writing a PostgreSQL module for my dba-layer. This will do until we have the purely Java/RIFE-based software ready. Not the sexiest solution, I know, but I don't want to wait for a fix of the MySQL Connector/J. Still, that bug should be fixed. Do you know anything else about what Connector/J does wrong? I won't hurt to send a bug report to [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] , which is the list for Connector/J. (Info at http://lists.mysql.com/java ) - You probably have the better understanding for this problem, but if not, I could send the bug report for you, just let me know. Simple question, which version of MySQL and Connector/J are you using? Upgrading them to the latest versions might help. MySQL Connector/J is 3.1.12, which is the latest. But MySQL itself is version 4.1.10a and it's probably a good idea to update that one anyway. Thanks for the idea. Regards, Stefan :) ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
With the Java version of the frontend we planned to switch to PostgreSQL anyways, but for now, we use a homemade database abstraction layer for the frontend. Written by me a long, long time ago, when I didn't see the light. ;) So, I'll make a Cronjob that tells Tomcat to reload the webapp, until I finish writing a PostgreSQL module for my dba-layer. This will do until we have the purely Java/RIFE-based software ready. Not the sexiest solution, I know, but I don't want to wait for a fix of the MySQL Connector/J. What I would do is to write a RIFE scheduler task that goes over all the connections in your mysql datasource and issue a SELECT 0 statement for each one. This task could then be run every hour of so. For details of how use the scheduler you'll probably have to look through some of our real-world app examples (Bamboo, ...) or ask someone here on the list to explain it to you. Still, that bug should be fixed. Do you know anything else about what Connector/J does wrong? I won't hurt to send a bug report to [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] , which is the list for Connector/J. (Info at http://lists.mysql.com/java ) - You probably have the better understanding for this problem, but if not, I could send the bug report for you, just let me know. I think that the main problem is (and that's the impression that I'm getting from their replies to these bug reports) that they don't think there's a problem. Basically, they are closing every opened connection automatically after 8 hours of inactivity. They then claim that it's up to the application or the connection pooling layer to check for the error condition that occurs and re-create the connection. This however means that those checks have to be done *everywhere* you use a connection (which is basically all the db- related code). I personally think that this is very invasive for something that I consider to be bad behavior on their behalf. Simple question, which version of MySQL and Connector/J are you using? Upgrading them to the latest versions might help. MySQL Connector/J is 3.1.12, which is the latest. But MySQL itself is version 4.1.10a and it's probably a good idea to update that one anyway. Thanks for the idea. -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
I think that the main problem is (and that's the impression that I'm getting from their replies to these bug reports) that they don't think there's a problem. Basically, they are closing every opened connection automatically after 8 hours of inactivity. They then claim that it's up to the application or the connection pooling layer to check for the error condition that occurs and re- create the connection. This however means that those checks have to be done *everywhere* you use a connection (which is basically all the db-related code). I personally think that this is very invasive for something that I consider to be bad behavior on their behalf. I have to add that RIFE's connection pool of course already does something like this. When an error occurs everything is closed and cleaned up properly, and the connection pool tries to acquire new connections. The exception is however re-thrown as a meaningful exception, which is what you saw bubbling up. What MySQL apparently seems to advocate though is that because they insist on closing connections after 8 hours of inactivity, that after the connection is re-created, the original operation is however tried again and no exceptions are thrown further. This can however become very complex when transactions are active. If they are, you typically don't want operations to be automatically retried, since the previous transactional state has probably rolled back, etc etc -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
Geert Bevin wrote: With the Java version of the frontend we planned to switch to PostgreSQL anyways, but for now, we use a homemade database abstraction layer for the frontend. Written by me a long, long time ago, when I didn't see the light. ;) So, I'll make a Cronjob that tells Tomcat to reload the webapp, until I finish writing a PostgreSQL module for my dba-layer. This will do until we have the purely Java/RIFE-based software ready. Not the sexiest solution, I know, but I don't want to wait for a fix of the MySQL Connector/J. What I would do is to write a RIFE scheduler task that goes over all the connections in your mysql datasource and issue a SELECT 0 statement for each one. This task could then be run every hour of so. For details of how use the scheduler you'll probably have to look through some of our real-world app examples (Bamboo, ...) or ask someone here on the list to explain it to you. Alright, nice solution, I'll try that. :) ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Struggling with template 2
Hi Geert, Thanks for the support but I am afraid I do not understand your last reply. I experimented with different code and template solutions but with no success. I want to share my last try because I fear that my understanding of the templating mechanism is not correct. public void doReservationList() { String action = getParameter( Action ); Reservation reservation = (Reservation)getSubmissionBean( reservationList, Reservation.class, rl_ ); mReservationId = reservation.getId(); mTemplate = getHtmlTemplate( tbs.browseReservations ); LOG.debug( doReservationList: + action + + mReservationId ); if( Details.equals( action ) ) { mMode = display; mTab = reservation; buildReservationList( mReservationId ); showReservationSeatsCustomerPaymentsTab(); setReservationTabCurrent(); processEmbeddedElement( mTemplate , .ReservationDetails, String.valueOf( mReservationId ) ); mTemplate.setBlock( reservationDetails, reservationDetails ); mTemplate.setValue( seatList, ); print( mTemplate ); } if( Seats.equals( action ) ) { mMode = display; mTab = seatList; buildReservationList( mReservationId ); showReservationSeatsCustomerPaymentsTab(); setSeatsTabCurrent(); reservation = Reservation.RetrieveById( mReservationId ); Seat[] seats = reservation.seats(); int nrofSeats = reservation.seats().length; for( int i = 0; i nrofSeats; i++ ) { int seatId = seats[i].getId(); processEmbeddedElement( mTemplate, .SeatEntry, String.valueOf( i ) + _ + String.valueOf( seatId ) + _ + String.valueOf( mReservationId ) ); mTemplate.appendBlock( seatDetailsList, seatEntry ); mTemplate.setValue( reservationDetails, ); } mTemplate.setBlock( seatList, seatList ); print( mTemplate ); } } For completeness the template snippet: div ${v reservationDetails}${/v} ${b reservationDetails} ${v ELEMENT:.ReservationDetails:/} ${/b} /div div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th themreservationId/em/th themfirstName/em/th themlastName/em/th thembirthDate/em/th themstreet/em/th themzip/em/th themcity/em/th themcountry/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div With this the Details action displays the reservationDetails and a totally empty seatList. But the Seats action displays both an empty reservationDetails (correct) and the fixed part of seatList but an empty seatDetailsList. If I remove the reservationDetails div from the template the Seats action display ok. So, the same code for the Seats action behaves differently in the two template variations and I do not see why. If the template mechanism is not meant to be used like I try, I would like to know because I then have to rethink my approach. Kind regards, Adriaan de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Struggling with template 2
Hi Andriaan, can you please paste your entire template? On 29 May 2006, at 14:15, apdewith wrote: Hi Geert, Thanks for the support but I am afraid I do not understand your last reply. I experimented with different code and template solutions but with no success. I want to share my last try because I fear that my understanding of the templating mechanism is not correct. public void doReservationList() { String action = getParameter( Action ); Reservation reservation = (Reservation)getSubmissionBean ( reservationList, Reservation.class, rl_ ); mReservationId = reservation.getId(); mTemplate = getHtmlTemplate( tbs.browseReservations ); LOG.debug( doReservationList: + action + + mReservationId ); if( Details.equals( action ) ) { mMode = display; mTab = reservation; buildReservationList( mReservationId ); showReservationSeatsCustomerPaymentsTab(); setReservationTabCurrent(); processEmbeddedElement( mTemplate , .ReservationDetails, String.valueOf( mReservationId ) ); mTemplate.setBlock( reservationDetails, reservationDetails ); mTemplate.setValue( seatList, ); print( mTemplate ); } if( Seats.equals( action ) ) { mMode = display; mTab = seatList; buildReservationList( mReservationId ); showReservationSeatsCustomerPaymentsTab(); setSeatsTabCurrent(); reservation = Reservation.RetrieveById( mReservationId ); Seat[] seats = reservation.seats(); int nrofSeats = reservation.seats().length; for( int i = 0; i nrofSeats; i++ ) { int seatId = seats[i].getId(); processEmbeddedElement( mTemplate, .SeatEntry, String.valueOf( i ) + _ + String.valueOf( seatId ) + _ + String.valueOf( mReservationId ) ); mTemplate.appendBlock( seatDetailsList, seatEntry ); mTemplate.setValue( reservationDetails, ); } mTemplate.setBlock( seatList, seatList ); print( mTemplate ); } } For completeness the template snippet: div ${v reservationDetails}${/v} ${b reservationDetails} ${v ELEMENT:.ReservationDetails:/} ${/b} /div div ${v seatList}${/v} ${b seatList} div id=tabContent class=tabContent table id=row class=displaytag tr themid/em/th themseatId/em/th themreservationId/em/th themfirstName/em/th themlastName/em/th thembirthDate/em/th themstreet/em/th themzip/em/th themcity/em/th themcountry/em/th thnbsp;/th /tr ${v seatDetailsList/} ${b seatEntry} ${v ELEMENT:.SeatEntry:/} ${/b} /table /div ${/b} /div With this the Details action displays the reservationDetails and a totally empty seatList. But the Seats action displays both an empty reservationDetails (correct) and the fixed part of seatList but an empty seatDetailsList. If I remove the reservationDetails div from the template the Seats action display ok. So, the same code for the Seats action behaves differently in the two template variations and I do not see why. If the template mechanism is not meant to be used like I try, I would like to know because I then have to rethink my approach. Kind regards, Adriaan de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Struggling with template 2
Here is is: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head link rel=stylesheet type=text/css href=/css/ajaxtags.css / link rel=stylesheet type=text/css href=/css/displaytag.css / titleTBS/title style type=text/css .error_mark { background: #ff; color: #99; font-weight: bold; } .error_markalt { background: #ff; color: #99; font-weight: bold; } .error_messages { background: #ff; color: #99; margin: 5px; } .error_messagesalt { background: #ff; color: #99; margin: 5px; } /style /head body script language=JavaScript1.2 function submitForm( type ) { document.getElementById( type ).submit(); } /script p/p ${v content/} ${bv content} div div div id=tabPanelWrapper div id=tabPanel class=tabPanel ul lia class=ajaxCurrentTab href=javascript://nop/Reservations/a /li /ul /div /div div id=tabContent class=tabContent ${v reservationList/} ${bv reservationList} table id=row class=displaytag tr themid/em/th themtourId/em/th themreservationDate/em/th themstatus/em/th themnrofRequestedSeats/em/th themprice/em/th themamountPaid/em/th thnbsp/th th style=text-align: right; form name=reservationNew action=${v SUBMISSION:FORM:reservationNew/} method=post ${v SUBMISSION:PARAMS:reservationNew/} input type=submit name=reservationAction value=Add new / /form /th /tr ${v reservations}${/v} ${b reservation} tr class=${v oddEvenType/} bgcolor=${v color/} td${v rl_id/}/td td${v rl_tourId/}/td td${v rl_reservationDate/}/td td${v rl_status/}/td td${v rl_nrofRequestedSeats/}/td td${v rl_price/}/td td width=100% nowrap${v rl_priceToBePaid/}/td td nowrap form id=rl${v rl_id/} name=reservationList action=${v SUBMISSION:FORM:reservationList/} method=post ${v SUBMISSION:PARAMS:reservationList/} ${v FORM:HIDDEN:rl_id}${/v} input type=submit name=Action value=Details / input type=submit name=Action value=Seats / input type=submit name=Action value=Customer / input type=submit name=Action value=Payments / /form /td td nowrap style=background-color: #fcf1be; form id=ra${v ra_id/} name=reservationAction action=${v SUBMISSION:FORM:reservationAction/} method=post ${v SUBMISSION:PARAMS:reservationAction/} ${v FORM:HIDDEN:ra_id}${/v} input type=submit name=Action value=Edit / input type=submit name=Action value=Remove / /form /td /tr ${/b} /table ${/bv} /div /div div nbsp; /div ${v reservationSeatsCustomerPaymentsTab}${/v} ${b reservationSeatsCustomerPaymentsTab} div div id=tabPanelWrapper div id=tabPanel class=tabPanel ul li a ${v currentReservationTab/} href='javascript:submitForm( rd );'Reservation/a form id=rd name=reservationDetails action=${v SUBMISSION:FORM:reservationDetails/} method=post ${v SUBMISSION:PARAMS:reservationDetails/} ${v
Re: [Rife-users] Struggling with template 2
Thanks for the support but I am afraid I do not understand your last reply. I experimented with different code and template solutions but with no success. I want to share my last try because I fear that my understanding of the templating mechanism is not correct. Hi Adriaan, I don't see anything at a quick glance. Can I ask you though to try it with the 1.4 release jar and see if your problem still persists? There are some changes in 1.5 that might cause your unwanted output. Thanks, Geert -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Strange MySQL-Problem w/ RIFE/Crud
Stefan Thomas wrote: Geert Bevin wrote: With the Java version of the frontend we planned to switch to PostgreSQL anyways, but for now, we use a homemade database abstraction layer for the frontend. Written by me a long, long time ago, when I didn't see the light. ;) So, I'll make a Cronjob that tells Tomcat to reload the webapp, until I finish writing a PostgreSQL module for my dba-layer. This will do until we have the purely Java/RIFE-based software ready. Not the sexiest solution, I know, but I don't want to wait for a fix of the MySQL Connector/J. What I would do is to write a RIFE scheduler task that goes over all the connections in your mysql datasource and issue a SELECT 0 statement for each one. This task could then be run every hour of so. For details of how use the scheduler you'll probably have to look through some of our real-world app examples (Bamboo, ...) or ask someone here on the list to explain it to you. Alright, nice solution, I'll try that. :) Ok, as I learned how to use the Scheduler, I added a Wiki page in the Cook Book. Everyone, please take a look and improve as you see fit. Thanks! http://rifers.org/wiki/display/RIFE/Scheduler Cheers, Stefan :) ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Sharing my experiments
Hi Adriaan, I got your example running thad to add a couple of jars) to try to reproduce your problem. However, I can't add a new reservation since the reservationNew submission isn't handled by the BrowseReservation element. Inherently I can't try out the reservation list logic that fails, since there are no reservation present. Maybe you could also send a zipped archive of your hsql db? Best regards, Geert On 29 May 2006, at 15:29, apdewith wrote: Hi, Reading to the mailing list and learning from questions and answers I decided to share my experiments with Rife. I am trying to build up a tour reservations application (partly just for fun) in small steps. Getting to know Rife in more detail is one of my goals but also building up java programming experience. I started with Rife jumpstart ofcourse, elaborated on the friends example first, tried some template variants and then started with the tbs (tour booking system). Note that this is an experiment of a novice java programmer and that there are several ad hoc solutions that should be labelled 'not perfect but for now works fine for me'. Attached is a dump of my source directory that should work out of the box in an Eclipse Rife jumpstart environment. Any comments and/or questions are welcome. Kind regards Adriaan de With src_29a.zip ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Sharing my experiments
Hi Adriaan, It's great to see more and more people interested with RIFE and by learning Java you are really diving into a huge area of high-end software engineering. I've just taken a very brief look at your code and I must say that you are on the right path. There are a few suggestions I want to give you, though: - Take a look at Java package naming conventions. You should always use a valid domain you own to prevent collisions. For example com.yourdomain.tbs instead of just tbs. - Comment more. What seems obvious today, may be a great riddle tomorrow. It's a good habit to *always* write comments, even when writing seemingly simple code. Still try to write only non-trivial comments, there are many good guides on commenting out there. - JavaDocs. You should take a look at JavaDocs. Most editors help you with writing those. If your editor does not, try Eclipse (eclipse.org). - For Java, there is an official document with Code Formatting guidelines. Find it here: http://java.sun.com/docs/codeconv/ - It's a pain to read, but once you got it it really helps, because almost everyone is following those guidelines. All of these suggestions are more concerning your code and less your logic. It would be really time consuming to dig into what you are trying to do there. So I can only recommend you read stuff about design patterns and software architecture to learn about these things. Maybe you should also get involved in an open source project where you'll be able to get some feedback from other team members. If you have a concrete problem involving RIFE, feel free to post a precise description to this list and I'm sure someone will have a look at it. Regards, Stefan :) apdewith schrieb: Hi, Reading to the mailing list and learning from questions and answers I decided to share my experiments with Rife. I am trying to build up a tour reservations application (partly just for fun) in small steps. Getting to know Rife in more detail is one of my goals but also building up java programming experience. I started with Rife jumpstart ofcourse, elaborated on the friends example first, tried some template variants and then started with the tbs (tour booking system). Note that this is an experiment of a novice java programmer and that there are several ad hoc solutions that should be labelled 'not perfect but for now works fine for me'. Attached is a dump of my source directory that should work out of the box in an Eclipse Rife jumpstart environment. Any comments and/or questions are welcome. Kind regards Adriaan de With ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Sharing my experiments
Hi Geert, Click 'browseTours' in the menu and then on one of the 'Tours' buttons. In the 'toursList' click on a 'Select' button and a Reservation with one seat will be created for that selected tour. Regards, Adriaan ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Sharing my experiments
Hi Adriaan, thanks a lot for your sources, I tracked it down to a bug in RIFE that creeped in with RIFE 1.4 (http://rifers.org/wiki/display/RIFE/ Embedded+element+priorities) I committed the fix and you should be able to download it form this night's nightly build. Btw, if you're processing embedded elements with dynamic differentiators, it's a good idea to make them late processing (add a + sign in front of the element id in the value tag). Best regards, Geert On 29 May 2006, at 16:11, apdewith wrote: Hi Geert, Click 'browseTours' in the menu and then on one of the 'Tours' buttons. In the 'toursList' click on a 'Select' button and a Reservation with one seat will be created for that selected tour. Regards, Adriaan ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Forms and I18N
Hi Laki, I add the properties file this way : ResourceBundle bundle = Localization.getResourceBundle(text, en); template.addResourceBundle(bundle); and i use it for the labels on my form. It works all right, except for my radio buttons... Try calling template.evaluateL10nTags() after manually adding the resource bundles: http://rifers.org/docs/api/com/uwyn/rife/template/ Template.html#evaluateL10nTags() By the way, is it possible to define my properties files for all my application, in order to avoid declaring it for each form ? Yes: http://rifers.org/wiki/display/RIFE/Type+specific+default+resource +bundles Thanks. Laki Geert Bevin a écrit : Hi Laki, are you somehow adding the properties file to the template? Either through default properties files or by explicitly adding it? Geert On 28 May 2006, at 23:21, Laki roganovic wrote: Hello, I'd like to display I18N values for a radio button in a form. I have a class Gender, with String id field. A GenderMetaData, with addConstraint(new ConstrainedProperty (id).inList(m, f).notNull(true).notEmpty(true)); I have this in my template : !--V 'FORM:RADIO:g_id' /-- It displays m or f. I'd like to display male or female, so i followed the procedure mentioned in the WIKI : template.addResourceBundle(new ListResourceBundle() { public Object[][] getContents() { return new Object[][] { { g_id:m, male }, { g_id:f, female }, }; } }); It works great, but my app is I18N aware, so i use text properties. I tried to manually add in my text_en.properties : g_id:m=male g_id:f=female but that doesn't work. Is there a way to achieve this ? Thanks. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Forms and I18N
Geert, I setted globally my properties with TEMPLATE_DEFAULT_RESOURCEBUNDLES_ENGINEHTML in config.xml and that's great. But unfortunately that didn't solve my problem for the radio button, even if i call evaluateL10nTags(). Another clue ? Geert Bevin a écrit : Hi Laki, I add the properties file this way : ResourceBundle bundle = Localization.getResourceBundle(text, en); template.addResourceBundle(bundle); and i use it for the labels on my form. It works all right, except for my radio buttons... Try calling template.evaluateL10nTags() after manually adding the resource bundles: http://rifers.org/docs/api/com/uwyn/rife/template/Template.html#evaluateL10nTags() By the way, is it possible to define my properties files for all my application, in order to avoid declaring it for each form ? Yes: http://rifers.org/wiki/display/RIFE/Type+specific+default+resource+bundles Thanks. Laki Geert Bevin a écrit : Hi Laki, are you somehow adding the properties file to the template? Either through default properties files or by explicitly adding it? Geert On 28 May 2006, at 23:21, Laki roganovic wrote: Hello, I'd like to display I18N values for a radio button in a form. I have a class Gender, with String id field. A GenderMetaData, with addConstraint(new ConstrainedProperty(id).inList(m, f).notNull(true).notEmpty(true)); I have this in my template : !--V 'FORM:RADIO:g_id' /-- It displays m or f. I'd like to display male or female, so i followed the procedure mentioned in the WIKI : template.addResourceBundle(new ListResourceBundle() { public Object[][] getContents() { return new Object[][] { { g_id:m, male }, { g_id:f, female }, }; } }); It works great, but my app is I18N aware, so i use text properties. I tried to manually add in my text_en.properties : g_id:m=male g_id:f=female but that doesn't work. Is there a way to achieve this ? Thanks. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users --Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Forms and I18N
Hehe I read over it, you're the victim of the properties file format versatility. Change your content to this: g_id\:m=male g_id\:f=female Otherwise it uses : to set the m=male value to the g_id key. On 29 May 2006, at 23:11, Laki roganovic wrote: Geert, I setted globally my properties with TEMPLATE_DEFAULT_RESOURCEBUNDLES_ENGINEHTML in config.xml and that's great. But unfortunately that didn't solve my problem for the radio button, even if i call evaluateL10nTags(). Another clue ? Geert Bevin a écrit : Hi Laki, I add the properties file this way : ResourceBundle bundle = Localization.getResourceBundle(text, en); template.addResourceBundle(bundle); and i use it for the labels on my form. It works all right, except for my radio buttons... Try calling template.evaluateL10nTags() after manually adding the resource bundles: http://rifers.org/docs/api/com/uwyn/rife/template/ Template.html#evaluateL10nTags() By the way, is it possible to define my properties files for all my application, in order to avoid declaring it for each form ? Yes: http://rifers.org/wiki/display/RIFE/Type+specific+default+resource +bundles Thanks. Laki Geert Bevin a écrit : Hi Laki, are you somehow adding the properties file to the template? Either through default properties files or by explicitly adding it? Geert On 28 May 2006, at 23:21, Laki roganovic wrote: Hello, I'd like to display I18N values for a radio button in a form. I have a class Gender, with String id field. A GenderMetaData, with addConstraint(new ConstrainedProperty (id).inList(m, f).notNull(true).notEmpty(true)); I have this in my template : !--V 'FORM:RADIO:g_id' /-- It displays m or f. I'd like to display male or female, so i followed the procedure mentioned in the WIKI : template.addResourceBundle(new ListResourceBundle() { public Object[][] getContents() { return new Object[][] { { g_id:m, male }, { g_id:f, female }, }; } }); It works great, but my app is I18N aware, so i use text properties. I tried to manually add in my text_en.properties : g_id:m=male g_id:f=female but that doesn't work. Is there a way to achieve this ? Thanks. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users --Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] JavaPaste Install and Config
hi,from svn repository, which archives are necessary to make download to use javapaste ? thanksminduOn 4/27/06, mindu [EMAIL PROTECTED] wrote:thank you ... :)I will try and any problem return for the list minduOn 4/27/06, Geert Bevin [EMAIL PROTECTED] wrote:Hi Mindu,these are the steps, I just verified them and they work fine. Please note that JavaPaste hasn't been packaged nor released yet. The setupand configuration might still change for the final release.* checkout the sources using Subversion from https://svn.rifers.org/javapaste/trunk* edit the file src/rep/participants.xml and change the 'derby'datasource into 'mysql'* edit the file src/rep/config-base.xml and adapt database_name,database_user, database_password to the MySQL database and user you created for JavaPaste* do ant package* you'll find the war file in: build/dist/javapaste-1.0.war* rename to javapaste.war or anything you like and put it in yourTomcat webapps directory * start tomcatEverything should be installed automatically.Hope this helps,GeertOn 26 Apr 2006, at 05:46, mindu wrote: hi, How i use javapaste in my java server with tomcat 5 and mysql ? thanks mindu -- Comunidade IRC de Usuários Java. #java - irc.brasnet.org http://canaljava.dev.java.net ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users--Geert Bevin Uwyn bvba GTalk: [EMAIL PROTECTED]Use what you need Avenue de Scailmont 34Skype: gbevin http://www.uwyn.com 7170 Manage, BelgiumAIM: geertbevingbevin at uwyn dot comTel: +32 64 84 80 03 Mobile: +32 477 302 599 PGP Fingerprint : 4E21 6399 CD9E A384 6619719A C8F4 D40D 309F D6A9 Public PGP key: available at servers pgp.mit.edu, wwwkeys.pgp.net___Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Comunidade IRC de Usuários Java.#java - irc.brasnet.org http://canaljava.dev.java.net -- Comunidade IRC de Usuários Java.#java - irc.brasnet.orghttp://canaljava.dev.java.net ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Forms and I18N
Thanks a lot Geert, everything's all right, now. Best regards Laki Geert Bevin a écrit : Hehe I read over it, you're the victim of the properties file format versatility. Change your content to this: g_id\:m=male g_id\:f=female Otherwise it uses : to set the m=male value to the g_id key. On 29 May 2006, at 23:11, Laki roganovic wrote: Geert, I setted globally my properties with TEMPLATE_DEFAULT_RESOURCEBUNDLES_ENGINEHTML in config.xml and that's great. But unfortunately that didn't solve my problem for the radio button, even if i call evaluateL10nTags(). Another clue ? Geert Bevin a écrit : Hi Laki, I add the properties file this way : ResourceBundle bundle = Localization.getResourceBundle(text, en); template.addResourceBundle(bundle); and i use it for the labels on my form. It works all right, except for my radio buttons... Try calling template.evaluateL10nTags() after manually adding the resource bundles: http://rifers.org/docs/api/com/uwyn/rife/template/Template.html#evaluateL10nTags() By the way, is it possible to define my properties files for all my application, in order to avoid declaring it for each form ? Yes: http://rifers.org/wiki/display/RIFE/Type+specific+default+resource+bundles Thanks. Laki Geert Bevin a écrit : Hi Laki, are you somehow adding the properties file to the template? Either through default properties files or by explicitly adding it? Geert On 28 May 2006, at 23:21, Laki roganovic wrote: Hello, I'd like to display I18N values for a radio button in a form. I have a class Gender, with String id field. A GenderMetaData, with addConstraint(new ConstrainedProperty(id).inList(m, f).notNull(true).notEmpty(true)); I have this in my template : !--V 'FORM:RADIO:g_id' /-- It displays m or f. I'd like to display male or female, so i followed the procedure mentioned in the WIKI : template.addResourceBundle(new ListResourceBundle() { public Object[][] getContents() { return new Object[][] { { g_id:m, male }, { g_id:f, female }, }; } }); It works great, but my app is I18N aware, so i use text properties. I tried to manually add in my text_en.properties : g_id:m=male g_id:f=female but that doesn't work. Is there a way to achieve this ? Thanks. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users --Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users --Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Sharing my experiments
Hi Geert, Well, I am glad you used my experiments sharing to look into my 'problem' and found the solution! One of the reasons to share my experiments is to challenge other users to do the same. What I like the most about Rife is that it allows users (even novice java programmers) to build up an application in small steps with a quick turn around time (edit, run, repair, retry) using Eclipse. Regards, Adriaan ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Sharing my experiments
Hi Adriaan, you can download the fixes version from here: http://rifers.org/downloads/rife/snapshots/rife-1.5M2-snapshot-20060530/ Well, I am glad you used my experiments sharing to look into my 'problem' and found the solution! One of the reasons to share my experiments is to challenge other users to do the same. That is great! What would be even cooler is to talk about the things you discover, the things you like, the things you think that can improve, ... by blogging about them (and making sure your blog is on javablogs.com). If you don't have a blog, you're free to blog about RIFE at http://rifers.org/blogs, just register and tell me that I have to activate you as a blogger. What I like the most about Rife is that it allows users (even novice java programmers) to build up an application in small steps with a quick turn around time (edit, run, repair, retry) using Eclipse. Very nice way of putting it, thanks :-) Take care, Geert -- Geert Bevin Uwyn Use what you need - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users