Re: JavaRebel experience
Is it possible to have Java Rebel reload the Wicket HTML as well? Like when we deploy a war file to JBoss, it will contain html and class files. The class files I can reload using Java Rebel, how would you do it with the html files? Stefan Simik wrote: Java Rebel worked for me too. I had no such problem. -- View this message in context: http://www.nabble.com/JavaRebel-experience-tp13422257p19414750.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Handling click events in your custom IRequestCodingStrategy
I am writing my own IRequestCodingStrategy that will be returned by getRequestCodingStrategy() in a subclass of DefaultWebRequestCycleProcessor. I use my IRequestCodingStrategy to translate a URL like index.jsp?content_id=17 into /press/articles/this_is_my_headline.html using decode() and encode() methods. It works pretty nice so far. However, I have a problem with Button or Link events that worked before. I mean these Buttons or Links, that have their onSubmit or onClick method overwritten. When I hover over these elements in the Browser, I see that the URL is still in the default Wicket style like Component::bla::[0]. When I trigger the action, nothing works really. Obviously my IRequestCodingStrategy and the way event methods are invoked, is not coupled together yet. How would I implement that? Is there a good tutorial maybe? -- View this message in context: http://www.nabble.com/Handling-click-events-in-your-custom-IRequestCodingStrategy-tp17595141p17595141.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: decode() in WebRequestCodingStrategy
why do you want to add extra params in the RequestParameters? The use case is this. The request comes in with a URL like /press/article/headline.html. I will take the URL and look up which Content node this path maps to in our CMS. Then I would like to add the id of this Content node into the RequestParameters for later processing. reikje wrote: I am trying to implement a custom WebRequestCodingStrategy. In the decode methode, I would like to add some custom parameters in the RequestParameters object that is returned. I can add whatever I want in addBookmarkablePageParameters(..) - perfect. However, all of my parameters are completly ignored as WebRequestCodingStrategy.decode will only return the parameters that were previously in the Request. Is that supposed to be like this? I was expecting that I could add individual parameters in a method called addBookmarkablePageParameters. I choosed to do that in WebRequestCodingStrategy because I don't want to mount anything. -- View this message in context: http://www.nabble.com/decode%28%29-in-WebRequestCodingStrategy-tp17460040p17595176.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
decode() in WebRequestCodingStrategy
I am trying to implement a custom WebRequestCodingStrategy. In the decode methode, I would like to add some custom parameters in the RequestParameters object that is returned. I can add whatever I want in addBookmarkablePageParameters(..) - perfect. However, all of my parameters are completly ignored as WebRequestCodingStrategy.decode will only return the parameters that were previously in the Request. Is that supposed to be like this? I was expecting that I could add individual parameters in a method called addBookmarkablePageParameters. I choosed to do that in WebRequestCodingStrategy because I don't want to mount anything. -- View this message in context: http://www.nabble.com/decode%28%29-in-WebRequestCodingStrategy-tp17460040p17460040.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView with a Set instead of a List
1 True, but why is it important that is has to be the same collection? I only care about changes being propagated to the ListItems, I don't care if they are contained in a Set within the Model or in a List given to the ListView. In other words, if you are saying, that you have to give the same List from the Model to the ListView, means you cannot render a Model object with a Set using a ListView. This is quite a restriction you have to be aware of then I think. We choosed the Set on purpose to avoid duplicates, there must be a way to render the contents of a Set using any Repeater component. 2 Yes, in my code snippet where it says // getModelObject and save this is very I call getModelObject(). Johan Compagner wrote: 1 because you dont have that detacheable list in the listview?? You are just giving a ArrayList directly to the listview 2 i dont see exactly where you call getModelObject on in onsubmit but i guess thats on page? Then it is loaded yes, this has nothing to do with the listview model. On 3/28/08, reikje [EMAIL PROTECTED] wrote: I have a rather specific question about a problem I am having. We have a domain object (OperatorSyncConfig) that we need to diplay in a page. That object contain a Set of FunctionSetting objects which I want to render in a ListView. For each ListItem (FunctionSetting) it should be possible to change the timeout value and then with one Form submit save the whole OperatorSyncConfig objects. Here is a snippet of the objects: public class OperatorSyncConfig implements Serializable { private SetFunctionSetting m_functionSettings = new LinkedHashSetFunctionSetting(); public SetFunctionSetting getFunctionSettings() { return Collections.unmodifiableSet(new LinkedHashSetFunctionSetting(m_functionSettings)); } .. no setter method for the set, just single add and remove accessors } public class FunctionSetting implements Serializable { private Long m_timeoutInMilliseconds; .. get and set for that } The WebPage looks in short like that: public class EditOperatorPage extends WebPage { LoadableDetachableModel model = new LoadableDetachableModel() { ... } // load the OperatorSyncConfig setModel(model); Form updateDeleteForm = new Form(updateForm) { @Override protected void onSubmit() { // getModelObject and save } }; OperatorSyncConfig operatorSyncConfig = (OperatorSyncConfig) getModelObject(); SetFunctionSetting settingsAsSet = operatorSyncConfig.getFunctionSettings(); ListFunctionSetting settings = new ArrayListFunctionSetting(settingsAsSet); updateDeleteForm.add(new ListView(operatorFunctionsList, settings) { @Override protected void populateItem(ListItem item) { FunctionSetting functionSetting = (FunctionSetting) item.getModelObject(); item.add(new TextField(Timeout, new PropertyModel(functionSetting, timeoutInMilliseconds))); } }); } The problem is that in the onSubmit of the Form I will always get the old version of the OperatorSyncConfig since getPage().getModelObject() in there will trigger LoadableDetachableModel.load() and get the object from the Database. If I debug, I see that the new value for timeoutInMilliseconds is bound properly to the FunctionSetting object in the model of the ListItem. However, the model of the whole ListView contains an ArrayList which itself contains different FunctionSetting objects (not the ones contained in the Page model OperatorSyncConfig.getFunctionSettings()). By different I mean they are equal but different objects in memory. Question is: 1) why are there different FunctionSetting objects in the Page model and the ListView model 2) why does onSubmit() call load() on the DetachableModel if form values have been bound already -- View this message in context: http://www.nabble.com/ListView-with-a-Set-instead-of-a-List-tp16349670p16349670.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ListView-with-a-Set-instead-of-a-List-tp16349670p16418733.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to do h3a
On the Java side, which Components can you use if you have HTML nested like this: h3 .. Text /h3 For the h3 if I use a Label, I cannot add a Link as child because it is not a MarkupContainer. -- View this message in context: http://www.nabble.com/How-to-do-%3Ch3%3E%3Ca%3E-tp16386001p16386001.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ListView only ListItem markup with setRenderBodyOnly
Let's say I have a ListView with this markup: lt;span wicket:id=links lt;span wicket:id=delimitergt;|lt;/spangt; lt;a href=# wicket:id=linkgt; lt;span wicket:id=linkTextgt;[[Linktext]]lt;/spangt; lt;/agt; lt;/spangt; and this Java Code: ListView paragraphs = new ListView(links, contentsToDisplay) { protected void populateItem(ListItem item) { Content content = (Content) item.getModelObject(); Label delimiter = new Label(delimiter, | ); delimiter.setVisible(item.getIndex() 0); item.add(delimiter); Link contentLink = getContentLink(link, content.getId()); Label linkText = new Label(linkText, content.getTitle()); linkText.setRenderBodyOnly(true); contentLink.add(linkText); item.add(contentLink) } }; paragraphs.setRenderBodyOnly(true); add(paragraphs); Even though I use setRenderBodyOnly on the ListView I still get the for each list item that is rendered. Is it possible to create a ListView so that only the Markup of the ListItems is rendered? -- View this message in context: http://www.nabble.com/ListView-only-ListItem-markup-with-setRenderBodyOnly-tp16386233p16386233.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to do h3a
Good idea, you mean something like this: lt;h3gt; lt;a href=.. wicket:id=gt;Textlt;/agt; lt;/h3gt; That works I guess, thx Pills wrote: It may be a WebMarkupContainer. Or nothing at all (having a component on the java side is possible, but not required) reikje a écrit : On the Java side, which Components can you use if you have HTML nested like this: h3 .. Text /h3 For the h3 if I use a Label, I cannot add a Link as child because it is not a MarkupContainer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/How-to-do-%3Ch3%3E%3Ca%3E-tp16386001p16386264.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ListView with a Set instead of a List
I have a rather specific question about a problem I am having. We have a domain object (OperatorSyncConfig) that we need to diplay in a page. That object contain a Set of FunctionSetting objects which I want to render in a ListView. For each ListItem (FunctionSetting) it should be possible to change the timeout value and then with one Form submit save the whole OperatorSyncConfig objects. Here is a snippet of the objects: public class OperatorSyncConfig implements Serializable { private SetFunctionSetting m_functionSettings = new LinkedHashSetFunctionSetting(); public SetFunctionSetting getFunctionSettings() { return Collections.unmodifiableSet(new LinkedHashSetFunctionSetting(m_functionSettings)); } .. no setter method for the set, just single add and remove accessors } public class FunctionSetting implements Serializable { private Long m_timeoutInMilliseconds; .. get and set for that } The WebPage looks in short like that: public class EditOperatorPage extends WebPage { LoadableDetachableModel model = new LoadableDetachableModel() { ... } // load the OperatorSyncConfig setModel(model); Form updateDeleteForm = new Form(updateForm) { @Override protected void onSubmit() { // getModelObject and save } }; OperatorSyncConfig operatorSyncConfig = (OperatorSyncConfig) getModelObject(); SetFunctionSetting settingsAsSet = operatorSyncConfig.getFunctionSettings(); ListFunctionSetting settings = new ArrayListFunctionSetting(settingsAsSet); updateDeleteForm.add(new ListView(operatorFunctionsList, settings) { @Override protected void populateItem(ListItem item) { FunctionSetting functionSetting = (FunctionSetting) item.getModelObject(); item.add(new TextField(Timeout, new PropertyModel(functionSetting, timeoutInMilliseconds))); } }); } The problem is that in the onSubmit of the Form I will always get the old version of the OperatorSyncConfig since getPage().getModelObject() in there will trigger LoadableDetachableModel.load() and get the object from the Database. If I debug, I see that the new value for timeoutInMilliseconds is bound properly to the FunctionSetting object in the model of the ListItem. However, the model of the whole ListView contains an ArrayList which itself contains different FunctionSetting objects (not the ones contained in the Page model OperatorSyncConfig.getFunctionSettings()). By different I mean they are equal but different objects in memory. Question is: 1) why are there different FunctionSetting objects in the Page model and the ListView model 2) why does onSubmit() call load() on the DetachableModel if form values have been bound already -- View this message in context: http://www.nabble.com/ListView-with-a-Set-instead-of-a-List-tp16349670p16349670.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Junit required for WicketTester?
Do you have to have junit.jar in the classpath if you want to use WicketTester? We are using TestNG here and in a regular TestNG test case (where the class is annotated with @Test), I get java.lang.NoClassDefFoundError: junit/framework/AssertionFailedError. -- View this message in context: http://www.nabble.com/Junit-required-for-WicketTester--tp15892202p15892202.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Custom WebRequestCycle and PageParameters
Hi all. I have created a custom class ContextAwareWebRequestCycle that extends WebRequestCycle. In my application I return an instance of ContextAwareWebRequestCycle in newRequestCycle(..). The ContextAwareWebRequestCycle requires some information that is in the PageParameters. Unfortunately the PageParameters are not available when the newRequestCycle(..) is called. They get populated later in the request cycle in the RESOLVE_TARGET step. I have changed ContextAwareWebRequestCycle now, so that the object is fully populated when the first WebPage or Panel requests it (which is after the resolve step). However, I would rather have the ContextAwareWebRequestCycle fully constructed before that. I could overwrite RequestCycle.setPageParameters(..) to not just set the PageParameters but also finish constructing ContextAwareWebRequestCycle. But setPageParameters(..) is final, so I cant overwrite it. Any good ideas which method to overwrite so that ContextAwareWebRequestCycle may be fully constructed using PageParameters? -- View this message in context: http://www.nabble.com/Custom-WebRequestCycle-and-PageParameters-tp15667118p15667118.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nested labels - Expected close tag
Hi, how can you add nested tags without getting a Expected close tag error? I have this html markup: div id=categories wicket:id=categories h2 wicket:id=titleRest[[titleFirst]] [[titleRest]]/h2 /div categories will be a ListView and in the populateItem method, I want to add text to h2 and in each iteration. I understand that I cannot use a Label for the h2 because it is not a container. Any way I can get this done in another way? -- View this message in context: http://www.nabble.com/Nested-labels--%3E-Expected-close-tag-tp15397144p15397144.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested labels - Expected close tag
Stupid me. Of course I have a nested tag in my h2. div id=categories wicket:id=categories h2 wicket:id=titleRest[[titleFirst]] [[titleRest]]/h2 /div I need to add text for both and h2 in the populateItem method of a ListView. igor.vaynberg wrote: you can use a label for h2 elements, why not? the only requirement of a label is that it has no nested wicket components. -igor On Feb 10, 2008 7:09 AM, reikje [EMAIL PROTECTED] wrote: Hi, how can you add nested tags without getting a Expected close tag error? I have this html markup: div id=categories wicket:id=categories h2 wicket:id=titleRest[[titleFirst]] [[titleRest]]/h2 /div categories will be a ListView and in the populateItem method, I want to add text to h2 and in each iteration. I understand that I cannot use a Label for the h2 because it is not a container. Any way I can get this done in another way? -- View this message in context: http://www.nabble.com/Nested-labels--%3E-Expected-close-tag-tp15397144p15397144.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Nested-labels--%3E-Expected-close-tag-tp15397144p15399336.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]