question form-usage / setDefaultModelObject(...) vs. getDefaullModel().setObject(...)

2014-02-17 Thread Patrick Davids
Hi all,
I have a question concerning the difference between 
Component#setDefaultModelObject(final Object object) and 
getDefaultModel().setObject(object), like described in javadoc

/**
  * Sets the backing model object. Unlike 
codegetDefaultModel().setObject(object)/code, this
  * method checks authorisation and model comparator, and invokes 
codemodelChanging/code and
  * codemodelChanged/code if the value really changes.
...


The default model comparator uses equals, to determine changes of the model.

My question is, why setDefaultModelObject checks that?

We often ran into problems when a form saves an new object, because in 
our programming model, we do not implement the persistence id into our 
equals, and when we write the onSubmit()-ed saved model into the form 
back, our model is not getting the fresh state (with id).
(for us, its still equal, and we want it like this, but next clicks or 
savings create duplicate entry errors on database side)

Yes, we can use form.getDefaultModel().setObject(object), but this often 
leads in bugs, because you easily forget it;  setDefaultModelObject() is 
such a standard.

My first thought, on finding the method setModelObject of the form 
itself, was: ah, this is the feature method, really changing the object, 
but on a second look

setModelObject() of the form also just delegates to 
component.setDefaultModelObject(), rather then 
getDefaultModel().setObject().

Could someone explain why is it like it is?
May I do not see the clue...

Is it really wanted by wickets way of usage, calling 
getDefaultModel().setObject(object) if someone want to change the model 
of a form without equal-checks?

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



Re: getting values from FormComponentPanel outside form.onSubmit()

2014-02-17 Thread lucast
Hi Sven and Richter,
Thank you for your replies.

What I am trying to achieve is a refreshing view, with fields that are
editable, and rows that can be removed, as shown on  Wicket Examples -
Repeaters - Contacts Editor - based on the previous example, but with
editable values
http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage?1
  

But in addition to those functionality, have one of having the list being
expandable instead of just contractile. 

That would be inside a form, with other fields, that's why I have been
setting the AjaxSubmitLink.setDefaultFormProcessing( false ).

I am making use of FormComponentPanel.onEvent(), as suggested, but the only
way to get the values from text fields is by using TextField.getInput(). 

TextField.getConvertedInput() will return null unless it is done via form
submit. Maybe I am missing something.

Thanks,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462p4664498.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



Is Wiki page down

2014-02-17 Thread arkady
Hi, 

I am trying https://cwiki.apache.org/confluence/display/WICKET/
but it doesn't work.

Can you help, please ?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-Wiki-page-down-tp4664497.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: Is Wiki page down

2014-02-17 Thread Martin Grigorov
http://monitoring.apache.org/status/

Confluence Wiki is red.
Be patient.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 17, 2014 at 10:53 AM, arkady prince_from_no...@hotmail.comwrote:

 Hi,

 I am trying https://cwiki.apache.org/confluence/display/WICKET/
 but it doesn't work.

 Can you help, please ?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Is-Wiki-page-down-tp4664497.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




DP for GUI interaction

2014-02-17 Thread Farrukh SATTOROV
what design pattern you use for interaction between gui components in
wicket. For instance, showing modal window from toolbar, manipulating with
table fom another panel, first of all in presentation tier.

-- 
Regards, Farrukh


setting visibility of a component decocorated with a behavior

2014-02-17 Thread Simon B
Hi, 

I have a behavior that decorates the component that it is added to by
using beforeRender(Component) and afterRender(Component).

So a simplified version of my behavior would be



I wish for the visibility of the surrounding html that is written to be
driven by the visibility of the component that it wraps including when the
component that it wraps is sent to the client in an AjaxRequestTarget.

What would be the best way to do this?

Any suggestions very much appreciated.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511.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: DP for GUI interaction

2014-02-17 Thread Richter, Marvin
It depends ...
I'm a big fan of loose coupling so I do almost all interaction between 
components with AJAX events.
For this you just override the onEvent method in your panels which should react 
on AJAX events.

Check out:
http://www.wicket-library.com/wicket-examples/events/wicket/bookmarkable/org.apache.wicket.examples.events.DecoupledAjaxUpdatePage

Best Regards,
Marvin 

-Original Message-
From: Farrukh SATTOROV [mailto:fireda...@gmail.com] 
Sent: Monday, February 17, 2014 4:37 PM
To: users@wicket.apache.org
Subject: DP for GUI interaction

what design pattern you use for interaction between gui components in wicket. 
For instance, showing modal window from toolbar, manipulating with table fom 
another panel, first of all in presentation tier.

--
Regards, Farrukh

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



Re: DP for GUI interaction

2014-02-17 Thread Farrukh SATTOROV
thanks for reply, Marvin


On Mon, Feb 17, 2014 at 7:43 PM, Richter, Marvin 
marvin.rich...@jestadigital.com wrote:

 It depends ...
 I'm a big fan of loose coupling so I do almost all interaction between
 components with AJAX events.
 For this you just override the onEvent method in your panels which should
 react on AJAX events.

 Check out:

 http://www.wicket-library.com/wicket-examples/events/wicket/bookmarkable/org.apache.wicket.examples.events.DecoupledAjaxUpdatePage

 Best Regards,
 Marvin

 -Original Message-
 From: Farrukh SATTOROV [mailto:fireda...@gmail.com]
 Sent: Monday, February 17, 2014 4:37 PM
 To: users@wicket.apache.org
 Subject: DP for GUI interaction

 what design pattern you use for interaction between gui components in
 wicket. For instance, showing modal window from toolbar, manipulating with
 table fom another panel, first of all in presentation tier.

 --
 Regards, Farrukh

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




-- 
Regards, Farrukh


How to start Wizard with an active step? / Best practise?

2014-02-17 Thread Patrick Davids
Hi all,
what is the best way to start a Wizard in a particular step?

I tried:
- to override onInit of WizardStep and setting this to activeStep, when 
the state is the right one, but init() of WizardModel always determines 
the next step after me (the current active), so this seems not to be a 
good way. I could set the prevoius, but this is quite faked.

- to implement a condition; state is determined correct, but than all 
buttons are deactive, hmm...

- manually setting setActiveStep() after init of WizardModel, but this 
needs to unpack model object to construction time to evaluate my state 
on my own (but it worked as expected).

Did I miss something? Or is the third implementation the best trade-off?

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



how to create editable spreadsheet

2014-02-17 Thread Farrukh SATTOROV
how to create spreadsheet (with editable cell), what kind of repeaters is
good choice in this case ?

-- 
Regards, Farrukh


Re: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Igor Vaynberg
see

IAjaxRegionMarkupIdProvider

-igor

On Mon, Feb 17, 2014 at 7:37 AM, Simon B simon.bott...@gmail.com wrote:
 Hi,

 I have a behavior that decorates the component that it is added to by
 using beforeRender(Component) and afterRender(Component).

 So a simplified version of my behavior would be



 I wish for the visibility of the surrounding html that is written to be
 driven by the visibility of the component that it wraps including when the
 component that it wraps is sent to the client in an AjaxRequestTarget.

 What would be the best way to do this?

 Any suggestions very much appreciated.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511.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: how to create editable spreadsheet

2014-02-17 Thread Martin Grigorov
Hi,

Any repeater will do it.
The magic is in the JavaScript.
Better reuse some JavaScript solution like http://handsontable.com/

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 17, 2014 at 7:39 PM, Farrukh SATTOROV fireda...@gmail.comwrote:

 how to create spreadsheet (with editable cell), what kind of repeaters is
 good choice in this case ?

 --
 Regards, Farrukh



Re: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Simon B
Hi Igor, 

Wow, that is *exactly* what I wanted, just tried it and it worked perfectly.

Thank you

Simon

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511p4664518.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 start Wizard with an active step? / Best practise?

2014-02-17 Thread Paul Bors
We need to build the WizardModel in a dynamic way. Although I think there
is a better more dynamic step too that can be used here.

So one cheap solution is to keep an enum or some sort of a definition of
your wizard steps:
public static enum WizStep {
/** Step 1 of N */ STEP_ONE(1),
/** Step N of N */ STEP_N;
...

private int stepNum;

WizStep(int stepNum) {
this.stepNum = stepNum;
}

public int getNum() {
return this.stepNum;
}
}

Then extend the wizard and build the model starting at the given step like
so:
private class MyWizard extends Wizard {
private static final long serialVersionUID = 1L;

public MyWizard(String id, WizStep startStep) {
super(id);
setDefaultModel(ediPojoModel);

WizardModel model = new WizardModel();
if(WizStep.STEP_ONE.getNum() = startStep.getNum()) {
model.add(new FirstWiwardStep()});
}
// Keep adding the rest of the steps
...
if(WizStep.STEP_N.getNum() = startStep.getNum()) {
model.add(new NthStep());
}

init(model);
}
}

Maybe a better approach is to create your own parent intelligent wizard
step that will skip itself in the init() or onInit() method till it get to
the Active step then you could build your model as normal.

Have fun.




On Mon, Feb 17, 2014 at 12:21 PM, Patrick Davids 
patrick.dav...@nubologic.com wrote:

 Hi all,
 what is the best way to start a Wizard in a particular step?

 I tried:
 - to override onInit of WizardStep and setting this to activeStep, when
 the state is the right one, but init() of WizardModel always determines
 the next step after me (the current active), so this seems not to be a
 good way. I could set the prevoius, but this is quite faked.

 - to implement a condition; state is determined correct, but than all
 buttons are deactive, hmm...

 - manually setting setActiveStep() after init of WizardModel, but this
 needs to unpack model object to construction time to evaluate my state
 on my own (but it worked as expected).

 Did I miss something? Or is the third implementation the best trade-off?

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




Re: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Simon B
Igor, 

Incidentally the javadoc on that interface is awesome, thanks for taking the
time to make it so easily readable and understandable.

Cheers
Simon

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511p4664520.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: Error in Modal opening two diffrent instances of Wicket applicaiton.

2014-02-17 Thread eaglei22
Thanks Paul, I am using new sessions and the problem seems to be okay
locally, but not on the server. So I noticed that on the server (through the
access portal we use) it forces a new session per tab. So the original issue
with the modal window I thought I have found the session issue to be the
culprit, but now even running locally I am getting page expirations when
running locally. This happens on a page that I redirect to using a
setResponsePage, and while this is up, and I open a new application instance
inside of a new browser tab, the original tab's page expires right away.
What should I be looking at to make sure this doesn't happen. I have been
searching all over and I can't seem to find any real solutions to this
issue. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664521.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: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Igor Vaynberg
cheers

-igor

On Mon, Feb 17, 2014 at 1:53 PM, Simon B simon.bott...@gmail.com wrote:
 Igor,

 Incidentally the javadoc on that interface is awesome, thanks for taking the
 time to make it so easily readable and understandable.

 Cheers
 Simon

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511p4664520.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



Wicket Modals and Bootstrap Modals - sizing issues

2014-02-17 Thread Chris Colman
We are using Wicket with Bootstrap which is fine except for modal
window.

With Wicket it appears as though the modal window provides all the
markup for the out modal 'window'. We can provide HTML for the panels
within that but the outer modal seems to be Wicket generated.

This seems to be causing problems when using responsive Bootstrap
because the calculations of the grid sizes are based on the screen and
not the width of the modal window and so the form fields end up being
wider than the form itself.

Has anyone else had this problem? Is there a work around?

We're not using the Wicket 'enable bootstrap' flag in the settings as we
support bootstrap and non bootstrap markup within the same wicket app.

Regards,
Chris

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



Re: Wicket Modals and Bootstrap Modals - sizing issues

2014-02-17 Thread Martin Grigorov
Hi,

I think you will need to tweak some CSS rules.
Wicket's ModalWindow main CSS class is 'wicket-modal'. So you have to
provide CSS rule that sets the width for any .form-control in .wicket-modal.
You can either use LESS/SASS to generate different rules for the different
screens or with CSS media queries.

Martin Grigorov
Wicket Training and Consulting


On Tue, Feb 18, 2014 at 8:04 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 We are using Wicket with Bootstrap which is fine except for modal
 window.

 With Wicket it appears as though the modal window provides all the
 markup for the out modal 'window'. We can provide HTML for the panels
 within that but the outer modal seems to be Wicket generated.

 This seems to be causing problems when using responsive Bootstrap
 because the calculations of the grid sizes are based on the screen and
 not the width of the modal window and so the form fields end up being
 wider than the form itself.

 Has anyone else had this problem? Is there a work around?

 We're not using the Wicket 'enable bootstrap' flag in the settings as we
 support bootstrap and non bootstrap markup within the same wicket app.

 Regards,
 Chris

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