Re: Problem with modal window and AJAX for Wicket 6.14 and higher

2014-06-01 Thread Martin Grigorov
Hi,

There is one ticket in 6.14's changelog related to ModalWindow -
https://issues.apache.org/jira/browse/WICKET-5469. But I doubt it is the
cause.
Most probably https://issues.apache.org/jira/browse/WICKET-5471 or
https://issues.apache.org/jira/browse/WICKET-5499 are the reason.

If you are able to reproduce it in an application that you can share with
us then please attach it to a ticket in Jira. Or send it privately to me if
this is an option for you.
Another way is to clone Wicket Git repo and use git bisect to see which
commit broke it.

Martin Grigorov
Wicket Training and Consulting


On Sun, Jun 1, 2014 at 12:49 AM, Armin Bollmann bo...@gmx.de wrote:

 In my demo-application I encountered a problem with calling a modal page:
 I have taken ModalContent1Page, ModalContent2Page, and ModalPanel1 from
 Wicket examples 6.0.x (Matej Knopp) and integrated them into my demo
 application.

 Up to Wicket version 6.13 everything is working fine with calling modal
 window page (=ModalContent1Page). Beginning with Wicket 6.14 (i.e. and
 for 6.15) I'm encountering abnormal behaviour after calling
 ModalContent1Page, i.e. instead of the content of ModalContent1Page the
 content of my web page (with all panels, links etc.) is appearing and I
 can call again ModalContent1Page out of appearing modal window and so
 on. Only header and close button of the modal window are correct. With
 ModalPanel1 there are no problems occuring.

 Unfortunately I couldn't reproduce this behaviour with a simple
 quickstart I build. I suppose it has something to do with markup
 inheritance.

 Any hint would be appreciated.

 Thanks,

 Armin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Dynamic Form Best Architecture

2014-06-01 Thread Martin Grigorov
Hi,

Can you give some examples with pseudo data ? It is a bit hard to follow
what is the requirement.
If I follow correctly you have a radio group. Depending on the selected
radio you have to make a call to a web service and render some form
controls dynamically for the web service response, right ?

You can have just one Panel for the dynamic part of the form. Start with an
EmptyPanel and selecting a radio will replace it with another one. To
create the dynamic form controls you will need a set (of Fragment or Panel)
of all possible controls and just add them to a repeater.

Martin Grigorov
Wicket Training and Consulting


On Fri, May 30, 2014 at 11:18 AM, sim999 simon.rie...@gmail.com wrote:

 Hello,

 I'm a new user of Wicket and I would like to have your opinion.

 Here is what I'm trying to do :

 Step 1 : My application calls a web service to retrieve some data.

 Step 2 :
 Based on these data the application must build a big web form, this form
 ask
 the user many questions
 (15-20 for instance, most of the time yes/no questions (without submit
 button), sometimes new inputs may appear etc).
 Each time a response is given a new question appears (conditions of
 appearance can be the previous response and / or data retrieved by the web
 service).
 At the beginning all the questions are invisible.

 I have multiple options to architecture this :

  - Initialize all the panels for each question and make them invisible at
 the beginning. Use Ajax on each Radio Button (yes / no), checkbox etc and
 make them appear.
 The problem as see with this solution is that it forces me to add all the
 panels to the form and the logic of appearance is fragmented in each
 panel
 which handle the question.
 The other problem is that we need the server (Ajax for each response) even
 though it isn't needed once we retrieved the data from the web service.
 The last problem I see is that how do I manage to hide all the children of
 a
 panel if the user decide to go back and change his response to a previous
 question.

 - Same as previous but I add dynamically the panel / question for each
 response. However once again
  the logic of appearance is fragmented in each question and it is
 difficult to maintain.

 - Same as previous but all in JavaScript. I will need to convert all the
 data from the web service to JavaScript variables not really the wicket
 Way...

 - Maybe I could use Nested Forms but I lack the required distance to be a
 good judge. I don't really know if is really the best response to my
 problem.

  - Finally What about the form Component panel ?

 Note : There are in fact many big forms depending on the user profile.

 If you could give me your take on this I will be really grateful.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Dynamic-Form-Best-Architecture-tp4666065.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




Opening a Modal window on page load in Wicket 6

2014-06-01 Thread chathuraka.waas
hi,

i'm trying to open a modal window on page load to show some information to
the user. i found this link specifying how to create a modalwindow class
that gives this behavior.

https://cwiki.apache.org/confluence/display/WICKET/Modal+Windows

but in wicket 6 getWindowOpenJavascript() method is not avialble. 

how can i achieve this in wicket 6. 

Thanks in advance. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Opening-a-Modal-window-on-page-load-in-Wicket-6-tp4666083.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: Opening a Modal window on page load in Wicket 6

2014-06-01 Thread chathuraka.waas
hi,

my bad the method is there. but now i'm getting a exception when creating
the modal window and from the stack trace its hard to figure out whats the
issue. 

here is my code. 

on page load. 

emailWarningModalWindow = new
EmailWarningModalWindow((emailwarningModal));
add(emailWarningModalWindow);

public class EmailWarningModalWindow extends ModalWindow implements
IHeaderContributor {

public EmailWarningModalWindow(String id) {
super(id);
}

@Override
public void renderHead(IHeaderResponse response) {
   
response.render(JavaScriptHeaderItem.forScript(getWindowOpenJavaScript(),null));
}

@Override
protected boolean makeContentVisible() {
return true;
}
}

and her's the exception i'm getting,

org.apache.wicket.WicketRuntimeException: Error creating page for modal
dialog.
at
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.getWindowOpenJavaScript(ModalWindow.java:1082)
at
com.fanminder.merchant.app.programs.EmailWarningModalWindow.renderHead(EmailWarningModalWindow.java:26)
at org.apache.wicket.Component.renderHead(Component.java:4446)
at org.apache.wicket.Component.renderHead(Component.java:2704)
at
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85)
at
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
at
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
at
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:78)
at
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:57)
at
org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:170)
at
org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71)
at 
org.apache.wicket.Component.internalRenderComponent(Component.java:2551)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1494)
at org.apache.wicket.Component.internalRender(Component.java:2381)
at org.apache.wicket.Component.render(Component.java:2309)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390)
at 
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1555)
at org.apache.wicket.Page.onRender(Page.java:887)
at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:142)
at org.apache.wicket.Component.internalRender(Component.java:2381)
at org.apache.wicket.Component.render(Component.java:2309)
at org.apache.wicket.Page.renderPage(Page.java:1024)
at
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121)
at
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:274)
at
org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.fanminder.HibernateFilter.doFilter(HibernateFilter.java:24)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)