Bjørn Grønbæk | 9 Feb 21:59
Favicon
Gravatar

Very simple Wicket test to verify panel type...

Hi,

I'm just starting out with Wicket and WicketTester...

I have a page that adds one of several panels, depending of its
PageParameter. I would like to verify that behaviour with WicketTester...
but how to?

The code is something like this:

        String type = null;
        Panel p = null;

        if(getPageParameters() != null)
            type = getPageParameters().getString("BRAND_TYPE");

        if(type != null && type.equals("BRAND"))
            p = new PanelA(id);
        else
            p = new PanelB(id);
         add(p);

I've tried something like this:

wicketTester.startPage(CreatePage.class);
wicketTester.assertRenderedPage(CreatePage.class);
wicketTester.assertComponent(":panelid",PanelA.class);

but that doesn't work. The test fails with this message:
junit.framework.AssertionFailedError: component 'CreatePage' is not
(Continue reading)

mukesh kumar | 9 Feb 18:18
Picon
Gravatar

wicket and javascript

Hi,
  In my wicket application, for session timeout, i have used .js(javascript)
file. And i am showing timeout message  from alert tag in .js file. And add
this file to my all html page; its working fine.
                   But my problem is, for internationalization, i want to
show that alert message from properties file. i tried, but unable to find
solutions. My project is going on deadline, so please help me, and give me
the solutions ASAP. 
Thanks !

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-and-javascript-tp4373587p4373587.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> wicket.apache.org
For additional commands, e-mail: users-help <at> wicket.apache.org

rene | 9 Feb 17:49
Gravatar

StatelessForm: Cannot login

Hello,

I have a strange problem with StatelessForms in combination with login in:
On my MainPage are two stateless forms. One for registration and one for the
login (registration isn't implemented yet). When I try to log in, Wicket
creates a new User() and saves it in the Session (I made this like it's
explained in Wicket in Action). A System.out.print("user created") in the
constructor of User confirms that. Everything seems to be ok. But when the
main page reloads, I am still logged out. 
And: When I change from StatelessForm to Form, everything works perfectly.
Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to /login. There
is the same LoginPanel (with StatelessForm) as on the main page - and the
login works! But when I directly open /login it's the same as on the main
page and I can't login.
I also noticed that the login works (with StatelessForm) when I open a page
that requires authorization, then press the back button (back to main page)
and there try to log in.

The question is now, what am I doing worng? I can't find the problem in my
code, I have been trying a lot to find out what's worng but everything seems
to be correct. I couldn't find anything in the mailing list / on the web, I
searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't speak english
natively.)
(Continue reading)

cosmindumy | 9 Feb 14:42
Picon
Favicon

call a javascript

Hello again,
I want to call a javascript when a java event. Actually on method mymethod()
from my button I want to set a javascript and the first time the button is
rerendered to call it. 
How can I do this?
Thanks 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/call-a-javascript-tp4372863p4372863.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> wicket.apache.org
For additional commands, e-mail: users-help <at> wicket.apache.org

nino martinez wael | 9 Feb 14:27
Picon
Gravatar

[1.5.4] addorReplace and then later visitor in same request

Hi I

have a problem where I first call addOrReplace on a components parent (in
this case it replaces).

And later in the same request I do this:
ComponentHierarchyIterator visitChildren = this.getPage()
.visitChildren(FeedbackPanel.class);

However when the visitor above runs, it complains about that one of the
components haven't got a page.

org.apache.wicket.WicketRuntimeException: No Page found for component
[ [Component id = saveButton]]
     at org.apache.wicket.Component.getPage(Component.java:1765)
     at com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.addAllFeedbackPanels(TriggerSchedulePanel.java:1051)
     at com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.cannotRefreshFeedbackIfOutSideConfig(TriggerSchedulePanel.java:1047)
     at com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.onSubmit(TriggerSchedulePanel.java:1033)
     at org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:103)
     at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1.onSubmit(AjaxFormSubmitBehavior.java:172)
     at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1154)
     at org.apache.wicket.markup.html.form.Form.process(Form.java:838)
     at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
     at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:158)
     at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
     at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:316)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
     at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
     at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:255)
(Continue reading)

vov | 9 Feb 14:15
Picon
Gravatar

JQWicket BlockUIBehavior does not work after target.addComponent()

Hi All,

Simple example:
---------------------------------------------------------------------------------
    final BlockUIBehavior blockBehavior = new BlockUIBehavior();
    final Form<Void> form = new Form<Void>("form");
    AjaxButton ajaxButton = new AjaxButton("block")
    {
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> ajaxForm)
      {
        target.addComponent(form); //(1)
        blockBehavior.unblock(target);
      }
    };

form.add(ajaxButton.add(JQBehaviors.mouseClick(blockBehavior.block(form))));
    add(form.add(blockBehavior));
---------------------------------------------------------------------------------
BlockUIBehavior works only first time. 
On the second click to the button - nothing happens.

If remove (1) then it works without problems.

Does anybody know the reason of the problem and possible workaround?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/JQWicket-BlockUIBehavior-does-not-work-after-target-addComponent-tp4372781p4372781.html
Sent from the Users forum mailing list archive at Nabble.com.

(Continue reading)

nino martinez wael | 9 Feb 14:14
Picon
Gravatar

HTML5 & offline storage

Hi

Have any of you tried using wicket with HTML 5 offline mode, and somehow
resynching data when coming online?

regards Nino
Matt | 9 Feb 14:12
Favicon
Gravatar

Problem DatePicker, ModalWindow and IE8

Hi everybody,

I've got some issue about the DatePicker.

I'm using Wicket 1.4.17 with wicket extension 1.4.17 as well.

I'v got a modal window, with a form and inside a datetextfield with a
datepicker. Everything is working fine with firefox but not with IE8.

In fact, i can display the calendar when i click on the calendar icon, i can
select a day (which closes the datepicker), but i can't close it with the
close button nor change the current month displayed ... . 

When i put my mouse over one of those buttons (close or change month), i
don't have the "pointer" cursor and when i click it does nothing.

I don't have any javascript error neither.

I tried the datepicker on IE8 but not in a modal window, and it's working.

The only thing that succeded, is that a changed the css attribute "position"
of the close button (set to "relative"), and then i can click the button but
the style is broken and i the the text "Close" above the image in backround
(tried to fix the style then but it's a pain in the ass).

Here is some of my code : 

/<form wicket:id="modalForm">
      <div wicket:id="modal"></div>
  </form>/
(Continue reading)

N. Metzger | 9 Feb 02:46
Favicon
Gravatar

wizard starting background task

Hi all,

I'm looking for hints to realize the following scenario:

I have a wizard gathering data. On finish the wizard kicks off a background
task that uses the aforementioned data. On clicking "finish" I would like to
open a new page or even a modal widow that displays a progress bar while the
background task is executing. So far the only working solutions I found are:
1) I start the background task in a lazy load panel, but haven't figured out
yet how to display a progress bar while the lazy load is executing.
2) Open new page and add a form that displays another button to the user
that kicks off the background task. I would really like to avoid the extra
form and button, the finish button of the wizard should be able to do it.

Thanks for your help,

Natalie

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4371604.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> wicket.apache.org
For additional commands, e-mail: users-help <at> wicket.apache.org

Evan Sable | 8 Feb 18:55
Gravatar

continueToOriginalDestination seems to be incorrectly retaining destination across multiple logins

Hi,

I'm using wicket 1.5-SNAPSHOT along with Shiro for
authentication/authorization security, and when an unauthorized user tries
to go to a page, Shiro calls redirectToInterceptPage behind the scenes, and
during the login process, after a successful login, there is code that says:

if (!continueToOriginalDestination()) {

       setResponsePage(getApplication().getHomePage());

}

It is working in the sense that if a user gets redirected to login, they are
taken to the correct destination afterwards, and if a user just clicks the
login link in a new browser they are redirected to the homepage after login.

BUT, the problem is, if an initial user tries to go to a protected page,
gets redirected to the login, logs in, and then logs out, and then, without
closing the browser, clicks the login link and logs in with the same user
again or even another user, it still redirects to the prior "original"
destination, which should no longer take effect.  I would think that this
should be forgotten upon logging out, which replaces the wicket session
with:

Session session = Session.get();

session.replaceSession();

I think I must be misunderstanding how continueToOriginalDestination is
(Continue reading)

brazz | 8 Feb 15:53
Picon
Gravatar

WicketTester functionalities

After working successfully with wicket for some time, I'm now trying ot set
up regression tests with fitnesse and the help of WicketTester functionality
or in combination with selenium if functionality of WicketTester does not
fulfill my needs (probably i won't do it with selenium as i already tried
and fought with the productivity problems that came along).

Here a few questions on WicketTester functionality:
- Is it possible to assert that a e.g. pdf/excel/tiff download succeeded?
- Is it possible to assert that a e.g. pdf/excel/tiff download succeeded
after click e.g. on a custom DefaultDataTable?
- Is it possible to simulate paging and assert results on a DataTable after
paging?

I had a look on the Basic WicketTester classes and "enhancedwickettester"
but couldn't find any classes that are capable of doing this.

Any hints on other testing strategies would also be appreciated.

Thanks in advance!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketTester-functionalities-tp4369673p4369673.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> wicket.apache.org
For additional commands, e-mail: users-help <at> wicket.apache.org


Gmane