Re: Glue for composing panels
Hi Frank, We use the same approach as you. We have found one disadvantage, which relates to references to components created by subclasses. I'll demostrate it (problem and solution) in the following example: class BasePage extends Page { /** Component created by subclass */ private Component component; private boolean componentsAssembled = false; /** Let the assemple method to set componentsAssembled flag */ private void assembleComponents() { component = createComponent(); ... componentsAssembled = true; } protected abstract Component createComponent(); @Override void onBeforeRender() { if ( !componentsAssembled ) { assembleComponents(); } super.onBeforeRender(); // Or whatever else is needed } /** Method uses assambelComponents() to ensure, that component is created */ public Component getComponent() { if(component == null) { assembleComponents(); } return component; } /** public method delegete to referenced component. Uses safe getComponent() method */ public void setComponentModel(IModel? model) { getComponent().setModel(model); } michal 2009/10/29 Frank Silbermann frank.silberm...@fedex.com: I was discussing glue for composing reusable panels into web pages on the blog of Erik van Oosten (http://blog.jteam.nl/2009/09/16/wicket-dos-and-donts/). I told him that my approach had been to create an abstract base page that constructs the common elements while leaving place-holders for page-specific panels by defining methods such as: abstract Panel createUpperLeftPanel (String wicketID); abstract Panel createLowerRightPanel(String wicketID); and having the base page's constructor say things like: Panel p1 = createUpperLeftPanel(a_wicket_id); add(p1); ... Add( createUpperRightPanel(another_wicket_id) ); The child page's contribution would be the implementation of the abstract methods. I explained that I preferred this to mark-up inheritance because I could add to the base page in any number places (not just one place), the compiler would tell the child-page writer exactly what panels were needed, and most importantly, no additional mark-up whatsoever would need to be associated with any of the child pages. (Panel classes used by the child page would of course have their associated mark-up.) Eric and others explained what a bad idea it is for constructors to call overridable methods -- they execute before the child-page's properties have been set. I usually got away with this, but I admit I was burnt a few times. Recently, I wondered whether there might be a simple fix for the constructor-calls-overridable-method problem, such as: (a) Move the base page's component tree construction out of the constructor, and put it into the method: private void assembleComponents() { ... } (b) Add the property: private boolean componentsAssembled = false; (c) Override as follows to construct the component tree after the class constructors finish: �...@override void onBeforeRender() { if ( !componentsAssembled ) { assembleComponents(); componentsAssembled = true; } super.onBeforeRender(); // Or whatever else is needed } Then component construction would wait until the properties in both the parent and the subclass had been set. I'd no longer have the problem associated with calling abstract methods from the constructor. Do you see any disadvantages to this approach? Is there a more appropriate hook upon which to hang my base page's component-tree assembly? If it _is_ a good approach, is there any reason the Wicket designers chose not to create an overrideable method in the Component class that is called just once after constructors terminate, and tell developers that this is where the component tree should be created? /Frank - 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
Wicket Wiki: create attachments permission
I would like to ask some screenshots and descriptive images to my documentations in the wiki. Can anybody give me these permissions? (I think of some screenshots ot the liferay portal when started first. Then in the future screenshots of wicket widgets, to promote them better...) I swear that I will not misuse the permission! This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tree table with check box
Hello again, Please find the below given code Page class: Treetable has been added in the Page class as follows IColumn columns[] = new IColumn[] { new PropertyTreeColumn(new ColumnLocation(Alignment.LEFT, Unit.PERCENT),Check,userObject.name) { public IRenderable newCell(javax.swing.tree.TreeNode node, int level) { return null; } public Component newCell(MarkupContainer parent,java.lang.String id, javax.swing.tree.TreeNode node, int level) { CheckBoxPanel boxPanel = new CheckBoxPanel(parent.getId(),id); return boxPanel; } }, }; TreeDataProvider treedataProvider = new TreeDataProvider(); TreeTable checkTrees = new TreeTable(trtTest,treedataProvider.getTreeModel(),columns); add(checkTrees); CheckBoxPanel class: public class CheckBoxPanel extends Panel { private CheckBox cbxName; public CheckBoxPanel(String id, String model) { super(id); setMarkupId(id); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); cbxName = new CheckBox(cbxName, new Model()); add(cbxName); } } Data Provider class: public class TreeDataProvider { private DefaultMutableTreeNode dmtRoot; public TreeDataProvider() { dmtRoot = new DefaultMutableTreeNode(new TreeListVO(Test)); DefaultMutableTreeNode dmtBase1 = new DefaultMutableTreeNode(new TreeListVO(Root1)); DefaultMutableTreeNode dmtChild1 = new DefaultMutableTreeNode(new TreeListVO(node1)); dmtBase1.add(dmtChild1); dmtRoot.add(dmtBase1); } public TreeModel getTreeModel() { DefaultTreeModel dtmTree = new DefaultTreeModel(dmtRoot); return dtmTree; } } Model class: public class TreeListVO { private String name; public TreeListVO(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } } -- View this message in context: http://old.nabble.com/Tree-table-with-check-box-tp26080852p26156645.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DefaultObjectStreamFactory | Re: AccessControlException with Wicket on Google App Engine (GAE)
just to circumvent the problem for a while, I am thinking of the following workaround: what would be the implications if I change the implementation of IObjectStreamFactor.DefaultObjectStreamFactory so that newObjectInputStream() and newObjectOutputStream return the regular JDK ObjectInputStream and ObjectOutputStream, respectively? To my mind, this would eliminate the AccessControlException problem since I am not subclassing ObjectInputStream and ObjectOutputStream. thanks, andr On 30.10.2009 10:27, A. Maza wrote: yes, except the fact that I am trying to use a Memcache-based implementation of the IPageStore instead of the HTTPSessionStore (based on the TerracottaPageStore. However, in my case the exception occurs when I am trying to serialize the page using the provided method of the AbstractPageStore. The exception of the second stacktrace I posted was reported by another user in the GAE forum [1], but happening in a totally different scenario. In my initial post I forgot the link to the issue I have opened on the GAE project site. [2] I am using Wicket 1.4.3 (I have also tried it with 1.4.2) and the latest GAE SDK (1.2.6) regards, andr [1] http://groups.google.com/group/google-appengine-java/browse_thread/thread/b80648c126778ef5/0a259ba5bba8078f?lnk=gstq=wicket+accesscontrolexception#0a259ba5bba8078f [2] http://code.google.com/p/googleappengine/issues/detail?id=2334 On 29.10.2009 21:56, Esteban Masoero wrote: I'm sure the answer is yes but to be sure: have you done everything that is said here http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html ? Also, what versions of gae sdk and wicket are you using? A. Maza escribió: Hi, I've encountered now (and have seen reported by other users) several different cases where Wicket on GAE throws an AccessControlException when serializing an object to a byte array. Although this is clearly an issue of GAE permissions, I would like to ask if someone could give me a hint, why this exception occurs or if someone may know a workaround. I've already filed an issue for this on the GAE project site [1] and would forward any findings of the wicket community. Below I include snippets of two different stacktraces. Thanks in advance, andr snip1 java.security.AccessControlException: access denied (java.io.SerializablePermission enableSubclassImplementation) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151) at java.io.ObjectOutputStream.init(ObjectOutputStream.java:253) at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.init(IObjectStreamFactory.java:150) at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory.newObjectOutputStream(IObjectStreamFactory.java:114) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203) /snip1 snip2 (java.io.SerializablePermission enableSubstitution) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:264) at java.security.AccessController.checkPermission (AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java: 532) at com.google.appengine.tools.development.DevAppServerFactory $CustomSecurityManager.checkPermission(DevAppServerFactory.java:122) at java.io.ObjectOutputStream.enableReplaceObject (ObjectOutputStream.java:556) at org.apache.wicket.util.lang.Objects $ReplaceObjectOutputStream.init(Objects.java:179) at org.apache.wicket.util.lang.Objects $ReplaceObjectOutputStream.init(Objects.java:170) at org.apache.wicket.util.lang.Objects.cloneModel(Objects.java:442) at org.apache.wicket.version.undo.ModelChange.init(ModelChange.java: 103) at org.apache.wicket.version.undo.ChangeList.componentModelChanging (ChangeList.java:64) at org.apache.wicket.version.undo.UndoPageVersionManager.componentModelChanging (UndoPageVersionManager.java:123) at org.apache.wicket.Page.componentModelChanging(Page.java:1555) at org.apache.wicket.Component.modelChanging(Component.java:2197) at org.apache.wicket.Component.setDefaultModelObject(Component.java: 3020) at org.apache.wicket.extensions.markup.html.tabs.TabbedPanel.setSelectedTab (TabbedPanel.java:346) at org.apache.wicket.extensions.markup.html.tabs.TabbedPanel$5.onClick (TabbedPanel.java:327) at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java: 221) /snip2 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail:
How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?
Hello, Is it possible to correctly add and then remove an AjaxSelfUpdatingTimerBehavior from a component, all by Ajax? At the moment I'm running into problems - the browser gets a Page Expired response soon after I remove the behavior. I think I have an idea why it doesn't work in its current form - is there any way to get something similar working? Thanks, Ambrose - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket + jdbc template app
thank you guys!
Re: How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?
Remember having the same problem with panel and I have dome something like for(Object behavior : getBehaviors()) { if(behavior instanceof AjaxSelfUpdatingTimerBehavior) { remove((AjaxSelfUpdatingTimerBehavior)behavior); } } add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1000))); So, that refresh is delayed a lot... but now that I look to it again I see there is an stop() method on AbstractAjaxTimerBehavior. Regards, Ernesto On Mon, Nov 2, 2009 at 12:20 PM, Ambrose Wheatcroft ambrosewheatcr...@gmail.com wrote: Hello, Is it possible to correctly add and then remove an AjaxSelfUpdatingTimerBehavior from a component, all by Ajax? At the moment I'm running into problems - the browser gets a Page Expired response soon after I remove the behavior. I think I have an idea why it doesn't work in its current form - is there any way to get something similar working? Thanks, Ambrose - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?
Okay, So I got it working. As you suggest - stop() works. I then also store the behavior so that it can be removed permanently on a later Ajax trip. That way I can keep adding and removing timers with different intervals. Thanks! 2009/11/2 Ernesto Reinaldo Barreiro reier...@gmail.com: Remember having the same problem with panel and I have dome something like for(Object behavior : getBehaviors()) { if(behavior instanceof AjaxSelfUpdatingTimerBehavior) { remove((AjaxSelfUpdatingTimerBehavior)behavior); } } add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1000))); So, that refresh is delayed a lot... but now that I look to it again I see there is an stop() method on AbstractAjaxTimerBehavior. Regards, Ernesto On Mon, Nov 2, 2009 at 12:20 PM, Ambrose Wheatcroft ambrosewheatcr...@gmail.com wrote: Hello, Is it possible to correctly add and then remove an AjaxSelfUpdatingTimerBehavior from a component, all by Ajax? At the moment I'm running into problems - the browser gets a Page Expired response soon after I remove the behavior. I think I have an idea why it doesn't work in its current form - is there any way to get something similar working? Thanks, Ambrose - 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
mount recursive
Hi all, is it possible to mount a package recursivly? Let's assume following classes: com.test.pages.TestClass1 com.test.pages.TestClass2 com.test.pages.subpackage.TestClass3 com.test.pages.subpackage.TestClass4 now i'd like to do mount(/pages, PackageName.forClass(TestClass1.class)); to make all Pages under com.test.pages available under /pages/ and pages/subpackage. Kind regards. Chris
Re: mount recursive
Hi, you may look at usage of http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-components/src/main/java/org/xaloon/wicket/component/mounting/MountPageGroup.java @MountPageGroup(context=/pages) class Parent {} @MountPage(path=/page_1) //result /pages/page_1 class A extends Parent {} @MountPage(path=/page_2) //result /pages/page_2 class B extends Parent {} This shows how to inject page scanner: http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-demo/xaloon-demo-jackrabbit/src/main/java/org/xaloon/wicket/demo/repository/XaloonDemoApplication.java Scanner configuration: http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-demo/xaloon-demo-jackrabbit/src/main/resources/META-INF/application-context.xml Giambalvo, Christian wrote: Hi all, is it possible to mount a package recursivly? Let's assume following classes: com.test.pages.TestClass1 com.test.pages.TestClass2 com.test.pages.subpackage.TestClass3 com.test.pages.subpackage.TestClass4 now i'd like to do mount(/pages, PackageName.forClass(TestClass1.class)); to make all Pages under com.test.pages available under /pages/ and pages/subpackage. Kind regards. Chris -- Regards, Vytautas Racelis --- phone:+370-600-34389 e-mail: turi...@gmail.com www.xaloon.org www.leenle.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Glue for composing panels
If I understand you correctly, Michal, you don't want to set the component's model once and for all as it is being created, and you're worried that the model-setting method might be called before the first onBeforeRender(). That's just an example, I guess, so perhaps the general concern is that you might need to access a component for whatever reason before the first call to onBeforeRender(). Therefore, _any_ attempt to access a component after constructors have terminated should trigger construction of the component tree if necessary. Is that the idea? It sure would be nice to have an honest to goodness post-constructors event on which I could hang the component tree creation -- then we wouldn't have to worry about this. In my use of Wicket, I've always set a component's model at the time that component was created -- I've never had to swap out a model in a separate operation. If the data to be displayed changes dynamically, I've always simply used a model which took that into account. Is that just a different style of programming? Or are there circumstances beyond my limited experience which would require one to access a component before the first call to onBeforeRender()? /Frank -Original Message- From: Michal Kurtak [mailto:michal.kur...@gmail.com] Sent: Monday, November 02, 2009 3:39 AM To: users@wicket.apache.org Subject: Re: Glue for composing panels Hi Frank, We use the same approach as you. We have found one disadvantage, which relates to references to components created by subclasses. I'll demostrate it (problem and solution) in the following example: class BasePage extends Page { /** Component created by subclass */ private Component component; private boolean componentsAssembled = false; /** Let the assemple method to set componentsAssembled flag */ private void assembleComponents() { component = createComponent(); ... componentsAssembled = true; } protected abstract Component createComponent(); @Override void onBeforeRender() { if ( !componentsAssembled ) { assembleComponents(); } super.onBeforeRender(); // Or whatever else is needed } /** Method uses assambelComponents() to ensure, that component is created */ public Component getComponent() { if(component == null) { assembleComponents(); } return component; } /** public method delegete to referenced component. Uses safe getComponent() method */ public void setComponentModel(IModel? model) { getComponent().setModel(model); } michal 2009/10/29 Frank Silbermann frank.silberm...@fedex.com: I was discussing glue for composing reusable panels into web pages on the blog of Erik van Oosten (http://blog.jteam.nl/2009/09/16/wicket-dos-and-donts/). I told him that my approach had been to create an abstract base page that constructs the common elements while leaving place-holders for page-specific panels by defining methods such as: abstract Panel createUpperLeftPanel (String wicketID); abstract Panel createLowerRightPanel(String wicketID); and having the base page's constructor say things like: Panel p1 = createUpperLeftPanel(a_wicket_id); add(p1); ... Add( createUpperRightPanel(another_wicket_id) ); The child page's contribution would be the implementation of the abstract methods. I explained that I preferred this to mark-up inheritance because I could add to the base page in any number places (not just one place), the compiler would tell the child-page writer exactly what panels were needed, and most importantly, no additional mark-up whatsoever would need to be associated with any of the child pages. (Panel classes used by the child page would of course have their associated mark-up.) Eric and others explained what a bad idea it is for constructors to call overridable methods -- they execute before the child-page's properties have been set. I usually got away with this, but I admit I was burnt a few times. Recently, I wondered whether there might be a simple fix for the constructor-calls-overridable-method problem, such as: (a) Move the base page's component tree construction out of the constructor, and put it into the method: private void assembleComponents() { ... } (b) Add the property: private boolean componentsAssembled = false; (c) Override as follows to construct the component tree after the class constructors finish: �...@override void onBeforeRender() { if ( !componentsAssembled ) { assembleComponents(); componentsAssembled = true; } super.onBeforeRender(); // Or whatever else is needed } Then component construction would wait until the
Re: OSGi Wicket
You might want to check out http://kenai.com/projects/joint the wicket example builds a menu system based of pages / links that are on the classpath which implement a Navigatable interface and have the @Navigation annotation. Still very early in development but it still might do what you need. On Mon, Nov 2, 2009 at 2:29 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Maybe OSGi ist o much overhead for my needs. I just want to be able to load WicketPages from a jar during runtime. Lets say i have a wicket app with just the wicketapplication and a homepage (extendable through plugins (jar)). Then during runtime i dropin a jar containing some Pages and i want wicket to be able to reach them. My idea is to to just add the jars to the classloader searchpath and let wicket do the rest. Is this a naive idea or whats the wicket way? Igor wrote (some time ago): what we have in wicket is a IClassResolver which we use to allow for pluggable class resolution. How can this pluggable resolution be accomplished? Greetz and thanks -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Sonntag, 1. November 2009 06:40 An: users@wicket.apache.org Betreff: Re: OSGi Wicket I do agree Eclipse buddy system in not proper OSGi, but it makes a lot easier to develop applications because 1- Your application, components, etc, will be same as in any normal Wicket application (no changes to are needed) 2- If you find out OSGi is not suitable at the end, you can always build the same application dropping OSGi and using the same (component) factory services. You will loose hot pluggability and that's it. I never hit serialization limitation myself. On the other hand, I do know from experience that integrating with certain application servers (using bridge approach) can be challenging. This is also something to take into account before deciding to use osgi. I think Igor is totally right about the things you should weight in deciding whether to use OSGi or not for a project. OSGi is a way to achieve pluggability but not the only one. Best, Ernesto On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote: If you do go with OSGi, you will have problems with classloaders and deserialization. To my knowledge, nobody has yet solved this (i.e. implemented a good solution) in a decent way. The Eclipse buddy system is not proper OSGi, IMO. pax-wicket does solve this problem (using proper OSGi), but I have never used their approach much even though I use the framework. Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Good luck to you! =David On Nov 1, 2009, at 3:26 AM, Igor Vaynberg wrote: it is easy to create a pluggable application in wicket. all you need is a registry of component providers, whether it be something like spring [1], a custom registry like brix uses [2] or something more advanced like osgi. the choice should be based on the featureset you need. eg, if you need hot updating, classloader separation, etc, then osgi is good. if not, there are simpler ways to achieve modularity [1] [2]. the great news is that wicket lends itself easily to modularization. [1] http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wicket-and-spring/ [2] http://code.google.com/p/brix-cms/source/browse/#svn/trunk/brix- core/src/main/java/brix/registry -igor 2009/10/29 Tomáš Mihok tomas.mi...@cnl.tuke.sk: Hello, I'm currently designing a new application. One of the requests is to make it modular. I found out that one of the possibilities to enable loading of modules while application is running is OSGi. Is there a tool/plugin/guide to accomplish this or are there any other possibilities of accomplishing same goal? Tom - 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
Re: OSGi Wicket
Forgot to mention, the Netbeans Lookup would also be an option. On Mon, Nov 2, 2009 at 10:45 AM, Ben Tilford bentilf...@gmail.com wrote: You might want to check out http://kenai.com/projects/joint the wicket example builds a menu system based of pages / links that are on the classpath which implement a Navigatable interface and have the @Navigation annotation. Still very early in development but it still might do what you need. On Mon, Nov 2, 2009 at 2:29 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Maybe OSGi ist o much overhead for my needs. I just want to be able to load WicketPages from a jar during runtime. Lets say i have a wicket app with just the wicketapplication and a homepage (extendable through plugins (jar)). Then during runtime i dropin a jar containing some Pages and i want wicket to be able to reach them. My idea is to to just add the jars to the classloader searchpath and let wicket do the rest. Is this a naive idea or whats the wicket way? Igor wrote (some time ago): what we have in wicket is a IClassResolver which we use to allow for pluggable class resolution. How can this pluggable resolution be accomplished? Greetz and thanks -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Sonntag, 1. November 2009 06:40 An: users@wicket.apache.org Betreff: Re: OSGi Wicket I do agree Eclipse buddy system in not proper OSGi, but it makes a lot easier to develop applications because 1- Your application, components, etc, will be same as in any normal Wicket application (no changes to are needed) 2- If you find out OSGi is not suitable at the end, you can always build the same application dropping OSGi and using the same (component) factory services. You will loose hot pluggability and that's it. I never hit serialization limitation myself. On the other hand, I do know from experience that integrating with certain application servers (using bridge approach) can be challenging. This is also something to take into account before deciding to use osgi. I think Igor is totally right about the things you should weight in deciding whether to use OSGi or not for a project. OSGi is a way to achieve pluggability but not the only one. Best, Ernesto On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote: If you do go with OSGi, you will have problems with classloaders and deserialization. To my knowledge, nobody has yet solved this (i.e. implemented a good solution) in a decent way. The Eclipse buddy system is not proper OSGi, IMO. pax-wicket does solve this problem (using proper OSGi), but I have never used their approach much even though I use the framework. Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Good luck to you! =David On Nov 1, 2009, at 3:26 AM, Igor Vaynberg wrote: it is easy to create a pluggable application in wicket. all you need is a registry of component providers, whether it be something like spring [1], a custom registry like brix uses [2] or something more advanced like osgi. the choice should be based on the featureset you need. eg, if you need hot updating, classloader separation, etc, then osgi is good. if not, there are simpler ways to achieve modularity [1] [2]. the great news is that wicket lends itself easily to modularization. [1] http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wicket-and-spring/ [2] http://code.google.com/p/brix-cms/source/browse/#svn/trunk/brix- core/src/main/java/brix/registry -igor 2009/10/29 Tomáš Mihok tomas.mi...@cnl.tuke.sk: Hello, I'm currently designing a new application. One of the requests is to make it modular. I found out that one of the possibilities to enable loading of modules while application is running is OSGi. Is there a tool/plugin/guide to accomplish this or are there any other possibilities of accomplishing same goal? Tom - 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
Re: Bookmarkable images from db
Hi Alex, I check SharedResources, but as I understand it I would have to add there a Resource object for each image. After checking again the javadoc there might be another way. Display each image with Image constructor that takes ValueMap and provide there some image identification. Add a single Resource object for all images and from getResourceStream() implementation to call getParameters() which will return the same parameters passed to Image constructor and tell me which image to return. Will this work? Best regards, Petar Alexandru Objelean wrote: Besides the servlet, there is also a wicket way of do it: - Use shared resource, which is stateless and bookmarkable If you need more informations about this approach, search on forum or just ask... and I'll provide you with some examples of how I do it.. Alex Objelean Peter Dotchev wrote: Hi, My app allows users to upload images and I store them in JCR http://en.wikipedia.org/wiki/Content_repository_API_for_Java. I can get InputStream for each one of them. I want to display images in specific pages and I want image URLs to be stable/bookmarkable. Also I don't want these pages to use the session in any way. I checked again chapter 9 about images from Wicket In Action but such use case is not addressed there. I found that SharedResources allows for stable URLs, but I cannot register each individual image. What approach would you suggest? Best regards, Peter -- View this message in context: http://old.nabble.com/Bookmarkable-images-from-db-tp26154577p26157711.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bookmarkable images from db
Just write a servlet (or Spring Web MVC handler). On Mon, Nov 2, 2009 at 10:52 AM, Peter Dotchev dotc...@gmail.com wrote: Hi Alex, I check SharedResources, but as I understand it I would have to add there a Resource object for each image. After checking again the javadoc there might be another way. Display each image with Image constructor that takes ValueMap and provide there some image identification. Add a single Resource object for all images and from getResourceStream() implementation to call getParameters() which will return the same parameters passed to Image constructor and tell me which image to return. Will this work? Best regards, Petar Alexandru Objelean wrote: Besides the servlet, there is also a wicket way of do it: - Use shared resource, which is stateless and bookmarkable If you need more informations about this approach, search on forum or just ask... and I'll provide you with some examples of how I do it.. Alex Objelean Peter Dotchev wrote: Hi, My app allows users to upload images and I store them in JCR http://en.wikipedia.org/wiki/Content_repository_API_for_Java. I can get InputStream for each one of them. I want to display images in specific pages and I want image URLs to be stable/bookmarkable. Also I don't want these pages to use the session in any way. I checked again chapter 9 about images from Wicket In Action but such use case is not addressed there. I found that SharedResources allows for stable URLs, but I cannot register each individual image. What approach would you suggest? Best regards, Peter -- View this message in context: http://old.nabble.com/Bookmarkable-images-from-db-tp26154577p26157711.html Sent from the Wicket - User mailing list archive at Nabble.com. - 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
Wicket Examples as portlets in Liferay
Hi, I try to get the wicket-examples-WAR running as portlets in Liferay according to my description here: http://cwiki.apache.org/confluence/display/WICKET/Wicket+Examples+as+portlets But after drag'n'drop e.g. the echo example portlet, it is not shown. When I look in the HTML-source of the portal page I see: div id=p_p_id_EchoApplication_WAR_wicketexamples_ class=portlet-boundary portlet-boundary_EchoApplication_WAR_wicketexamples_ a id=p_EchoApplication_WAR_wicketexamples/ script type=text/javascript 1/*![CDATA[*/Liferay.Portlet.onLoad({canEditTitle:true,columnPos:0,isStatic:no,namespacedId:p_p_id\u005f\u0045\u0063\u0068\u006f\u0041\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u005f\u0057\u0041\u0052\u005f\u0077\u0069\u0063\u006b\u0065\u0074\u0065\u0078\u0061\u006d\u0070\u006c\u0065\u0073\u005f,portletId:\u0045\u0063\u0068\u006f\u0041\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u005f\u0057\u0041\u0052\u005f\u0077\u0069\u0063\u006b\u0065\u0074\u0065\u0078\u0061\u006d\u0070\u006c\u0065\u0073});/*]]*/ /script /div So it seems added, but does not contain anything to show... What is wrong?
Re: OSGi Wicket
Hi, The very simple way to solve such problems is: 1. Add: DynamicImport-Package: * to MANIFEST.MF file in bundle with Wicket. 2. Use customized implementation of IClassResolver which falls back to Wicket bundle ClassLoader, eg: try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = DefaultClassResolver.class.getClassLoader(); clazz = loader.loadClass(classname); } else { try { clazz = loader.loadClass(classname); } catch (ClassNotFoundException e) { loader = DefaultClassResolver.class.getClassLoader(); clazz = loader.loadClass(classname); } } } We are using this approach in our applications and everything works like a charm (0 serialization related problems) :). Maybe this is not the best way and maybe not very elegant but it uses OSGi standard mechanism, nothing Equinox specific. -- Daniel On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote: If you do go with OSGi, you will have problems with classloaders and deserialization. To my knowledge, nobody has yet solved this (i.e. implemented a good solution) in a decent way. The Eclipse buddy system is not proper OSGi, IMO. pax-wicket does solve this problem (using proper OSGi), but I have never used their approach much even though I use the framework. Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Good luck to you! =David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Exception in paging
maybe you are missing wrong versions of wicket and extensions jars. they should be the same version. -igor On Mon, Nov 2, 2009 at 7:34 AM, Dusan Banik bani...@gmail.com wrote: Hi can somebody help me with this exception. It happends only in table with paging. 13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver - Cannot find field class org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from java.lang.NoSuchFieldException: from at java.lang.Class.getField(Unknown Source) at org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472) at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84) at org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86) at org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129) at org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70) at org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350) at org.apache.wicket.Localizer.getString(Localizer.java:249) at org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343) at org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469) at org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114) at org.apache.wicket.Component.getModelObject(Component.java:1510) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1532) at org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119) at org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112) at org.apache.wicket.Component.renderComponent(Component.java:2429) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240) at
Re: OSGi Wicket
One more thing, I've read your post: Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Maybe the problems with serialization of EntityImpl private class should be solved by... not serializing this class at all :), but using a proper models (LoadableDetachableModels) to access such entities. My solution described in previous post, assumes that all classes serializable by Wicket should be exported. So it does not solve problems which you described in your blog post. -- Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problems with displaying modal window
Hello everybody. I have a webpage under development where I use modal windows. This has so fare not caused any problems - but now I get an error on one of my pages. I have just added the modal window capability to the page - so this has not worked before. When I click the button I get the following errors in Firefox (and the pages just reloads) Line 1: Error: undefined entity Source File: Line: 1, Column: 61 Source Code: div xmlns=http://www.w3.org/1999/xhtml;bINFO: /bUsingnbsp;XMLHttpRequestnbsp;transport/ (here there is a green error under nbsp;) Line 2: Error: uncaught exception: [Exception... Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML] nsresult: 0x80004003 (NS_ERROR_INVALID_POINTER) location: JS frame :: http://localhost:8080/resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js:: anonymous :: line 64 data: no] My guess to why I get this error is, that my page is defined as: ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1 plus MathML 2.0//EN http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd; html xmlns=http://www.w3.org/1999/xhtml; The reason for this is, that I display MathML on the page. The modal window however does not contain MathML - it's just regular html. Environment: Wicket 1.4.3 JDK 1.6.0_16 Firefox 3.5.4 Does anybody have any input on this? -- Med venlig hilsen/Best regards Anders Sørensen
Re: DefaultObjectStreamFactory | Re: AccessControlException with Wicket on Google App Engine (GAE)
that should most likely work without problems. -igor On Mon, Nov 2, 2009 at 1:47 AM, Andreas Maza andr.m...@gmail.com wrote: just to circumvent the problem for a while, I am thinking of the following workaround: what would be the implications if I change the implementation of IObjectStreamFactor.DefaultObjectStreamFactory so that newObjectInputStream() and newObjectOutputStream return the regular JDK ObjectInputStream and ObjectOutputStream, respectively? To my mind, this would eliminate the AccessControlException problem since I am not subclassing ObjectInputStream and ObjectOutputStream. thanks, andr On 30.10.2009 10:27, A. Maza wrote: yes, except the fact that I am trying to use a Memcache-based implementation of the IPageStore instead of the HTTPSessionStore (based on the TerracottaPageStore. However, in my case the exception occurs when I am trying to serialize the page using the provided method of the AbstractPageStore. The exception of the second stacktrace I posted was reported by another user in the GAE forum [1], but happening in a totally different scenario. In my initial post I forgot the link to the issue I have opened on the GAE project site. [2] I am using Wicket 1.4.3 (I have also tried it with 1.4.2) and the latest GAE SDK (1.2.6) regards, andr [1] http://groups.google.com/group/google-appengine-java/browse_thread/thread/b80648c126778ef5/0a259ba5bba8078f?lnk=gstq=wicket+accesscontrolexception#0a259ba5bba8078f [2] http://code.google.com/p/googleappengine/issues/detail?id=2334 On 29.10.2009 21:56, Esteban Masoero wrote: I'm sure the answer is yes but to be sure: have you done everything that is said here http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html ? Also, what versions of gae sdk and wicket are you using? A. Maza escribió: Hi, I've encountered now (and have seen reported by other users) several different cases where Wicket on GAE throws an AccessControlException when serializing an object to a byte array. Although this is clearly an issue of GAE permissions, I would like to ask if someone could give me a hint, why this exception occurs or if someone may know a workaround. I've already filed an issue for this on the GAE project site [1] and would forward any findings of the wicket community. Below I include snippets of two different stacktraces. Thanks in advance, andr snip1 java.security.AccessControlException: access denied (java.io.SerializablePermission enableSubclassImplementation) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151) at java.io.ObjectOutputStream.init(ObjectOutputStream.java:253) at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.init(IObjectStreamFactory.java:150) at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory.newObjectOutputStream(IObjectStreamFactory.java:114) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203) /snip1 snip2 (java.io.SerializablePermission enableSubstitution) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:264) at java.security.AccessController.checkPermission (AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java: 532) at com.google.appengine.tools.development.DevAppServerFactory $CustomSecurityManager.checkPermission(DevAppServerFactory.java:122) at java.io.ObjectOutputStream.enableReplaceObject (ObjectOutputStream.java:556) at org.apache.wicket.util.lang.Objects $ReplaceObjectOutputStream.init(Objects.java:179) at org.apache.wicket.util.lang.Objects $ReplaceObjectOutputStream.init(Objects.java:170) at org.apache.wicket.util.lang.Objects.cloneModel(Objects.java:442) at org.apache.wicket.version.undo.ModelChange.init(ModelChange.java: 103) at org.apache.wicket.version.undo.ChangeList.componentModelChanging (ChangeList.java:64) at org.apache.wicket.version.undo.UndoPageVersionManager.componentModelChanging (UndoPageVersionManager.java:123) at org.apache.wicket.Page.componentModelChanging(Page.java:1555) at org.apache.wicket.Component.modelChanging(Component.java:2197) at org.apache.wicket.Component.setDefaultModelObject(Component.java: 3020) at org.apache.wicket.extensions.markup.html.tabs.TabbedPanel.setSelectedTab (TabbedPanel.java:346) at org.apache.wicket.extensions.markup.html.tabs.TabbedPanel$5.onClick (TabbedPanel.java:327) at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java: 221)
Re: Wicket Wiki: create attachments permission
dont think we could even if we wanted to. you will have to upload the images somewhere public and then ask on the list to have them attached to a wiki page :| -igor On Mon, Nov 2, 2009 at 2:32 AM, ralf.eichin...@pixotec.de wrote: I would like to ask some screenshots and descriptive images to my documentations in the wiki. Can anybody give me these permissions? (I think of some screenshots ot the liferay portal when started first. Then in the future screenshots of wicket widgets, to promote them better...) I swear that I will not misuse the permission! This message was sent using IMP, the Internet Messaging Program. - 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
Re: Glue for composing panels
Yes Frank, model-setting method was just an example how to access a component before onBeforeRender() executes. I've only tried to point out that we set componentsAssembled = true in assembleComponents() method. We call assembleComponents() from get-method (for referenced component) to ensure that referenced component has been created. michal 2009/11/2 Frank Silbermann frank.silberm...@fedex.com: If I understand you correctly, Michal, you don't want to set the component's model once and for all as it is being created, and you're worried that the model-setting method might be called before the first onBeforeRender(). That's just an example, I guess, so perhaps the general concern is that you might need to access a component for whatever reason before the first call to onBeforeRender(). Therefore, _any_ attempt to access a component after constructors have terminated should trigger construction of the component tree if necessary. Is that the idea? It sure would be nice to have an honest to goodness post-constructors event on which I could hang the component tree creation -- then we wouldn't have to worry about this. In my use of Wicket, I've always set a component's model at the time that component was created -- I've never had to swap out a model in a separate operation. If the data to be displayed changes dynamically, I've always simply used a model which took that into account. Is that just a different style of programming? Or are there circumstances beyond my limited experience which would require one to access a component before the first call to onBeforeRender()? /Frank -Original Message- From: Michal Kurtak [mailto:michal.kur...@gmail.com] Sent: Monday, November 02, 2009 3:39 AM To: users@wicket.apache.org Subject: Re: Glue for composing panels Hi Frank, We use the same approach as you. We have found one disadvantage, which relates to references to components created by subclasses. I'll demostrate it (problem and solution) in the following example: class BasePage extends Page { /** Component created by subclass */ private Component component; private boolean componentsAssembled = false; /** Let the assemple method to set componentsAssembled flag */ private void assembleComponents() { component = createComponent(); ... componentsAssembled = true; } protected abstract Component createComponent(); @Override void onBeforeRender() { if ( !componentsAssembled ) { assembleComponents(); } super.onBeforeRender(); // Or whatever else is needed } /** Method uses assambelComponents() to ensure, that component is created */ public Component getComponent() { if(component == null) { assembleComponents(); } return component; } /** public method delegete to referenced component. Uses safe getComponent() method */ public void setComponentModel(IModel? model) { getComponent().setModel(model); } michal 2009/10/29 Frank Silbermann frank.silberm...@fedex.com: I was discussing glue for composing reusable panels into web pages on the blog of Erik van Oosten (http://blog.jteam.nl/2009/09/16/wicket-dos-and-donts/). I told him that my approach had been to create an abstract base page that constructs the common elements while leaving place-holders for page-specific panels by defining methods such as: abstract Panel createUpperLeftPanel (String wicketID); abstract Panel createLowerRightPanel(String wicketID); and having the base page's constructor say things like: Panel p1 = createUpperLeftPanel(a_wicket_id); add(p1); ... Add( createUpperRightPanel(another_wicket_id) ); The child page's contribution would be the implementation of the abstract methods. I explained that I preferred this to mark-up inheritance because I could add to the base page in any number places (not just one place), the compiler would tell the child-page writer exactly what panels were needed, and most importantly, no additional mark-up whatsoever would need to be associated with any of the child pages. (Panel classes used by the child page would of course have their associated mark-up.) Eric and others explained what a bad idea it is for constructors to call overridable methods -- they execute before the child-page's properties have been set. I usually got away with this, but I admit I was burnt a few times. Recently, I wondered whether there might be a simple fix for the constructor-calls-overridable-method problem, such as: (a) Move the base page's component tree construction out of the constructor, and put it into the method: private void assembleComponents() { ... } (b) Add the property: private boolean componentsAssembled = false; (c)
Re: Tree table with check box
Hello again, Please find the below given code Page class: Treetable has been added in the Page class as follows IColumn columns[] = new IColumn[] { new PropertyTreeColumn(new ColumnLocation(Alignment.LEFT, Unit.PERCENT),Check,userObject.name) { public IRenderable newCell(javax.swing.tree.TreeNode node, int level) { return null; } public Component newCell(MarkupContainer parent,java.lang.String id, javax.swing.tree.TreeNode node, int level) { CheckBoxPanel boxPanel = new CheckBoxPanel(parent.getId(),id); return boxPanel; } }, }; TreeDataProvider treedataProvider = new TreeDataProvider(); TreeTable checkTrees = new TreeTable(trtTest,treedataProvider.getTreeModel(),columns); add(checkTrees); CheckBoxPanel class: public class CheckBoxPanel extends Panel { private CheckBox cbxName; public CheckBoxPanel(String id, String model) { super(id); setMarkupId(id); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); cbxName = new CheckBox(cbxName, new Model()); add(cbxName); } } Data Provider class: public class TreeDataProvider { private DefaultMutableTreeNode dmtRoot; public TreeDataProvider() { dmtRoot = new DefaultMutableTreeNode(new TreeListVO(Test)); DefaultMutableTreeNode dmtBase1 = new DefaultMutableTreeNode(new TreeListVO(Root1)); DefaultMutableTreeNode dmtChild1 = new DefaultMutableTreeNode(new TreeListVO(node1)); dmtBase1.add(dmtChild1); dmtRoot.add(dmtBase1); } public TreeModel getTreeModel() { DefaultTreeModel dtmTree = new DefaultTreeModel(dmtRoot); return dtmTree; } } Model class: public class TreeListVO { private String name; public TreeListVO(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } } -- View this message in context: http://old.nabble.com/Tree-table-with-check-box-tp26080852p26157749.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bookmarkable images from db
Exactly. You can see the example posted by Vytautas Racelis earlier at this link: http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-repository/src/main/java/org/xaloon/wicket/component/resource/ImageLink.java I prefer to do it this way: http://pastebin.com/m328e21ff The first example allow you to use directly an Image component, while the second allows you to build the url of any resource by name.. Alex Objelean Peter Dotchev wrote: Hi Alex, I check SharedResources, but as I understand it I would have to add there a Resource object for each image. After checking again the javadoc there might be another way. Display each image with Image constructor that takes ValueMap and provide there some image identification. Add a single Resource object for all images and from getResourceStream() implementation to call getParameters() which will return the same parameters passed to Image constructor and tell me which image to return. Will this work? Best regards, Petar Alexandru Objelean wrote: Besides the servlet, there is also a wicket way of do it: - Use shared resource, which is stateless and bookmarkable If you need more informations about this approach, search on forum or just ask... and I'll provide you with some examples of how I do it.. Alex Objelean Peter Dotchev wrote: Hi, My app allows users to upload images and I store them in JCR http://en.wikipedia.org/wiki/Content_repository_API_for_Java. I can get InputStream for each one of them. I want to display images in specific pages and I want image URLs to be stable/bookmarkable. Also I don't want these pages to use the session in any way. I checked again chapter 9 about images from Wicket In Action but such use case is not addressed there. I found that SharedResources allows for stable URLs, but I cannot register each individual image. What approach would you suggest? Best regards, Peter -- View this message in context: http://old.nabble.com/Bookmarkable-images-from-db-tp26154577p26157757.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
tinymce ajaxbutton
My form has tinymce text area so I added TinyMceAjaxButton , now due to new requirements sometimes I have to hide tinymce textarea , anytime I hide tinymce text area the TinyMceAjaxButton submit button does not work , Is there a way I can use the TinyMceAjaxButton without tinynmce textarea ?
Re: Wicket Release Plans for 1.5
The best would be short release cycle and very long support cycle. The latter is more important. igor.vaynberg wrote: do you guys want a release cycle that will take a year? the auto-detaching models are perfectly possible now by implementing a IDetachListener and detaching all fields that implement IDetachable via reflection. -igor On Sun, Nov 1, 2009 at 3:05 AM, Vladimir K koval...@gmail.com wrote: what about promiced auto-detaching models? may we expect it in 1.5? igor.vaynberg wrote: possibly. i think i would like this release to be as small as possible, centered around the new url stuff. once that is in release 1.5 and put the new ajax support from ng into 1.6. trying to release more and more often instead of taking over a year and a half like we did with 1.4.0 -igor On Fri, Oct 30, 2009 at 5:10 AM, Richard Allen richard.l.al...@gmail.com wrote: Is the Wicket Ajax Next Generation work going into 1.5? Also, is there plans for an event bus, sort of like what you see in Jonathan Locke's 26 wicket tricks source code? I've seen some really nice use of event bus in GWT that I think Wicket could benefit from. -Richard On Fri, Oct 30, 2009 at 4:43 AM, Dave B d...@davebolton.net wrote: I'm still eager to make WicketTester a first class citizen. I'm keen on this too -- is there a 'voting' mechanism in the bug tracker for this sort of thing? Cheers, Dave On Fri, Oct 30, 2009 at 7:27 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: I'm still eager to make WicketTester a first class citizen. Martijn On Thu, Oct 29, 2009 at 7:01 PM, dtoffe dto...@yahoo.com.ar wrote: Thanks for your answer, Daniel igor.vaynberg wrote: the focus of this release is to rewrite url and page handling. the focus is on flexibility and pluggability as well as simplification of use to the end user. the other major feature is the markupfragment implementation, which will allow users access to the markup the component is attached to, possibly, at a time earlier then render time. other then that there will probably be smaller features that will not go into 1.4.x because they require an api break. -igor On Thu, Oct 29, 2009 at 10:38 AM, dtoffe dto...@yahoo.com.ar wrote: Besides, it would be very interesting to know what changes and new features are planned. Cheers, Daniel -- View this message in context: http://www.nabble.com/Wicket-Release-Plans-for-1.5-tp26115807p26117927.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - 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 -- View this message in context: http://old.nabble.com/Wicket-Release-Plans-for-1.5-tp26115807p26148878.html Sent from the Wicket - User mailing list archive at Nabble.com. - 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 -- View this message in context: http://old.nabble.com/Wicket-Release-Plans-for-1.5-tp26115807p26157809.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
tinymce textarea hidden in form
My form has tinymce text area so I added TinyMceAjaxButton , now due to new requirements sometimes I have to hide tinymce textarea , anytime I hide tinymce text area the TinyMceAjaxButton submit button does not work , Is there a way I can use the TinyMceAjaxButton without tinynmce textarea ?
Asynchronous construction of page
I am trying to find out how to load several parts (Wicket panels) of a page in parallel using Ajax. The content of these parts takes long to render but I still want the user to see the other, readily available parts of the page, with the delayed panels appearing when available. Several posts on this list indicate that AjaxLazyLoadPanel's only work synchronously. Is this still the case with the latest version/snapshot of Wicket? Is there maybe another approach available (one that still uses Wicket for the parts)? Thanks, Kaspar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Asynchronous construction of page
if you want nonblocking you have to make each thing you are trying to load asynchronously its own page inside an iframe. the page itself can only be accessed synchronously, otherwise you would have to do your own multithreaded access handling in components...which would be horrific. -igor On Mon, Nov 2, 2009 at 1:32 PM, Kaspar Fischer kaspar.fisc...@dreizak.com wrote: I am trying to find out how to load several parts (Wicket panels) of a page in parallel using Ajax. The content of these parts takes long to render but I still want the user to see the other, readily available parts of the page, with the delayed panels appearing when available. Several posts on this list indicate that AjaxLazyLoadPanel's only work synchronously. Is this still the case with the latest version/snapshot of Wicket? Is there maybe another approach available (one that still uses Wicket for the parts)? Thanks, Kaspar - 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
Page model returning null
I've got the following bits of code: public HomePage(PageParameters parms) { this(); Long accountId = parms.getLong(accountId); account = new ModelEntity(Account.class, accountId); setModel(account); ... public class EditContactDetails extends Panel{ public EditContactDetails(String id, final ModelEntity contact){ super(id); Form form = new Form(form, new CompoundPropertyModel(contactObj)){ @Override protected void onSubmit(){ //do stuff //redraw the page HomePage hp = (HomePage) this.findPage(); ModelEntity account = (ModelEntity) parent.getInnermostModel(); facade.logSevere(account.toString()); hp.reloadAccount(account); } }; ... getInnermostModel() is returning null, instead of the model I set it to when loading the page. This all used to work until I added a panel to hierarchy above EditContactDetails and I'm not sure why I can't get my hands on the model now. I'm using wicket 1.3.5. Are there circumstances where findPage() would return a new instance of HomePage? Logging tells me that HomePage's model does not contain null at the time it is set, and I'm not explicitly setting it anywhere else, is there some trickery that could be resetting it for me? Thanks for you time. Loren
London Wicket Event at Foyles Bookshop, November 21st, 2009
We will hold our next London Wicket Event on Saturday, 21st November, from 14:45. This time we have hired The Gallery at the iconic Foyles Bookshop in central London. We again welcome guests and speakers from several countries, including at least 3 core committers, Matej, Jeremy and of course, Alastair, as well as the founders of WiQuery (Wicket-jQuery integration), Lionel Armanet and his team. Join us for some very interesting, high quality presentations and to chat with fellow Wicket users and developers at all levels. We're expecting this to be another popular event and since places are limited book and confirm early if you can make it. Details and registration are at the usual place [1]. There is a cool little Jazz cafe at Foyles too, where there'll be a live act (Femi Temowo) at 13:00 if you enjoy some Jazz guitar relaxation before your intellectual stimulation. They offer a decent range of food and drink there too. The event schedule looks like: Cemal Bayramoglu: Introduction Jeremy Thomerson (USA): Custom JavaScript Integrations with Wicket + Auto Resolvers Lionel Armanet (FR): Announcing WiQuery 1.0: Introduction Demo Matej Knopp (SK): BRIX CMS + Wicket 1.5 Developments QA Alastair Maw (UK): The Al Talk Our Regular General Wicket QA with Al and Cemal We expect to formally finish by around 19:00. I would expect the usual suspects will be heading somewhere in the neighbourhood for refreshments straight after the event, and of course you are more than welcome to join us. Regards - Cemal jWeekend http://jWeekend.com Training, Consulting, Development [1] http://jweekend.com/dev/LWUGReg/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page model returning null
On Mon, Nov 2, 2009 at 4:57 PM, Loren Cole loren.c...@gmail.com wrote: HomePage hp = (HomePage) this.findPage(); ModelEntity account = (ModelEntity) parent.getInnermostModel(); Is this just a typo? You're getting the home page and then getting the innermost model from something else? Shouldn't it be hp.getModel()? -- Jeremy Thomerson http://www.wickettraining.com
sesseion timeout using a Panel
i have a pannel code for login ,when session timeout ,i don't login fist time. it mean i must refresh the page, then i can login form the login pannel when the session timeout. if the login code is not the pannel, it don't need refresh the login page ,and it can login .i don't know why. thx joe ___ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/
Wicket Examples as portlets in Liferay
Hi sending again, as I do not see it in user list...: Hi, I try to get the wicket-examples-WAR running as portlets in Liferay according to my description here: http://cwiki.apache.org/confluence/display/WICKET/Wicket+Examples+as+portlets But after drag'n'drop e.g. the echo example portlet, it is not shown. When I look in the HTML-source of the portal page I see: div id=p_p_id_EchoApplication_WAR_wicketexamples_ class=portlet-boundary portlet-boundary_EchoApplication_WAR_wicketexamples_ a id=p_EchoApplication_WAR_wicketexamples/ script type=text/javascript 1/*![CDATA[*/Liferay.Portlet.onLoad({canEditTitle:true,columnPos:0,isStatic:no,namespacedId:p_p_id\u005f\u0045\u0063\u0068\u006f\u0041\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u005f\u0057\u0041\u0052\u005f\u0077\u0069\u0063\u006b\u0065\u0074\u0065\u0078\u0061\u006d\u0070\u006c\u0065\u0073\u005f,portletId:\u0045\u0063\u0068\u006f\u0041\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u005f\u0057\u0041\u0052\u005f\u0077\u0069\u0063\u006b\u0065\u0074\u0065\u0078\u0061\u006d\u0070\u006c\u0065\u0073});/*]]*/ /script /div So it seems added, but does not contain anything to show... What is wrong?