Re: PMC chair of Apache MyFaces changed
Hi Matthias, Gerhard, @Matthias: Thanks for all the work you did. Hope you will still be part of the community, be it in a different role. @Gerhard: Congratulations! In the past few years, I have got to know you as a very enthusiastic person, I think that's a very important quality for a chair! Best regards, Bart On Thu, Mar 17, 2011 at 08:20, Matthias Wessendorf mat...@apache.orgwrote: Hi, I am stepping back from being the Apache MyFaces PMC chair. The MyFaces PMC did vote (internally) that Gerhard Petracek would be a very good PMC chair. Yesterday, during the board meeting, this has been made official. Please join me in welcoming Gerhard as being the new PMC chair of Apache MyFaces! Congrats, Gerhard! -Matthias -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf -- ___ *Bart Kummel* Author of the book Apache MyFaces 1.2 Web Application Developmenthttp://tinyurl.com/am12wad blog: BK http://www.bartkummel.net/ | twitter: @bkummel http://twitter.com/bkummel
Re: myfaces news
Wow! GREAT idea, Gerhard! On Mon, Nov 15, 2010 at 17:14, Hazem Saleh haz...@apache.org wrote: Great Idea Thanks Gerhard. On Mon, Nov 15, 2010 at 5:57 PM, Mark Struberg strub...@yahoo.de wrote: +1 LieGrue, strub --- On Mon, 11/15/10, Matthias Wessendorf mat...@apache.org wrote: From: Matthias Wessendorf mat...@apache.org Subject: Re: myfaces news To: MyFaces Development d...@myfaces.apache.org Cc: users@myfaces.apache.org Date: Monday, November 15, 2010, 10:39 AM Gerhard, great stuff! Thanks for setting it up! -M On Mon, Nov 15, 2010 at 11:34 AM, Gerhard gerhard.petra...@gmail.com wrote: hi @ all, we created a twitter-account for providing you the latest and greatest news about myfaces. you can follow us on twitter [1] or via news feed [2]. regards, gerhard [1] http://twitter.com/MyFacesTeam [2] http://s.apache.org/myfaces_news http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf -- Hazem Ahmed Saleh Ahmed Author of (The Definitive Guide to Apache MyFaces and Facelets): http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/1590597370 http://www.amazon.com/-/e/B002M052KY Web blog: http://www.jroller.com/HazemBlog [Web 2.0] Mashups Integration with JSF: http://code.google.com/p/mashups4jsf/
Re: Problem with combination of f:selectItems and tr:selectOneChoice...
Hi Lukasz, The error message says it all: JSF is looking for a value com.pac5.datamodel.pojos.ris.dictionaries.slownikrispraco...@1b3114, which is an Object of class SlownikRisPracowni. The getRisPracownieSlownik() method that is used to fill the tr:selectOneChoice with items returns a List of SelectItems, where the value of each SelectItem is the ID of a SlownikRisPracowni object. So I think if you change the value=#{konsolaadmina.risAparat.slownikRisPracowni} expression in your tr:selectOneChoice to something like value=#{konsolaadmina.risAparat.slownikRisPracowni.id} it will work. In other words: the value expression of your tr:selectItem should be of the same type as the values in your list. Regarding the WARNING: FacesMessage(s) have been enqueued, but may not have been displayed. error: it seems you don't have a message(s) component on your page. You should add one, otherwise JSF doesn't have a way to display error messages. Hop this helps! Best regards, Bart 2010/4/6 Lukasz Feldman lukasz.feld...@googlemail.com Hmmm... Now I have xhtml like this: (...) h:selectOneMenu partialTriggers=slownikRisAparatow actionListener=#{konsolaadmina.ustawRisAparat} value=#{konsolaadmina.risAparat.slownikRisPracowni} label=w pracowni f:selectItems value=#{slowniki.risPracownieSlownik}/ f:converter converterId=risPracowniReadWriteConverter/ /h:selectOneMenu (...) It goes without saying that my PPR mechanism is not working properly which eliminate this as a solution. But to be honest I can see somekind of different behavior here. I can see some chosen value for selectonemenu but it is not chosen properly. Additionally I cannot walk between pages because of validation errror: INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed. sourceId=konsolaadminaform:tab04:j_id213[severity=(ERROR 2), summary=(w pracowni: Validation Error: Value is not valid), detail=(w pracowni: Validation Error: Value is not valid)] BR, Lukasz W dniu 6 kwietnia 2010 18:05 użytkownik Anton Gavazuk antongava...@gmail.com napisał: Lukasz, could you verify that your custom converter works with standart h:selectOneMenu component? 2010/4/6 Lukasz Feldman lukasz.feld...@googlemail.com Here is english version: WARNING: Could not find selected item matching value com.pac5.datamodel.pojos.ris.dictionaries.slownikrispraco...@1b3114 in * CoreSelectOneChoice*[*UIXEditableFacesBeanImpl*, id=j_id213] I have found same error here but still I am not sure what should I do: http://old.nabble.com/af:selectOneChoice-td16572647.html BR, Lukasz 2010/4/6 Bart Kummel bkum...@gmail.com Hi Lukasz, I don't understand the error message, it is not in English. Can you configure your appserver to generate English error messages? Best regards, Bart 2010/4/6 Lukasz Feldman lukasz.feld...@googlemail.com Hi, I have some challenging problem which makes me a little nervouse since I have started to solve it few days ago. I want to combine f:selectItems with tr:selectOneChoice. Here is code snippet: something.xhtml: - (...) tr:selectOneChoice partialTriggers=slownikRisAparatow actionListener=#{konsolaadminabb.ustawRisAparat} value=#{konsolaadmina.risAparat.slownikRisPracowni} label=w pracowni f:selectItems value=#{slownikibb.risPracownieSlownik}/ f:converter converterId=risPracowniReadWriteConverter/ /tr:selectOneChoice (...) konsolaadminabb.java: - (...) public void ustawRisAparat(ValueChangeEvent event) { risAparat = (SlownikRisAparatow) event.getNewValue(); DetachedCriteria criteria = DetachedCriteria.forClass(SlownikRisPracowni.class); criteria.setFetchMode(slownikRisAparatows, FetchMode.DEFAULT).createAlias(slownikRisAparatows, aparat).add(Restrictions.eq(aparat.id, risAparat.getId())); risAparat.setSlownikRisPracowni(new RisPracowniSlownikDAO().findByCriteria(criteria).get(0)); (...) slownikibb.java: -- (...) public ListSelectItem getRisPracownieSlownik() { List selectItemList = new ArrayList(); for (SlownikRisPracowni pracownia : slownikiService.zaladujRisPracowniSlownik()) { selectItemList.add(new SelectItem(Long.toString(pracownia.getId()), pracownia.getNazwaPracowni())); } return selectItemList; } (...) risPracowniReadWriteConverter: --- public class RisPracowniReadWriteConverter implements Converter { private Logger logger = Logger.getLogger(com.pac5); public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2
Re: Problem with combination of f:selectItems and tr:selectOneChoice...
Hi Lukasz, I don't understand the error message, it is not in English. Can you configure your appserver to generate English error messages? Best regards, Bart 2010/4/6 Lukasz Feldman lukasz.feld...@googlemail.com Hi, I have some challenging problem which makes me a little nervouse since I have started to solve it few days ago. I want to combine f:selectItems with tr:selectOneChoice. Here is code snippet: something.xhtml: - (...) tr:selectOneChoice partialTriggers=slownikRisAparatow actionListener=#{konsolaadminabb.ustawRisAparat} value=#{konsolaadmina.risAparat.slownikRisPracowni} label=w pracowni f:selectItems value=#{slownikibb.risPracownieSlownik}/ f:converter converterId=risPracowniReadWriteConverter/ /tr:selectOneChoice (...) konsolaadminabb.java: - (...) public void ustawRisAparat(ValueChangeEvent event) { risAparat = (SlownikRisAparatow) event.getNewValue(); DetachedCriteria criteria = DetachedCriteria.forClass(SlownikRisPracowni.class); criteria.setFetchMode(slownikRisAparatows, FetchMode.DEFAULT).createAlias(slownikRisAparatows, aparat).add(Restrictions.eq(aparat.id, risAparat.getId())); risAparat.setSlownikRisPracowni(new RisPracowniSlownikDAO().findByCriteria(criteria).get(0)); (...) slownikibb.java: -- (...) public ListSelectItem getRisPracownieSlownik() { List selectItemList = new ArrayList(); for (SlownikRisPracowni pracownia : slownikiService.zaladujRisPracowniSlownik()) { selectItemList.add(new SelectItem(Long.toString(pracownia.getId()), pracownia.getNazwaPracowni())); } return selectItemList; } (...) risPracowniReadWriteConverter: --- public class RisPracowniReadWriteConverter implements Converter { private Logger logger = Logger.getLogger(com.pac5); public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) { if (arg2.equals(null)) { return null; } return (Object) new RisPracowniSlownikDAO().findById(arg2); } public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) { if (arg2==null) { return ; } SlownikRisPracowni pracownia = new RisPracowniSlownikDAO().findById(arg2.toString()); return Long.toString(pracownia.getId()); } As a result of this I have a problem like this: 2010-04-05 23:10:35 org.apache.myfaces. trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer _getSelectedIndex WARNING: Nie znaleziono wybranego elementu zgodnego z wartością com.pac5.datamodel.pojos.ris.dictionaries.slownikrispraco...@1b3114 w CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id213] Has anyone idea what is going on? BR, Lukasz -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Fwd: Book Promo: Apache MyFaces 1.2 Web Application Development
Hi everybody, I announced the publication of my book Apache MyFaces 1.2 Web Application Development [1] a few weeks ago. This week there is a promotion of the book over at JavaRanch [2], se the forwarded message below. Feel free to ask questions about the book on their JSF forum and you might be lucky and win a free copy of the book! Best regards, Bart Kummel [1] http://tinyurl.com/am12wad [2] http://www.coderanch.com/forums/f-82/JSF -- Forwarded message -- From: Java Ranch Moose mmo...@javaranch.com Date: Tue, Mar 23, 2010 at 02:12 Subject: Book Promo: Apache MyFaces 1.2 Web Application Development To: Java Ranch Moose mmo...@javaranch.com We are thrilled to have Bart Kummel on the ranch to promote the book Apache MyFaces 1.2 Web Application Development. The promotion will be held in the JSF forum which can be found here: http://www.coderanch.com/forums/f-82/JSF or on our mobile site: http://www.coderanch.com/mobile/forums/f-82/JSF Participate in this week's giveaway by asking Bart Kummel a question or two and you may win a copy of the book! The giveaway starts on Tuesday, March 23rd 2010. The drawing will be held on Friday, March 26th 2010. For more info or if you're plumb tired of getting this info, visit: http://faq.javaranch.com/view?BookPromotions -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Re: [TRINIDAD] Header rendering multiple times.
Hi Joachim, The pageFlowScope is *the* alternative for t:savestate. I don't see why pageFlowScope is less convenient. I admit you'll have to get used to it. But in the end, I think pageFlowScope is a more structural solution. And pageFlowScope is more versatile, as it can be used across pages too. You should also be aware that JSF 2.0 uses a similar solution to this problem. So by getting used to pageFlowScope you are already preparing yourself for a switch to JSF 2.0... Best regards, Bart On Tue, Mar 16, 2010 at 15:38, Joachim Schrod jsch...@acm.org wrote: Bart Kummel wrote: Hello, Why are you mixing Tomahawk and Trinidad components? Apart from some special cases (e.g. captcha and schedule) there are Trinidad alternatives to every Tomahawk component. What do you use as the Trinidad replacement for t:savestate, as a method to cache request-scoped beans on the same page? E.g., to avoid the need for another database roundtrip in postback or redirect requests. I know pageFlowScope, but it is more inconvenient to use and has also a slightly different focus, AFAIU. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jsch...@acm.org Roedermark, Germany -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Re: [Trinidad] Problem with chooseDate and chart in Opera
Hi Jozef, I don't have any experience with Opera. (I don't even have it installed...) So I cannot help you on this. But I can give you some clues... - The charts are rendered with SVG and JavaScript. So you should check if Opera can render SVG. Perhaps you'll need some plugin? - The date picker: perhaps Opera has a built-in popup blocker that blocks the date picker popup? To prevent this, you can use Trinidad's lightweigt dialogs, see [1]. Best regards, Bart [1] http://myfaces.apache.org/trinidad/devguide/configuration.html#org.apache.myfaces.trinidad.ENABLE_LIGHTWEIGHT_DIALOGS On Sun, Mar 14, 2010 at 14:51, Jozef Dropco jozef.dro...@gmail.com wrote: Hello again, I did not mention that, this does not work also in examples on http://test.codebeat.ro/trinidad-components-demo/component-demo/chart-Default. Could somebody say something to it, its a bug? Thanks Jozef On 10.3.2010 13:57, Jozef Dropco wrote: Hello all, I dont know why it doesnt work but, i have opera 10.5 and it does not work. If I open my page in Firefox everything is fine, but in opera chooseDate is not rendered at all and chart loads something but never stops. What is wrong here I cant understand it. Thanks Jozef Conf: Facelets 1.1.14, trinidad:1.2.13, Glassfish (and same on tomcat) -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Re: [Trinidad] How to get control over tr:table detail disclose link table cell?
Hi Elmar, Yeah, I got your problem. In skinning terms, I think you can summarize your problem by saying that a af|table::disclosureCell skinning selector is missing, right? I can think of a couple of solutions, you also mentioned some. I think for a lot of use cases the addition of aforementioned skinning selector is a good solution. This way the cell with the disclosure link and everything that is in that cell can be styled as you like. (This includes hiding it.) Adding a discloser facet, as you suggest, gives even more flexibility, especially when combined with one or more extra skinning selectors. A downside of adding such a facet might be that it can make things overly complex. I'm not a fan of extra styleClass attributes. I think it is better to have enough skinning selectors. In my opinion, using styleClass attributes is very close to mixing View code with Controller logic, which should be prevented. Long story short: I don't think what you want is possible yet. However, you can always create an enhancement request in Jira and/or supply a patch... Best regards, Bart On Wed, Mar 17, 2010 at 09:26, Elmar Kretzer e.kret...@symentis.com wrote: Hi Bart, the skinning support for the automatic disclose link is not sufficient as far as i can see. E.g. in tr:column i can set the style class via EL so i have full control over the styles in a rendered table row, and I can explicitly change the style class of a disclosed row's table cells. But there is no possibility to change the style class of the cell with the built-in disclose link of a disclosed row. i am missing something like: 1. f:facet name=discloser /f:facet or 2. an attribute in tr:table like: discloseLinkCellStyleClass={#xxx.yyy} or 3. any way to hide the built-in disclose link (cell). we already implemented an own listener for enhanced control over the row disclosing which we place inside a normal tr:column. but there is no way to hide the built-in disclose link (cell). As soon as i add the necessary detail facet, the cell gets rendered. you see my problem? =) Best regards, Elmar Hi Elmar, You should use Trinidad Skinning for this. You can take an existing skin and change the elements you want to change the appearance of. See [1] for more information. Best regards, Bart [1] http://myfaces.apache.org/trinidad/devguide/skinning.html On Wed, Mar 10, 2010 at 11:58, Elmar Kretzer e.kret...@symentis.com wrote: Hi all, is it possible to get control over the appearance of the disclose link in a tr:table? Currently it seems like the td with the disclose link get automagically rendered with class af_column_cell-text and OraTableBorder when you add the detail stamp. Like: td nowrap= class=af_column_cell-text OraTableBorder headers=j_id1div/div/td Is there any hook to change the style class of this td? We want to mark the disclosed rows + details with a different background color. The only problem now is that the disclose link able cell has always the same style class . Thx for any suggestions. Elmar -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Re: [TRINIDAD] Header rendering multiple times.
Hi, I know Trinidad components use a special way of client side state saving. Maybe the problem is that the Tomahawk components do not support this Trinidad-specific solution. So it could be related to the fact that you're mixing Tomahawk and Trinidad components, as you suggested. Why are you mixing Tomahawk and Trinidad components? Apart from some special cases (e.g. captcha and schedule) there are Trinidad alternatives to every Tomahawk component. So why don't you whitch to Trinidad-only? An alternative solution would be to turn off Trinidad's special client side state saving method. (See [1]) But my advise is to do not mix Tomahawk with Trinidad. Best regards, Bart Kummel [1] http://myfaces.apache.org/trinidad/devguide/configuration.html#org.apache.myfaces.trinidad.CLIENT_STATE_METHOD ___ Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad On Tue, Mar 16, 2010 at 06:37, preeti agarwal preetiagarwa...@gmail.comwrote: Can anyone help in this issue? On Mon, Mar 15, 2010 at 9:56 PM, Andrew Robinson andrew.rw.robin...@gmail.com wrote: Sorry, not sure then, anyone else have an idea? -A On Mon, Mar 15, 2010 at 6:11 AM, preeti agarwal preetiagarwa...@gmail.com wrote: There are no JSTL components being used. Though we use facelets. There is an entry in web.xml file : context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueclient/param-value !--param-valueserver/param-value-- /context-param When this entry is removed (thereby reverting to default settings), the problem gets solved. Any reason why client side State Saving is causing an issue? On Tue, Mar 9, 2010 at 10:23 PM, Andrew Robinson andrew.rw.robin...@gmail.com wrote: Do you use any JSTL tags? Have you any component binding in the page, especially ones that may live longer than one request? On Tue, Mar 9, 2010 at 7:31 AM, preeti agarwal preetiagarwa...@gmail.com wrote: Description of problem : I have an xhtml page in which I use trininad components (like tablelayout) and also tomahawk components (like form). I have used some usual HTML components along with it. First time the page is rendered correctly. But anysubsequent refresh causes the header to render multiple times. I suspect it might have something to do with state saving. Can anyone help me with this? PS: I originally suspected that it had something to do with mixing of incompatible HTML div and Trinidad components.Changing div to t:div didn't solve the issue.
Re: Trinidad: auto suggest input box?
Hi Mike, As far as I know there isn't. Yet... Best regards, Bart On Mon, Mar 15, 2010 at 19:24, Mike Quentel mquen...@4dm-inc.com wrote: Does Trinidad have an auto-suggest functionality like this example: http://www.tomcoote.co.uk/AutoSuggestBox.aspx Many thanks, Mike Quentel -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Re: [Trinidad] How to get control over tr:table detail disclose link table cell?
Hi Elmar, You should use Trinidad Skinning for this. You can take an existing skin and change the elements you want to change the appearance of. See [1] for more information. Best regards, Bart [1] http://myfaces.apache.org/trinidad/devguide/skinning.html On Wed, Mar 10, 2010 at 11:58, Elmar Kretzer e.kret...@symentis.com wrote: Hi all, is it possible to get control over the appearance of the disclose link in a tr:table? Currently it seems like the td with the disclose link get automagically rendered with class af_column_cell-text and OraTableBorder when you add the detail stamp. Like: td nowrap= class=af_column_cell-text OraTableBorder headers=j_id1div/div/td Is there any hook to change the style class of this td? We want to mark the disclosed rows + details with a different background color. The only problem now is that the disclose link able cell has always the same style class . Thx for any suggestions. Elmar -- ___ Bart Kummel Author of the book Apache MyFaces 1.2 Web Application Development See http://tinyurl.com/am12wad
Published today: Apache MyFaces 1.2 Web Application Development
Hi everybody! I'm proud to announce that today my book, Apache MyFaces 1.2 Web Application Development [1], is bublished by Packt Publishing [2]! A short announcement can be found on my blog [3] and a page with resources that accompany the book can be found at [4]. Please feel free to contact me with any questions or comments about the book. And of course: don't forget to order your copy right now! The MyFaces project will receive royalties for every sold copy of this book. (See the Packt open source project royalty scheme [5].) Best regards, Bart Kummel [1] http://www.packtpub.com/apache-myfaces-1-2-web-application-development/ [2] http://www.packtpub.com/ [3] http://www.bartkummel.net/journal/2010/3/3/published-today-apache-myfaces-12-web-application-developmen.html [4] http://www.bartkummel.net/book-resources/ [5] http://www.packtpub.com/article/packt_open_source_project_royalty_scheme
Re: [Trinidad 1.0.11] Skinning: extends is not working (or at least, not fully)
Hi Rafa, I have been struggling with the extends functionality as well. My experience is the same as yours: it doesn't work. I asked nearly the same question as you on this list about a year ago, but I didn't get a satisfying answer. I think the best way to extend a skin is just copying the CSS and images and adapt them. I tried several scenarios with the extends functionality, but neither of them gave me a working solution. Perhaps you should file a bug in JIRA about this. At least the documentation is incomplete, but I think the implementation isn't complete either. Hope this helps, although it is probably not the answer you hoped for... Good luck! Best regards, Bart Kummel 2010/1/29 Rafa Pérez raja...@gmail.com Hi all, I have been reading about the extending facilities for skinning in Trinidad. I have created one skin as basis and then have created another one just to override a couple of styles. My configuration is as follows: - In trinidad-config.xml: ?xml version=1.0 encoding=windows-1252? trinidad-config xmlns=http://myfaces.apache.org/trinidad/config; skin-familyskin_extended/skin-family accessibility-modeinaccessible/accessibility-mode /trinidad-config - In trinidad-skins.xml: ?xml version=1.0 encoding=ISO-8859-1? skins xmlns=http://myfaces.apache.org/trinidad/skin; skin idskin_base.desktop/id familyskin_base/family render-kit-idorg.apache.myfaces.trinidad.desktop/render-kit-id style-sheet-nameskins/prueba/prueba.css/style-sheet-name /skin skin idskin_extended.desktop/id familyskin_extended/family render-kit-idorg.apache.myfaces.trinidad.desktop/render-kit-id style-sheet-nameskins/prueba/prueba_ext.css/style-sheet-name extendsskin_base.desktop/extends /skin /skins The fact is that the styles seems to be merged in the generated CSS file, but aren't applied to the page. It's quite weird, because in firebug's CSS tab you cannot see all the styles that are present in the generated CSS file. Am I misunderstanding anything? Is it possible that the generated CSS file is wrong at any point and the browser does not parse it right? Regards, -- Rafa
Re: [Trinidad] new skin and new demo
Hi all, I just posted a short article about the new Cassablanca skin for Trinidad at my blog: http://www.bartkummel.net/journal/2010/2/2/new-skin-for-trinidad.html. Best regards, Bart Kummel On Sat, Jan 30, 2010 at 12:19, Matthias Wessendorf mat...@apache.orgwrote: Hello, as FYI, the new skin (cassablanca) has been committed to trunk (1.2.14-SNAPSHOT). There will be a release for that in a few weeks. Thanks to our friends from Irian.at, for already hosting the new beautiful demo: http://example.irian.at/trinidad-components-showcase/ Check it out! Special thanks for the code-donation goes to Catalin and team from CodeBeat: http://www.codebeat.ro Enjoy the new skin, guys! -Matthias -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: [Trinidad] Trinidad and Glassfish: resource servlet does not work
Hi Walter, I never used 1.1, so I don't have experience with 1.1 to 1.2 migration. However, I think the changes from 1.1 to 1.2 shouldn't have much impact. For what I know, most are improvements that will only make your life easier. If I were you, I'd try upgrading and see if the existing code runs without changes. Good luck! Regards, Bart 2009/12/29 Walter Mourão walter.mou...@gmail.com Hi Bart, I will search a doc about migrating from 1.1 to 1.2. If you have some doc or info to make my path easier, please let me know. thanks, Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br 2009/12/29 Bart Kummel b...@kummelweb.nl Hi Walter, I do use Trinidad on Glassfish. I'm using Trinidad 1.2.x though. Why don't you switch to 1.2.x? Best regards, Bart 2009/12/29 Walter Mourão walter.mou...@gmail.com I would like to know if somebody is using Trinidad + Glassfish successfully... Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br 2009/12/24 Walter Mourão walter.mou...@gmail.com Hi Bart, I'm already using this way. my sun-web.xml : ?xml version=1.0 encoding=UTF-8? !DOCTYPE sun-web-app PUBLIC -//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd; sun-web-app class-loader delegate=false/ property name=useMyFaces value=true/!-- Glassfish V2 -- property name=useBundledJsf value=true/!-- Glassfish V3 -- /sun-web-app No luck yet. Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br On Wed, Dec 23, 2009 at 11:49 AM, Bart Kummel bkum...@gmail.comwrote: Hi Walter, Do you have the class-loader delegate=false/ element in your sun-web.xml? Like this: sun-web-app class-loader delegate=false/ property name=useMyFaces value=true/ /sun-web-app There are several class loading problems, and this setting seems to solve some of them... Best regards, Bart 2009/12/22 Walter Mourão walter.mou...@gmail.com Hi Matthias, thanks the attention. I just checked and I'm sure the resource servlet is executed. The url is null after URL url = loader.getResource(resourcePath); in: ... ResourceLoader loader = _getResourceLoader(request); String resourcePath = getResourcePath(request); URL url = loader.getResource(resourcePath); // Make sure the resource is available if (url == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } ... Some not found resources I saw during debug: /adf/jsLibs/DebugCommon1_0_10.js /adf/styles/cache/default-desktop-lmwkb-ltr-gecko.css /adf/images/t.gif Since the application is running fine in a standalone Tomcat, I think the problem is related with some classloader issue regarding Glassfish X Trinidad ... Hints ? Should I open a Jira issue ? In Glassfish or Trinidad :-) ? Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br On Mon, Dec 21, 2009 at 10:38 AM, Matthias Wessendorf mat...@apache.org wrote: did you check (w/ debugger) that the resource servlet is really executed ? If not, that's likely some container specific issue -M 2009/12/21 Walter Mourão walter.mou...@gmail.com: Hi folks, I'm trying to make an existing Trinidad (1.0.10) application to work in Glassfish (2.1.1). After creating the sun-web.xml with the property useMyFaces=true, the application started to work, but the resources from Trinidad (css, javascript) isn't going to the browser. The urls inside the html source code are correct and it looks like the servlet isn't being executed. I checked in Glassfish and the servlet is recognized (appears as sub-component of the web application). Any hints ? Thanks in advance, Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: [Trinidad] Trinidad and Glassfish: resource servlet does not work
Hi Walter, Do you have the class-loader delegate=false/ element in your sun-web.xml? Like this: sun-web-app class-loader delegate=false/ property name=useMyFaces value=true/ /sun-web-app There are several class loading problems, and this setting seems to solve some of them... Best regards, Bart 2009/12/22 Walter Mourão walter.mou...@gmail.com Hi Matthias, thanks the attention. I just checked and I'm sure the resource servlet is executed. The url is null after URL url = loader.getResource(resourcePath); in: ... ResourceLoader loader = _getResourceLoader(request); String resourcePath = getResourcePath(request); URL url = loader.getResource(resourcePath); // Make sure the resource is available if (url == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } ... Some not found resources I saw during debug: /adf/jsLibs/DebugCommon1_0_10.js /adf/styles/cache/default-desktop-lmwkb-ltr-gecko.css /adf/images/t.gif Since the application is running fine in a standalone Tomcat, I think the problem is related with some classloader issue regarding Glassfish X Trinidad ... Hints ? Should I open a Jira issue ? In Glassfish or Trinidad :-) ? Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br On Mon, Dec 21, 2009 at 10:38 AM, Matthias Wessendorf mat...@apache.org wrote: did you check (w/ debugger) that the resource servlet is really executed ? If not, that's likely some container specific issue -M 2009/12/21 Walter Mourão walter.mou...@gmail.com: Hi folks, I'm trying to make an existing Trinidad (1.0.10) application to work in Glassfish (2.1.1). After creating the sun-web.xml with the property useMyFaces=true, the application started to work, but the resources from Trinidad (css, javascript) isn't going to the browser. The urls inside the html source code are correct and it looks like the servlet isn't being executed. I checked in Glassfish and the servlet is recognized (appears as sub-component of the web application). Any hints ? Thanks in advance, Walter Mourão http://waltermourao.com.br http://arcadian.com.br http://oriens.com.br -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: General JSF 1.2 + Facelets question
Hi Surija, Am I getting you right? Are you using Facelets 1.1.14 with a JSF 2.0 implementation? That's weird, as JSF 2.0 includes a newer version of Facelets. You shouldn't use a separate Facelets lib when using JSF 2.0. Regards, Bart Kummel On Fri, Dec 18, 2009 at 16:22, Luka Surija l...@iytim.hr wrote: Yeah, it works. Thank you. I'm just wondering the behavior is changed between facelets 1.1.13 and 1.1.14? Luka Surija Jakob Korherr wrote: Hi Luka, The JSF 2.0 specification only explains that when attaching a f:setPropertyActionListener, an ActionListener (with specific behavior) should be created and added to the nesting UIComponent (which has to implement ActionSource) with addActionListener(). From my point of view it is not clear which is added first, the action listener from the tag attribute »actionListener« or the nested action listener(s), but I think the order is: first tag attributes, then nested tags. You can try to work around this problem using f:actionListener / below f:setPropertyActionListener instead of the tag attribute »actionListener«, so that it will be added to the UIComponent after f:setPropertyActionListener and thus executed after f:setPropertyActionListener. I hope this works for you. Regards, Jakob Korherr 2009/12/16 Luka Surija lukaxremo...@iytim.hr It looks like i'm not familiar with JSF as much as I've thought. What is the expected behavior in JSF 1.2 + Facelets for f:setPropertyActionListener? code: h:panelGroup rendered=#{PersonMB.person == null} h:dataTable value=#{PersonMB.allPersons} var=item h:column f:facet name=headerName/f:facet #{item.name} /h:column h:column h:commandLink value=Edit actionListener=#{PersonMB.edit} f:setPropertyActionListener value=#{item} target=#{PersonMB.person} / /h:commandLink /h:column h:column h:commandLink actionListener=#{PersonMB.delete} value=Delete f:setPropertyActionListener value=#{item} target=#{PersonMB.person} / /h:commandLink /h:column /h:dataTable h:commandLink onclick=dialog.show() actionListener=#{PersonMB.createPerson} value=New person / br / h:commandLink actionListener=#{PersonMB.reload} value=Reload / /h:panelGroup PersonMB: @EJB PersonController controller; private Person person; public Person getPerson(){ return person; } public void setPerson(Person _person){ this.person=_person; } public void delete(ActionEvent event){ controller.delete(person); } So here are two possible scenarios: case #1: actionListener delete executes BEFORE f:setPropertyActionListener sets value item to person case #2: actionListener delete executes AFTER f:setPropertyActionListener sets value item to person In case #1 action listener delete isn't executed as expected because person is null, but in case #2 function is executed properly. Why I'm asking this? Till facelets version 1.1.14+trinidad and back on old Oracle ADF Faces all my applications behaved as described in scenario case #2, BUT with trinidad+facelets 1.1.14 or IceFaces 1.8.x and now JSF 2.0 (mojarra) behavior changed to scenario case #1. What is the proper behavior according to specification ? Best regards, Luka Surija
Re: [Trinidad] Trinidad, Facelets, multiple forms
Hi Arnold, I don't see why a solution with request parameters is more elegant than using a JSF/Spring managed bean? Best regards, Bart On Fri, Nov 20, 2009 at 08:21, Arnold Preg ap...@mailbox.hu wrote: Hi Bart, I asked it already in the spring forum but nobody answered. I read the spring reference already but I think it's not particular and I did not see example for this problem in the example program neither. There is a requestParameters EL variable to reach the request parameters as I know, but the problem is I can't send an appropriate parameter. I will looking for solution in this http://www.apress.com/book/view/9781430216247 book too. The scoped bean thing (Spring call it Spring Managed Bean) could works like a charm just like in plain JSF solutions, but I hoped there is an elegant way to handle this like the f:param in commandLink. Thank you for your help. On 2009.11.19. 10:32, Bart Kummel wrote: Hi Arnold, I'm afraid I can't help you with the parameter sending problem. I think you should read the Spring WebFlow documentation. They must have implemented an elegant way to handle parameters. I think you should focus on setting a value on a scope or in a bean that is on a scope. That way JSF and/or SWF will do the hard parameter encoding/decoding for you. Generally speaking, with JSF, you should be messing around with GET or POST parameters. I can't imaging SWF changes this. But as said, I don't know anything about SWF. Perhaps you should ask this question on an SWF related mailing list or forum. Composite Component: I think that is an elegant way to implement it, as I said. Remember to not use any trh tag in your composite component. What you want can be achieved by using standard components, like outputText, various panelXyz variants, etc. In your main page you can do the iteration. You could usetr:iterator, but with Facelets, it is also possible to use JSTL iteration. Best regards, Bart On Wed, Nov 18, 2009 at 20:06, Arnold Pregap...@mailbox.hu wrote: I accept that making a composite component cleans the code etc. But I still have to iterate over the collection of books somehow, e.g. with tr:iterator, right? And I don't know how does it solve the parameter sending problem. With tr:inputHidden the POST parameters looks like this: _noJavaScriptfalse *j_id33:0:j_id36:selectedBookId1 j_id33:1:j_id36:selectedBookId2 j_id33:2:j_id36:selectedBookId3 j_id33:3:j_id36:selectedBookId4 * javax.faces.ViewStateH4sI... org.apache.myfaces.trinidad.faces.FORMj_id30 sourcej_id33:0:j_id36:j_id41 The point is the parameter's name is *j_id33:0:j_id36:selectedBookId *and so on. So, I could reference it on this name only in the flow definition, but of course it's not good. I need one form for one hidden field. On 2009.11.18. 11:51, Bart Kummel wrote: Okay, now I get what you want. Good idea to post an image! If I were you, I would craete a Facelets Composition Component to render a single book's details (image, title, etc.) Inside that Composition Component you could use various Trinidad components to render the image, the price, the link, etc. (Use Google to find more info on Facelets Composition Components.) Then you could use e.g. atr:panelGroupLayout or ah:panelGrid or something like that to distribute the items over a page as desired. As for passing on the selected book ID, have you tried using tr:inputHidden? Best regards, Bart On Wed, Nov 18, 2009 at 11:20, Arnold Pregap...@mailbox.hu wrote: Hi, If I can reach thishttp://i48.tinypic.com/2q207ib.png( http://i48.tinypic.com/2q207ib.png ) look with skinning, then yes. (In essence I don't need column headers, pagination bar, radiobuttons etc. Just the layout and collection handling function I need from tr:table in this case.) I think SWF can handle POST and GET parameters equally. On 2009.11.18. 10:33, Bart Kummel wrote: Hi, If you only want to change the appearance, you should definitely take a look at Trinidad's skinning featureshttp://myfaces.apache.org/trinidad/devguide/skinning.html. You can change the appearance of every Trinidad component this way, while keeping the functionality. Is that what you're looking for? As for you other question: what type of parameters does SWF expect? POST or GET? Best regards, Bart On Wed, Nov 18, 2009 at 09:35, Arnold Pregap...@mailbox.hu wrote: Hi, I have to use Trinidad components, and minimalize the use of manual HTML or js codes. I do not like to use trh: components, but the tr:table appearance has not been being suitable and I did not want to write own component because I thought the tr:table and iterate will do the work and I never wrote an own component before yet, so this was left. Although, as I see the own component could be the best solution to reach the proper appearance. But one question is still
Re: [Trinidad] Trinidad, Facelets, multiple forms
Hi Arnold, I'm afraid I can't help you with the parameter sending problem. I think you should read the Spring WebFlow documentation. They must have implemented an elegant way to handle parameters. I think you should focus on setting a value on a scope or in a bean that is on a scope. That way JSF and/or SWF will do the hard parameter encoding/decoding for you. Generally speaking, with JSF, you should be messing around with GET or POST parameters. I can't imaging SWF changes this. But as said, I don't know anything about SWF. Perhaps you should ask this question on an SWF related mailing list or forum. Composite Component: I think that is an elegant way to implement it, as I said. Remember to not use any trh tag in your composite component. What you want can be achieved by using standard components, like outputText, various panelXyz variants, etc. In your main page you can do the iteration. You could use tr:iterator, but with Facelets, it is also possible to use JSTL iteration. Best regards, Bart On Wed, Nov 18, 2009 at 20:06, Arnold Preg ap...@mailbox.hu wrote: I accept that making a composite component cleans the code etc. But I still have to iterate over the collection of books somehow, e.g. with tr:iterator, right? And I don't know how does it solve the parameter sending problem. With tr:inputHidden the POST parameters looks like this: _noJavaScriptfalse *j_id33:0:j_id36:selectedBookId1 j_id33:1:j_id36:selectedBookId2 j_id33:2:j_id36:selectedBookId3 j_id33:3:j_id36:selectedBookId4 * javax.faces.ViewStateH4sI... org.apache.myfaces.trinidad.faces.FORMj_id30 sourcej_id33:0:j_id36:j_id41 The point is the parameter's name is *j_id33:0:j_id36:selectedBookId *and so on. So, I could reference it on this name only in the flow definition, but of course it's not good. I need one form for one hidden field. On 2009.11.18. 11:51, Bart Kummel wrote: Okay, now I get what you want. Good idea to post an image! If I were you, I would craete a Facelets Composition Component to render a single book's details (image, title, etc.) Inside that Composition Component you could use various Trinidad components to render the image, the price, the link, etc. (Use Google to find more info on Facelets Composition Components.) Then you could use e.g. atr:panelGroupLayout or ah:panelGrid or something like that to distribute the items over a page as desired. As for passing on the selected book ID, have you tried using tr:inputHidden? Best regards, Bart On Wed, Nov 18, 2009 at 11:20, Arnold Pregap...@mailbox.hu wrote: Hi, If I can reach thishttp://i48.tinypic.com/2q207ib.png( http://i48.tinypic.com/2q207ib.png ) look with skinning, then yes. (In essence I don't need column headers, pagination bar, radiobuttons etc. Just the layout and collection handling function I need from tr:table in this case.) I think SWF can handle POST and GET parameters equally. On 2009.11.18. 10:33, Bart Kummel wrote: Hi, If you only want to change the appearance, you should definitely take a look at Trinidad's skinning featureshttp://myfaces.apache.org/trinidad/devguide/skinning.html. You can change the appearance of every Trinidad component this way, while keeping the functionality. Is that what you're looking for? As for you other question: what type of parameters does SWF expect? POST or GET? Best regards, Bart On Wed, Nov 18, 2009 at 09:35, Arnold Pregap...@mailbox.hu wrote: Hi, I have to use Trinidad components, and minimalize the use of manual HTML or js codes. I do not like to use trh: components, but the tr:table appearance has not been being suitable and I did not want to write own component because I thought the tr:table and iterate will do the work and I never wrote an own component before yet, so this was left. Although, as I see the own component could be the best solution to reach the proper appearance. But one question is still here: How to send parameters with tr:commandButton to SWF correctly and easy? Thank you for your patience. On 2009.11.18. 8:54, Bart Kummel wrote: Hi, I'm afraid I still don't understand exactly what you need. However, I still think you shouldn't use the approach with thetrh:tableLayout, etc. (Should you need *some* HTML for layout of your page, with Facelets you can use HTML in your Facelet, so you don't need anytrh:...tag for that anymore.) If you want to use JSF, you should use JSF components that do the hard work for you. You can search the Trinidad, Tomahawk and Tobago libraries or other component libraries for a component that suits your needs. If nothing can be found, you can create your own JSF component. If you prefer to be super flexible in the HTML output, you should perhaps consider a framework that isn't component based, like JSF. Best regards, Bart On Tue, Nov 17, 2009 at 20:28, Arnold Pregap...@mailbox.hu wrote
Re: [Trinidad] Trinidad, Facelets, multiple forms
Hi, If you only want to change the appearance, you should definitely take a look at Trinidad's skinning featureshttp://myfaces.apache.org/trinidad/devguide/skinning.html. You can change the appearance of every Trinidad component this way, while keeping the functionality. Is that what you're looking for? As for you other question: what type of parameters does SWF expect? POST or GET? Best regards, Bart On Wed, Nov 18, 2009 at 09:35, Arnold Preg ap...@mailbox.hu wrote: Hi, I have to use Trinidad components, and minimalize the use of manual HTML or js codes. I do not like to use trh: components, but the tr:table appearance has not been being suitable and I did not want to write own component because I thought the tr:table and iterate will do the work and I never wrote an own component before yet, so this was left. Although, as I see the own component could be the best solution to reach the proper appearance. But one question is still here: How to send parameters with tr:commandButton to SWF correctly and easy? Thank you for your patience. On 2009.11.18. 8:54, Bart Kummel wrote: Hi, I'm afraid I still don't understand exactly what you need. However, I still think you shouldn't use the approach with thetrh:tableLayout, etc. (Should you need *some* HTML for layout of your page, with Facelets you can use HTML in your Facelet, so you don't need anytrh:... tag for that anymore.) If you want to use JSF, you should use JSF components that do the hard work for you. You can search the Trinidad, Tomahawk and Tobago libraries or other component libraries for a component that suits your needs. If nothing can be found, you can create your own JSF component. If you prefer to be super flexible in the HTML output, you should perhaps consider a framework that isn't component based, like JSF. Best regards, Bart On Tue, Nov 17, 2009 at 20:28, Arnold Pregap...@mailbox.hu wrote: On 2009.11.17. 13:50, Bart Kummel wrote: Hi, I don't have any experience with Spring WebFlow, so I can't help you on that part. But when it comes to your other question, as I understand you right, you want to spread your list of books over multiple pages if the number of books exceeds a certain value, right? This is simple to achieve, but you shouldn't usetrh:tableLayout. You should usetr:table instead.tr:table will do all hard work for you, including the pagination of your data. Please read the documentation of tr:table http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_table.html first. And regarding yourtr:subform: you are right that you don't use it properly. In this case, it can be left out, you don't need it here. One last remark: as I look at your code, I get the impression that you don't get the idea of JavaServer Faces. The idea is to use components that render a user interface for you. Those components perform all the hard work for you. Generally speaking, you shouldn't be fiddling with repetition in any JSF page definition. In this example, if you use atr:table, the only thing you have to do is tell the table where the collection is that you want to show. The table component will do all the hard work, including the repetition and pagination. I hope this helps. Good luck! Best regards, Bart Kummel On Tue, Nov 17, 2009 at 10:01, Arnold Pregap...@mailbox.hu wrote: Hi, I'm newbie, so sorry for stupid questions. I'm trying to use Facelets 1.1.14. SWF 2.0.8. Spring 2.5.6. Apache Trinidad 1.2.12. JBoss EL 2.0.1. and Hibernate JPA imp. but I think it's not relevant now. My English not too good let the code snippets speak because of this rather. borderLayout.xhtml tr:document xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:tr=http://myfaces.apache.org/trinidad; title=#{pageTitle} tr:form id=mainForm tr:panelBorderLayout f:facet name=top ui:include src=searchbar.xhtml / /f:facet ui:insert name=pageContent / /tr:panelBorderLayout /tr:form ui:debug / /tr:document page.xhtml ui:composition xmlns=http://www.w3.org/1999/xhtml; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:tr=http://myfaces.apache.org/trinidad; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:test=http://www.my.net/some/arbitrary/namespace; template=/WEB-INF/layouts/borderLayout.xhtml ui:param name=pageTitle value=Home / ui:define name=pageContent trh:tableLayout width=75% borderWidth=0 cellSpacing=10 halign=center trh:rowLayout ui:repeat var=book value=#{bestsellers} offset=0 size=3 !--tr:iterator var=book first=0 rows=4 value=#{bestsellers} -- trh:cellFormat valign=bottom tr:commandLink action=selectBook2SeeDetails text=#{book.title} f:param name
Re: [Trinidad] Trinidad, Facelets, multiple forms
Okay, now I get what you want. Good idea to post an image! If I were you, I would craete a Facelets Composition Component to render a single book's details (image, title, etc.) Inside that Composition Component you could use various Trinidad components to render the image, the price, the link, etc. (Use Google to find more info on Facelets Composition Components.) Then you could use e.g. a tr:panelGroupLayout or a h:panelGrid or something like that to distribute the items over a page as desired. As for passing on the selected book ID, have you tried using tr:inputHidden? Best regards, Bart On Wed, Nov 18, 2009 at 11:20, Arnold Preg ap...@mailbox.hu wrote: Hi, If I can reach this http://i48.tinypic.com/2q207ib.png( http://i48.tinypic.com/2q207ib.png ) look with skinning, then yes. (In essence I don't need column headers, pagination bar, radiobuttons etc. Just the layout and collection handling function I need from tr:table in this case.) I think SWF can handle POST and GET parameters equally. On 2009.11.18. 10:33, Bart Kummel wrote: Hi, If you only want to change the appearance, you should definitely take a look at Trinidad's skinning featureshttp://myfaces.apache.org/trinidad/devguide/skinning.html. You can change the appearance of every Trinidad component this way, while keeping the functionality. Is that what you're looking for? As for you other question: what type of parameters does SWF expect? POST or GET? Best regards, Bart On Wed, Nov 18, 2009 at 09:35, Arnold Pregap...@mailbox.hu wrote: Hi, I have to use Trinidad components, and minimalize the use of manual HTML or js codes. I do not like to use trh: components, but the tr:table appearance has not been being suitable and I did not want to write own component because I thought the tr:table and iterate will do the work and I never wrote an own component before yet, so this was left. Although, as I see the own component could be the best solution to reach the proper appearance. But one question is still here: How to send parameters with tr:commandButton to SWF correctly and easy? Thank you for your patience. On 2009.11.18. 8:54, Bart Kummel wrote: Hi, I'm afraid I still don't understand exactly what you need. However, I still think you shouldn't use the approach with thetrh:tableLayout, etc. (Should you need *some* HTML for layout of your page, with Facelets you can use HTML in your Facelet, so you don't need anytrh:... tag for that anymore.) If you want to use JSF, you should use JSF components that do the hard work for you. You can search the Trinidad, Tomahawk and Tobago libraries or other component libraries for a component that suits your needs. If nothing can be found, you can create your own JSF component. If you prefer to be super flexible in the HTML output, you should perhaps consider a framework that isn't component based, like JSF. Best regards, Bart On Tue, Nov 17, 2009 at 20:28, Arnold Pregap...@mailbox.hu wrote: On 2009.11.17. 13:50, Bart Kummel wrote: Hi, I don't have any experience with Spring WebFlow, so I can't help you on that part. But when it comes to your other question, as I understand you right, you want to spread your list of books over multiple pages if the number of books exceeds a certain value, right? This is simple to achieve, but you shouldn't usetrh:tableLayout. You should usetr:tableinstead.tr:tablewill do all hard work for you, including the pagination of your data. Please read the documentation of tr:table http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_table.html first. And regarding yourtr:subform: you are right that you don't use it properly. In this case, it can be left out, you don't need it here. One last remark: as I look at your code, I get the impression that you don't get the idea of JavaServer Faces. The idea is to use components that render a user interface for you. Those components perform all the hard work for you. Generally speaking, you shouldn't be fiddling with repetition in any JSF page definition. In this example, if you use atr:table, the only thing you have to do is tell the table where the collection is that you want to show. The table component will do all the hard work, including the repetition and pagination. I hope this helps. Good luck! Best regards, Bart Kummel On Tue, Nov 17, 2009 at 10:01, Arnold Pregap...@mailbox.hu wrote: Hi, I'm newbie, so sorry for stupid questions. I'm trying to use Facelets 1.1.14. SWF 2.0.8. Spring 2.5.6. Apache Trinidad 1.2.12. JBoss EL 2.0.1. and Hibernate JPA imp. but I think it's not relevant now. My English not too good let the code snippets speak because of this rather. borderLayout.xhtml tr:document xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:trh=http://myfaces.apache.org
Re: [Trinidad] Trinidad, Facelets, multiple forms
Hi, I don't have any experience with Spring WebFlow, so I can't help you on that part. But when it comes to your other question, as I understand you right, you want to spread your list of books over multiple pages if the number of books exceeds a certain value, right? This is simple to achieve, but you shouldn't use trh:tableLayout. You should use tr:table instead. tr:table will do all hard work for you, including the pagination of your data. Please read the documentation of tr:tablehttp://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_table.htmlfirst. And regarding your tr:subform: you are right that you don't use it properly. In this case, it can be left out, you don't need it here. One last remark: as I look at your code, I get the impression that you don't get the idea of JavaServer Faces. The idea is to use components that render a user interface for you. Those components perform all the hard work for you. Generally speaking, you shouldn't be fiddling with repetition in any JSF page definition. In this example, if you use a tr:table, the only thing you have to do is tell the table where the collection is that you want to show. The table component will do all the hard work, including the repetition and pagination. I hope this helps. Good luck! Best regards, Bart Kummel On Tue, Nov 17, 2009 at 10:01, Arnold Preg ap...@mailbox.hu wrote: Hi, I'm newbie, so sorry for stupid questions. I'm trying to use Facelets 1.1.14. SWF 2.0.8. Spring 2.5.6. Apache Trinidad 1.2.12. JBoss EL 2.0.1. and Hibernate JPA imp. but I think it's not relevant now. My English not too good let the code snippets speak because of this rather. borderLayout.xhtml tr:document xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:tr=http://myfaces.apache.org/trinidad; title=#{pageTitle} tr:form id=mainForm tr:panelBorderLayout f:facet name=top ui:include src=searchbar.xhtml / /f:facet ui:insert name=pageContent / /tr:panelBorderLayout /tr:form ui:debug / /tr:document page.xhtml ui:composition xmlns=http://www.w3.org/1999/xhtml; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:tr=http://myfaces.apache.org/trinidad; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:test=http://www.my.net/some/arbitrary/namespace; template=/WEB-INF/layouts/borderLayout.xhtml ui:param name=pageTitle value=Home / ui:define name=pageContent trh:tableLayout width=75% borderWidth=0 cellSpacing=10 halign=center trh:rowLayout ui:repeat var=book value=#{bestsellers} offset=0 size=3 !-- tr:iterator var=book first=0 rows=4 value=#{bestsellers} -- trh:cellFormat valign=bottom tr:commandLink action=selectBook2SeeDetails text=#{book.title} f:param name=selectedBookId value=#{book.bookId} / /tr:commandLink !-- Probably I don't use the subform properly -- * tr:subform tr:commandButton text=Add to cart action=add2Cart/ input type=hidden name=selectedBookId value=#{book.bookId} / /tr:subform* /trh:cellFormat /ui:repeat !-- /tr:iterator -- /trh:rowLayout /trh:tableLayout /ui:define /ui:composition flow.xml ?xml version=1.0 encoding=UTF-8? flow xmlns=http://www.springframework.org/schema/webflow; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd; persistence-context / var name=cart class=bookstore.domain.Cart / view-state id=home on-render evaluate expression=catalogService.getAllBooks() result=viewScope.bestsellers/evaluate /on-render transition on=selectBook2SeeDetails to=reviewBookDetails set name=flowScope.selectedBook value=catalogService.getBookById(requestParameters.selectedBookId) / /transition /view-state global-transitions transition on=add2Cart evaluate !-- Maybe it would be better to use the bestsellers list of Book entities but then I guess the place of code that should iterate over the list to find the Book with the appropriate id would be good in a custom Action bean (correct me if I'm wrong) and I don't want to complicate this sample with that too. expression=cart.addItem(catalogService.getBookById(requestParameters.selectedBookId)) /evaluate /transition /global-transitions /flow When I click on the Add to cart button the post request will be something like this: _noJavaScriptfalse j_id5 j_id17:rangeStart0 javax.faces.ViewStateH4sIA.. org.apache.myfaces.trinidad.faces.FORMmainForm *selectedBookId1 selectedBookId2 selectedBookId3 selectedBookId4 * sourcej_id31:0:j_id37:j_id38 state value As it seems it's send a String array of selectedBookId . I'd like to send just the appropriate
Re: A telephone tag?
I think the easiest way to get your phone number validation is to use a regular expression validator, such as tr:validateRegExphttp://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateRegExp.html. You can use google search to find a good regular expression to validate phone numbers. I found this one http://regexlib.com/REDetails.aspx?regexp_id=458for example. Best regards, Bart Kummel On Fri, Nov 13, 2009 at 19:05, laredotornado laredotorn...@gmail.comwrote: I appreciate the fact that you are responding but you realize the second link is basically an empty page and neither contains examples. I think what you are trying to say is that there are no such tags as the ones I'm searching for and I'll have to write them myself. - Dave Anton Gavazuk wrote: http://wiki.apache.org/myfaces/Extensions/Validator/ http://myfaces.apache.org/commons12/myfaces-validators12/index.html 2009/11/13 laredotornado laredotorn...@gmail.com Could you provide some examples? I'm looking to create and validate some common fields, such as phone number, email address, US state (possibly from a select menu of all states) and country. It seems that those types of things would have been tackled before and I would not need to re-invent the wheel. Thanks, - Dave Anton Gavazuk wrote: Myfaces Common RegExp validator will validate everything what you want or you can even write your own. 2009/11/13 laredotornado laredotorn...@gmail.com Hi, I'm using MyFaces 1.1.9. Is there a pre-built tag somewhere that can validate a US telephone number field of the form XXX-XXX- where X is a number? This seems like something that would have been done many times before. Thanks, - Dave -- View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Validating a number range
Hi Dave, That's basic JSF stuff: f:validateLongRange maximum=30 minimum=1/ Good luck! Bart Kummel On Mon, Nov 16, 2009 at 18:05, laredotornado laredotorn...@gmail.comwrote: Hi, I'm using MyFaces 1.2 and Tomahawk 1.1.9. For a particular text field with id=numPeople, I'm trying to validate that the value entered is between 1 and 30 . How do I do that? Thanks, - Dave -- View this message in context: http://old.nabble.com/Validating-a-number-range-tp26375583p26375583.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: [Trinidad] Trinidad, Facelets, multiple forms
Hi, I'm afraid I still don't understand exactly what you need. However, I still think you shouldn't use the approach with the trh:tableLayout, etc. (Should you need *some* HTML for layout of your page, with Facelets you can use HTML in your Facelet, so you don't need any trh:... tag for that anymore.) If you want to use JSF, you should use JSF components that do the hard work for you. You can search the Trinidad, Tomahawk and Tobago libraries or other component libraries for a component that suits your needs. If nothing can be found, you can create your own JSF component. If you prefer to be super flexible in the HTML output, you should perhaps consider a framework that isn't component based, like JSF. Best regards, Bart On Tue, Nov 17, 2009 at 20:28, Arnold Preg ap...@mailbox.hu wrote: On 2009.11.17. 13:50, Bart Kummel wrote: Hi, I don't have any experience with Spring WebFlow, so I can't help you on that part. But when it comes to your other question, as I understand you right, you want to spread your list of books over multiple pages if the number of books exceeds a certain value, right? This is simple to achieve, but you shouldn't usetrh:tableLayout. You should usetr:table instead.tr:table will do all hard work for you, including the pagination of your data. Please read the documentation of tr:table http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_table.html first. And regarding yourtr:subform: you are right that you don't use it properly. In this case, it can be left out, you don't need it here. One last remark: as I look at your code, I get the impression that you don't get the idea of JavaServer Faces. The idea is to use components that render a user interface for you. Those components perform all the hard work for you. Generally speaking, you shouldn't be fiddling with repetition in any JSF page definition. In this example, if you use atr:table, the only thing you have to do is tell the table where the collection is that you want to show. The table component will do all the hard work, including the repetition and pagination. I hope this helps. Good luck! Best regards, Bart Kummel On Tue, Nov 17, 2009 at 10:01, Arnold Pregap...@mailbox.hu wrote: Hi, I'm newbie, so sorry for stupid questions. I'm trying to use Facelets 1.1.14. SWF 2.0.8. Spring 2.5.6. Apache Trinidad 1.2.12. JBoss EL 2.0.1. and Hibernate JPA imp. but I think it's not relevant now. My English not too good let the code snippets speak because of this rather. borderLayout.xhtml tr:document xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:tr=http://myfaces.apache.org/trinidad; title=#{pageTitle} tr:form id=mainForm tr:panelBorderLayout f:facet name=top ui:include src=searchbar.xhtml / /f:facet ui:insert name=pageContent / /tr:panelBorderLayout /tr:form ui:debug / /tr:document page.xhtml ui:composition xmlns=http://www.w3.org/1999/xhtml; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:ui=http://java.sun.com/jsf/facelets; xmlns:tr=http://myfaces.apache.org/trinidad; xmlns:trh=http://myfaces.apache.org/trinidad/html; xmlns:test=http://www.my.net/some/arbitrary/namespace; template=/WEB-INF/layouts/borderLayout.xhtml ui:param name=pageTitle value=Home / ui:define name=pageContent trh:tableLayout width=75% borderWidth=0 cellSpacing=10 halign=center trh:rowLayout ui:repeat var=book value=#{bestsellers} offset=0 size=3 !--tr:iterator var=book first=0 rows=4 value=#{bestsellers} -- trh:cellFormat valign=bottom tr:commandLink action=selectBook2SeeDetails text=#{book.title} f:param name=selectedBookId value=#{book.bookId} / /tr:commandLink !-- Probably I don't use the subform properly -- *tr:subform tr:commandButton text=Add to cart action=add2Cart/ input type=hidden name=selectedBookId value=#{book.bookId} / /tr:subform* /trh:cellFormat /ui:repeat !--/tr:iterator -- /trh:rowLayout /trh:tableLayout /ui:define /ui:composition flow.xml ?xml version=1.0 encoding=UTF-8? flow xmlns=http://www.springframework.org/schema/webflow; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd; persistence-context / var name=cart class=bookstore.domain.Cart / view-state id=home on-render evaluate expression=catalogService.getAllBooks() result=viewScope.bestsellers/evaluate /on-render transition on=selectBook2SeeDetails to=reviewBookDetails set name=flowScope.selectedBook value=catalogService.getBookById(requestParameters.selectedBookId) / /transition /view-state global-transitions transition on=add2Cart evaluate !-- Maybe it would be better to use the bestsellers
Re: MyFaces - can backing beans access native html elements?
Hi, What you are asking is not possible. It is against the nature of JSF to do so. In your example, you should use a h:inputText to render the HTML input. Good luck! Best regards, Bart Kummel On Tue, Sep 15, 2009 at 14:41, Dvora barak.ya...@gmail.com wrote: Hello all, I was wondering - is it possible for the server side to access html elements (or the dom tree) that not rendered by myfaces tags? For example the following jsp: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h% %...@taglib uri=http://myfaces.apache.org/tomahawk; prefix=t% f:view . . . body h:form id=myForm input id=bbb name=bbb type=text value=/ /h:form /body /f:view Can the backing bean access the 'bbb' input text element and its value? I tried to debug and inspect the FacesContext instance, but found only Myfaces elements. -- View this message in context: http://www.nabble.com/MyFaces---can-backing-beans-access-native-html-elements--tp25453164p25453164.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: MyFaces - can backing beans access native html elements?
Hi Dvora, I would not recommend writing your own component or renderer if this are your first steps in JSF land. One of the most important ideas behind JSF is that JSF components form an abstraction layer to the developer of the application. The goal is that the developer doesn't have to worry about HTML, CSS, JavaScript, etc. So by trying to integrate a certain JavaScript library, you're breaking with that principle. If I were you, I would start looking for a JSF library that has a nice datepicker component that does the job. There are lots of component libraries out there, and most have some sort of datepicker component. To name some component libraries (commercial as well as open source): MyFaces Trinidad http://myfaces.apache.org/trinidad/, MyFaces Tomahawkhttp://myfaces.apache.org/tomahawk/, ICEFaces http://www.icefaces.org/, Oracle ADF Faceshttp://www.oracle.com/technology/products/adf/adffaces/index.html,, RichFaces http://www.jboss.org/richfaces PrimeFaceshttp://primefaces.prime.com.tr/, ... I would like to finish with a general JSF tip: I would skip JSP and use Facelets https://facelets.dev.java.net/ instead. (See Facelets fits JSF like a glove http://www.ibm.com/developerworks/java/library/j-facelets/ for a nice introduction.) Enjoy your first steps in JSF land! Best regards, Bart Kummel On Tue, Sep 15, 2009 at 17:39, Mike Kienenberger mkien...@gmail.com wrote: If it were me, I'd be looking at this first: http://www.jquery4jsf.org/ http://code.google.com/p/jquery4jsf/ Then I'd consider creating non-rendering alternatives to the standard input components. On Tue, Sep 15, 2009 at 10:53 AM, Dvora barak.ya...@gmail.com wrote: Unless I'm missing something - the link you attached talking about client side work, while my wish is to access the components rendered by jquery in the server side backing beans... I'll try to implement the custom component as suggested above. Thanks again for the help, these are my first steps in jsf and I'm learning :-) Mike Kienenberger wrote: If you're working with a specific library, you can do a search on the library and jsf -- it may be that someone else has already written an integration library for it. For example, a search on jquery and jsf turned up this -- not an integration library but has an example of how to integrate individual items. http://www.rupeal.com/2007/03/09/jquery-and-java-server-faces/ On Tue, Sep 15, 2009 at 10:24 AM, Dvora barak.ya...@gmail.com wrote: I read the article, and I'm facing some difficulties. The article is very dojo oriented, and the library I'm trying to work with is jquery (datepicker). I guess the second approach mentioned there is similar to the solution proposed above. Am I right? Can you please explain how does this custom tag read the value of inner input text 'bbb' (datepicker set a date into it)? Thanks again for helping. Richard Yee wrote: There are a couple ways to integrate js libraries and jsf. One way is to write custom input tags. Do a search on ' dojo jsf integration' and you should find a very good article on it on the IBM developer site. R Sent from my iPhone On Sep 15, 2009, at 5:59 AM, Dvora barak.ya...@gmail.com wrote: Of course, this is understood. I'm asking because I would like to integrate external js library which render html elements in the page, and I would like to access these elements in the server side... Bart Kummel-2 wrote: Hi, What you are asking is not possible. It is against the nature of JSF to do so. In your example, you should use a h:inputText to render the HTML input. Good luck! Best regards, Bart Kummel On Tue, Sep 15, 2009 at 14:41, Dvora barak.ya...@gmail.com wrote: Hello all, I was wondering - is it possible for the server side to access html elements (or the dom tree) that not rendered by myfaces tags? For example the following jsp: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h% %...@taglib uri=http://myfaces.apache.org/tomahawk; prefix=t% f:view . . . body h:form id=myForm input id=bbb name=bbb type=text value=/ /h:form /body /f:view Can the backing bean access the 'bbb' input text element and its value? I tried to debug and inspect the FacesContext instance, but found only Myfaces elements. -- View this message in context: http://www.nabble.com/MyFaces---can-backing-beans-access-native-html-elements--tp25453164p25453164.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/MyFaces---can-backing-beans-access-native-html-elements--tp25453164p25453541.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com
[ExtVal] ClassCastException
Hi, I just added MyFaces ExtVal to my existing project, which uses MyFaces core, Trinidad and Orchestra. When I try to go to an edit page which should contain validations generated by ExtVal, I get the following stack trace. I've no clue what's going on here. Does anybody have an idea? Best regards, Bart Kummel java.lang.ClassCastException: $Proxy39 cannot be cast to org.apache.myfaces.extensions.validator.baseval.annotation.Length at org.apache.myfaces.extensions.validator.baseval.metadata.transformer.LengthMetaDataTransformer.convertMetaData(LengthMetaDataTransformer.java:41) at org.apache.myfaces.extensions.validator.core.interceptor.ValidationInterceptor.initComponent(ValidationInterceptor.java:94) at org.apache.myfaces.extensions.validator.core.interceptor.ValidationInterceptor.beforeEncodeBegin(ValidationInterceptor.java:56) at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:208) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeBegin(UIXComponentBase.java:716) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:288) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:878) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:47) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1386) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1305) at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:111) at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187) at org.apache.myfaces.trinidad.component.UIXGroup.processFlattenedChildren(UIXGroup.java:96) at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:101) at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187) at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:153) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:298) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:136) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224) at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererProxy.encodeEnd(ExtValRendererProxy.java:165) at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:409) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749) at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:70) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:299) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:321) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:64) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:138) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:119) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78) at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:335) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:80) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224) at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererProxy.encodeEnd(ExtValRendererProxy.java:165) at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:409) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749) at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1368) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:769) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48
Re: [Orchestra] Transaction not committed
Hi René, Thanks for your suggestion. I have these settings already, but I put them in my persistence.xml, as I think that's where they belong. But I tried putting them in the applicationContext.xml, to see if it makes any difference. Unfortunately it doesn't. Any other suggestions? By the way, for putting these settings in the applicationContext.xml, the appropriate syntax would be: bean id=entityManagerFactoryclass=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ property name=jpaProperties props prop key=eclipselink.logging.levelFINEST/prop prop key=eclipselink.target-databaseDerby/prop prop key=eclipselink.target-serverSunAS9/prop prop key=eclipselink.cache.shared.defaultfalse/prop /props /property /bean But, as I already said, these settings can be put in the persistence.xml as well (although the syntax is slightly different there). I think it does make more sense to put the settings for the persistence unut in persistence.xml. Best regards, Bart Kummel On Mon, Aug 10, 2009 at 15:15, Rene van Wijk rw...@transfer-solutions.comwrote: This has probably something to do with you're persistence configuration. If you are using EclipseLink, try setting some properties such as bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=jpaProperties props prop key=eclipselink.logging.level value=FINEST/ prop key=eclipselink.target-database value=Database/ prop key=eclipselink.target-server value=Server/ prop key=eclipselink.cache.shared.default value=false/ /props /property property name=persistenceUnitName value=MIAS-EJB/ /bean The last property is the most important, that is, set cache sharing to false. This does not function properly on most servers (the server where it does is OC4J) -Original message- *From:* Bart Kummel b...@kummelweb.nl *Sent:* Sun 09-08-2009 16:34 *To:* MyFaces Discussion users@myfaces.apache.org; *Subject:* [Orchestra] Transaction not committed Hi, I have set up an application with MyFaces Orchestra. It seems to work fine, except that no transaction is committed at the end of the conversation. I tried both access and manual conversation scopes, both with the same result. I'm probably missing something. Can someone assist me a little bit here? Below are some snippets from the most important files in my project. Best regards, Bart Kummel *applicationContext.xml: *?xml version=1.0 encoding=UTF-8? beans ... !-- 1. initialization of all orchestra modules (required for core15 module) -- import resource=classpath*:/META-INF/spring-orchestra-init.xml / !-- 2. the conversation scopes -- bean class=org.springframework.beans.factory.config.CustomScopeConfigurer property name=scopes map entry key=conversation.manual bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=timeout value=30 / property name=advices list ref bean=persistentContextConversationInterceptor/ /list /property /bean /entry entry key=conversation.access bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=timeout value=30 / property name=advices list ref bean=persistentContextConversationInterceptor/ /list /property property name=lifetime value=access/ /bean /entry /map /property /bean !-- 3. the entity manager manager -- bean id=persistentContextConversationInterceptor class=org.apache.myfaces.orchestra.conversation.spring.PersistenceContextConversationInterceptor property name=persistenceContextFactory ref=persistentContextFactory/ /bean !-- 4. conversation - persistence adapter -- bean id=persistentContextFactory class=org.apache.myfaces.orchestra.conversation.spring.JpaPersistenceContextFactory property name=entityManagerFactory ref=entityManagerFactory/ /bean !-- 5. persistence -- bean class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor/ tx:annotation-driven / bean id=transactionManager class=org.springframework.orm.jpa.JpaTransactionManager property name=entityManagerFactory ref=entityManagerFactory/ /bean bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ /bean bean name=editKidController class
Re: Re: [Orchestra] Transaction not committed
Hi René, I already tried both, but it doesn't make any difference. If there is no transactionManager defined with the default name or the given name, thetx:annotation-driven/element would have caused an org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined exception at deploy time, which is not the case. The propagation=Propagation.REQUIRED, readOnly=falsesettings are the defaults of @Transactional, so that explains why that doesn't make a difference... Any other suggestions? Regards, Bart On Fri, Aug 14, 2009 at 11:00, Rene van Wijk rw...@transfer-solutions.comwrote: Ok here it goes, next try 1) Add the attribute transaction-manager to the annotation-driven element (it should default to the name given below - but just in case) tx:annotation-driven transaction-manager=transactionManager/ 2) Add transaction advice to the @Transaction annotations in the class, for example @Transactional(propagation=Propagation.REQUIRED, readOnly=false) Indicates that the current method must run within a transaction. If an existing transaction is in progress, the method will run within that transaction. Otherwise, a new transaction will be started. You can probably also use propagation=Propagation.REQUIRES_NEW. Indicates that the current method must run within its own transaction. A new transaction is started and if an existing transaction is in progress, it will be suspended for the duration of the method. If using JTATransactionManager, access to TransactionManager is required. -Original message- *From:* Bart Kummel bkum...@gmail.com *Sent:* Fri 14-08-2009 09:25 *To:* MyFaces Discussion users@myfaces.apache.org; *CC:* Rene van Wijk rw...@transfer-solutions.com; *Subject:* Re: [Orchestra] Transaction not committed Hi René, Thanks for your suggestion. I have these settings already, but I put them in my persistence.xml, as I think that's where they belong. But I tried putting them in the applicationContext.xml, to see if it makes any difference. Unfortunately it doesn't. Any other suggestions? By the way, for putting these settings in the applicationContext.xml, the appropriate syntax would be: bean id=entityManagerFactoryclass=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ property name=jpaProperties props prop key=eclipselink.logging.levelFINEST/prop prop key=eclipselink.target-databaseDerby/prop prop key=eclipselink.target-serverSunAS9/prop prop key=eclipselink.cache.shared.defaultfalse/prop /props /property /bean But, as I already said, these settings can be put in the persistence.xmlas well (although the syntax is slightly different there). I think it does make more sense to put the settings for the persistence unut in persistence.xml. Best regards, Bart Kummel On Mon, Aug 10, 2009 at 15:15, Rene van Wijk rw...@transfer-solutions.com wrote: This has probably something to do with you're persistence configuration. If you are using EclipseLink, try setting some properties such as bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=jpaProperties props prop key=eclipselink.logging.level value=FINEST/ prop key=eclipselink.target-database value=Database/ prop key=eclipselink.target-server value=Server/ prop key=eclipselink.cache.shared.default value=false/ /props /property property name=persistenceUnitName value=MIAS-EJB/ /bean The last property is the most important, that is, set cache sharing to false. This does not function properly on most servers (the server where it does is OC4J) -Original message- *From:* Bart Kummel b...@kummelweb.nl *Sent:* Sun 09-08-2009 16:34 *To:* MyFaces Discussion users@myfaces.apache.org; *Subject:* [Orchestra] Transaction not committed Hi, I have set up an application with MyFaces Orchestra. It seems to work fine, except that no transaction is committed at the end of the conversation. I tried both access and manual conversation scopes, both with the same result. I'm probably missing something. Can someone assist me a little bit here? Below are some snippets from the most important files in my project. Best regards, Bart Kummel *applicationContext.xml: *?xml version=1.0 encoding=UTF-8? beans ... !-- 1. initialization of all orchestra modules (required for core15 module) -- import resource=classpath*:/META-INF/spring-orchestra-init.xml / !-- 2. the conversation scopes -- bean class=org.springframework.beans.factory.config.CustomScopeConfigurer property name=scopes map entry key=conversation.manual bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope
Re: Re: Re: [Orchestra] Transaction not committed
No, that's one of the first things I checked. there are only SELECT statements in the log. That's how I concluded that transactions are not committed. I suspect Orchestra for not doing this, but I don't understand why. All methods that change any data and/or call methods on my DAO are annotated @Transactional. The converstation is started and ended successfully. I can tell that because any changed data is available through the conversation, but is discarded after the conversation ends. On Fri, Aug 14, 2009 at 11:25, Rene van Wijk rw...@transfer-solutions.comwrote: Do you see in your logging output of EclipseLink any update, or insert statements when some save button is clicked? Best way to check this is by setting the logging to FINE - otherwise to much info is heading your way. -Original message- *From:* Bart Kummel bkum...@gmail.com *Sent:* Fri 14-08-2009 11:19 *To:* MyFaces Discussion users@myfaces.apache.org; *CC:* René van Wijk rw...@transfer-solutions.com; *Subject:* Re: Re: [Orchestra] Transaction not committed Hi René, I already tried both, but it doesn't make any difference. If there is no transactionManager defined with the default name or the given name, thetx:annotation-driven/element would have caused an org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined exception at deploy time, which is not the case. The propagation=Propagation.REQUIRED, readOnly=false settings are the defaults of @Transactional, so that explains why that doesn't make a difference... Any other suggestions? Regards, Bart On Fri, Aug 14, 2009 at 11:00, Rene van Wijk rw...@transfer-solutions.com wrote: Ok here it goes, next try 1) Add the attribute transaction-manager to the annotation-driven element (it should default to the name given below - but just in case) tx:annotation-driven transaction-manager=transactionManager/ 2) Add transaction advice to the @Transaction annotations in the class, for example @Transactional(propagation=Propagation.REQUIRED, readOnly=false) Indicates that the current method must run within a transaction. If an existing transaction is in progress, the method will run within that transaction. Otherwise, a new transaction will be started. You can probably also use propagation=Propagation.REQUIRES_NEW. Indicates that the current method must run within its own transaction. A new transaction is started and if an existing transaction is in progress, it will be suspended for the duration of the method. If using JTATransactionManager, access to TransactionManager is required. -Original message- *From:* Bart Kummel bkum...@gmail.com *Sent:* Fri 14-08-2009 09:25 *To:* MyFaces Discussion users@myfaces.apache.org; *CC:* Rene van Wijk rw...@transfer-solutions.com; *Subject:* Re: [Orchestra] Transaction not committed Hi René, Thanks for your suggestion. I have these settings already, but I put them in my persistence.xml, as I think that's where they belong. But I tried putting them in the applicationContext.xml, to see if it makes any difference. Unfortunately it doesn't. Any other suggestions? By the way, for putting these settings in the applicationContext.xml, the appropriate syntax would be: bean id=entityManagerFactoryclass=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ property name=jpaProperties props prop key=eclipselink.logging.levelFINEST/prop prop key=eclipselink.target-databaseDerby/prop prop key=eclipselink.target-serverSunAS9/prop prop key=eclipselink.cache.shared.defaultfalse/prop /props /property /bean But, as I already said, these settings can be put in the persistence.xmlas well (although the syntax is slightly different there). I think it does make more sense to put the settings for the persistence unut in persistence.xml. Best regards, Bart Kummel On Mon, Aug 10, 2009 at 15:15, Rene van Wijk rw...@transfer-solutions.com wrote: This has probably something to do with you're persistence configuration. If you are using EclipseLink, try setting some properties such as bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=jpaProperties props prop key=eclipselink.logging.level value=FINEST/ prop key=eclipselink.target-database value=Database/ prop key=eclipselink.target-server value=Server/ prop key=eclipselink.cache.shared.default value=false/ /props /property property name=persistenceUnitName value=MIAS-EJB/ /bean The last property is the most important, that is, set cache sharing to false. This does not function properly on most servers (the server where it does is OC4J) -Original message- *From:* Bart Kummel b...@kummelweb.nl *Sent:* Sun 09
Re: Re: Re: [Orchestra] Transaction not committed
Yeah, I am aware of the increased complexity. Unfortunately, your suggestion did not help... On Fri, Aug 14, 2009 at 11:51, Rene van Wijk rw...@transfer-solutions.comwrote: You use an EJB for the actual database access: @EJB(mappedName=mias/KidService) private KidService service; @Transactional public void saveSelected(ActionEvent event) { Kid k = getSelectedKid(); log.fine(Saving kid + k.getId() + : + k.getFirstName() + + k.getLastName() + .); if(service.existsKid(k)) { service.updateKid(k); } else { service.addKid(k); } } How are the transactions defined here (In the EJB). Do you use container managed transactions or bean managed transactions. If you are using container managed transactions, these transactions interfere with the Spring's transactions. Try using bean managed transactions in the EJB by defining (on the class) the annotation @TransactionManagement(TransactionManagementType.BEAN). If this does not work you might consider using Spring's JpaTemplate instead of EJB's (You are now using to much container managed frameworks Spring and EJB - so you have to keep in mind which services you want to use from which framework). -Original message- *From:* Bart Kummel bkum...@gmail.com *Sent:* Fri 14-08-2009 11:19 *To:* MyFaces Discussion users@myfaces.apache.org; *CC:* René van Wijk rw...@transfer-solutions.com; *Subject:* Re: Re: [Orchestra] Transaction not committed Hi René, I already tried both, but it doesn't make any difference. If there is no transactionManager defined with the default name or the given name, thetx:annotation-driven/element would have caused an org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined exception at deploy time, which is not the case. The propagation=Propagation.REQUIRED, readOnly=false settings are the defaults of @Transactional, so that explains why that doesn't make a difference... Any other suggestions? Regards, Bart On Fri, Aug 14, 2009 at 11:00, Rene van Wijk rw...@transfer-solutions.com wrote: Ok here it goes, next try 1) Add the attribute transaction-manager to the annotation-driven element (it should default to the name given below - but just in case) tx:annotation-driven transaction-manager=transactionManager/ 2) Add transaction advice to the @Transaction annotations in the class, for example @Transactional(propagation=Propagation.REQUIRED, readOnly=false) Indicates that the current method must run within a transaction. If an existing transaction is in progress, the method will run within that transaction. Otherwise, a new transaction will be started. You can probably also use propagation=Propagation.REQUIRES_NEW. Indicates that the current method must run within its own transaction. A new transaction is started and if an existing transaction is in progress, it will be suspended for the duration of the method. If using JTATransactionManager, access to TransactionManager is required. -Original message- *From:* Bart Kummel bkum...@gmail.com *Sent:* Fri 14-08-2009 09:25 *To:* MyFaces Discussion users@myfaces.apache.org; *CC:* Rene van Wijk rw...@transfer-solutions.com; *Subject:* Re: [Orchestra] Transaction not committed Hi René, Thanks for your suggestion. I have these settings already, but I put them in my persistence.xml, as I think that's where they belong. But I tried putting them in the applicationContext.xml, to see if it makes any difference. Unfortunately it doesn't. Any other suggestions? By the way, for putting these settings in the applicationContext.xml, the appropriate syntax would be: bean id=entityManagerFactoryclass=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ property name=jpaProperties props prop key=eclipselink.logging.levelFINEST/prop prop key=eclipselink.target-databaseDerby/prop prop key=eclipselink.target-serverSunAS9/prop prop key=eclipselink.cache.shared.defaultfalse/prop /props /property /bean But, as I already said, these settings can be put in the persistence.xmlas well (although the syntax is slightly different there). I think it does make more sense to put the settings for the persistence unut in persistence.xml. Best regards, Bart Kummel On Mon, Aug 10, 2009 at 15:15, Rene van Wijk rw...@transfer-solutions.com wrote: This has probably something to do with you're persistence configuration. If you are using EclipseLink, try setting some properties such as bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=jpaProperties props prop key=eclipselink.logging.level value=FINEST/ prop key=eclipselink.target-database value=Database/ prop key=eclipselink.target
[Orchestra] Transaction not committed
Hi, I have set up an application with MyFaces Orchestra. It seems to work fine, except that no transaction is committed at the end of the conversation. I tried both access and manual conversation scopes, both with the same result. I'm probably missing something. Can someone assist me a little bit here? Below are some snippets from the most important files in my project. Best regards, Bart Kummel *applicationContext.xml: *?xml version=1.0 encoding=UTF-8? beans ... !-- 1. initialization of all orchestra modules (required for core15 module) -- import resource=classpath*:/META-INF/spring-orchestra-init.xml / !-- 2. the conversation scopes -- bean class=org.springframework.beans.factory.config.CustomScopeConfigurer property name=scopes map entry key=conversation.manual bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=timeout value=30 / property name=advices list ref bean=persistentContextConversationInterceptor/ /list /property /bean /entry entry key=conversation.access bean class=org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope property name=timeout value=30 / property name=advices list ref bean=persistentContextConversationInterceptor/ /list /property property name=lifetime value=access/ /bean /entry /map /property /bean !-- 3. the entity manager manager -- bean id=persistentContextConversationInterceptor class=org.apache.myfaces.orchestra.conversation.spring.PersistenceContextConversationInterceptor property name=persistenceContextFactory ref=persistentContextFactory/ /bean !-- 4. conversation - persistence adapter -- bean id=persistentContextFactory class=org.apache.myfaces.orchestra.conversation.spring.JpaPersistenceContextFactory property name=entityManagerFactory ref=entityManagerFactory/ /bean !-- 5. persistence -- bean class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor/ tx:annotation-driven / bean id=transactionManager class=org.springframework.orm.jpa.JpaTransactionManager property name=entityManagerFactory ref=entityManagerFactory/ /bean bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=MIAS-EJB/ /bean bean name=editKidController class=inc.monsters.mias.controller.EditKidController scope=conversation.manual autowire=byName/ bean name=editKidForm class=inc.monsters.mias.backing.EditKidForm scope=request autowire=byName/ bean name=editScaredForm class=inc.monsters.mias.backing.EditScaredForm scope=request autowire=byName/ bean name=kidsTable class=inc.monsters.mias.backing.KidsTable scope=request autowire=byName/ !-- Enable injection for @EJB annotations -- context:component-scan base-package=inc.monsters.mias / /beans* EditKidController.java: *package inc.monsters.mias.controller; public class EditKidController { @EJB(mappedName=mias/KidService) private KidService service; private Kid selectedKid; public Kid getSelectedKid() { if(null == selectedKid) { FacesContext context = FacesContext.getCurrentInstance(); selectedKid = (Kid)context.getExternalContext().getRequestMap().get(selectedKid); } return selectedKid; } public void setSelectedKid(Kid selectedKid) { this.selectedKid = selectedKid; } @Transactional public void saveSelected(ActionEvent event) { Kid k = getSelectedKid(); log.fine(Saving kid + k.getId() + : + k.getFirstName() + + k.getLastName() + .); if(service.existsKid(k)) { service.updateKid(k); } else { service.addKid(k); } } @Transactional public void updateScareData(ActionEvent event) { Kid k = getSelectedKid(); k.getEmployee().setKidsScared(k.getEmployee().getKidsScared() + 1); } public void endConversationAndSave(ActionEvent event) { saveSelected(event); endConversation(event); } public void endConversation(ActionEvent event) { Conversation.getCurrentInstance().invalidate(); } } *EditKidForm.java:* package inc.monsters.mias.backing; @ViewController(viewIds={EditKid.xhtml}) public class EditKidForm { private EditKidController editKidController; public EditKidController getEditKidController() { return editKidController; } public void setEditKidController(EditKidController
Re: [Trinidad] Skinning: inherit from minimal?
Hi Andrew, Sorry, but I still don't get it. I still have a couple of questions: 1. What do you mean by saying that the minimal skin is [not] well tested enough to be a 100% 'style-free' skin? 2. but you will probably have to modify certain components to your needs: how to determine what I have to modify? 3. I still don't understand why extending is helpful. How helpful is it to extend a skin and than have to guess what elements have to be adapted? 4. I tried extending the suede skin. I don't see any difference with the case where I extended the minimal skin. Should I see some difference? Best regards, Bart On Tue, Mar 31, 2009 at 19:11, Andrew Robinson andrew.rw.robin...@gmail.com wrote: You may have to touch components, but you will not have to re-skin everything, so extending is very helpful. As I mentioned, I don't think the minimal skin is well tested enough to be a 100% style-free skin, it probably has some style in it. You don't have to start from scratch, but you will probably have to modify certain components to your needs. Just defining aliases won't be enough. On Mon, Mar 30, 2009 at 11:12 AM, Bart Kummel b...@kummelweb.nl wrote: Hi, Thanks, Andrew. Good to know that all skins are free to use. I don't get what you mean by saying You can extend the minimal skin just fine, but [...] you will also probably have to skin each component. In what way do I extend a skin if I still have to skin all components? Whats the point of extending a skin if I have to start from scratch anyway? I still don't get it. I think there are two possibilities: a) I am missing something. b) the extend functionality is not (yet) fully implemented, although it is documented as if it is. In either case, can someone give me a clear answer? I don't care what the answer is, but I need clarity, that's all. Thanks! Best regards, Bart Kummel On Mon, Mar 30, 2009 at 18:13, Andrew Robinson andrew.rw.robin...@gmail.com wrote: All the skins in MyFaces are Apache licensed, so suede vs minimal should have no license implications. The suede was donated by Oracle, so we do not own it anymore. You can extend the minimal skin just fine, but there is more to do than just setting the aliases, you will also probably have to skin each component. -Andrew On Mon, Mar 30, 2009 at 1:32 AM, Bart Kummel b...@kummelweb.nl wrote: Hi Andrew, I already figured that building my own skin would be an awful lot of work. That's why I was looking into taking another skin and overriding it with help of the extends feature. But it seems that if I extend a skin that way, I loose a lot of features from the skin I extend, as I tried to explain in my earlier post. The documentation suggests that I could simple change some aliases in order to change the colors, for example. But am I right that you are saying that this isn't the case? Are you saying the only way to do this is actually change and existing skin instead of extending it? Talking about that: is it allowed (license-wise) to use the suede skin as basis instead of the minimal skin? Best regards, Bart Kummel On Mon, Mar 30, 2009 at 02:41, Andrew Robinson andrew.rw.robin...@gmail.com wrote: It really is not easy. The best thing may be to start with a good skin delete / change selectors, or start cutting pasting. The minimal still has some CSS in it and it isn't 100% maintained so there may be things in there that do not need to be and there may be things that should be there that are not. Either way, building your own skin will be a lot of work. On Sun, Mar 29, 2009 at 7:43 AM, Bart Kummel b...@kummelweb.nlwrote: Hi, I have a question about Trinidad Skinning. I want to create my own skin. I'm fairly satisfied with the standard, minimal skin. However, the green accent colors don't match the company style, so I want to change the colors. So I thought I could simple create a myCompany.css file with the following contents: .AFDarkBackground:alias {background-color: #00173A;} .AFVeryDarkBackground:alias {background-color: #000102;} .AFMediumBackground:alias {background-color: #0373B1;} .AFLightBackground:alias {background-color: #3295CA;} .AFTextBackground:alias {background-color: white;} .AFDarkForeground:alias {color: #000102;} .AFDarkAccentForeground:alias {color: #002C76 ;} .AFTextForeground:alias {color: #000102;} .AFSelectedTextForeground:alias {color: yellow;} .AFErrorTextForeground:alias {color: red;} I thought by inheriting from minimal , I would get all other formatting from the minimal skin. Therefore, I created the following skin definition in trinidad-skins.xml: skin idmyCompany.desktop/id familymyCompany/family render-kit-id org.apache.myfaces.trinidad.desktop/render-kit-id style-sheet-nameskins/myCompany/myCompany-skin.css/style-sheet-name extendsminimal/extends /skin However, I seem to loose a lot of formatting. For example
Re: [Trinidad] Skinning: inherit from minimal?
Hi, Thanks, Andrew. Good to know that all skins are free to use. I don't get what you mean by saying You can extend the minimal skin just fine, but [...] you will also probably have to skin each component. In what way do I extend a skin if I still have to skin all components? Whats the point of extending a skin if I have to start from scratch anyway? I still don't get it. I think there are two possibilities: a) I am missing something. b) the extend functionality is not (yet) fully implemented, although it is documented as if it is. In either case, can someone give me a clear answer? I don't care what the answer is, but I need clarity, that's all. Thanks! Best regards, Bart Kummel On Mon, Mar 30, 2009 at 18:13, Andrew Robinson andrew.rw.robin...@gmail.com wrote: All the skins in MyFaces are Apache licensed, so suede vs minimal should have no license implications. The suede was donated by Oracle, so we do not own it anymore. You can extend the minimal skin just fine, but there is more to do than just setting the aliases, you will also probably have to skin each component. -Andrew On Mon, Mar 30, 2009 at 1:32 AM, Bart Kummel b...@kummelweb.nl wrote: Hi Andrew, I already figured that building my own skin would be an awful lot of work. That's why I was looking into taking another skin and overriding it with help of the extends feature. But it seems that if I extend a skin that way, I loose a lot of features from the skin I extend, as I tried to explain in my earlier post. The documentation suggests that I could simple change some aliases in order to change the colors, for example. But am I right that you are saying that this isn't the case? Are you saying the only way to do this is actually change and existing skin instead of extending it? Talking about that: is it allowed (license-wise) to use the suede skin as basis instead of the minimal skin? Best regards, Bart Kummel On Mon, Mar 30, 2009 at 02:41, Andrew Robinson andrew.rw.robin...@gmail.com wrote: It really is not easy. The best thing may be to start with a good skin delete / change selectors, or start cutting pasting. The minimal still has some CSS in it and it isn't 100% maintained so there may be things in there that do not need to be and there may be things that should be there that are not. Either way, building your own skin will be a lot of work. On Sun, Mar 29, 2009 at 7:43 AM, Bart Kummel b...@kummelweb.nl wrote: Hi, I have a question about Trinidad Skinning. I want to create my own skin. I'm fairly satisfied with the standard, minimal skin. However, the green accent colors don't match the company style, so I want to change the colors. So I thought I could simple create a myCompany.css file with the following contents: .AFDarkBackground:alias {background-color: #00173A;} .AFVeryDarkBackground:alias {background-color: #000102;} .AFMediumBackground:alias {background-color: #0373B1;} .AFLightBackground:alias {background-color: #3295CA;} .AFTextBackground:alias {background-color: white;} .AFDarkForeground:alias {color: #000102;} .AFDarkAccentForeground:alias {color: #002C76 ;} .AFTextForeground:alias {color: #000102;} .AFSelectedTextForeground:alias {color: yellow;} .AFErrorTextForeground:alias {color: red;} I thought by inheriting from minimal , I would get all other formatting from the minimal skin. Therefore, I created the following skin definition in trinidad-skins.xml: skin idmyCompany.desktop/id familymyCompany/family render-kit-id org.apache.myfaces.trinidad.desktop/render-kit-id style-sheet-nameskins/myCompany/myCompany-skin.css/style-sheet-name extendsminimal/extends /skin However, I seem to loose a lot of formatting. For example, in the minimal skin, the tr:panelBox component has a thin line around the box and some padding inside that line. If I apply my own skin, the color of the title bar of the tr:panelBox is now indeed in the blue color I set in the CSS, but there is no line and no padding around the box. I thought that I would simply inherit all formatting except the things I override, but it seems that I'm only inherriting some formatting. Am I missing something? Is something wrong? Or is it meant to be this way? Wo can clear this up for me? Thanks in advance! Best regards, Bart Kummel
[Trinidad] Skinning: inherit from minimal?
Hi, I have a question about Trinidad Skinning. I want to create my own skin. I'm fairly satisfied with the standard, minimal skin. However, the green accent colors don't match the company style, so I want to change the colors. So I thought I could simple create a myCompany.css file with the following contents: .AFDarkBackground:alias {background-color: #00173A;} .AFVeryDarkBackground:alias {background-color: #000102;} .AFMediumBackground:alias {background-color: #0373B1;} .AFLightBackground:alias {background-color: #3295CA;} .AFTextBackground:alias {background-color: white;} .AFDarkForeground:alias {color: #000102;} .AFDarkAccentForeground:alias {color: #002C76 ;} .AFTextForeground:alias {color: #000102;} .AFSelectedTextForeground:alias {color: yellow;} .AFErrorTextForeground:alias {color: red;} I thought by inheriting from minimal , I would get all other formatting from the minimal skin. Therefore, I created the following skin definition in trinidad-skins.xml: skin idmyCompany.desktop/id familymyCompany/family render-kit-id org.apache.myfaces.trinidad.desktop/render-kit-id style-sheet-nameskins/myCompany/myCompany-skin.css/style-sheet-name extendsminimal/extends /skin However, I seem to loose a lot of formatting. For example, in the minimal skin, the tr:panelBox component has a thin line around the box and some padding inside that line. If I apply my own skin, the color of the title bar of the tr:panelBox is now indeed in the blue color I set in the CSS, but there is no line and no padding around the box. I thought that I would simply inherit all formatting except the things I override, but it seems that I'm only inherriting some formatting. Am I missing something? Is something wrong? Or is it meant to be this way? Wo can clear this up for me? Thanks in advance! Best regards, Bart Kummel
Custom converter: attributes not set?
Hi, I'm trying to write a custom converter that converts the casing of text. Therefor I want a type attribute that let's me choose if I want to convert to lower case, UPPER CASE or Title Case. This is what I've done so far: *Created converter class* I've created a class, CaseConverter.java: package my.company.conversion; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; public class CaseConverter implements Converter { private String type = lower; public Object getAsObject(FacesContext context, UIComponent component, String string) { String result = ; if (upper.equals(getType())){ return string.toUpperCase(); } else if (title.equals(getType())) { return toTitleCase(string); } else { return string.toLowerCase(); } return result; } private String toTitleCase(String string){ // left out for brevity } public synchronized String getAsString(FacesContext context, UIComponent component, Object object) { return object.toString(); } public void setType(String type) { if (type != null) { this.type = type.toLowerCase(); } } public String getType() { return type; } } *Registered converter in faces-config.xml* As follows: converter descriptionCase converter for text values/description converter-idconvertCase/converter-id converter-classmy.company.conversion.CaseConverter/converter-class /converter *Added to Facelets taglib* I already had a my.taglib.xml file for some composition components, so I added my converter there: tag tag-nameconvertCase/tag-name converter converter-idconvertCase/converter-id /converter /tag *Used the converter in a page* I added the converter to a page, like this: my:field id=jobTitle bean=#{pageFlowScope.selectedEmployee} my:convertCase type=title/ /my:field The my:field component is a Facelets Composition Component, defined as follows: ui:composition c:if test=#{empty autoComplete} c:set var=autoComplete value=on / /c:if c:if test=#{empty simple} c:set var=simple value=false / /c:if !-- This is a work around for bug TRINIDAD-1390. -- c:if test=#{empty maximumLength} c:if test=#{columns gt 1} c:set var=maximumLength value=2147483647 / /c:if /c:if !-- This is a work around for bug TRINIDAD-1417. -- c:if test=#{not empty partialTriggers} c:set var=partialTriggers value=#{my:getStringArray(partialTriggers)} / /c:if tr:inputText value=#{bean[id]} id=#{id} required=#{required} readOnly=#{readOnly} label=#{msg[id]}: secret=#{secret} maximumLength=#{maximumLength} columns=#{columns} rows=#{rows} wrap=#{wrap} autoComplete=#{autoComplete} simple=#{simple} partialTriggers=#{partialTriggers} ui:insert/ /tr:inputText /ui:composition *Versions used:* Apache MyFaces 1.2.4 Apache MyFaces Trinidad 1.2.10 Facelets 1.1.14 *Problem description: *Everything works fine, except that the method setType() is only called before a call to getAsString(). I figured out that: - Everytime the converter is needed, a new instance of the class is constructed. - Before every call to getAsString() the setType() is called with the value set in the tag attribute (title in this case). - Before a call to getAsObject() the setType() method is *not *called. This causes the strings to always be converted to lower case, which is de default. Is this normal behaviour? What should I do to get it right? I hope someine can help... Best regards, Bart Kummel
Re: Running MyFaces 1.2 on glassfish 2
) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) Caused by: java.lang.IllegalArgumentException: Cannot convert sat,sun of type class java.lang.String to class [Ljava.lang.String; at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:381) at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:66) ... 87 more So it's still not working. But even if it was working, this is not a workable solution, since it will stop all other applications that don't use MyFaces from working on this Glassfish instance. That includes the management interface... Unfortunaltely I don't have the time to investigate this further. I can now work around this, by using a backing bean method that returns a String[] containing the days. The problems with that work around I mentioned in my first email were due to a nasty typo... Best regards, Bart Kummel On Fri, Feb 20, 2009 at 09:32, Bart Kummel b...@kummelweb.nl wrote: I don't think the Mojarra/RI runtime is running. There is no entry in the logfile with the version string. BTW: I already followed the instructions from that forum thread. On Thu, Feb 19, 2009 at 17:36, Matthias Wessendorf mat...@apache.orgwrote: FYI -- Forwarded message -- From: Ryan Lubke ryan.lu...@sun.com Date: Thu, Feb 19, 2009 at 5:23 PM Subject: Re: Running MyFaces 1.2 on glassfish 2 To: d...@javaserverfaces.dev.java.net Matthias Wessendorf wrote: Hi, on the myfaces user list a user reported an error of the mentioned combo. Can you take a look at the thread and these two mail especially ? a) http://markmail.org/message/dbyfsuixyaqm4mji b) http://markmail.org/message/xeneoggcmjzlcrw3 Sounds like the mojarra runtime is still being bootstrapped. This could be confirmed by looking in the logs. If it is, the version string will be displayed to the logs when the application in initialized. Also
Re: [Trinidad] Problem with tr:validateDateRestriction on Facelets
On Thu, Feb 19, 2009 at 10:39, Matthias Wessendorf mat...@apache.orgwrote: On Thu, Feb 19, 2009 at 10:18 AM, Bart Kummel b...@kummelweb.nl wrote: Yes, but there is a useMyFaces setting, see http://forums.java.net/jive/thread.jspa?threadID=48486tstart=15. I used that one, so I suppose now my Glassfish is using MyFaces. (Isn't com.sun.faces the package where the interfaces of the JSF standard reside?) on. javax.faces.*** They impl their crap w/i com.sun.faces*** and we do our crap in org.apache.myfaces** :-) Ok. Should have known that... Another thing that makes me think Glassfish is really running the MyFaces implementation, is that I get the MyFaces debug logging in the server log. (Which is much better than the RI's logging, BTW...) But the RI is probably still on the classpath. Could that be a problem? I could try to remove the JARs from the filesystem, I hope that won't break anything... hrm. I am overasked on that one, b/c I never really use glassfish :-/ I'd check what's really going inside here: javax.faces.FacesException: Cannot find FacesContext. at com.sun.faces.application.ConverterPropertyEditorBase.setAsText(ConverterPropertyEditorBase.java:103) Also, yes, you are running MyFaces, snip: ... at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140) ... So, I wonder why there is no FacesContext, since you are running w/in the lifecycle. The FacesContext is created by the FAcesServlet, *before* triggering the lifecyle. I'll dive into it. I'll let you (and the list) know if I find something... Bart -Matthias On Thu, Feb 19, 2009 at 09:20, Matthias Wessendorf mat...@apache.org wrote: Wait! Glassfish v2 server. Doesn't this ship the RI ? I am seeing this guy in you stack trace: com.sun.faces.application.ConverterPropertyEditorBase On Thu, Feb 19, 2009 at 9:19 AM, Matthias Wessendorf mat...@apache.org wrote: crazy, so you get that always, with tr:validateDateRestriction (and facelets) ? -Matthias On Thu, Feb 19, 2009 at 8:37 AM, Bart Kummel b...@kummelweb.nl wrote: Hi, Has anyone an idea about what's going wrong here? Matthias? Regards, Bart On Sat, Feb 14, 2009 at 12:24, Bart Kummel b...@kummelweb.nl wrote: Hi, I'm trying to use the tr:validateDateRestriction component to restrict an input date to working days. So I set the invalidDaysOfWeek attribute to sat sun. But then I get the following stack trace. (In fact I get this stack trace no matter what the contents of the string are.) javax.faces.FacesException: Cannot find FacesContext. at com.sun.faces.application.ConverterPropertyEditorBase.setAsText(ConverterPropertyEditorBase.java:103) at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:377) at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:66) at com.sun.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:45) at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36) at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62) at com.sun.facelets.tag.jsf.ValidateHandler.apply(ValidateHandler.java:98) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:122) at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310) at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280) at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314) at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169) at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:241) at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:98) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314
Re: [Trinidad] Problem with tr:validateDateRestriction on Facelets
Hi, Has anyone an idea about what's going wrong here? Matthias? Regards, Bart On Sat, Feb 14, 2009 at 12:24, Bart Kummel b...@kummelweb.nl wrote: Hi, I'm trying to use the tr:validateDateRestriction component to restrict an input date to working days. So I set the invalidDaysOfWeek attribute to sat sun. But then I get the following stack trace. (In fact I get this stack trace no matter what the contents of the string are.) javax.faces.FacesException: Cannot find FacesContext. at com.sun.faces.application.ConverterPropertyEditorBase.setAsText(ConverterPropertyEditorBase.java:103) at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:377) at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:66) at com.sun.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:45) at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36) at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62) at com.sun.facelets.tag.jsf.ValidateHandler.apply(ValidateHandler.java:98) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:122) at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310) at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280) at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314) at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169) at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:241) at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:98) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314) at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314) at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169) at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64) at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131) at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310) at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280) at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314) at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144) at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95) at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48) at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:188) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155
[Trinidad] Problem with tr:validateDateRestriction on Facelets
) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) I saw the same behaviour with the tr:validateDateTimeRange, when I tried to set the minimum and maximum attributes with a literal string in the-MM-ddformat. I worked around that by using an expression that evaluates to a java.util.Date. So I tried the same solution here, except that the expression now evaluates to a java.lang.String[] with the following contents: {sat, sun}. When I do that, I don't get the exception and my page is rendered fine. But the validation is not working at all, I can still input dates that are on saturday or sunday. Am I doing something wrong, or should I file a bug? I'm using Trinidad 1.2.10, MyFaces core 1.2.4, Facelets 1.1.14 on a Glassfish v2 server. Best regards, Bart Kummel http://www.bartkummel.net
[Trinidad] How to render onclick in tr or td element of tr:table?
Hi all, As I posted a while ago on this list, I'm working on a set of CSS and JavaScript tweaks to select a row in a tr:table by clicking on the row instead of using the radiobuttons. I sorted out most issues (see previous posts), but one issue is still open: a row gets only selected when clicking on the contents of a table cell. (I add an onclick event to the tr:outputText component that is within the tr:column.) I want the row to be selected when clicking anywhere on the row: text and whitespace. To achieve that, I'll have to add an onclick paramater to the TD or TR elements in the rendered table. Is there a way to add a parameter to one of those? I tried adding an onclick to the tr:column, but that only renders an onclick parameter in the column header, (which is interfering with the sorting functionality, by the way). Best regards, Bart Kummel
Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF
Hi Stephen, Thanks for pointing me at that example. I will have a look at it. Best regards, Bart Kummel Stephen Friedrich [EMAIL PROTECTED] 24-06-2008 17:07 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF Have a look at the Seam Framework's seamdiscs example. It uses both Trinidad and RichFaces. Have not tried it myself, though. For example it makes this slightly mysterious statement in trinidad-config.xml: !-- Improve a4j compatibility -- accessibility-modeinaccessible/accessibility-mode [EMAIL PROTECTED] wrote: Hi, We're very happy using Trinidad components on Facelets, running on a Glassfish (v2) server, hence using the Sun RI JSF implementation. One of the few features that Trinidad is missing is drag-and-drop support. I tried to add it via the Ajax4Jsf (a4j) approach of RichFaces, which has the ability to add AJAX functions to existing JSF components. However, I did not succeed in my attempt. It seems tuning the web.xml is a very delicate matter. Every time I try to add RichFaces, the whole application breaks. Does someone have any experience with the combination of Trinidad components, Facelets pages, Sun RI JSF implementation and additional RichFaces / Ajax4JSF components? Or does anybody have a alternative suggestion on how to add drag-and-drop support to Trinidad components? Best regards, Bart Kummel PS I already asked a similar question on the RichFaces user forum (http://jboss.com/index.html?module=bbop=viewtopict=137717), but it seems very quiet there...
Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF
Hi Cagatay, Can you recall any special configuration that you had to do to let Trinidad and Ajax4JSF coexist in the same application? I cannot get my application deployed without errors when I try to combine them both... Best regards, Bart Kummel Cagatay Civici [EMAIL PROTECTED] 24-06-2008 16:04 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF I've tried to combine these two for an experimental project, other than the ppr stuff, it was fine. Ajax4JSF and Trinidad PPR doesn't play well. On Tue, Jun 24, 2008 at 5:00 PM, Matthias Wessendorf [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 12:25 AM, [EMAIL PROTECTED] wrote: Hi, We're very happy using Trinidad components on Facelets, running on a Glassfish (v2) server, hence using the Sun RI JSF implementation. One of the few features that Trinidad is missing is drag-and-drop support. I tried to add it via the Ajax4Jsf (a4j) approach of RichFaces, which has the ability to add AJAX functions to existing JSF components. However, I did not succeed in my attempt. It seems tuning the web.xml is a very delicate matter. Every time I try to add RichFaces, the whole application breaks. Does someone have any experience with the combination of Trinidad components, Facelets pages, Sun RI JSF implementation and additional RichFaces / Ajax4JSF components? Or does anybody have a alternative suggestion on how to add drag-and-drop support to Trinidad components? here is the myfaces lists are several reports, that kinda indicate that these too don't work well together. :( -Matthias Best regards, Bart Kummel PS I already asked a similar question on the RichFaces user forum (http://jboss.com/index.html?module=bbop=viewtopict=137717), but it seems very quiet there... -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org
Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF
Hi Cagatay, Yes, I get several exceptions at deploytime. But I don't have the server log anymore. At the moment I'm working at another project, that has higher priority. I'll post the exact exceptions when I have time to try it again. Best regards, Bart Cagatay Civici [EMAIL PROTECTED] 25-06-2008 08:15 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF Hi Bart, Sorry, I don't have the example anymore. Do you get an exception when you add RichFaces? Cagatay On Wed, Jun 25, 2008 at 9:10 AM, [EMAIL PROTECTED] wrote: Hi Cagatay, Can you recall any special configuration that you had to do to let Trinidad and Ajax4JSF coexist in the same application? I cannot get my application deployed without errors when I try to combine them both... Best regards, Bart Kummel Cagatay Civici [EMAIL PROTECTED] 24-06-2008 16:04 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] + Facelets + RichFaces / Ajax4JSF I've tried to combine these two for an experimental project, other than the ppr stuff, it was fine. Ajax4JSF and Trinidad PPR doesn't play well. On Tue, Jun 24, 2008 at 5:00 PM, Matthias Wessendorf [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 12:25 AM, [EMAIL PROTECTED] wrote: Hi, We're very happy using Trinidad components on Facelets, running on a Glassfish (v2) server, hence using the Sun RI JSF implementation. One of the few features that Trinidad is missing is drag-and-drop support. I tried to add it via the Ajax4Jsf (a4j) approach of RichFaces, which has the ability to add AJAX functions to existing JSF components. However, I did not succeed in my attempt. It seems tuning the web.xml is a very delicate matter. Every time I try to add RichFaces, the whole application breaks. Does someone have any experience with the combination of Trinidad components, Facelets pages, Sun RI JSF implementation and additional RichFaces / Ajax4JSF components? Or does anybody have a alternative suggestion on how to add drag-and-drop support to Trinidad components? here is the myfaces lists are several reports, that kinda indicate that these too don't work well together. :( -Matthias Best regards, Bart Kummel PS I already asked a similar question on the RichFaces user forum (http://jboss.com/index.html?module=bbop=viewtopict=137717), but it seems very quiet there... -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org
[Trinidad] + Facelets + RichFaces / Ajax4JSF
Hi, We're very happy using Trinidad components on Facelets, running on a Glassfish (v2) server, hence using the Sun RI JSF implementation. One of the few features that Trinidad is missing is drag-and-drop support. I tried to add it via the Ajax4Jsf (a4j) approach of RichFaces, which has the ability to add AJAX functions to existing JSF components. However, I did not succeed in my attempt. It seems tuning the web.xml is a very delicate matter. Every time I try to add RichFaces, the whole application breaks. Does someone have any experience with the combination of Trinidad components, Facelets pages, Sun RI JSF implementation and additional RichFaces / Ajax4JSF components? Or does anybody have a alternative suggestion on how to add drag-and-drop support to Trinidad components? Best regards, Bart Kummel PS I already asked a similar question on the RichFaces user forum (http://jboss.com/index.html?module=bbop=viewtopict=137717), but it seems very quiet there...
Re: [TRINIDAD] Table with each row own css style
Hi Joris, I think the best thing you can do is reading the documentation on Trinidad Skinning first. Trinidad does some magic tricks with CSS files, which is explained there. The skinning documentation is part of the Developer Guide and can be found here (for version 1.2.x): http://myfaces.apache.org/trinidad/devguide/skinning.html. The first thing you should change in your application is adding the following setting to your web.xml: context-param param-name org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION/param-name param-valuetrue/param-value /context-param This will prevent the use of x7a xbd, which are compressed CSS class names. Then you can see which classes are appended. I had a similar situation and figured out this: .selectedRow td.af_column_cell-text-band { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } In this case .selectedRow is my custom classname. af_colum_cell-text-band is the name that Trinidad appended. And td is the element on which it was applied. One last tip: for debugging CSS issues, I highly recommend the use of Firebug (https://addons.mozilla.org/en-US/firefox/addon/1843), a Firefox plugin for debugging HTML, CSS, etc. Good luck! Best regards, Bart Kummel Joris Kimpe [EMAIL PROTECTED] wrote on 19-06-2008 10:55:18: Hi all, I have a table (containing days) where I want the weekdays to have a different css style than Saturday and Sunday. In my jsp I used a variable styleClass: tr:table value=#{backingBean.dataModel} var=row width=100% tr:column width=10% styleClass=overviewTable_#{row.dayType} f:facet name=header tr:outputText value=#{text['date']}/ /f:facet tr:outputText value=#{row.date} converter=DateConverter/ /tr:column ... /tr:table The generated html looks like this: ... td class=calculationOverviewTable_week x7a xbd ... td class=calculationOverviewTable_weekend x7a xbd ... Why are there some additions (x7a xbd), and how do I have to implement my css file(s)? Because my styles aren't applied... My css file has now this: .overviewTable_week { vertical-align:top; background-color:#ff; } .overviewTable_weekend { vertical-align:top; background-color:#99CCFF; } Thanks! -- View this message in context: http://www.nabble.com/-TRINIDAD-- Table-with-each-row-own-css-style-tp18000357p18000357.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: [TRINIDAD] Table with each row own css style
Hi Joris, Just after posting my previous message, I saw what the real problem is: in my case, I apply my custom style to the TR element, which is the parent of the TD's. (TRTD.../TDTD.../TD/TR) That's why I can write .myStyle td.trinidadStyle in my CSS. (In CSS, two class names separated by a space means every element of class trinidadStyle which has a parent of class myStyle.) In your case, you're applying your own style to the same element the trinidad style is applied to. In that case it should be enough to define only your own style in the CSS. The reason you cannot see any difference is perhaps that your style is overridden by the trinidad style... I'm not a real CSS guru, but I know there are ways to mark certain properties as important, so that they will not be overridden. I hope that gives you enough hints to Google around a bit more. Best regards, Bart Joris Kimpe [EMAIL PROTECTED] 19-06-2008 14:16 Please respond to MyFaces Discussion users@myfaces.apache.org To users@myfaces.apache.org cc Subject Re: [TRINIDAD] Table with each row own css style Hi Bart, your answer is very helpfull (I think), but in my html code (in firebug) shows: td class=calculationOverviewTable_week af_column_cell-text OraTableBorder!--Start: org.apache.myfaces.trinidad.Output[j_id_jsp_1239635067_13j_id_1]--do, 19-06-2008/td In my css file, I added this: calculationoverviewtable_week td.af_column_cell-text { background-color:#FF; vertical-align:top; } .calculationOverviewTable_weekend td.af_column_cell-text { background-color:#99CCFF; vertical-align:top; } But my style isn't applied... Do you know what's wrong? Thanks! bkummel wrote: Hi Joris, I think the best thing you can do is reading the documentation on Trinidad Skinning first. Trinidad does some magic tricks with CSS files, which is explained there. The skinning documentation is part of the Developer Guide and can be found here (for version 1.2.x): http://myfaces.apache.org/trinidad/devguide/skinning.html. The first thing you should change in your application is adding the following setting to your web.xml: context-param param-name org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION/param-name param-valuetrue/param-value /context-param This will prevent the use of x7a xbd, which are compressed CSS class names. Then you can see which classes are appended. I had a similar situation and figured out this: .selectedRow td.af_column_cell-text-band { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } In this case .selectedRow is my custom classname. af_colum_cell-text-band is the name that Trinidad appended. And td is the element on which it was applied. One last tip: for debugging CSS issues, I highly recommend the use of Firebug (https://addons.mozilla.org/en-US/firefox/addon/1843), a Firefox plugin for debugging HTML, CSS, etc. Good luck! Best regards, Bart Kummel Joris Kimpe [EMAIL PROTECTED] wrote on 19-06-2008 10:55:18: Hi all, I have a table (containing days) where I want the weekdays to have a different css style than Saturday and Sunday. In my jsp I used a variable styleClass: tr:table value=#{backingBean.dataModel} var=row width=100% tr:column width=10% styleClass=overviewTable_#{row.dayType} f:facet name=header tr:outputText value=#{text['date']}/ /f:facet tr:outputText value=#{row.date} converter=DateConverter/ /tr:column ... /tr:table The generated html looks like this: ... td class=calculationOverviewTable_week x7a xbd ... td class=calculationOverviewTable_weekend x7a xbd ... Why are there some additions (x7a xbd), and how do I have to implement my css file(s)? Because my styles aren't applied... My css file has now this: .overviewTable_week { vertical-align:top; background-color:#ff; } .overviewTable_weekend { vertical-align:top; background-color:#99CCFF; } Thanks! -- View this message in context: http://www.nabble.com/-TRINIDAD-- Table-with-each-row-own-css-style-tp18000357p18000357.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-TRINIDAD--Table-with-each-row-own-css-style-tp18000357p18007656.html Sent from the MyFaces - Users mailing list archive at Nabble.com.
[Trinidad] Displaying more than one root element in tr:treeTable
Hi all, We're using a tr:treeTable in our project and it is required that more than one item of the topmost level is shown. In other words, we have to get rid of the show 1-1 from 23 pull down box; we don't want pagination fot this application. We tried the rowsByDepth parameter of the treeTable, but it seems to have influence on all levels except the top level. Is there a way to display more than one item of the top level? Or is it simply impossible? (We're thinking of adding a single top element to our model, but that's not a really elegant solution in my opinion.) Best regards, Bart Kummel
Re: [Trinidad] Selecting a row in tr:table by clicking on the row
Hi Tom, Thanks for you suggestion. How exactly did you use the rowLayout component? The documentation is not really extensive and I don't get it working. Depending on where I put the rowLayout it either makes no difference or it hides the whole row... Best regards, Bart Kummel Tom Dufresne [EMAIL PROTECTED] 10-06-2008 00:38 To [EMAIL PROTECTED] cc Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row I wish I had seen you post last Friday, it would have saved me a day of work. Selecting a row by clikcing on its contents is a step in the right direction, but I'm still looking for a way to make the whole row clickable. Does someone have any idea on how I can add an onclick property to either the tr element or to every td element within a row? I was able to make the whole row clickable by adding a rowLayout around the contents and then assigning the onclick property to the rowLayout. Tom
Re: [Trinidad] Selecting a row in tr:table by clicking on the row
Hi Bill, The Dojo component looks really powerful, but it goes far beyond what I need. And I think it's not that straightforward to integrate it with the trinidad components we're using. But if you can prove the contrary, I'm interested! Best regards, Bart Kummel Zigc Junk [EMAIL PROTECTED] 29-05-2008 16:58 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row Maybe it is easier just to use the ready-made javascript component, such as http://dojocampus.org/explorer/#Dojox_Grid_Basic regards Bill On Thu, May 29, 2008 at 8:22 AM, [EMAIL PROTECTED] wrote: Hi all, Yesterday I posted a couple of questions on how to change the tr:table so that a row can be selected by clicking on the row instead of the radio buttons/checkboxes that are used by default. I figured a couple of things out myself. I'll try to explain what I've accomplished so far: I've been focussing on single selection only for now. It's easy to hide the column with radio buttons, since the TH and TD's in that column get a different CSS style class. I already have a custom skin.css file, if you want to know how to do that, see the skinning documentation on the Trinidad website. To hide the column with radio buttons, just add the following to your skinning css file: af|tableSelectOne_cell-icon-format-band { display: none; visibility: hidden; width: 0px; } af|tableSelectOne_cell-icon-format { display: none; visibility: hidden; width: 0px; } af|column_header-icon-format { display: none; visibility: hidden; width: 0px; } To select a row by clicking on it's contents, I add an onclick eventhandler to the component that renders the contents of each column. This implicates that the row will not get selected when the user clicks somewhere in a table cell where no contents are rendered. For example when using a tr:outputText component, the code becomes: tr:outputText value=#{row.someVariable} onclick=${mySelectRow('#{tableId}', #{status.count});}/ This calls a JavaScript function which is (in my case) defined in the Facelets page template. (It should be possible to include a .js file as a resource, but I did not succeed in that approach yet...) Note that there must be a variable tableId, containing the ID of the table. It can be defined like this: c:set variable=tableId value=table1/ You can use it in your table declaration as well: tr:table id=#{tableId} ... The script that contains the function definition looks like this: script type='text/javascript' language='javascript' //![CDATA[ function kpmSelectRow(tableName, rowIndex) { var n = rowIndex - 1; var selBox = document.getElementById(tableName+':'+n); selBox.checked = true; var selectedRow = selBox.parentNode.parentNode; var table = selectedRow.parentNode; var rowCount = table.rows.length; for (var currentRow = 0; currentRow rowCount; currentRow++) { var r = table.rows[currentRow] if(currentRow == rowIndex) { if(r.className.indexOf('selectedRow') 0) { r.className += ' selectedRow'; } else { selBox.checked = false; r.className = r.className.replace(/selectedRow/g, ''); } } else { r.className = r.className.replace(/selectedRow/g, ''); } } } //]] /script As you can see, this script sets a CSS class selectedRow on the selected row and removes it again if the row gets deselected (either by clicking it a second time or by clicking another row.) The CSS class selectedRow is used in the skinning CSS file, to change the layout of all cells (TD's) that are contained in a selected row, like this: .selectedRow td.af_column_cell-text-band { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } .selectedRow td.af_column_cell-text { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } Notice that we have to do it twice, because even and odd rows get different CSS classes. This also gives us the possibility to use different styling for selected rows, matching the banding colors. (As you can see, I chose to keep the selected style the same, regardless of the banding.) Following this recipe, I now have a table where a single row can be selected by clicking on the contents of a cell in the row. Clicking the row a second time will deselect it. Here's my list of things I want to do to make it even better. Any suggestions on how to achieve these things will be highly appreciated... It should be possible to select a row by clicking on a cell (a TD element, so not only it's contents.) I'm still searching for a way to add an onclick
Re: [Trinidad] Selecting a row in tr:table by clicking on the row
clicking on the disabled component. I still prefer to place my JavaScript function in a separate .js file, but I cannot find a method to include such a file any help on that is appreciated too! I don't need it right now, but for the sake of completeness it would be nice if I could add support for multiple select too. It shouldn't be too hard... So far I had a lot of fun figuring this out. I improved my JavaScript skills a little bit too. I'll keep the list posted of I figure out more things. If anyone has an idea on improving this solution, please let met (and the list) know! Best regards, Bart Kummel [EMAIL PROTECTED] 28-05-2008 12:52 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc MyFaces Discussion users@myfaces.apache.org Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row Hi all, Thanks for your replies. I agree with Shane that richness being a core feature of JSF. However, I find if XYZ can do it, it ought to be possible in Trinidad too a somewhat tricky assumption. With the right combination of Java, JavaScript, XML, etc, virtually everything is possible. But I'm asking this question on a Myfaces Trinidad mailing list. The reason for that is that I'm looking for a solution that requires the least amount of custom code and will not interfer with standard Trinidad features. With some additional Googling, I found some useful bits and pieces. I can now select a row by clicking on it's contents, this can be achieved by adding an onclick property to the tr:outputText that renders the contents of a cell in the tr:table. Like this: onclick=var selBox = document.getElementById ('#{tableId}: ${status.count-1}'); selBox.checked='true'; selBox.parentNode.parentNode.className='selectedRow'; In this snippet tableId is the id I gave to my tr:table. status is the variable name I assigned to the varStatus property of the tr:table. As you can see, the JavaScript code also changes the className of the parent of the parent of the selection checkbox. This is actually the table row. Now I have selected a row in the table by clicking on its contents, I have some additional things to do: I have to externalize the JavaScript code in a .js file. (That's not difficult.) I have to add some functionality to unselect a row. In case of a single selection table, this is done by selecting another row. This works already for the radiobutton, but the selectedRow class is not yet removed from the table row in that case. In case of a multiple selection table, this should be done by clicking on the row again. Therefore, the current selection state should be checked first. I think this is pretty straightforward, expecially once I have rewritten the solution as a couple of JavaScript functions in a separate .js file. Trinidad does not use the tr element for styling, but relies on the td elements only. If I change the style of the tr element, this cannot be seen on the page, because the style is overridden by the style that is defined for the td elements. If someone has a suggestion how to solve this, please let me know. (I can think of a solution where I iterate over all TD's in JavaScript, but this does not sound very elegant.) If I succeed in implementing this solution, I still have the checkboxes/radiobuttons in the first column. Neither the table cell (TD) nor the box/button itself get a special CSS class from Trinidad, so I cannot think of a simple way to hide this column using CSS only. Of course I could set the rowSelection property of my tr:table to none, but that way I would lose the selection functionality, meaning that I would have to write something myself. That's not the type of solution I am looking for, as I want to stay with standard functionality as much as possible. Suggestions are appreciated! Selecting a row by clikcing on its contents is a step in the right direction, but I'm still looking for a way to make the whole row clickable. Does someone have any idea on how I can add an onclick property to either the tr element or to every td element within a row? Adding an onclick property to the tr:column results in an onclick property on the table header. Anyone? That are a lot of questions in one email... I'd highly appreciate any suggestions / idea's. Best regards, Bart Kummel Shane Petroff [EMAIL PROTECTED] 27-05-2008 17:04 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row Zigc Junk wrote: If you really need that kind of richness, you should use other technologies such as applet, etc. Huh?! Richness is the raison d'être for JSF; striving for desktop features is the goal! I'd love to see something like this too (selection of any sort on tree would be a step forward). I have to admit that neither my
Re: [Trinidad] Selecting a row in tr:table by clicking on the row
}', #{status.count});}/ This calls a JavaScript function which is (in my case) defined in the Facelets page template. (It should be possible to include a .js file as a resource, but I did not succeed in that approach yet...) Note that there must be a variable tableId, containing the ID of the table. It can be defined like this: c:set variable=tableId value=table1/ You can use it in your table declaration as well: tr:table id=#{tableId} ... The script that contains the function definition looks like this: script type='text/javascript' language='javascript' //![CDATA[ function kpmSelectRow(tableName, rowIndex) { var n = rowIndex - 1; var selBox = document.getElementById(tableName+':'+n); selBox.checked = true; var selectedRow = selBox.parentNode.parentNode; var table = selectedRow.parentNode; var rowCount = table.rows.length; for (var currentRow = 0; currentRow rowCount; currentRow++) { var r = table.rows[currentRow] if(currentRow == rowIndex) { if(r.className.indexOf('selectedRow') 0) { r.className += ' selectedRow'; } else { selBox.checked = false; r.className = r.className.replace(/selectedRow/g, ''); } } else { r.className = r.className.replace(/selectedRow/g, ''); } } } //]] /script As you can see, this script sets a CSS class selectedRow on the selected row and removes it again if the row gets deselected (either by clicking it a second time or by clicking another row.) The CSS class selectedRow is used in the skinning CSS file, to change the layout of all cells (TD's) that are contained in a selected row, like this: .selectedRow td.af_column_cell-text-band { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } .selectedRow td.af_column_cell-text { background-color: rgb(0, 0, 200); font-weight: bold; color: rgb(255, 255, 255); } Notice that we have to do it twice, because even and odd rows get different CSS classes. This also gives us the possibility to use different styling for selected rows, matching the banding colors. (As you can see, I chose to keep the selected style the same, regardless of the banding.) Following this recipe, I now have a table where a single row can be selected by clicking on the contents of a cell in the row. Clicking the row a second time will deselect it. Here's my list of things I want to do to make it even better. Any suggestions on how to achieve these things will be highly appreciated... It should be possible to select a row by clicking on a cell (a TD element, so not only it's contents.) I'm still searching for a way to add an onclick value to a rendered TD element, but this seems hard (impossible?) to achieve. The table component remembers the selected row in several situations: when pagination is used, the selected row is remembered if the user navigates to another page and back to the page that contains the selected row. when some action is performed on a selected row (for example a detail page is shown) and the user returns to the table page. In these situtations, the remembered selection is not shown using my solution. So I'm looking for a method to re-apply my script whenever a table is refreshed. When using a disabled component to render a read only value (for instance a disabled checkbox to render a read only boolean value), the onclick event does not get fired when clicking on the disabled component. I still prefer to place my JavaScript function in a separate .js file, but I cannot find a method to include such a file any help on that is appreciated too! I don't need it right now, but for the sake of completeness it would be nice if I could add support for multiple select too. It shouldn't be too hard... So far I had a lot of fun figuring this out. I improved my JavaScript skills a little bit too. I'll keep the list posted of I figure out more things. If anyone has an idea on improving this solution, please let met (and the list) know! Best regards, Bart Kummel [EMAIL PROTECTED] 28-05-2008 12:52 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc MyFaces Discussion users@myfaces.apache.org Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row Hi all, Thanks for your replies. I agree with Shane that richness being a core feature of JSF. However, I find if XYZ can do it, it ought to be possible in Trinidad too a somewhat tricky assumption. With the right combination of Java, JavaScript, XML, etc, virtually everything is possible. But I'm asking this question on a Myfaces Trinidad mailing list. The reason for that is that I'm looking for a solution that requires the least amount
Re: [Trinidad] Selecting a row in tr:table by clicking on the row
Hi all, Thanks for your replies. I agree with Shane that richness being a core feature of JSF. However, I find if XYZ can do it, it ought to be possible in Trinidad too a somewhat tricky assumption. With the right combination of Java, JavaScript, XML, etc, virtually everything is possible. But I'm asking this question on a Myfaces Trinidad mailing list. The reason for that is that I'm looking for a solution that requires the least amount of custom code and will not interfer with standard Trinidad features. With some additional Googling, I found some useful bits and pieces. I can now select a row by clicking on it's contents, this can be achieved by adding an onclick property to the tr:outputText that renders the contents of a cell in the tr:table. Like this: onclick=var selBox = document.getElementById ('#{tableId}: ${status.count-1}'); selBox.checked='true'; selBox.parentNode.parentNode.className='selectedRow'; In this snippet tableId is the id I gave to my tr:table. status is the variable name I assigned to the varStatus property of the tr:table. As you can see, the JavaScript code also changes the className of the parent of the parent of the selection checkbox. This is actually the table row. Now I have selected a row in the table by clicking on its contents, I have some additional things to do: I have to externalize the JavaScript code in a .js file. (That's not difficult.) I have to add some functionality to unselect a row. In case of a single selection table, this is done by selecting another row. This works already for the radiobutton, but the selectedRow class is not yet removed from the table row in that case. In case of a multiple selection table, this should be done by clicking on the row again. Therefore, the current selection state should be checked first. I think this is pretty straightforward, expecially once I have rewritten the solution as a couple of JavaScript functions in a separate .js file. Trinidad does not use the tr element for styling, but relies on the td elements only. If I change the style of the tr element, this cannot be seen on the page, because the style is overridden by the style that is defined for the td elements. If someone has a suggestion how to solve this, please let me know. (I can think of a solution where I iterate over all TD's in JavaScript, but this does not sound very elegant.) If I succeed in implementing this solution, I still have the checkboxes/radiobuttons in the first column. Neither the table cell (TD) nor the box/button itself get a special CSS class from Trinidad, so I cannot think of a simple way to hide this column using CSS only. Of course I could set the rowSelection property of my tr:table to none, but that way I would lose the selection functionality, meaning that I would have to write something myself. That's not the type of solution I am looking for, as I want to stay with standard functionality as much as possible. Suggestions are appreciated! Selecting a row by clikcing on its contents is a step in the right direction, but I'm still looking for a way to make the whole row clickable. Does someone have any idea on how I can add an onclick property to either the tr element or to every td element within a row? Adding an onclick property to the tr:column results in an onclick property on the table header. Anyone? That are a lot of questions in one email... I'd highly appreciate any suggestions / idea's. Best regards, Bart Kummel Shane Petroff [EMAIL PROTECTED] 27-05-2008 17:04 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] Selecting a row in tr:table by clicking on the row Zigc Junk wrote: If you really need that kind of richness, you should use other technologies such as applet, etc. Huh?! Richness is the raison d'être for JSF; striving for desktop features is the goal! I'd love to see something like this too (selection of any sort on tree would be a step forward). I have to admit that neither my javascript nor css is up to the task, but what about using goLinks in your nodes/column cells, use whatever styleClass you are currently using on the outputText components, then trigger your css changes from the link's js. You couldn't handle clicking on the whitespace inside the table, but it should be familiar to users at least (more so than the stinking radio buttons and checkboxes featured by Trinidad and other frameworks) Besides, if the guys at icefaces can do it, it ought not to be impossible in Trinidad (naturally, icefaces doesn't have a treeTable...) http://component-showcase.icefaces.org/component-showcase/showcase.iface (open the table folder and choose row selection) Shane On Tue, May 27, 2008 at 8:41 AM, [EMAIL PROTECTED] wrote: Hi List, I asked this question a couple of days ago, but still not have an answer from somebody who knows about the tr:table component. Even
How to inlcude resource
Hi List, I want to include an external JavaScript file as a resource in my Facelets template. I added a script src=myLib.js/ tag to the HTML head. When I do this, the JSF servlet tries to interpret the .js file as a JSF page. I guess this is why the ResourceServlet exists. The ResourceServlet is configured on the /adf/* pattern. So i guess I'll have to add /adf/ in front of the URL I'm refering to in my script tag. But two problems arise: When the page that uses the Facelet template is in a subdirectory, this subdirectory is automatically added to the relative path of the script tag. How can I use a path relative to the location of the template itself? (So that I get the js library included in all pages that are based on the template, whether they are in a subdirectory or not.) Where do I heave to put my .js file so that it can be found by the ResourceServlet? I tried several locations within my WAR file, but none worked Thanks in advance for helping me out! Best regards, Bart Kummel
[Trinidad] Selecting a row in tr:table by clicking on the row
Hi List, I'm looking for a method to select a row in a tr:table or tr:treeTable by clicking anywhere on the row. I have a rather complex UI and I'm looking for ways to reduce the number of controls the user sees. One thing I came up with was removing the radio buttons in the treeTable on my page. While the user should be able to select a single row, I thought it would be nice if the row was selected just by clicking anywhere on the row and selection of the row is indicated by a different background color and/or use of a different font (bold instead of plain). I found a proposal for this functionality as standard feature here: http://myfaces.markmail.org/search/?q=table%20select%20row#query:table%20select%20row+page:2+mid:dw257hvw5mgp5g5e+state:results But this did not make in into the regular builds aparantly. Does someone know a way to achieve this without adapting Trinidad itself. I think it should be possible with a clever combination of skinning (CSS) and JavaScript. Best regards, Bart Kummel
RE: [Trinidad] Selecting a row in tr:table by clicking on the row
Hi Guy, The Trinidad tr:table component (which is Trinidad's dataTable replacement) does not have a property rowOnClick... Best regards, Bart Kummel Guy Bashan [EMAIL PROTECTED] wrote on 21-05-2008 15:23:48: Hi Bart, I don't know about Trinidad, but for showing selected row in t: dataTable I simply saved the selected row in hidden field (you can store in the hidden field the id of the selected object or the row index). For showing the selected row you can use css and for clicking on the entire row you can use: rowOnClick. Guy. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 21, 2008 4:01 PM To: MyFaces Discussion Subject: [Trinidad] Selecting a row in tr:table by clicking on the row Hi List, I'm looking for a method to select a row in a tr:table or tr: treeTable by clicking anywhere on the row. I have a rather complex UI and I'm looking for ways to reduce the number of controls the user sees. One thing I came up with was removing the radio buttons in the treeTable on my page. While the user should be able to select a single row, I thought it would be nice if the row was selected just by clicking anywhere on the row and selection of the row is indicated by a different background color and/or use of a different font (bold instead of plain). I found a proposal for this functionality as standard feature here: http://myfaces.markmail.org/search/?q=table%20select%20row#query: table%20select%20row+page:2+mid:dw257hvw5mgp5g5e+state:results But this did not make in into the regular builds aparantly. Does someone know a way to achieve this without adapting Trinidad itself. I think it should be possible with a clever combination of skinning (CSS) and JavaScript. Best regards, Bart Kummel
Re: [Trinidad] tr:selectBooleanCheckbox does not update Entity
Hi Richard, Thanks for trying to help! We solved the problem in the meantime. We used a custom made Facelets component, which used the tr:selectBooleanCheckbox. There was a stupid bug in our facelets definition which caused our troubles. (We use autoSubmit, but the facelets definition forgot to set the autoSubmit value.) Once that was fixed, everything worked as expected. The reason we were trying to use bindings, was to work around the fact that boolean values were not updated in the first place. Now that's solved, we do not use binding anymore. And no, there was no particular reason for using UIXSelectBoolean. Just out of curiosity: are there good reasons to use CoreSelectBooleanCheckbox instead? Best regards, Bart Richard Yee [EMAIL PROTECTED] 08-04-2008 21:23 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] tr:selectBooleanCheckbox does not update Entity Is there any particular reason you are using the UIXSelectBoolean as opposed to the CoreSelectBooleanCheckbox? -R On 4/8/08, Jeroen Weijers [EMAIL PROTECTED] wrote: Hi all, I'm working on the same problem as Bart Kummel. Another problem, but similar to the problem of Bart Kummel (it is actually on the same page and with the same bean) is the following: I bind my booleancheckbox to a UIXSelectBoolean object in my bean (it is configured as a backing bean in the xml file). binding =#{myBean.uixSelectBooleanObject} In the action listener coupled to the submit button I try to read this value but get a Null pointer exception. public void actionMethod(ActionEvent action){ value = getUixSelectBooleanObject.isSelected(); } Regards, Jeroen Weijers On 4/8/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Richard, I have a Managed Bean with Session scope. The following works as expected: tr:textInput value=#{myBean.myEntity.fieldName}/ The managed bean has a member myEntity and the corresponding getMyEntity and setMyEntity methods. As expected, the value of myField is displayed in the textInput when the page loads and if a make any changes, the value of myField gets updated when I press Submit. So I expect the same behaviour if I use tr:selectBooleanCheckbox value=#{myBean.myEntity.booleanFieldName}/ On page load the boolean value is displayed correctly. But when I press Submit, hte booleanField in my entity is not updated. Do I have to take extra action for a boolean field? Or is something else going wrong? Best regards, Bart Kummel Richard Yee [EMAIL PROTECTED] 02-04-2008 15:27 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] tr:selectBooleanCheckbox does not update Entity Bart, Is your entity bean configured in faces-config.xml to be a backing bean? Otherwise, you should have your boolean value field in your backing bean and copy its value to your entity bean in your action handler method that is invoked from your command button. -R On Wed, Apr 2, 2008 at 2:01 AM, [EMAIL PROTECTED] wrote: Hi all, I'm having problems with the tr:selectBooleanCheckbox component. I have a page that updates an EJB3 Entity. If I make changes, alle values in the Entity get updated, except for the boolean values that are linked with the tr:selectBooleanCheckbox components. (Like this: tr:selectBooleanCheckbox value=#{entity.booleanValue}/.) It seems that selecting or deselecting a checkbox is not recognized as a change. If I only change boolean values, the Entity is not touched at all. I don't have a clue what is going wrong. Am I doing something wrong? Or is this a known issue? Any help would be appreciated! Best regards, Bart Kummel
Re: [Trinidad] tr:selectBooleanCheckbox does not update Entity
Hi Richard, I have a Managed Bean with Session scope. The following works as expected: tr:textInput value=#{myBean.myEntity.fieldName}/ The managed bean has a member myEntity and the corresponding getMyEntity and setMyEntity methods. As expected, the value of myField is displayed in the textInput when the page loads and if a make any changes, the value of myField gets updated when I press Submit. So I expect the same behaviour if I use tr:selectBooleanCheckbox value=#{myBean.myEntity.booleanFieldName}/ On page load the boolean value is displayed correctly. But when I press Submit, hte booleanField in my entity is not updated. Do I have to take extra action for a boolean field? Or is something else going wrong? Best regards, Bart Kummel Richard Yee [EMAIL PROTECTED] 02-04-2008 15:27 Please respond to MyFaces Discussion users@myfaces.apache.org To MyFaces Discussion users@myfaces.apache.org cc Subject Re: [Trinidad] tr:selectBooleanCheckbox does not update Entity Bart, Is your entity bean configured in faces-config.xml to be a backing bean? Otherwise, you should have your boolean value field in your backing bean and copy its value to your entity bean in your action handler method that is invoked from your command button. -R On Wed, Apr 2, 2008 at 2:01 AM, [EMAIL PROTECTED] wrote: Hi all, I'm having problems with the tr:selectBooleanCheckbox component. I have a page that updates an EJB3 Entity. If I make changes, alle values in the Entity get updated, except for the boolean values that are linked with the tr:selectBooleanCheckbox components. (Like this: tr:selectBooleanCheckbox value=#{entity.booleanValue}/.) It seems that selecting or deselecting a checkbox is not recognized as a change. If I only change boolean values, the Entity is not touched at all. I don't have a clue what is going wrong. Am I doing something wrong? Or is this a known issue? Any help would be appreciated! Best regards, Bart Kummel
[Trinidad] tr:selectBooleanCheckbox does not update Entity
Hi all, I'm having problems with the tr:selectBooleanCheckbox component. I have a page that updates an EJB3 Entity. If I make changes, alle values in the Entity get updated, except for the boolean values that are linked with the tr:selectBooleanCheckbox components. (Like this: tr:selectBooleanCheckbox value=#{entity.booleanValue}/.) It seems that selecting or deselecting a checkbox is not recognized as a change. If I only change boolean values, the Entity is not touched at all. I don't have a clue what is going wrong. Am I doing something wrong? Or is this a known issue? Any help would be appreciated! Best regards, Bart Kummel
[Trinidad] Preventing unnecessary calls to DataModel?
() called on row 10. Returning true ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.getRowIndex() called on row 11 ScrollableDataModel.setRowIndex(10) called. ScrollableDataModel.isRowAvailable() called on row 10. Returning true ScrollableDataModel.getRowData() called on row 11 ScrollableDataModel.isRowAvailable() called on row 11. Returning true ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.getRowIndex() called on row 12 ScrollableDataModel.setRowIndex(11) called. ScrollableDataModel.isRowAvailable() called on row 11. Returning true ScrollableDataModel.getRowData() called on row 12 ScrollableDataModel.isRowAvailable() called on row 12. Returning true ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.getRowIndex() called on row 13 ScrollableDataModel.setRowIndex(12) called. ScrollableDataModel.isRowAvailable() called on row 12. Returning true ScrollableDataModel.getRowData() called on row 13 ScrollableDataModel.isRowAvailable() called on row 13. Returning true ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.getRowIndex() called on row 14 ScrollableDataModel.setRowIndex(13) called. ScrollableDataModel.isRowAvailable() called on row 13. Returning true ScrollableDataModel.getRowData() called on row 14 ScrollableDataModel.isRowAvailable() called on row 14. Returning true ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.getRowIndex() called on row 15 ScrollableDataModel.setRowIndex(14) called. ScrollableDataModel.isRowAvailable() called on row 14. Returning true ScrollableDataModel.getRowData() called on row 15 ScrollableDataModel.isRowAvailable() called on row 15. Returning true ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.getRowIndex() called on row 16 ScrollableDataModel.setRowIndex(4) called. ScrollableDataModel.isRowAvailable() called on row 4. Returning true ScrollableDataModel.getRowData() called on row 5 ScrollableDataModel.isRowAvailable() called on row 5. Returning true ScrollableDataModel.getRowIndex() called on row 6 ScrollableDataModel.setRowIndex(1) called. ScrollableDataModel.isRowAvailable() called on row 1. Returning true ScrollableDataModel.getRowData() called on row 2 ScrollableDataModel.isRowAvailable() called on row 2. Returning true ScrollableDataModel.getRowIndex() called on row 3 ScrollableDataModel.setRowIndex(6) called. ScrollableDataModel.isRowAvailable() called on row 6. Returning true ScrollableDataModel.getRowData() called on row 7 ScrollableDataModel.isRowAvailable() called on row 7. Returning true ScrollableDataModel.getRowIndex() called on row 8 Best regards, Bart Kummel
[Trinidad] Pagination in a tr:table?
Hi List, It's fairly easy to implement pagination with a tr:table component. Just set the rows and first attributes and you're done. But it turns out that the pagination is not implemented very smart. Let me explain my case... I have a database with some very large tables (1 to 10 records per table). The database is (sadly enough) not too fast. So to make the user interface responsive to the users, it is very important that only the data that is displayed is fetched from the database. Therefore, I implemented a lazy list, as suggested on http://www.ilikespam.com/blog/lazy_list. I expected to get much better performance, but this did not happen. I added some logging to the lazy list to see what's happening. It turns out that the table is prefetching a lot more rows that the ones that are displayed initially. I did set the rows attribute to 10, but it seems the table is fetching about 300 rows at a time. (This takes more than a minute due to my poor performing database...) This can actually be a nice feature, since the user can browse very fast through the next 300 records... once they are loaded. The problem is, however, that the table does not get rendered until the fetching of those 300 records is finished. So my question is: is there a way to configure the fetching strategy of the table component? Is it possible to give rendering a higher priority than prefetching, for instance? Or can I configure how many rows are prefetched? Thanks in advance for your help! Best regards, Bart Kummel
Re: AW: [Trinidad] Pagination in a tr:table?
Hi Sven, Thanks for your reply. I think the solution on the wiki does not solve my problem. As Renzo stated in his reply, the real problem is that the Trinidad table is calling isRowAvailable() for rows that are not visible. (Perhaps we should file a bug report?) The solution on the wiki does go to the database too when isRowAvailable() is called, just like Trinidad's own CollectionModel, right? I will try implementing my onw CollectionModel, as Markus proposed. (Markus' reply is not included in the history below, sorry for that.) I'll let you all know if I succeed. Best regards, Bart Kummel Rottstock, Sven [EMAIL PROTECTED] wrote on 17-01-2008 13:08:45: Please have a look at: http://wiki.apache.org/myfaces/WorkingWithLargeTables You can also use it with Trinidad. Regards, Sven Von: Renzo Tomaselli [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 12:16 An: MyFaces Discussion Betreff: Re: [Trinidad] Pagination in a tr:table? Bart, I noticed this behavior as well, but I was unable to collect any reply from this list. The basic issue is that the page navigator calls isRowAvailable() in the data model many times just to setup a predefined number of ranges in the widget, where the user can select from. These calls in turn endup in probing the database with searches, and here performance drops down. This behavior occurs if you declare in advance the overall dataset size. If this is undefined (-1), then the widget contains one range plus more I found that the second solution avoids a lot of isRowAvailable() calls. And you cannot be lazy in answering this call: if your model answers yes, while returnin null at the getRowData(), you end up with a blank row. In any case a significat performance gain is achieve by caching a page, saving/restoring it across requests. Then reload the cache before rendering, if the underlying model might have changed. Hope it helps. -- Renzo [EMAIL PROTECTED] wrote: Hi List, It's fairly easy to implement pagination with a tr:table component. Just set the rows and first attributes and you're done. But it turns out that the pagination is not implemented very smart. Let me explain my case... I have a database with some very large tables (1 to 10 records per table). The database is (sadly enough) not too fast. So to make the user interface responsive to the users, it is very important that only the data that is displayed is fetched from the database. Therefore, I implemented a lazy list, as suggested on http://www.ilikespam.com/blog/lazy_list. I expected to get much better performance, but this did not happen. I added some logging to the lazy list to see what's happening. It turns out that the table is prefetching a lot more rows that the ones that are displayed initially. I did set the rows attribute to 10, but it seems the table is fetching about 300 rows at a time. (This takes more than a minute due to my poor performing database...) This can actually be a nice feature, since the user can browse very fast through the next 300 records... once they are loaded. The problem is, however, that the table does not get rendered until the fetching of those 300 records is finished. So my question is: is there a way to configure the fetching strategy of the table component? Is it possible to give rendering a higher priority than prefetching, for instance? Or can I configure how many rows are prefetched? Thanks in advance for your help! Best regards, Bart Kummel
Re: AW: AW: [Trinidad] Pagination in a tr:table?
Hi Sven, I am absolutely sure that Trinidad calls isRowAvailable() on rows that are not visible! To be more specific: isRowAvailable() is called on all rows that show up in the combobox where you can choose the range. I can confirm that isRowAvailable() is not called for rows that are beyond the more... item in the combobox. Perhaps that is what you mean to say? I looked again at the code example on the wiki. It turns out you are right about not calling the database more than once, since the page is stored as a member of DataPage. (I overlooked that the first time. Sorry for that.) That means the wiki solution should work, even while Trinidad keeps calling isRowAvailable() on invisible rows. (Which is still wrong in my opinion...) So I'll give the Wiki solution a try. I'll let you know the outcome... Best regards, Bart Kummel Rottstock, Sven [EMAIL PROTECTED] wrote on 17-01-2008 14:58:15: By the way - you should set the rows attribute in the table and you should keep it synchronize with the pageSize parameter in the constructor of PagedListDataModel. So Trinidad will call isRowAvailable() only for the visible row entries. Trust me - i have it also implemented and it works great ;-) -Ursprüngliche Nachricht- Von: Rottstock, Sven [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 14:50 An: MyFaces Discussion Betreff: AW: AW: [Trinidad] Pagination in a tr:table? No it is. You have an object that represent a subset of fetched entries (DataPage). Furthermore the total count of entries is also stored in this object. If Trinidad is calling isRowAvailable then you gets the total count of entries in your database and compares it to your current rowIndex: public boolean isRowAvailable() { DataPageT page = getPage(); if (page == null) return false; int rowIndex = getRowIndex(); if (rowIndex 0) { return false; } else if (rowIndex = page.getDatasetSize()) { return false; } else { return true; } } Only getRowData will do any database transactions if a desired rowIndex is not in a subset. Regards, Sven Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 13:22 An: MyFaces Discussion Cc: MyFaces Discussion Betreff: Re: AW: [Trinidad] Pagination in a tr:table? Hi Sven, Thanks for your reply. I think the solution on the wiki does not solve my problem. As Renzo stated in his reply, the real problem is that the Trinidad table is calling isRowAvailable() for rows that are not visible. (Perhaps we should file a bug report?) The solution on the wiki does go to the database too when isRowAvailable() is called, just like Trinidad's own CollectionModel, right? I will try implementing my onw CollectionModel, as Markus proposed. (Markus' reply is not included in the history below, sorry for that.) I'll let you all know if I succeed. Best regards, Bart Kummel Rottstock, Sven [EMAIL PROTECTED] wrote on 17-01-2008 13:08:45: Please have a look at: http://wiki.apache.org/myfaces/WorkingWithLargeTables You can also use it with Trinidad. Regards, Sven Von: Renzo Tomaselli [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 12:16 An: MyFaces Discussion Betreff: Re: [Trinidad] Pagination in a tr:table? Bart, I noticed this behavior as well, but I was unable to collect any reply from this list. The basic issue is that the page navigator calls isRowAvailable() in the data model many times just to setup a predefined number of ranges in the widget, where the user can select from. These calls in turn endup in probing the database with searches, and here performance drops down. This behavior occurs if you declare in advance the overall dataset size. If this is undefined (-1), then the widget contains one range plus more I found that the second solution avoids a lot of isRowAvailable() calls. And you cannot be lazy in answering this call: if your model answers yes, while returnin null at the getRowData(), you end up with a blank row. In any case a significat performance gain is achieve by caching a page, saving/restoring it across requests. Then reload the cache before rendering, if the underlying model might have changed. Hope it helps. -- Renzo [EMAIL PROTECTED] wrote: Hi List, It's fairly easy to implement pagination with a tr:table component. Just set the rows and first attributes and you're done. But it turns out that the pagination is not implemented very smart. Let me explain my case... I have a database with some very large tables (1 to 10 records per table). The database is (sadly enough) not too fast. So to make the user interface responsive to the users, it is very important
Trinidad design time support in Eclipse?
Hi list, We're using Eclipse here and we're planning to implement our next application as a JSF web application, using Trinidad as implementation and as provider of extended components. We would like some sort of near-WYSIWYG design time support in Eclipse. In the Eclipse WTP project, there is a visual editor. When using the Sun RI as JSF implementation, the JSF components get rendered in the design view. But when I switch to Trinidad (1.2.3), all components are rendered as empty boxes, with just the component name in it. Even in the preview screen I only see empty boxes. Do I need some additional configuration? Or is Trinidad lacking design time support in Eclipse? If the first thing is the case: what do I need to configure? If the last thing is the case: can this support be added? Can I do it myself? Or can I file some sort of enhancement request for it? Best regards, Bart Kummel
Re: Trinidad design time support in Eclipse?
Hi Matthias (and list), Matthias Wessendorf [EMAIL PROTECTED] wrote on 29-11-2007 15:03:03: Hi Bart, On Nov 29, 2007 2:51 PM, [EMAIL PROTECTED] wrote: Hi list, We're using Eclipse here and we're planning to implement our next application as a JSF web application, using Trinidad as implementation and as provider of extended components. We would like some sort of near-WYSIWYG Trinidad is just a component library. As JSF-impl you need MyFaces (or the RI) Right, of course. That was what I meant, I didn't phrase it very well, sorry. design time support in Eclipse. In the Eclipse WTP project, there is a visual editor. When using the Sun RI as JSF implementation, the JSF components get rendered in the design view. But when I switch to Trinidad (1.2.3), all components are rendered as empty boxes, with just thecomponent name in it. Even in the preview screen I only see empty boxes. Do I need by default the tool supports the standard components, that's right. I assumed the tool based it's rendering on the meta information that is provided by the lib, but I guess that's not the case? some additional configuration? Or is Trinidad lacking design time support in Eclipse? If the first thing is the case: what do I need to configure? If the last thing is the case: can this support be added? Can I do it myself? Or can I file some sort of enhancement request for it? I am not really familiar with the WPE (web page editor), but I know that the JSF-tooling is working on Facelets support (see [1]) and there may be other things as well. Are you suggesting that the editor will render the components in the design view when I switch to Facelets instead of JSPs? Best suggestion is, to connect to their email list and simply ask for Trinidad-support. I will do so! HTH, Matthias Thanks a lot for you quick response! Regards, Bart [1] http://wiki.eclipse.org/Design_Time_View_Handlers Best regards, Bart Kummel -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org