Re: how to switch off sort?
Hello, maybe i've describe problem wrong, my effort leads to 3-state orderbyborder link. off->asc->desc->off etc. I've extended my data provider from SortableDataProvider and i try to override getSort() method to achieve 3state. It seems to work except icon shown in table header. Even i return null from getSort() after click on desc ordered data , icon in header is switched again to asc (arrow up). Maybe code will say more: private enum SortState {OFF, ASC, DESC} private SortState currentState = SortState.OFF; @Override public SortParam getSort() { SortParam sortParam = super.getSort(); if (sortParam == null) { return null; } switch (currentState) { case OFF: currentState = SortState.ASC; break; case ASC: currentState = SortState.DESC; break; case DESC: currentState = SortState.OFF; break; } return currentState == SortState.OFF ? null : new SortParam(sortParam.getProperty(), currentState == SortState.ASC ? true : false); } On 08/27/2013 11:59 PM, Paul Bors wrote: What happens when you give it a null sortProperty? ~ Thank you, Paul Bors -Original Message- From: Boris Brinza [mailto:boris.bri...@htsolution.sk] Sent: Tuesday, August 27, 2013 5:48 PM To: users@wicket.apache.org Subject: how to switch off sort? Hello is it possible to switch off sort, when i use OrderByBorder on DataView? Or, better say, I'd like to change sort to 3-state behavior : asc, desc, off Thanks in advance Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk | www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
how to switch off sort?
Hello is it possible to switch off sort, when i use OrderByBorder on DataView? Or, better say, I'd like to change sort to 3-state behavior : asc, desc, off Thanks in advance Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
replace content of div with generated html
hello is it possible to replace content of div with content of WebMarkupContainer when user clicks on ajaxLink? I have DataView enclosed in WebMarkupContainer, java seems like this: WebMarkupContainet tableContainer = new WebMarkupContainer("tableContainer"); tableContainer.add(dataview) html: ... ... And i want to replace the content of another div in another page with content of tableContainer For clarification: i have table of Users used in UserListPage, but same table should be accessible as subtable of Company table in CompanyListPage. -- S pozdravom Boris Brinza HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk | www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
You're right, but if you use propertymodel with dbEntity as model object, there is no such code in your form like getModelObject().setXXX(), or another question: where and when to start tx and commit tx? On 06/14/2013 02:14 PM, heapifyman wrote: Correct me if I'm wrong but I think as long as dbObject is still "managed" code like the following should persist the changes to dbObject, i.e. changes to dbObject will be saved once the transaction commits. beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() If dbObject is "detached" you will have to call entityManager.merge(dbObject) before committing the transaction. 2013/6/14 Evgheni Emelianov Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier : It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, "If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs." So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read "9.6 Detachable models" of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPage extends WebPage { protected dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza --- HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk, Internet: www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
Hello, thanks for advices to all, still in war with jpa :-) On 06/14/2013 01:27 PM, Evgheni Emelianov wrote: Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier : It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, "If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs." So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read "9.6 Detachable models" of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPage extends WebPage { protected dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza --- HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk, Internet: www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, "If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs." So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read "9.6 Detachable models" of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPage extends WebPage { protected dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza --- HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk, Internet: www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket and JPA
Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPage extends WebPage { protected dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior("onclick")
thanks very much, sven works exactly as i want! have a nice evening boris On 06/08/2013 10:58 PM, Sven Meier wrote: attributes.getDynamicExtraParameters().add( "return {'ctrl' : attrs.event.ctrlKey, 'shift' : attrs.event.shiftKey}" ); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEventBehavior("onclick")
Hello how to get status of keyboard in onclick handler, i mean status of ctrl or alt keys? i want to select multiple lines in my table using ctrl-click on lines. i.ve found some solutions using overriden getCallbackScript, but it seems it;'s working only in older wicket versions, after several hours i've not found any working solution for wicket 6. Thanks for any advice boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org