Adding extra request parameters to AJAX calls
The project I am working on currently requires that we introduce the concept of request scope using request parameters. To do this we need to add a conversation id to any URLs that are generated by wicket controls. Does wicket support this? So all AJAX buttons, link, drop down choices, etc will have to have the conversation ID. I have been looking at adding an AJAX behavior and overriding the getCallBackURL method with no success. Any help would be appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4405842.html Sent from the Users forum 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: Adding extra request parameters to AJAX calls
Hi, I think this application shows how to do that in Wicket 1.3/1.4/1.5. In Wicket 6.0 it will be easier: http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java;hb=master Search for attributes.getDynamicExtraParameters().add(dynamicExtraParameters); and the lines above. More about this at: https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-AjaxRequestAttributes On Tue, Feb 21, 2012 at 4:02 AM, gmparker2000 greg.par...@brovada.com wrote: The project I am working on currently requires that we introduce the concept of request scope using request parameters. To do this we need to add a conversation id to any URLs that are generated by wicket controls. Does wicket support this? So all AJAX buttons, link, drop down choices, etc will have to have the conversation ID. I have been looking at adding an AJAX behavior and overriding the getCallBackURL method with no success. Any help would be appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4405842.html Sent from the Users forum 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Session for Stateless Pages (logged in user)
Hi, I have a web application that contains only stateless pages. I need to allow users to register and login. So I need to store user's login in a session. Could you please advise me how to start session after successful login and make session persistent for stateless pages? Any links to examples would be appreciated. Thanks Sergej Sizov
Re: Session for Stateless Pages (logged in user)
Just call Session.get().bind() after successful login. On Tue, Feb 21, 2012 at 11:04 AM, Sergej Sizov sergej.si...@wincor-nixdorf.cz wrote: Hi, I have a web application that contains only stateless pages. I need to allow users to register and login. So I need to store user's login in a session. Could you please advise me how to start session after successful login and make session persistent for stateless pages? Any links to examples would be appreciated. Thanks Sergej Sizov -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket 1.5 rewrites template content - imho should not
I have recently upgraded from Wicket 1.4.14 to 1.5.4. One issue that I encountered is that script tags in panel templates are rewritten by Wicket, even when the script tags in question have no wicket handlers attached to them. I.e. the following panel template (notice that there are no wicket:id attributes whatsoever): wicket:panel script id=template-upload type=text/x-jquery-tmpl span${name}/span /script /wicket:panel Would render in the panel as: script id=template-upload type=text/x-jquery-tmpl /*![CDATA[*/ span${name}/span /*]]*/ /script Imho this is unwanted behavior that is a regression from the behavior in Wicket 1.4.x (or at least 1.4.14). Wicket should not add content to the body of the script tags (or any other tags in a template, unless their content is provided programmatically), as it does not have the knowledge how that affects the functionality of the page. Moreover, the content that Wicket adds to these script tags is only correct for Javascript (hence incorrect for the scripts in the example as they are not javascript). In the above example adding /*, */ and even the CDATA part will change the functionality of the script tag. If the /*![CDATA[*/ part was necessary in the script tags above, they should be added by the person that provides the template, not magically added by Wicket. Comments? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating a component from custom thread or why getRequestCycle returns null
Actually this is not my problem. You update component just once after some time while I need non-stop updating. I found a semi-solution. I am using ScheduledThreadPoolExecutor. final ExecutorService service = new ScheduledThreadPoolExecutor(100) { protected void beforeExecute(final Thread t, final Runnable r) { Application.set(getApplication()); } protected void afterExecute(final Runnable r, final Throwable t) { Application.unset(); } }; service.submit(chat); but..the thread is submitted, but it is not executed. I'm debugging and.there is nothing that calls my run() method in my thread. So how can execute this thread which is submited in service. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-a-component-from-custom-thread-or-why-getRequestCycle-returns-null-tp4393783p4406892.html Sent from the Users forum 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: Wicket 1.5 rewrites template content - imho should not
Hi, Agree. Wicket should not do this in this case. File a ticket with a quickstart. On Tue, Feb 21, 2012 at 1:42 PM, Pointbreak pointbreak+wicketst...@ml1.net wrote: I have recently upgraded from Wicket 1.4.14 to 1.5.4. One issue that I encountered is that script tags in panel templates are rewritten by Wicket, even when the script tags in question have no wicket handlers attached to them. I.e. the following panel template (notice that there are no wicket:id attributes whatsoever): wicket:panel script id=template-upload type=text/x-jquery-tmpl span${name}/span /script /wicket:panel Would render in the panel as: script id=template-upload type=text/x-jquery-tmpl /*![CDATA[*/ span${name}/span /*]]*/ /script Imho this is unwanted behavior that is a regression from the behavior in Wicket 1.4.x (or at least 1.4.14). Wicket should not add content to the body of the script tags (or any other tags in a template, unless their content is provided programmatically), as it does not have the knowledge how that affects the functionality of the page. Moreover, the content that Wicket adds to these script tags is only correct for Javascript (hence incorrect for the scripts in the example as they are not javascript). In the above example adding /*, */ and even the CDATA part will change the functionality of the script tag. If the /*![CDATA[*/ part was necessary in the script tags above, they should be added by the person that provides the template, not magically added by Wicket. Comments? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating a component from custom thread or why getRequestCycle returns null
maybe i misunderstood. if you attach a quickstart to this thread I can take a look. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-a-component-from-custom-thread-or-why-getRequestCycle-returns-null-tp4393783p4406978.html Sent from the Users forum 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: Updating a component from custom thread or why getRequestCycle returns null
You will still need client initiated requests to get your non-stop-updates from the page/component to the browser. Hence, just separate the work (which you can do continuously in your thread) from the page rendering (which will need to be initiated by a browser request whatever you do). Will make your live so much easier if you cleanly separate those two tasks... On Tue, Feb 21, 2012, at 04:48, BayPhilip wrote: Actually this is not my problem. You update component just once after some time while I need non-stop updating. I found a semi-solution. I am using ScheduledThreadPoolExecutor. final ExecutorService service = new ScheduledThreadPoolExecutor(100) { protected void beforeExecute(final Thread t, final Runnable r) { Application.set(getApplication()); } protected void afterExecute(final Runnable r, final Throwable t) { Application.unset(); } }; service.submit(chat); but..the thread is submitted, but it is not executed. I'm debugging and.there is nothing that calls my run() method in my thread. So how can execute this thread which is submited in service. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AbstractAjaxBehavior and missing unbind(Component) method
Similar to this topic (http://apache-wicket.1842946.n4.nabble.com/Possible-AbstractAjaxBehavior-Bug-tp1867734p1867734.html) I'm running into trouble adding a Behavior to a Component dynamically with an Ajax request. I have a test page for jQuery UI Effects similar to this example (http://jqueryui.com/demos/effect/) where AbstractEffect extends AbstractAjaxBehavior. If I wanna replace the old selected behavior with the new one, previously attached to a WebMarkupContainer, I get an IllegalStateException thrown at org.apache.wicket.behavior.AbstractAjaxBehavior.bind(AbstractAjaxBehavior.java:62). I know, the Behavior was not designed with the adding/removing in mind, but as this issue (https://issues.apache.org/jira/browse/WICKET-713) has been fixed, it would be quite easy to solve this problem. I reckon the AbstractAjaxBehavior should just overwrite the unbind(Component component) method, to set the component the handler is currently bound to to null. Unfortunately the component attribute is private. Or do I miss the point and there is another solution I'm currently not aware of. Here is the exception thrown: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [ [Component id = effectContainer]], but component [ [Component id = effectContainer]] wants to be attached too at org.apache.wicket.behavior.AbstractAjaxBehavior.bind(AbstractAjaxBehavior.java:62) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AbstractAjaxBehavior-and-missing-unbind-Component-method-tp4407049p4407049.html Sent from the Users forum 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: AbstractAjaxBehavior and missing unbind(Component) method
Hi, Why do you want to reuse the behavior instance ? Can't you just create a new instance and assign it to the new component ? You can remove the old behavior from the old component with Component#remove(Behavior) On Tue, Feb 21, 2012 at 2:44 PM, Dirk Forchel dirk.forc...@exedio.com wrote: Similar to this topic (http://apache-wicket.1842946.n4.nabble.com/Possible-AbstractAjaxBehavior-Bug-tp1867734p1867734.html) I'm running into trouble adding a Behavior to a Component dynamically with an Ajax request. I have a test page for jQuery UI Effects similar to this example (http://jqueryui.com/demos/effect/) where AbstractEffect extends AbstractAjaxBehavior. If I wanna replace the old selected behavior with the new one, previously attached to a WebMarkupContainer, I get an IllegalStateException thrown at org.apache.wicket.behavior.AbstractAjaxBehavior.bind(AbstractAjaxBehavior.java:62). I know, the Behavior was not designed with the adding/removing in mind, but as this issue (https://issues.apache.org/jira/browse/WICKET-713) has been fixed, it would be quite easy to solve this problem. I reckon the AbstractAjaxBehavior should just overwrite the unbind(Component component) method, to set the component the handler is currently bound to to null. Unfortunately the component attribute is private. Or do I miss the point and there is another solution I'm currently not aware of. Here is the exception thrown: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [ [Component id = effectContainer]], but component [ [Component id = effectContainer]] wants to be attached too at org.apache.wicket.behavior.AbstractAjaxBehavior.bind(AbstractAjaxBehavior.java:62) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AbstractAjaxBehavior-and-missing-unbind-Component-method-tp4407049p4407049.html Sent from the Users forum 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 rewrites template content - imho should not
See https://issues.apache.org/jira/browse/WICKET-4425 On Tue, Feb 21, 2012, at 14:01, Martin Grigorov wrote: Hi, Agree. Wicket should not do this in this case. File a ticket with a quickstart. On Tue, Feb 21, 2012 at 1:42 PM, Pointbreak pointbreak+wicketst...@ml1.net wrote: I have recently upgraded from Wicket 1.4.14 to 1.5.4. One issue that I encountered is that script tags in panel templates are rewritten by Wicket, even when the script tags in question have no wicket handlers attached to them. I.e. the following panel template (notice that there are no wicket:id attributes whatsoever): wicket:panel script id=template-upload type=text/x-jquery-tmpl span${name}/span /script /wicket:panel Would render in the panel as: script id=template-upload type=text/x-jquery-tmpl /*![CDATA[*/ span${name}/span /*]]*/ /script Imho this is unwanted behavior that is a regression from the behavior in Wicket 1.4.x (or at least 1.4.14). Wicket should not add content to the body of the script tags (or any other tags in a template, unless their content is provided programmatically), as it does not have the knowledge how that affects the functionality of the page. Moreover, the content that Wicket adds to these script tags is only correct for Javascript (hence incorrect for the scripts in the example as they are not javascript). In the above example adding /*, */ and even the CDATA part will change the functionality of the script tag. If the /*![CDATA[*/ part was necessary in the script tags above, they should be added by the person that provides the template, not magically added by Wicket. Comments? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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
wiquery css
Hi all, I'm having another of my blind mornings. I just tried wiquery for the first time and had an accordion running within a few minutes, so first of all: thanks!!! Now: what's the best way to change the look and feel? I saw a that you can define a jquery theme and upload if somehow. How? Or should I just define the css for my page? If the latter, what should I use as my base? Thanks, Natalie P.S. I'm using wicket 1.4.19 with wiquery 1.2.4 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wiquery-css-tp4407116p4407116.html Sent from the Users forum 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: AbstractAjaxBehavior and missing unbind(Component) method
I have a static list of pre-configured instances (my Effects). On the page is a select box (a DropDownChoiceAbstractEffect component) which uses this list of instances to select an effect. Within the onClick() method of an additional AjaxLink, the WebMarkupContainer (effectContainer) is updated and the selected Behavior is added to this one. The old attached effect is removed. It would be possible to create every time new instance, but it was straightforward to me to just use a static list to choose from. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AbstractAjaxBehavior-and-missing-unbind-Component-method-tp4407049p4407159.html Sent from the Users forum 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: How to write an HTTP header (to detect cookie disablement)?
Hello Jeff, Thanks for the tip. I have tried to detect my header in the HTTP response headers using, in my web application class: @Override protected WebResponse MyWebApplicationnewWebResponse(final WebRequest webRequest, final HttpServletResponse httpServletResponse) { ServletWebResponse swrResponse = new ServletWebResponse( (ServletWebRequest)webRequest, httpServletResponse) { private static final long serialVersionUID = 1L; ... } String sHeaderValue = webRequest.getHeader(X-MyApp-NotFirstPageBase-1); // Show sHeaderValue in the logger return swrResponse; } but sadly with no header detected. (I know little about the details of request and response, which is one reason why I selected Wicket for my application.) Thanks anyway for your input, Ian Jeff Schneller wrote The header won't appear in the browser's page source but will be in the http response header. Sent from my iPhone On Feb 17, 2012, at 12:01 PM, Ian Marshall lt;IanMarshall.UK@gt; wrote: I am having trouble with JSessionIDs in my URLs (my post at http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4381881.html refers). So my plan is to detect the case where a web browser has disabled (session) cookies and react accordingly (for example: show a page to ask for cookie enablement). I plan to detect cookie disablement by writing a cookie during each client request from my common page PageBase (almost all of my web pages are sub-classed from PageBase, which in turn is sub-classed from org.apache.wicket.markup.html.WebPage). If any server response after the first does not have this cookie then I know that cookies are disabled. But how to know that a client request is not the first? I want to explore adding/setting an HTML header to each server response. I can use this to know whether or not this is the client's first request. In my application class, which is a sub-class of org.apache.wicket.protocol.http.WebApplication, I override newWebResponse(...) like this: @Override protected WebResponse newWebResponse(final WebRequest webRequest, final HttpServletResponse httpServletResponse) { httpServletResponse.addHeader(X-MyApp-NotFirstPageBase-1, true); httpServletResponse.setHeader(X-MyApp-NotFirstPageBase-2, true); return super.newWebResponse(webRequest, httpServletResponse); } No such headers appear in the browser's page source. I tried the following code in my About us page. public PageAbout() { super(); Form frmForm = new Form(frmForm) { private static final long serialVersionUID = 1L; @Override protected void onSubmit() { setResponsePage(PageHome.class); WebResponse wrResponse = (WebResponse)getResponse(); wrResponse.addHeader(X-MyApp-NotFirstPageBase-1, true); wrResponse.setHeader(X-MyApp-NotFirstPageBase-2, true); } }; add(frmForm); ... } Again no such header appeared. Can anyone see what I am doing wrong? Regards, Ian Marshall -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4397827.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4407998.html Sent from the Users forum 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: How to write an HTTP header (to detect cookie disablement)?
Hi Ian, If you add/set a header in the HttpServletResponse (even thru Wicket's WebResponse) then it will be written to the browser. You can verify that by investigating the request in Firebug's Net panel. If you want to send a cookie you should either use #addCookie() or set/addHeader(Set-Cookie). Check in google for more info. So you set the cookie in the current response and if not expired it should be available in the next *request* (HttpServletRequest or Wicket's WebRequest). On Tue, Feb 21, 2012 at 8:18 PM, Ian Marshall ianmarshall...@gmail.com wrote: Hello Jeff, Thanks for the tip. I have tried to detect my header in the HTTP response headers using, in my web application class: @Override protected WebResponse MyWebApplicationnewWebResponse(final WebRequest webRequest, final HttpServletResponse httpServletResponse) { ServletWebResponse swrResponse = new ServletWebResponse( (ServletWebRequest)webRequest, httpServletResponse) { private static final long serialVersionUID = 1L; ... } String sHeaderValue = webRequest.getHeader(X-MyApp-NotFirstPageBase-1); // Show sHeaderValue in the logger return swrResponse; } but sadly with no header detected. (I know little about the details of request and response, which is one reason why I selected Wicket for my application.) Thanks anyway for your input, Ian Jeff Schneller wrote The header won't appear in the browser's page source but will be in the http response header. Sent from my iPhone On Feb 17, 2012, at 12:01 PM, Ian Marshall lt;IanMarshall.UK@gt; wrote: I am having trouble with JSessionIDs in my URLs (my post at http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4381881.html refers). So my plan is to detect the case where a web browser has disabled (session) cookies and react accordingly (for example: show a page to ask for cookie enablement). I plan to detect cookie disablement by writing a cookie during each client request from my common page PageBase (almost all of my web pages are sub-classed from PageBase, which in turn is sub-classed from org.apache.wicket.markup.html.WebPage). If any server response after the first does not have this cookie then I know that cookies are disabled. But how to know that a client request is not the first? I want to explore adding/setting an HTML header to each server response. I can use this to know whether or not this is the client's first request. In my application class, which is a sub-class of org.apache.wicket.protocol.http.WebApplication, I override newWebResponse(...) like this: @Override protected WebResponse newWebResponse(final WebRequest webRequest, final HttpServletResponse httpServletResponse) { httpServletResponse.addHeader(X-MyApp-NotFirstPageBase-1, true); httpServletResponse.setHeader(X-MyApp-NotFirstPageBase-2, true); return super.newWebResponse(webRequest, httpServletResponse); } No such headers appear in the browser's page source. I tried the following code in my About us page. public PageAbout() { super(); Form frmForm = new Form(frmForm) { private static final long serialVersionUID = 1L; @Override protected void onSubmit() { setResponsePage(PageHome.class); WebResponse wrResponse = (WebResponse)getResponse(); wrResponse.addHeader(X-MyApp-NotFirstPageBase-1, true); wrResponse.setHeader(X-MyApp-NotFirstPageBase-2, true); } }; add(frmForm); ... } Again no such header appeared. Can anyone see what I am doing wrong? Regards, Ian Marshall -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4397827.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4407998.html Sent from the Users forum 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
Re: How to refresh frame2 with an Ajax submit button in frame1 for a page using frameset?
Thanks a lot for your information. I have modified my application to use frameless implementation, and the problem went away. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-refresh-frame2-with-an-Ajax-submit-button-in-frame1-for-a-page-using-frameset-tp4326014p4408435.html Sent from the Users forum 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
How to open BreadCrumbPanel from a context menu item instead of link
Hi there, In my application, I would like to navigate through several breadcrumb panels through clicking context menu item. For example, in panel1, I have a result table, right click a context menu of a row in the table, I would like to open another panel2 in a breadcrumb fashion. Is there a way to do that? I have looked at Wicket breadcrumb examples, but they are all using a link or button of sort to navigate from one panel to another. Thanks for your suggestions. -min -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-open-BreadCrumbPanel-from-a-context-menu-item-instead-of-link-tp4408530p4408530.html Sent from the Users forum 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
Reusing forms in different contexts
Hi, I want to reuse the same form panels in different contexts and would like to know how fellow Wicket users achieve this. The core of the problem is how to let the user of a form panel specify where to navigate when the form is submitted or canceled. There are multiple possibilities for this: -setResponsePage a bookmarkable page -setResponsePage a page instance (to go back to the previous page for example) -replace the form panel via ajax -close a modal window via ajax -bubble a Wicket event I've tried 2 approaches up to now : -some form of markup inheritance. This requires subclassing the form panel at each usage site. -navigation factories provided to the form panel which are responsible for populating it with the proper submit and cancel links/buttons. Both of these approaches are kludgy and I have the feeling there has to be a better way. Which way is the Wicket way to let the user of a panel customize its navigation? Thanks, Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reusing forms in different contexts
*abstract* class myformpanel extends panel { public myformpanel(string id) { add(new button(save) { onsubmit() { *onsave(model);* });} *protected abstract void onsave(imodel);* } add(new myformpanel(panel) { protected void onsave(imodel) { // do stuff setResponsePage() or replaceWith() or whatever you want }} -igor On Tue, Feb 21, 2012 at 3:53 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I want to reuse the same form panels in different contexts and would like to know how fellow Wicket users achieve this. The core of the problem is how to let the user of a form panel specify where to navigate when the form is submitted or canceled. There are multiple possibilities for this: -setResponsePage a bookmarkable page -setResponsePage a page instance (to go back to the previous page for example) -replace the form panel via ajax -close a modal window via ajax -bubble a Wicket event I've tried 2 approaches up to now : -some form of markup inheritance. This requires subclassing the form panel at each usage site. -navigation factories provided to the form panel which are responsible for populating it with the proper submit and cancel links/buttons. Both of these approaches are kludgy and I have the feeling there has to be a better way. Which way is the Wicket way to let the user of a panel customize its navigation? Thanks, Bertrand - 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
ContextNotActiveException using net.ftlines.wicket-cdi:wicket-cdi 1.2
Hi, I am trying to use wicket + cdi, reading Ivan post at [1], there is an exception javax.enterprise.context.ContextNotActiveException: Conversation Context not active when method called on conversation Transient conversation I put the following excerpt in the HomePage.java but the error persist. @Inject Conversation conversation; public HomePage(final PageParameters parameters) { conversation.begin(); The full stacktrace is at [2] I tested with weld 1.1.2.Final and 1.1.5.Final the error is the same for both weld versions. The system runs with java 1.6 update 30. maven is 3.0.3 The quickstart project can be found at [3] To run type: mvn jetty:run Can you see something that I am missing to configure/code ? Thanks Claudio 1. https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/ 2. http://pastebin.com/qukj1btc 3. http://www.2shared.com/file/MJCf4E4T/cdi-wickettar.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ContextNotActiveException-using-net-ftlines-wicket-cdi-wicket-cdi-1-2-tp4408946p4408946.html Sent from the Users forum 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: ContextNotActiveException using net.ftlines.wicket-cdi:wicket-cdi 1.2
you are missing seam-conversation-weld jar, see the Setting Up wicket-cdi section under [1]. -igor On Tue, Feb 21, 2012 at 5:37 PM, Claudio Miranda clau...@claudius.com.br wrote: Hi, I am trying to use wicket + cdi, reading Ivan post at [1], there is an exception javax.enterprise.context.ContextNotActiveException: Conversation Context not active when method called on conversation Transient conversation I put the following excerpt in the HomePage.java but the error persist. @Inject Conversation conversation; public HomePage(final PageParameters parameters) { conversation.begin(); The full stacktrace is at [2] I tested with weld 1.1.2.Final and 1.1.5.Final the error is the same for both weld versions. The system runs with java 1.6 update 30. maven is 3.0.3 The quickstart project can be found at [3] To run type: mvn jetty:run Can you see something that I am missing to configure/code ? Thanks Claudio 1. https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/ 2. http://pastebin.com/qukj1btc 3. http://www.2shared.com/file/MJCf4E4T/cdi-wickettar.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ContextNotActiveException-using-net-ftlines-wicket-cdi-wicket-cdi-1-2-tp4408946p4408946.html Sent from the Users forum 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
Re: Reusing forms in different contexts
Thanks Igor. This is actually very close to what I used as my first approach. The problem I had then was that depending on the context in which the panel is used, the component must be one of the following: 1-A Link/Button, like in your code 2-A BookmarkablePageLink 3-An AjaxLink (ajax replacement, close modal window, etc.) In your example, myformpanel can only work with case #1. This is essentially the problem that has me scratching my head. Regards, Bertrand On 21/02/2012 7:04 PM, Igor Vaynberg wrote: *abstract* class myformpanel extends panel { public myformpanel(string id) { add(new button(save) { onsubmit() { *onsave(model);* });} *protected abstract void onsave(imodel);* } add(new myformpanel(panel) { protected void onsave(imodel) { // do stuff setResponsePage() or replaceWith() or whatever you want }} -igor On Tue, Feb 21, 2012 at 3:53 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I want to reuse the same form panels in different contexts and would like to know how fellow Wicket users achieve this. The core of the problem is how to let the user of a form panel specify where to navigate when the form is submitted or canceled. There are multiple possibilities for this: -setResponsePage a bookmarkable page -setResponsePage a page instance (to go back to the previous page for example) -replace the form panel via ajax -close a modal window via ajax -bubble a Wicket event I've tried 2 approaches up to now : -some form of markup inheritance. This requires subclassing the form panel at each usage site. -navigation factories provided to the form panel which are responsible for populating it with the proper submit and cancel links/buttons. Both of these approaches are kludgy and I have the feeling there has to be a better way. Which way is the Wicket way to let the user of a panel customize its navigation? Thanks, Bertrand - 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: AbstractAjaxBehavior and missing unbind(Component) method
Yes, I mean Java's static. Actually it was not meant to re-use this list due to concurrent requests. It's just a test page. But I've got it. I'll chance the page and use new instances instead. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AbstractAjaxBehavior-and-missing-unbind-Component-method-tp4407049p4409371.html Sent from the Users forum 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: Reusing forms in different contexts
HI Bertrand, I'm not quite sure whether this is your concern but take a look at org.apache.wicket.markup.html.tree.BaseTree#newLink() It uses LinkType to decide what kind of Link to create. You can use the same approach. On Wed, Feb 22, 2012 at 6:12 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Thanks Igor. This is actually very close to what I used as my first approach. The problem I had then was that depending on the context in which the panel is used, the component must be one of the following: 1-A Link/Button, like in your code 2-A BookmarkablePageLink 3-An AjaxLink (ajax replacement, close modal window, etc.) In your example, myformpanel can only work with case #1. This is essentially the problem that has me scratching my head. Regards, Bertrand On 21/02/2012 7:04 PM, Igor Vaynberg wrote: *abstract* class myformpanel extends panel { public myformpanel(string id) { add(new button(save) { onsubmit() { *onsave(model);* });} *protected abstract void onsave(imodel);* } add(new myformpanel(panel) { protected void onsave(imodel) { // do stuff setResponsePage() or replaceWith() or whatever you want }} -igor On Tue, Feb 21, 2012 at 3:53 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I want to reuse the same form panels in different contexts and would like to know how fellow Wicket users achieve this. The core of the problem is how to let the user of a form panel specify where to navigate when the form is submitted or canceled. There are multiple possibilities for this: -setResponsePage a bookmarkable page -setResponsePage a page instance (to go back to the previous page for example) -replace the form panel via ajax -close a modal window via ajax -bubble a Wicket event I've tried 2 approaches up to now : -some form of markup inheritance. This requires subclassing the form panel at each usage site. -navigation factories provided to the form panel which are responsible for populating it with the proper submit and cancel links/buttons. Both of these approaches are kludgy and I have the feeling there has to be a better way. Which way is the Wicket way to let the user of a panel customize its navigation? Thanks, Bertrand - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org