AW: Nested forms in WizardStep

2017-11-20 Thread Patrick Davids
Hi Dirk,
on selecting your radio choice, do an ajax request and disable your inner Login 
Form depending on the chosen value.

In this case, it won't be part of the form submit, which is executed by the 
wizard next click.

This also should happen after your login is done by your ajax button.
After login succeeded, just disable the inner login form, and the user should 
be able to proceed.

Patrick


Health AG| Patrick Davids | Softwareentwickler
Tel. +49 40 524 709-258 | p.dav...@healthag.de
Fax +49 40 524 709-258 |  www.healthag.de


EOS Health IT-Concept GmbH | Lübeckertordamm 1–3 | 20099 Hamburg | GmbH mit 
Sitz in Hamburg
HRB 127591, Amtsgericht Hamburg | Ust-IdNr.: DE289113521 | Geschäftsführer: 
Jens Törper, Uwe Schäfer

Save a tree – think before you print.
-Ursprüngliche Nachricht-
Von: Dirk Forchel [mailto:dirk.forc...@exedio.com]
Gesendet: Donnerstag, 16. November 2017 18:19
An: users@wicket.apache.org
Betreff: Nested forms in WizardStep

Currently we use the Wizard/WizardStep classes from wicket-extensions to set 
required data for an object (in our case a checkout process with some user 
Information, e.g. addresses etc.).
The first step contains a Login form with two "required" input components for 
the credentials and a separate "Login" button and a Panel with two ratio 
buttons where the user must decide whether to go on without login
(anonymous) or to register a new user account.
Only the values for the ratio buttons should be triggered by this step with the 
"next" button.
The Login itself should be triggered with the additional "login" button which 
is not part of the ButtonBar.

As far as I know it's not good to have nested forms. We don't need to have 
forms inside our steps actually, since the Wizard itself has a form already.
I've noticed that if the user hits the "next" button, the form validation for 
the login form ist triggered as well, but it should not. The form processing 
for the login form should actually not part of step, but the "login container" 
must be part of the view.

What is the best solution to implement this scenario? I implemented the step 
without an additional form component and used an AjaxButton. In 
AjaxButton#onSubmit I implemented the authentication stuff.  But further on I 
got some problems with updating the current state and how to go on to the next 
step.
Also I've noticed, that pressing the "next" button would require some input for 
the credentials. So I'm a bit confused now.
I hope, I could express myself clearly.

Could someone give me some hint? Thank you very much.


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



clearInput() if FormComponentPanel does not delegate to its inner FormComponents

2016-03-07 Thread Patrick Davids

Hi Wicket Pros,

is it bug or an feature, that FormComponentPanel is not overriding 
clearInput() to delegate the clearing to its inner FormComponents?


For me, it should behave the same way, when extending FormComponent.
But I'm not sure here about consequences...

(As I can see... Form.clearInput() features this by visiting its inner 
FormComponents.)


kind regards
Patrick

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



adding FeedbackMessages in onBeforeRender()

2016-02-29 Thread Patrick Davids

Hi all,
is there any way to add a message when onBeforeRender() is called?

I have a behavior for a special use-case which does some checks and 
provides feedback to the user when a check is unsuccessfull.


But I get a
org.apache.wicket.WicketRuntimeException: Cannot modify component 
hierarchy after render phase has started (page version cant change then 
anymore)


I know this restriction... but I need this kind of check on render-time 
not on configure-time of the component due to visibility issues.


If someone has an idea how to fake "onBeforeRender()" some how to get my 
feedback message... this would be great.


Thanx and best regards
Patrick

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



Re: Use a Factory to create a Panel (Yay or Nay)?

2016-02-18 Thread Patrick Davids
> I have at times used factories and then found that they made some 
simply things more complicated


I agree... you will loose the feature to sub-class and override 
onConfigure() or onBeforeRender() of your components.


And what I also encountered using factories, when having sub-classed 
model-objects and you want to choose as specific component depending on 
the model-objects subclass, you run into the "unpack on construction 
time" issue, which is also not that good.


And if you want to use shared models for your components and forward 
your model to your via factory constructed component, you will get type 
safety warnings.


e.g. factoryMethod(IModel personModel){

if(personModel.getObject() instanceof Employee){
		return new EmployeePanel((IModel)personModel);//type safety 
warning

}else{
...
}

}

All this points are somehow "code smells" to me and from the experience 
of the last years I more and more agree with the "bad practice" not to 
use factories for components.


But I never used Spring / SpringFactories... maybe you wont run into the 
described issues... not sure here.


best regards
Patrick


Am 18.02.2016 um 10:12 schrieb Urbani, Edmund:

Hello,

I have at times used factories and then found that they made some simply
things more complicated. Eg. I could no longer simply override
isEnabled() or isVisible() methods to suit the page I was added the
component to. So I try to avoid factories for Wicket components now
unless I see a real advantage.

Kind regards,
  Edmund

On 02/18/2016 09:53 AM, Sven Meier wrote:

Hi,

I wouldn't use a factory for each and every component (e.g. label).
But any sufficiently large Wicket project will benefit from separating
it into separate parts which very light interdependencies only: a
plugin-based architecture.

If you're using Spring factories, you just have to take care that no
references to Spring beans leak into the components - something you
have easily with inner classes (as in the example listing 15 in the
Wicket guide).

Have fun
Sven


On 18.02.2016 09:01, Martin Grigorov wrote:

Hi,

I don't share the option in the guide.
Using factories when needed is perfectly fine.
Apache Isis uses factories to provide custom UI for almost any part
of the
Wicket viewer.
BrixCMS also uses factories to create tiles.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Feb 18, 2016 at 7:21 AM, Arjun Dhar  wrote:


Hi,
I have a bunch of Admin panels but i want to be able to override
them. The
issue is the pages obviously use "add(new SomeAdminPanel())";

To overcome this I was thinking or writing a Factory, that via can
create
the desired instance of the Panel and pass it to the Page. The factory
internally can use Spring to make this highly configurable.

however, I came across

https://ci.apache.org/projects/wicket/guide/6.x/guide/bestpractices.html#bestpractices_12

(Do not use factories for components)

... can anyone validate if I should let that stop me from doing what I
intend? Maybe Panels are an exception to this rule?!

thanks

-
Software documentation is like sex: when it is good, it is very, very
good; and when it is bad, it is still better than nothing!
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Use-a-Factory-to-create-a-Panel-Yay-or-Nay-tp4673622.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




--

Mit freundlichen Grüßen
Edmund Urbani
Liland IT Team

Email: edmund.urb...@lilandit.com

Liland IT GmbH ...does IT better
Tel: +43 463 220111
Fax: +43 463 220111-33
Tel(GER): +49 221 65028588

Find us at Facebook http://facebook.com/Lilandit
http://green-badges.com
http://iventcloud.com
http://Lilandit.com

 

Copyright © 2016, Liland IT GmbH

Diese Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese Email irrtuemlich
erhalten haben, informieren Sie bitte sofort den Absender und vernichten
Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe
dieser Mail ist nicht gestattet.

This email may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this email in
error) please notify the sender immediately and destroy this email. Any
unauthorised copying, disclosure or distribution of the material in this
email is strictly forbidden.




-
To unsu

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-15 Thread Patrick Davids

Hi Sven,

> Yes, the converted values haven't been written yet.

Does this objection have any consequences for my implementation?
For me, it semms it is working now... so I think, there is no need to me 
to additionally override


>  @Override
>  public void validate() {
>// validate nested convertedInput which is *not* yet written
>
>if (nestedFormComponent.getConvertedInput() ...) {
>  error(...);
>}
>  }

Should I pay any special attention for an unusual behavior?
Should I test a special case?
Whats the risk, leaving my impl. as it is?
Or am I quite save?

kind regards
Patrick

Am 12.02.2016 um 18:29 schrieb Sven Meier:

Hi again,

now I see what you meant:

Yes, the converted values haven't been written yet.
I was writing my example off the top of my head :). Validators won't
help here, you'll have to do validation by hand instead:

   PersonPanel extends FormComponentPanel {
 @Override
 protected void convertInput() {
   // converted input is just the current model object
   setConvertedInput(getModelObject();
 }

 @Override
 public void validate() {
   // validate nested convertedInput which is *not* yet written

   if (nestedFormComponent.getConvertedInput() ...) {
 error(...);
   }
 }

Regards
Sven


On 12.02.2016 18:17, Sven Meier wrote:

Hi Martin,

>The modelObject should be the one before the form submit,

it should be the same one which all nested formComponents are
changing. I can't think of a case where this shouldn't hold.

>Because Form#updateModels() is called after the conversion and
validations.
>By calling the line above you basically ignore the submitted parameters.

The containing 'normal' formComponents have written the parameters
into their models, which are changing properties of the 'main'
modelObject.

For the FormComponentPanel the following is a noop:
setConvertedInput(getModelObject());
...
updateModel();

I'm doing it this way, because the formComponentPanel hasn't anything
to convert actually, its model object stays the same.

Regards
Sven


On 12.02.2016 17:44, Martin Grigorov wrote:

Hi Sven,


On Fri, Feb 12, 2016 at 12:08 PM, Sven Meier  wrote:


Hi,


Is it a good idea to implement such a case extending
FormComponentPanel,

or is FormComponentPanel for other purposes?

usuallly a FormComponentPanel is used when you want to combine the
input
of several formComponents into a single model object, e.g.
MultiFileUploadField and DateTimeField.

But you can also use it for validation of whole model objects:

PersonPanel extends FormComponentPanel {
   protected void convertInput() {
 // converter input is just the current model object
 setConvertedInput(getModelObject();


The modelObject should be the one before the form submit, no? Because
Form#updateModels() is called after the conversion and validations.
By calling the line above you basically ignore the submitted parameters.
I am missing something in your idea. What is it?



   }
}

Form f = new Form(...);
PersonPanel personPanel = new PersonPanel(...)
personPanel.add(new XYValidator()); // <-- a validator that
validates the
'converted' person
f.add(personPanel);

Have fun
Sven




On 12.02.2016 11:17, Patrick Davids wrote:


Hi all,
I would like to implement some kind of modular form components.

So, a developer is able stick together a form to save e.g. person data
and adress data with different panels containing the particular needed
input fields (textfield, selectboxes etc).

Form f = new Form(...);
f.add(new PersonFormComponentPanel(...));
f.add(new AddressFormComponentPanel(...));

Both, PersonFormComponentPanel and AddressFormComponentPanel are
simple
panels, now, and it is working so far.

Now, I have a special use-case, which needs to add an
AbstractFormValidator to the form.

Not to bypass the inner required textfields validations of
PersonFormComponentPanel, I can implement
FormComponent[] getDependentFormComponents(){...}
of the AbstractFormValidator.

BUT, it requieres to return FormComponents, not simple panels.
So, my idea was, just changing the implementation of
PersonFormComponentPanel extends Panel to PersonFormComponentPanel
extends
FormComponentPanel, so the entire PersonFormComponentPanel acts as
FormComponent to be able to fullfill the FormComponent[]
getDependentFormComponents(){...} return value.

Unfortunately this is not working, and I dont know why...
My getInnerMostModel() of the PropertyResolver is always null and the
formcomponents model-update does not succeed / WicketRuntimeException.

Maybe it has something todo with the need to implement
setConvertedInput() / getConvertedInput() which is mentioned in the
javadoc
of FormComponentPanel?

I'm not sure about that... maybe someone can help here?

So... these are my questions:
Is it a good idea to implement such a

Re: How to get rid off Feedback Messages?

2016-02-12 Thread Patrick Davids

Hi Lorno,
I faced the same problem, and I only get this working by
overriding onDetach() and reading getFeedbackmessageModel() of my 
Feedbackpanels in combination with the Feedbackpanel.setMaxMessage(1).


FeedbackPanel f = new FeedbackPanel("feedback"){
@Override
protected void onDetach() {
		//to let setMaxMessages(1) work correct, we have to mark all other 
messages rendered,
		//otherwise they will be shown in sequence one-by-one as long as the 
user reloads the page


for(FeedbackMessage f : getFeedbackMessagesModel().getObject()){
f.markRendered();
}

super.onDetach();
}
}
f.setmaxMessage(1);

I'm not sure, why I have to do it, and if its a bug or feature or 
misunderstanding by me... but this works for me.


best regards
Patrick



Am 12.02.2016 um 15:24 schrieb Lorne Malvo:


I have a form with a large number of textfields I want to validate for
numerical input. However, if multiple fields fail validation, I want to
display only a single error message.

I'm using an AjaxSubmitLink to submit my form.

To avoid displaying multiple error messages when multiple textfields fail
validation, I figure I could just delete all FeedbackMessages generated
during form validation, and then register my own FeedbackMessage.
However, it seems a thing of impossibility to delete (or mark as rendered)
existing FeedbackMessages.

I'm trying to do this in an AjaxSubmitLink's onError() method like this:

FeedbackCollector collector = new FeedbackCollector(form);
for (FeedbackMessage fm : collector.collect()) {
fm.markRendered();
}

But that doesn't do the trick. The feeback messages are found, but marking
them as rendered doesn't prevent them from being displayed.
I also tried collector.collect().clear() but that also doesn't work.

I also tried to do the same thing by overriding the form's onValidate()
method and deleting the messages right after validation, but that also
doesn't work.

How to get rid off these damn things?  :)

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-get-rid-off-Feedback-Messages-tp4673577.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



SOLVED / Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Patrick Davids

Hi Sven,
thanx for your code-snippet.
Sometimes it is so easy...

Works perfect!

kind regards
Patrick

Am 12.02.2016 um 12:08 schrieb Sven Meier:

Hi,

 > Is it a good idea to implement such a case extending
FormComponentPanel, or is FormComponentPanel for other purposes?

usuallly a FormComponentPanel is used when you want to combine the input
of several formComponents into a single model object, e.g.
MultiFileUploadField and DateTimeField.

But you can also use it for validation of whole model objects:

PersonPanel extends FormComponentPanel {
   protected void convertInput() {
 // converter input is just the current model object
 setConvertedInput(getModelObject();
   }
}

Form f = new Form(...);
PersonPanel personPanel = new PersonPanel(...)
personPanel.add(new XYValidator()); // <-- a validator that validates
the 'converted' person
f.add(personPanel);

Have fun
Sven



On 12.02.2016 11:17, Patrick Davids wrote:

Hi all,
I would like to implement some kind of modular form components.

So, a developer is able stick together a form to save e.g. person data
and adress data with different panels containing the particular needed
input fields (textfield, selectboxes etc).

Form f = new Form(...);
f.add(new PersonFormComponentPanel(...));
f.add(new AddressFormComponentPanel(...));

Both, PersonFormComponentPanel and AddressFormComponentPanel are
simple panels, now, and it is working so far.

Now, I have a special use-case, which needs to add an
AbstractFormValidator to the form.

Not to bypass the inner required textfields validations of
PersonFormComponentPanel, I can implement
FormComponent[] getDependentFormComponents(){...}
of the AbstractFormValidator.

BUT, it requieres to return FormComponents, not simple panels.
So, my idea was, just changing the implementation of
PersonFormComponentPanel extends Panel to PersonFormComponentPanel
extends FormComponentPanel, so the entire PersonFormComponentPanel
acts as FormComponent to be able to fullfill the FormComponent[]
getDependentFormComponents(){...} return value.

Unfortunately this is not working, and I dont know why...
My getInnerMostModel() of the PropertyResolver is always null and the
formcomponents model-update does not succeed / WicketRuntimeException.

Maybe it has something todo with the need to implement
setConvertedInput() / getConvertedInput() which is mentioned in the
javadoc of FormComponentPanel?

I'm not sure about that... maybe someone can help here?

So... these are my questions:
Is it a good idea to implement such a case extending
FormComponentPanel, or is FormComponentPanel for other purposes?

How can I achieve the binding of the dependend formcomponents to the
AbstractFormValidator, without exposing the inner formcomponents of
the PersonFormComponentPanel by providing a method like
PersonFormComponentPanel.getAllInnerFormComponents()?

Am I able to keep the idea of extending FormComponentPanel by
implementing getConvertedInput(), but how to to that right?

Thanx a lot for help
kind regards
Parick

-
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



Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Patrick Davids

Hi all,
I would like to implement some kind of modular form components.

So, a developer is able stick together a form to save e.g. person data 
and adress data with different panels containing the particular needed 
input fields (textfield, selectboxes etc).


Form f = new Form(...);
f.add(new PersonFormComponentPanel(...));
f.add(new AddressFormComponentPanel(...));

Both, PersonFormComponentPanel and AddressFormComponentPanel are simple 
panels, now, and it is working so far.


Now, I have a special use-case, which needs to add an 
AbstractFormValidator to the form.


Not to bypass the inner required textfields validations of 
PersonFormComponentPanel, I can implement

FormComponent[] getDependentFormComponents(){...}
of the AbstractFormValidator.

BUT, it requieres to return FormComponents, not simple panels.
So, my idea was, just changing the implementation of 
PersonFormComponentPanel extends Panel to PersonFormComponentPanel 
extends FormComponentPanel, so the entire PersonFormComponentPanel acts 
as FormComponent to be able to fullfill the FormComponent[] 
getDependentFormComponents(){...} return value.


Unfortunately this is not working, and I dont know why...
My getInnerMostModel() of the PropertyResolver is always null and the 
formcomponents model-update does not succeed / WicketRuntimeException.


Maybe it has something todo with the need to implement 
setConvertedInput() / getConvertedInput() which is mentioned in the 
javadoc of FormComponentPanel?


I'm not sure about that... maybe someone can help here?

So... these are my questions:
Is it a good idea to implement such a case extending FormComponentPanel, 
or is FormComponentPanel for other purposes?


How can I achieve the binding of the dependend formcomponents to the 
AbstractFormValidator, without exposing the inner formcomponents of the 
PersonFormComponentPanel by providing a method like 
PersonFormComponentPanel.getAllInnerFormComponents()?


Am I able to keep the idea of extending FormComponentPanel by 
implementing getConvertedInput(), but how to to that right?


Thanx a lot for help
kind regards
Parick

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



Re: Question to DataTable and ReuseIfModelsEqualStrategy

2015-12-17 Thread Patrick Davids

Hi Sven,

> Why are you refreshing the whole table instead of a single row only?
At the end of the table is a ButtomToolBar calculating sums of all rows.
(the Spinner is for changing amounts / prices for an item in the rows)

How can I refresh a single row? This would help a bit (than, later, I 
could refresh the BottomToolBar by wickets event bus).


But I'm in a AbstractColumn...
@Override
public void populateItem(Item> cellItem, String 
componentId, final IModel rowModel) {

...
}
I don't have access to the row.

Patrick


Am 17.12.2015 um 10:40 schrieb Sven Meier:

Hi,

 >Is it quite save to use the ReuseIfModelsEqualStrategy?
 >What are the pitfalls using it?

as long as you follow the instructions in its JavaDoc I see no problem
in using this strategy.

Why are you refreshing the whole table instead of a single row only? If
you did the latter, you won't get ComponentNotFoundExceptions either.

Have fun
Sven



On 17.12.2015 09:35, Patrick Davids wrote:

Hi all,
I have a problem with an ComponentNotFoundExceptions when multiple
ajax-request are fired with refreshing components and I fixed it using
a ReuseIfModelsEqualStrategy in my refreshing DataTable.

But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.

This is my case:
Panel
DataTable
(rows with columns)
Spinner with ajax-request refreshing the DataTable on
change/spin


The Spinner has an AjaxChannel.QUEUE not too loose any data, when the
user does multiple fast clicks.

Now the problem:
If the user is very fast with the mouse and uses the Spinner of the
next row in the DataTable, while the previous Spinner is still working
on its AjaxChannel.QUEUE and always refreshes the DataTable I run into
ComponentNotFoundExceptions, when the first click of the next used
Spinner is occuring.

Using ReuseIfModelsEqualStrategy for the DataTable, it is working,
because the Items and componenents are reused.

I never used the ReuseIfModelsEqualStrategy before and while reading
the javadoc, I am not sure about the equals() details and if I
understood it really, really right.

Is it quite save to use the ReuseIfModelsEqualStrategy?
What are the pitfalls using it?

Thanx for any feedback and know-how!

kind regards
Patrick

-
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



Question to DataTable and ReuseIfModelsEqualStrategy

2015-12-17 Thread Patrick Davids

Hi all,
I have a problem with an ComponentNotFoundExceptions when multiple 
ajax-request are fired with refreshing components and I fixed it using a 
ReuseIfModelsEqualStrategy in my refreshing DataTable.


But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.

This is my case:
Panel
DataTable
(rows with columns)
Spinner with ajax-request refreshing the 
DataTable on change/spin


The Spinner has an AjaxChannel.QUEUE not too loose any data, when the 
user does multiple fast clicks.


Now the problem:
If the user is very fast with the mouse and uses the Spinner of the next 
row in the DataTable, while the previous Spinner is still working on its 
AjaxChannel.QUEUE and always refreshes the DataTable I run into 
ComponentNotFoundExceptions, when the first click of the next used 
Spinner is occuring.


Using ReuseIfModelsEqualStrategy for the DataTable, it is working, 
because the Items and componenents are reused.


I never used the ReuseIfModelsEqualStrategy before and while reading the 
javadoc, I am not sure about the equals() details and if I understood it 
really, really right.


Is it quite save to use the ReuseIfModelsEqualStrategy?
What are the pitfalls using it?

Thanx for any feedback and know-how!

kind regards
Patrick

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



Re: Quetsion to nesting Forms and reflecting states of FormComponents after ajax refreshs

2015-11-20 Thread Patrick Davids

Hi both,
ticket opened and quickstart attached.

https://issues.apache.org/jira/browse/WICKET-6041

Concerning reuseing components.
Yes, the clearInput() works, but the refreshed components, does not know 
anything about another component, which changes something.
So, I got a dependency on behavior-semantic from one component to the 
other, I don't want to have.


Yes, wickets event bus can help here... but I currently vote for Martin 
point of view.


Patrick

Am 20.11.2015 um 17:02 schrieb Sven Meier:

 > When a nested form is submitted Wicket calls the processing methods
 > only for the nested form.
 > I don't see a reason why #inputChanged() should be an exception.

The outer form is not processed, because we don't want validation errors
to appear. #inputChanged() is called, so that on a possible render of
the whole page the input of the user is preserved.

 > it is very common to reuse components in Wicket

I'm shocked ;)

 > So a Panel with a Form could appear as a nested anywhere.
 > That is the main reason to support nested forms.

Yes, and it comes with a price. In most cases it's not necessary to
include a form in panels - generally I would advice against it:
- because "it's not supported in HTML"
- again, it comes with a price (see above)

Have fun
Sven




On 20.11.2015 16:47, Martin Grigorov wrote:

On Fri, Nov 20, 2015 at 4:37 PM, Sven Meier  wrote:


IMO the current behavior is wrong.


I don't see anything wrong with the current nested form handling.
Care to
elaborate?



The problem I see is that Wicket treats #inputChanged() differently than
all other Form processing methods (like #validate(), #on[In]Valid(),
#updateModel()).
When a nested form is submitted Wicket calls the processing methods only
for the nested form.
I don't see a reason why #inputChanged() should be an exception.




It's rather unusual to have to formComponents for the same model on a
single page.

IMHO Patrick shouldn't use nested forms in the first place, I consider
them an advanced feature.



Advanced or not, it is very common to reuse components in Wicket.
So a Panel with a Form could appear as a nested anywhere. That is the
main
reason to support nested forms.




Regards
Sven




On 20.11.2015 16:06, Martin Grigorov wrote:


OK. I see what happens.
At
org.apache.wicket.markup.html.form.Form#onFormSubmitted(org.apache.wicket.markup.html.form.IFormSubmitter)

Wicket calls #inputChanged() for the root form, so this calls
#inputChanged() on *all* FormComponents (including nested ones).
My first reaction is: this is a bug!
But then ... the purpose of the rawInput is to preserve the data
entered
by
the user. So if your #onSubmit() logic in the nested form / submitter
repaints the form components in the root/parent form then their data
would
be lost and the user will have to re-type it again.

It seems in both cases the application developer will have to do
something:
1) either clear the input manually (as now)
2) or update it manually when needed (by calling #inputChanged()
only on
the FormComponents in the rootForm).

IMO the current behavior is wrong.

Please create a bug with a quickstart.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Nov 20, 2015 at 3:51 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

Hi Martin,

this is true for my DropDownChoice2.
But DropDownChoice1 does not get validated.
So, this could be the reason why it is not cleared.

Now... I'm getting more and more confused... *lol*


Page
  Form A
  DropDownChoice1 displaying selected 'Car 1'
  Form B
  DropDownChoice2 displaying selected 'Car 1'

Patrick



Am 20.11.2015 um 15:32 schrieb Martin Grigorov:

Hi,


On Fri, Nov 20, 2015 at 3:22 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

Hi Sven,



using clearInput() works.
I call it in onConfigure() of my DropDownChoice.

Ok, so far... but I'm still confused about the raw-input-handling.

Ususally, (and thats what I have in mind): components reflect the
current
model objects state.

Whats the reason saving the raw-input and determining the selected
value
by raw-input and not by the model-objects value?


Wicket clears the rawInput

at org.apache.wicket.markup.html.form.FormComponent#valid().
FormComponent#valid() is called if the validation and conversion pass
successfully.
You can put a breakpoint and see what happens.



kind regards

Patrick


Am 19.11.2015 um 16:43 schrieb Sven Meier:

Hi Patrick,



so you have two components using the same model? Interesting.

Easiest solution would be to clear the rawInput on DropDownChoice1:

  choice1.clearInput();

If you don't have access to the dropDown from your submitting code,
you
might use component events to signal the car selection:

(Wicket events infrastructure)



https://ci.apache.org/proj

Re: Quetsion to nesting Forms and reflecting states of FormComponents after ajax refreshs

2015-11-20 Thread Patrick Davids

Hi Martin,
this is true for my DropDownChoice2.
But DropDownChoice1 does not get validated.
So, this could be the reason why it is not cleared.

Now... I'm getting more and more confused... *lol*


Page
Form A
DropDownChoice1 displaying selected 'Car 1'
Form B
DropDownChoice2 displaying selected 'Car 1'

Patrick


Am 20.11.2015 um 15:32 schrieb Martin Grigorov:

Hi,

On Fri, Nov 20, 2015 at 3:22 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi Sven,

using clearInput() works.
I call it in onConfigure() of my DropDownChoice.

Ok, so far... but I'm still confused about the raw-input-handling.

Ususally, (and thats what I have in mind): components reflect the current
model objects state.

Whats the reason saving the raw-input and determining the selected value
by raw-input and not by the model-objects value?



Wicket clears the rawInput
at org.apache.wicket.markup.html.form.FormComponent#valid().
FormComponent#valid() is called if the validation and conversion pass
successfully.
You can put a breakpoint and see what happens.




kind regards
Patrick


Am 19.11.2015 um 16:43 schrieb Sven Meier:


Hi Patrick,

so you have two components using the same model? Interesting.

Easiest solution would be to clear the rawInput on DropDownChoice1:

choice1.clearInput();

If you don't have access to the dropDown from your submitting code, you
might use component events to signal the car selection:

(Wicket events infrastructure)

https://ci.apache.org/projects/wicket/guide/6.x/guide/advanced.html#advanced_2


Have fun
Sven


On 19.11.2015 13:40, Patrick Davids wrote:


Hi Wicket Pros,

I have a quite special case here and a question concerning nested form
submits and FormComponent/Raw-Input Handling.

This is my component tree:

Page
  Form A
  DropDownChoice1 displaying selected 'Car 1'
  Form B
  DropDownChoice2 displaying selected 'Car 1'

The model-binding of both DropDownChoices pointing to the same member of
the model-object of the page.

This is my case and code flow:
- Someone uses DropDownChoice2 of Form B and changes the value to 'Car 2'
- Form B does a form submit
- Method onFormSubmitted(IFormSubmitter submitter) of Form A is also
called
- which calls inputChanged() of the DropDownChoice1 (by visiting /
iteration)
- so DropDownChoice1.inputChanged() reads and sets its rawInput to the
current displayed value 'Car 1'
- after form submit is done, an ajax refresh updates Form A
- DropDownChoice1 re-renders an runs through its appendOptionHtml()
- this reads getValue(), returning 'Car 1' from its previously saved
rawInput
- after the ajax refresh is finished, Form A shows the old selected 'Car
1' instead of 'Car 2'

Model-Object updates are working fine... but DropDownChoice1 does not
reflect it correct, due to the raw-input-handling.

Can someone help here, please?

Thanx a lot
kind regards
Patrick

-
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: Quetsion to nesting Forms and reflecting states of FormComponents after ajax refreshs

2015-11-20 Thread Patrick Davids

Hi Sven,

using clearInput() works.
I call it in onConfigure() of my DropDownChoice.

Ok, so far... but I'm still confused about the raw-input-handling.

Ususally, (and thats what I have in mind): components reflect the 
current model objects state.


Whats the reason saving the raw-input and determining the selected value 
by raw-input and not by the model-objects value?


kind regards
Patrick


Am 19.11.2015 um 16:43 schrieb Sven Meier:

Hi Patrick,

so you have two components using the same model? Interesting.

Easiest solution would be to clear the rawInput on DropDownChoice1:

   choice1.clearInput();

If you don't have access to the dropDown from your submitting code, you
might use component events to signal the car selection:

(Wicket events infrastructure)
https://ci.apache.org/projects/wicket/guide/6.x/guide/advanced.html#advanced_2


Have fun
Sven


On 19.11.2015 13:40, Patrick Davids wrote:

Hi Wicket Pros,

I have a quite special case here and a question concerning nested form
submits and FormComponent/Raw-Input Handling.

This is my component tree:

Page
 Form A
 DropDownChoice1 displaying selected 'Car 1'
 Form B
 DropDownChoice2 displaying selected 'Car 1'

The model-binding of both DropDownChoices pointing to the same member of
the model-object of the page.

This is my case and code flow:
- Someone uses DropDownChoice2 of Form B and changes the value to 'Car 2'
- Form B does a form submit
- Method onFormSubmitted(IFormSubmitter submitter) of Form A is also
called
- which calls inputChanged() of the DropDownChoice1 (by visiting /
iteration)
- so DropDownChoice1.inputChanged() reads and sets its rawInput to the
current displayed value 'Car 1'
- after form submit is done, an ajax refresh updates Form A
- DropDownChoice1 re-renders an runs through its appendOptionHtml()
- this reads getValue(), returning 'Car 1' from its previously saved
rawInput
- after the ajax refresh is finished, Form A shows the old selected 'Car
1' instead of 'Car 2'

Model-Object updates are working fine... but DropDownChoice1 does not
reflect it correct, due to the raw-input-handling.

Can someone help here, please?

Thanx a lot
kind regards
Patrick

-
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



--
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Südportal 1 • 22848 Norderstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Christian Capelle

HRB10145Pi | Amtsgericht Pinneberg

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



Re: Quetsion to nesting Forms and reflecting states of FormComponents after ajax refreshs

2015-11-19 Thread Patrick Davids

Hi Sven

> so you have two components using the same model? Interesting.
I didn't mentioned the details in my previous mail to reduce the 
description of the case.


Yes, its a shared model, because Form B is contained in a dialog.
And Form A comes from the Wizard (internal / needed for step transitions).

The dialog submits, closes and should refresh the underlying components 
on page.
Due to the structure of the page, I'm not able to put the dialog outside 
the wizard. Thats why I have the situation with nested form.


>choice1.clearInput();
Ok, I will try this.

Thanx so far...
Patrick


Am 19.11.2015 um 16:43 schrieb Sven Meier:

Hi Patrick,

so you have two components using the same model? Interesting.

Easiest solution would be to clear the rawInput on DropDownChoice1:

   choice1.clearInput();

If you don't have access to the dropDown from your submitting code, you
might use component events to signal the car selection:

(Wicket events infrastructure)
https://ci.apache.org/projects/wicket/guide/6.x/guide/advanced.html#advanced_2


Have fun
Sven


On 19.11.2015 13:40, Patrick Davids wrote:

Hi Wicket Pros,

I have a quite special case here and a question concerning nested form
submits and FormComponent/Raw-Input Handling.

This is my component tree:

Page
 Form A
 DropDownChoice1 displaying selected 'Car 1'
 Form B
 DropDownChoice2 displaying selected 'Car 1'

The model-binding of both DropDownChoices pointing to the same member of
the model-object of the page.

This is my case and code flow:
- Someone uses DropDownChoice2 of Form B and changes the value to 'Car 2'
- Form B does a form submit
- Method onFormSubmitted(IFormSubmitter submitter) of Form A is also
called
- which calls inputChanged() of the DropDownChoice1 (by visiting /
iteration)
- so DropDownChoice1.inputChanged() reads and sets its rawInput to the
current displayed value 'Car 1'
- after form submit is done, an ajax refresh updates Form A
- DropDownChoice1 re-renders an runs through its appendOptionHtml()
- this reads getValue(), returning 'Car 1' from its previously saved
rawInput
- after the ajax refresh is finished, Form A shows the old selected 'Car
1' instead of 'Car 2'

Model-Object updates are working fine... but DropDownChoice1 does not
reflect it correct, due to the raw-input-handling.

Can someone help here, please?

Thanx a lot
kind regards
Patrick

-
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



Quetsion to nesting Forms and reflecting states of FormComponents after ajax refreshs

2015-11-19 Thread Patrick Davids

Hi Wicket Pros,

I have a quite special case here and a question concerning nested form 
submits and FormComponent/Raw-Input Handling.


This is my component tree:

Page
Form A
DropDownChoice1 displaying selected 'Car 1'
Form B
DropDownChoice2 displaying selected 'Car 1'

The model-binding of both DropDownChoices pointing to the same member of 
the model-object of the page.


This is my case and code flow:
- Someone uses DropDownChoice2 of Form B and changes the value to 'Car 2'
- Form B does a form submit
- Method onFormSubmitted(IFormSubmitter submitter) of Form A is also called
- which calls inputChanged() of the DropDownChoice1 (by visiting / 
iteration)
- so DropDownChoice1.inputChanged() reads and sets its rawInput to the 
current displayed value 'Car 1'

- after form submit is done, an ajax refresh updates Form A
- DropDownChoice1 re-renders an runs through its appendOptionHtml()
- this reads getValue(), returning 'Car 1' from its previously saved 
rawInput
- after the ajax refresh is finished, Form A shows the old selected 'Car 
1' instead of 'Car 2'


Model-Object updates are working fine... but DropDownChoice1 does not 
reflect it correct, due to the raw-input-handling.


Can someone help here, please?

Thanx a lot
kind regards
Patrick

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



setDefaultModelObject() and IModelComparator

2015-10-13 Thread Patrick Davids

Hi wicket pros,
could someone please give some further details about the default 
implementation of IModelComparator of Component doing an a.equals(b) of 
the both model-objects (old.equals(new))?


I often run into this issue when calling setDefaultModelObject(), 
because my expectation is having the new model-object, not the old one.

In (possibly) 99% percent of my use-cases I expect this behavior.

(Especially, when using own equals implementations in model-objects, 
which are not checking for members and changes)


Whats the main reason for this equals check?
Why not using an IModelComparator.ALWAYS_FALSE as default implementation?

Thanx in advance for feedback!

kind regards
Patrick

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



Re: Components/Behaviour execution order

2015-09-30 Thread Patrick Davids

Hi Col.,
sometimes I try to cheat by using onBeforeRender() in such cases to 
'fake' an order, because its called after onConfigure().

But this has some restrictions concerning visibility issues of components.
But in simple dependencies this sometimes works for me.

I think somewhere in wickets jira is an issue for a similar problem, to 
feature defining a kind of order of behaviors.

Unfort. I'm not able to find it right away.

(@Sebastien: I think, we had such problem someday... do you remember maybe?)

best regards
Patrick

Am 01.10.2015 um 06:27 schrieb Colin Rogers:

Wicketeers,

This question is to do with lifecycle execution order - it's not a bug as such, 
just a usage question - I hope you can help.

I have component X with an AjaxFormComponentUpdatingBehavior, that triggers 
updates in Components Y and Z by adding to target.

Y has a generic Behaviour that updates it's data. Z needs to hide or show 
itself depending on Y's data state.

Y needs to use that generic Behaviour, as it's complex, does loads of stuff and 
is used throughout the system - so I can't change this.

Originally, in Z's onConfigure() we set the setVisible() depending on Y's 
state. But that doesn't work as Z's onConfigure() executes after Y's Behaviours 
onConfigure(). Which is just the way Component.configure() works. Which is fair 
enough.

So, I figured if Behaviours execute after onConfigure, I simply put the 
setVisible() code into a Behaviour on Z, and bingo!

Only Y's Behaviour always executes first. Always. Even if I create it second, 
even if I add Z to their parent container before Y. I can't work out how to 
affect the order of Components/Behaviour execution.

Note - I did extend the Y's Behaviour to update Z, but as Z has already 
completed its cycle, the state didn't actually update.

Can anyone help?

Cheers,
Col.
EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.




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



Re: Web Frameworks pool

2015-08-03 Thread Patrick Davids

Done, too :-)

Am 03.08.2015 um 17:29 schrieb Tobias Soloschenko:

Done :-)

Am 03.08.15 um 16:17 schrieb Andrea Del Bene:

Hi guys,

if you have 5 seconds to spare please vote this poll :).

Thank you.

Andrea.

http://www.surveygizmo.com/s3/2262144/Poll-Which-JVM-Web-Frameworks-Do-You-Use





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



--
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Südportal 1 • 22848 Norderstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Christian Capelle

HRB10145Pi | Amtsgericht Pinneberg

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



Re: Feedback Messages across Requests / Problem

2015-05-06 Thread Patrick Davids
Hm... yes, already thought about a similar solution, but I would like to 
avoid any custom feedback handlings. I like the way wicket does.


The only custom requierment I have is, just showing 1 message.

I think the problem I is more related to the "across requests" issue in 
combination with "ajax requests".


Any other ideas?

Am 05.05.2015 um 16:12 schrieb Ernesto Reinaldo Barreiro:

Store messages somewhere else? And on constructor check if there are any
and add them to the page?

On Tue, May 5, 2015 at 11:49 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi all,

I have have a quite complicated feedback message case here.
Could someone help me, please...

We only want to show a single feedback message.
No matter, how much errors a form validation procudes.

So, I use setMaxMessages(1) on the feedback panel.
To avoid having them all showed up one by one while clicking reload, I
implemented a FeedbackCollector and do a feedbackMessage.markAsRendered()
somewhere on detach().
(maybe someone remember my post some months ago ;-) )

This all works pretty good... but:

In a special case I need to use setResponsePage(getPage()) on an
AjaxRequest, instead of target.add(...).

To add feedback messages across requests, I have to use
Session.get().error("my error").

But on a ajax request, it seems there is a second detach() more when using
setResponsePage(), so my message will never get displayed, even when I used
Session.get().error(...).

I read about a redirect issue, when using setReponsePage() in ajax cases.

Does this redirect accidently marks my messages as rendered, caused by an
implicit second detach() (-> my own markAsRendered())?

Could some one confirm that? And if yes, is there any way to prevent it?

thanx and kind regards
Patrick

-
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



Feedback Messages across Requests / Problem

2015-05-05 Thread Patrick Davids

Hi all,

I have have a quite complicated feedback message case here.
Could someone help me, please...

We only want to show a single feedback message.
No matter, how much errors a form validation procudes.

So, I use setMaxMessages(1) on the feedback panel.
To avoid having them all showed up one by one while clicking reload, I 
implemented a FeedbackCollector and do a 
feedbackMessage.markAsRendered() somewhere on detach().

(maybe someone remember my post some months ago ;-) )

This all works pretty good... but:

In a special case I need to use setResponsePage(getPage()) on an 
AjaxRequest, instead of target.add(...).


To add feedback messages across requests, I have to use 
Session.get().error("my error").


But on a ajax request, it seems there is a second detach() more when 
using setResponsePage(), so my message will never get displayed, even 
when I used Session.get().error(...).


I read about a redirect issue, when using setReponsePage() in ajax cases.

Does this redirect accidently marks my messages as rendered, caused by 
an implicit second detach() (-> my own markAsRendered())?


Could some one confirm that? And if yes, is there any way to prevent it?

thanx and kind regards
Patrick

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



Re: Client side javascript listeners / HeaderItems / OnDomReadyHeaderItem

2015-04-15 Thread Patrick Davids

Hi Andrea,
thanx for your feedback...

Currently I'm researching more into AbstractDefaultAjaxBehaviors.

My javascript which should be executed with priority is an ajax-call.
So, it can be handled by Wicket itself.

I've seen the default event of an AbstractDefaultAjaxBehavior is a 
'ondomready', so that fits my needs.
Also IAjaxCallListeners are looking very good to me, to have the 
listener-feature.


Right now I'm facing the problem, how I can force my behavior beeing a 
singleton on page, but appling many IAjaxCallListeners to the 
updateAjaxAttributes() to support a list of success-handlers.


Patrick

Am 15.04.2015 um 12:17 schrieb andrea del bene:



On 15/04/2015 11:02, Patrick Davids wrote:

Hi all,

is there something included as feature in Wickets HeaderItems, what I
can use as kind of client-side javascript observer-listener pattern?

For instance... I have components which relies on a on-dom-ready
previous executed javascript, before the components internal
javascripts can be executed.

So, its a kind of mix of PriorityHeaderItem and OnDomReadyHeaderItem
and fire mechanism, when the scripts with priority has been
successfully executed.

I would like to implement this feature as behavior, so multiple
components on a page can have this pre-executed-javascript-behavior,
and listen for a javascript "execution done" event.

Have considered yet to use resource dependencies. You might create a
resource specifying which resource it depends on must be rendered first.
Than you can render it in your custom behavior. See chapter '16.6
Resource dependencies' of user guide.


This javascript-code should also applied to the page only once,
independently how often the behavior is added to my different
components on page.

I also need some sort of subscription code on javascript-side to get
notified.


To avoid multiple rendering of the same header item, class HeaderItem
uses method getRenderTokens to check if the item has already been
rendered. So if your heder item doesn't change (for example, the
javascript code is always the same) it won't be rendered more than once.


I already have some ideas to implement this, but would like to ask for
framework-features or other inspirations, best practices or ideas, first.

Thanx for feedback!
Patrick

-
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



Client side javascript listeners / HeaderItems / OnDomReadyHeaderItem

2015-04-15 Thread Patrick Davids

Hi all,

is there something included as feature in Wickets HeaderItems, what I 
can use as kind of client-side javascript observer-listener pattern?


For instance... I have components which relies on a on-dom-ready 
previous executed javascript, before the components internal javascripts 
can be executed.


So, its a kind of mix of PriorityHeaderItem and OnDomReadyHeaderItem and 
fire mechanism, when the scripts with priority has been successfully 
executed.


I would like to implement this feature as behavior, so multiple 
components on a page can have this pre-executed-javascript-behavior, and 
listen for a javascript "execution done" event.


This javascript-code should also applied to the page only once, 
independently how often the behavior is added to my different components 
on page.


I also need some sort of subscription code on javascript-side to get 
notified.



I already have some ideas to implement this, but would like to ask for 
framework-features or other inspirations, best practices or ideas, first.


Thanx for feedback!
Patrick

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



Re: FormComponentPanel and propagating model value to components

2015-04-08 Thread Patrick Davids

Hi,
quite unusal to me using a behavior to set a model.

Why dont you delegate to your inner textfiled by implementing an own 
setXYZModel()-method?


Or bind your inner textfield direct by providing a particular model in 
your Constructor of your custom MyFormComponentPanel?

And no onInitialize()-method...

public class MyFormComponentPanel extends FormComponentPanel {
  public MyFormComponentPanel(IModel myModel){
add(new TextField("id", myModel));
  }
}
(add generics if needed)


Patrick

Am 08.04.2015 um 09:27 schrieb mscoon:

Hi all,

I have a FormComponentPanel. Is it okay if I set its components models
using a behavior that overrides onConfigure() as below?

public class MyFormComponentPanel extends FormComponentPanel {

 protected void onInitialize() {
super.onInitialize();
 componentA = new TextField...
 componentA.add(new Behavior() {
  @Override
public void onConfigure(Component component) {
  componentA.setModel(...);
  }
 });
}

thanks




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



Re: AjaxRequests and middle mouse-clicks on links and buttons

2015-03-26 Thread Patrick Davids

Hi Martin,
I missed something.

We have a kind of own LinkComponent class here and someone in our team 
implemented an AjaxFallbackLink in the upper class hierarhcy, so 
currently we have a AjaxFallbackLink case here.

I didnt know that.

Thats the reason why I have a null AjaxRequestTarget.
Sorry, for giving a wrong hint here...

I removed the AjaxFallbackLink.

Now, the browser opens a new tab, with just having "javascript:;" as url.
(This also avoids the NPE issue mentioned in my previous mail.)

So, my question is reducing now to (and is not really wicket related 
anymore):

What the best practise to prevent a middle mouse click?

best regards
Patrick

Am 25.03.2015 um 18:25 schrieb Martin Grigorov:

Hi,

I don't use a mouse (and I have no one around) so I cannot test the use
case.
I cannot see how
org.apache.wicket.ajax.markup.html.form.AjaxButton#onSubmit(org.apache.wicket.ajax.AjaxRequestTarget,
org.apache.wicket.markup.html.form.Form)
or 
org.apache.wicket.ajax.markup.html.AjaxLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
would deliver null as a target.
The target is created
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#onRequest(). Put a
breakpoint there is see what happens.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 25, 2015 at 3:33 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi all,
I have a problem here, I would like to ask you for feedback.

I am not sure, if its more a jquery/js / wicket issue, so thanx in advance
for any brainstorming and hints.

Browsers often features the middle mouse button to open a link or button
in a new tab.
This is quite browser-specific, so I'm looking for the most independent
solution.

Clicking the middle mouse on a ajaxified Link or Button, the browser opens
a new tab and starts a usual request cycle.

This leads into wicket call e.g.
onClick(AjaxRequestTarget target)
but then the target parameter is null.
(I cannot use AjaxFallbackLinks in my case)

I'm able to handle this NPEs by implementing null-checks on every ajax
link.
Hmm... not the perfect solution.

So, I could try to prevent middle mouse clicks by a global javascript on
all pages.
I've seen several scripts, and here also it seems to be very
browser-specific (mousewheel, or not... event.which seem to differ and
so...).
Also, not my favorite solution, yet.

Then I thought about wicket solution. Is there any possible way?
I know about a IComponentOnConfigureListener, which can be used to have to
implement an application-wide onConfigure() for any component in page
hierarchy.
Is there something siilar e.g. IComponentOnAjaxRequestListener?
So I could implement some code there, checking for null and stop any
further code-calls on ajaxified wicket components, to avoid running into
NPEs in later code?

All these are my thoughts for now.

Thanx a lot for feedback...

kind regards
Patrick

-
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



AjaxRequests and middle mouse-clicks on links and buttons

2015-03-25 Thread Patrick Davids

Hi all,
I have a problem here, I would like to ask you for feedback.

I am not sure, if its more a jquery/js / wicket issue, so thanx in 
advance for any brainstorming and hints.


Browsers often features the middle mouse button to open a link or button 
in a new tab.
This is quite browser-specific, so I'm looking for the most independent 
solution.


Clicking the middle mouse on a ajaxified Link or Button, the browser 
opens a new tab and starts a usual request cycle.


This leads into wicket call e.g.
onClick(AjaxRequestTarget target)
but then the target parameter is null.
(I cannot use AjaxFallbackLinks in my case)

I'm able to handle this NPEs by implementing null-checks on every ajax link.
Hmm... not the perfect solution.

So, I could try to prevent middle mouse clicks by a global javascript on 
all pages.
I've seen several scripts, and here also it seems to be very 
browser-specific (mousewheel, or not... event.which seem to differ and 
so...).

Also, not my favorite solution, yet.

Then I thought about wicket solution. Is there any possible way?
I know about a IComponentOnConfigureListener, which can be used to have 
to implement an application-wide onConfigure() for any component in page 
hierarchy.

Is there something siilar e.g. IComponentOnAjaxRequestListener?
So I could implement some code there, checking for null and stop any 
further code-calls on ajaxified wicket components, to avoid running into 
NPEs in later code?


All these are my thoughts for now.

Thanx a lot for feedback...

kind regards
Patrick

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



Re: Wicket in web-fragments environment

2015-03-25 Thread Patrick Davids

Hi Martin,
while creating the quickstart the problem disappeared.
Its working.

I figured out, I had some wrong configurations in my m2e eclipse project 
specific settings while migration my project structure to web-fragments 
structure.
Due to that my classpatch settings were wrong and packaging of jars were 
incorrect. ;-)


kind regards
Patrick

Am 17.03.2015 um 10:47 schrieb Martin Grigorov:

Oh, right!

So /META-INF/web-fragment.xml and de.example.infrastructure.wicket.
MyWicketApplication are in the same .jar file ?
It seems the code at
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/http/ContextParamWebApplicationFactory.java#L64-L72
doesn't work in this case.
Please create a quickstart and attach it to a ticket in JIRA.
Thanks!



Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 17, 2015 at 11:24 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


I dont have a annotated WebFilter sub-class.

I just splitted my web.xml into fragments.
So, my web-fragment.xml looks like this.


http://java.sun.com/xml/ns/javaee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd";
  version="3.0"
  id="myApp">

 
 wicket.myapp
 org.apache.wicket.protocol.http.
WicketFilter
 
 applicationClassName
  de.example.infrastructure.wicket.
MyWicketApplication
 
 

 
 wicket.myapp
 /*
 




Patrick

Am 17.03.2015 um 10:10 schrieb Martin Grigorov:


Please share also the code of the @WebFilter class.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 17, 2015 at 11:01 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

  Hi Martin,

sorry, for delay...

This is the stacktrace.

kind regards
Patrick

Information: Starting Servlet Engine: Apache Tomcat/7.0.59
ERROR [WicketFilter] - The initialization of an application with name
'wicket.myapp' has failed.
org.apache.wicket.WicketRuntimeException: Unable to create application
of
class de.example.infrastructure.wicket.MyWicketApplication
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:86)
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:50)
  at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:387)
  at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:353)
  at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
ApplicationFilterConfig.java:279)
  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
ApplicationFilterConfig.java:260)
  at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:105)
  at org.apache.catalina.core.StandardContext.filterStart(
StandardContext.java:4854)
  at org.apache.catalina.core.StandardContext.startInternal(
StandardContext.java:5542)
  at org.apache.catalina.util.LifecycleBase.start(
LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1575)
  at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1565)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: de.example.infrastructure.
wicket.MyWicketApplication
  at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1720)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1571)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:72)
  ... 15 more
Mrz 17, 2015 8:22:57 AM org.apache.catalina.core.StandardContext
filterStart
Schwerwiegend: Exception starting filter wicket.myapp
javax.servlet.ServletException: org.apache.wicket.
WicketRuntimeException:
Unable to create application of class de.example.infrastructure.
wicket.MyWicketApplication
  at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:452)
  

Re: Wicket in web-fragments environment

2015-03-17 Thread Patrick Davids

> So /META-INF/web-fragment.xml and de.example.infrastructure.wicket.
> MyWicketApplication are in the same .jar file ?

Correct.

> It seems the code at ... doesn't work in this case.
Jepp, also have found this code part, and due to the mentioned 
bug-entry, my initial question "arises".


> Please create a quickstart and attach it to a ticket in JIRA.
Ok, but I think I am not able to do it before weekend.

Thanx so far...
Patrick

Am 17.03.2015 um 10:47 schrieb Martin Grigorov:

Oh, right!

So /META-INF/web-fragment.xml and de.example.infrastructure.wicket.
MyWicketApplication are in the same .jar file ?
It seems the code at
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/http/ContextParamWebApplicationFactory.java#L64-L72
doesn't work in this case.
Please create a quickstart and attach it to a ticket in JIRA.
Thanks!



Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 17, 2015 at 11:24 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


I dont have a annotated WebFilter sub-class.

I just splitted my web.xml into fragments.
So, my web-fragment.xml looks like this.


http://java.sun.com/xml/ns/javaee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd";
  version="3.0"
  id="myApp">

 
 wicket.myapp
 org.apache.wicket.protocol.http.
WicketFilter
 
 applicationClassName
  de.example.infrastructure.wicket.
MyWicketApplication
 
 

 
 wicket.myapp
 /*
 




Patrick

Am 17.03.2015 um 10:10 schrieb Martin Grigorov:


Please share also the code of the @WebFilter class.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 17, 2015 at 11:01 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

  Hi Martin,

sorry, for delay...

This is the stacktrace.

kind regards
Patrick

Information: Starting Servlet Engine: Apache Tomcat/7.0.59
ERROR [WicketFilter] - The initialization of an application with name
'wicket.myapp' has failed.
org.apache.wicket.WicketRuntimeException: Unable to create application
of
class de.example.infrastructure.wicket.MyWicketApplication
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:86)
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:50)
  at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:387)
  at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:353)
  at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
ApplicationFilterConfig.java:279)
  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
ApplicationFilterConfig.java:260)
  at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:105)
  at org.apache.catalina.core.StandardContext.filterStart(
StandardContext.java:4854)
  at org.apache.catalina.core.StandardContext.startInternal(
StandardContext.java:5542)
  at org.apache.catalina.util.LifecycleBase.start(
LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1575)
  at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1565)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: de.example.infrastructure.
wicket.MyWicketApplication
  at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1720)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1571)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at org.apache.wicket.protocol.http.
ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:72)
  ... 15 more
Mrz 17, 2015 8:22:57 AM org.apache.catalina.core.StandardContext
filterStart
Schwerwiegend: Exception starting filter wicket.myapp
javax.servlet.ServletException: org.apache.wicket.
WicketRuntimeException:
Unable to create application of class de.example.infrastructure.
wicket.MyW

Re: Wicket in web-fragments environment

2015-03-17 Thread Patrick Davids

I dont have a annotated WebFilter sub-class.

I just splitted my web.xml into fragments.
So, my web-fragment.xml looks like this.


http://java.sun.com/xml/ns/javaee";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd";

 version="3.0"
 id="myApp">


wicket.myapp

org.apache.wicket.protocol.http.WicketFilter

applicationClassName
		 
de.example.infrastructure.wicket.MyWicketApplication





wicket.myapp
/*





Patrick

Am 17.03.2015 um 10:10 schrieb Martin Grigorov:

Please share also the code of the @WebFilter class.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 17, 2015 at 11:01 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi Martin,
sorry, for delay...

This is the stacktrace.

kind regards
Patrick

Information: Starting Servlet Engine: Apache Tomcat/7.0.59
ERROR [WicketFilter] - The initialization of an application with name
'wicket.myapp' has failed.
org.apache.wicket.WicketRuntimeException: Unable to create application of
class de.example.infrastructure.wicket.MyWicketApplication
 at org.apache.wicket.protocol.http.ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:86)
 at org.apache.wicket.protocol.http.ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:50)
 at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:387)
 at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:353)
 at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
ApplicationFilterConfig.java:279)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
ApplicationFilterConfig.java:260)
 at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:105)
 at org.apache.catalina.core.StandardContext.filterStart(
StandardContext.java:4854)
 at org.apache.catalina.core.StandardContext.startInternal(
StandardContext.java:5542)
 at org.apache.catalina.util.LifecycleBase.start(
LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1575)
 at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1565)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: de.example.infrastructure.
wicket.MyWicketApplication
 at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1720)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(
WebappClassLoader.java:1571)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at org.apache.wicket.protocol.http.ContextParamWebApplicationFact
ory.createApplication(ContextParamWebApplicationFactory.java:72)
 ... 15 more
Mrz 17, 2015 8:22:57 AM org.apache.catalina.core.StandardContext
filterStart
Schwerwiegend: Exception starting filter wicket.myapp
javax.servlet.ServletException: org.apache.wicket.WicketRuntimeException:
Unable to create application of class de.example.infrastructure.
wicket.MyWicketApplication
 at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:452)
 at org.apache.wicket.protocol.http.WicketFilter.init(
WicketFilter.java:353)
 at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
ApplicationFilterConfig.java:279)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
ApplicationFilterConfig.java:260)
 at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:105)
 at org.apache.catalina.core.StandardContext.filterStart(
StandardContext.java:4854)
 at org.apache.catalina.core.StandardContext.startInternal(
StandardContext.java:5542)
 at org.apache.catalina.util.LifecycleBase.start(
LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1575)
 at org.apache.catalina.core.ContainerBase$StartChild.call(
ContainerBase.java:1565)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoo

Re: Wicket in web-fragments environment

2015-03-17 Thread Patrick Davids
re!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Mar 16, 2015 at 10:05 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi all,
does someone have some experiences concerning wicket and web-fragments?

I set up a project with two jars, having both a web-fragments.xml.

One of the web-fragments.xml defines a filter starting a
WicketApplication, but I run into a ClassNotFoundExceptions, while it gets
initilaized.

The WicketApplication sub-class class is contained in the jar, so I'm
wondering why its not working.

Are there any further classloader configurations I have to do in tomcat or
somewhere else?

(tested with wicket7)

kind regards
Patrick

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






--
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Südportal 1 • 22848 Norderstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Christian Capelle

HRB10145Pi | Amtsgericht Pinneberg

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



Wicket in web-fragments environment

2015-03-16 Thread Patrick Davids

Hi all,
does someone have some experiences concerning wicket and web-fragments?

I set up a project with two jars, having both a web-fragments.xml.

One of the web-fragments.xml defines a filter starting a 
WicketApplication, but I run into a ClassNotFoundExceptions, while it 
gets initilaized.


The WicketApplication sub-class class is contained in the jar, so I'm 
wondering why its not working.


Are there any further classloader configurations I have to do in tomcat 
or somewhere else?


(tested with wicket7)

kind regards
Patrick

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



Re: DataTable generics vs. IColumn generics

2015-03-09 Thread Patrick Davids

Hi Sven,
I did already implement it this way... and its working.

But my team members asked (more the client developers point of view), 
why the column-class itself is not a generic of Location, like this.


public class LocationColumn extends PropertyColumn {
...
}

At the current implementation they need to do
cols.add(new LocationColum(...));
instead of just
cols.add(new LocationColum(...));

Thats why I "forwarded" the question here, because I studied a bit the 
Column-Hierarchie code and also wondered about this strength coupling 
between T of ICellPopulator and T of rowModel and T of DataTable.



I suppose my team members see the PropertyColumn more like the usage of 
a PropertModel.
The generic of a PropertyModel is the type, which is returned by the 
expression.
The generic of a PropertyColumn is the DataTables generic / rowModel 
generic, not what its expression retrieves/returns/displays.


I think thats it...

As more as I think about this issue, maybe this could be a nice feature 
of PropertyColums.
Not to have a too strength coupling of what the column displays in the 
cell and what the data table shows.


kind regards
Patrick

Am 05.03.2015 um 18:43 schrieb Sven Meier:

Hi Patrick,

you can let your column implementation be generic:

  public class LocationColumn extends PropertyColumn {

  public LocationColumn(String expressionToLocation){
  super(Model.of("Location"), expressionToLocation);
  }

  @Override
  public void populateItem(Item> cellItem,
String componentId, IModel rowModel) {
  cellItem.add(new Label(componentId, new
LocationFormatModel((IModel)createDataModel(rowModel),
Model.of(Session.get().getLocale();
  }
  }

What do you need more?

Regards
Sven


Am 05.03.2015 um 15:34 schrieb Patrick Davids:

Hi Sven,
thanx for feedback.

Ok, how to implement the LocationColumn more reusable?
I dont want to be bound to a Datatable of Persons.

I'd like to have a Column which works with a Locations, independently
from which model-object the expression fetches the Location.

Is there any way to do that?

best regards
Patrick

Am 05.03.2015 um 15:19 schrieb Sven Meier:

Hi,

generic T is identical for the DataTable, and it's IColumns: it's the
type of the row models.

A column is responsible to provide a cell component for a row: For
DataTable only the input (e.g. Person) is interesting, the output
(Location) doesn't matter.

Your LocationColumn should extend PropertyColumn:

 public class LocationColumn extends PropertyColumn{

 public LocationColumn(String expressionToLocation){
 super(Model.of("Location"), expressionToLocation);
 }

 @Override
 public void populateItem(Item> cellItem,
String componentId, IModel rowModel) {
 cellItem.add(new Label(componentId, new
LocationFormatModel((IModel)createDataModel(rowModel),
Model.of(Session.get().getLocale();
 }
 }

Have fun
Sven

Am 05.03.2015 um 12:26 schrieb Patrick Davids:

Hi all,
whats the meaning of generic T on DataTables vs T of IColumn and T of
ICellPopulator?

As I understand its the type of object shown by the table rows.

Reading the javadoc of AbstractColumn it says T (if I understand
correct), its the type of object shown by the cell itself.

But DataTable and its internal list of columns are bound together.
T of both must be the same...

I tried to implement something like this, and here I get problems.


List> cols = new ArrayList<>();
cols.add(new PropertyColumn(Model.of("Name"), "name"));
(compiler error)
cols.add(new LocationColumn("location"));
(compiler error)

new DataTable("id", cols, new
ListDataProvider(), 50);


public class LocationColumn extends PropertyColumn{

public LocationColumn(String expressionToLocation){
super(Model.of("Location"), expressionToLocation);
}

  @Override
public void populateItem(Item> cellItem,
String componentId, IModel rowModel) {
cellItem.add(new Label(componentId, new
LocationFormatModel(rowModel, Model.of(Session.get().getLocale();
}
}

Also the Generic of ICellPopulator is bound to T of column.

I always thought it could be possible to implement sub-class columns
to allow special renderings of table-cells.

But how can I achieve this, if also ICellPopulator is bound to T of
the rowModel?

kind regards
Patrick

-
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 

Re: DataTable generics vs. IColumn generics

2015-03-05 Thread Patrick Davids

Hi Sven,
thanx for feedback.

Ok, how to implement the LocationColumn more reusable?
I dont want to be bound to a Datatable of Persons.

I'd like to have a Column which works with a Locations, independently 
from which model-object the expression fetches the Location.


Is there any way to do that?

best regards
Patrick

Am 05.03.2015 um 15:19 schrieb Sven Meier:

Hi,

generic T is identical for the DataTable, and it's IColumns: it's the
type of the row models.

A column is responsible to provide a cell component for a row: For
DataTable only the input (e.g. Person) is interesting, the output
(Location) doesn't matter.

Your LocationColumn should extend PropertyColumn:

 public class LocationColumn extends PropertyColumn{

 public LocationColumn(String expressionToLocation){
 super(Model.of("Location"), expressionToLocation);
 }

 @Override
 public void populateItem(Item> cellItem,
String componentId, IModel rowModel) {
 cellItem.add(new Label(componentId, new
LocationFormatModel((IModel)createDataModel(rowModel),
Model.of(Session.get().getLocale();
 }
 }

Have fun
Sven

Am 05.03.2015 um 12:26 schrieb Patrick Davids:

Hi all,
whats the meaning of generic T on DataTables vs T of IColumn and T of
ICellPopulator?

As I understand its the type of object shown by the table rows.

Reading the javadoc of AbstractColumn it says T (if I understand
correct), its the type of object shown by the cell itself.

But DataTable and its internal list of columns are bound together.
T of both must be the same...

I tried to implement something like this, and here I get problems.


List> cols = new ArrayList<>();
cols.add(new PropertyColumn(Model.of("Name"), "name"));
(compiler error)
cols.add(new LocationColumn("location"));
(compiler error)

new DataTable("id", cols, new
ListDataProvider(), 50);


public class LocationColumn extends PropertyColumn{

public LocationColumn(String expressionToLocation){
super(Model.of("Location"), expressionToLocation);
}

  @Override
public void populateItem(Item> cellItem,
String componentId, IModel rowModel) {
cellItem.add(new Label(componentId, new
LocationFormatModel(rowModel, Model.of(Session.get().getLocale();
}
}

Also the Generic of ICellPopulator is bound to T of column.

I always thought it could be possible to implement sub-class columns
to allow special renderings of table-cells.

But how can I achieve this, if also ICellPopulator is bound to T of
the rowModel?

kind regards
Patrick

-
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



--
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Südportal 1 • 22848 Norderstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Christian Capelle

HRB10145Pi | Amtsgericht Pinneberg

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



DataTable generics vs. IColumn generics

2015-03-05 Thread Patrick Davids

Hi all,
whats the meaning of generic T on DataTables vs T of IColumn and T of 
ICellPopulator?


As I understand its the type of object shown by the table rows.

Reading the javadoc of AbstractColumn it says T (if I understand 
correct), its the type of object shown by the cell itself.


But DataTable and its internal list of columns are bound together.
T of both must be the same...

I tried to implement something like this, and here I get problems.


List> cols = new ArrayList<>();
cols.add(new PropertyColumn(Model.of("Name"), "name"));
(compiler error)
cols.add(new LocationColumn("location"));
(compiler error)

new DataTable("id", cols, new ListDataProvider(), 50);


public class LocationColumn extends PropertyColumn{

public LocationColumn(String expressionToLocation){
super(Model.of("Location"), expressionToLocation);
}

@Override
	public void populateItem(Item> cellItem, 
String componentId, IModel rowModel) {
		cellItem.add(new Label(componentId, new LocationFormatModel(rowModel, 
Model.of(Session.get().getLocale();

}
}

Also the Generic of ICellPopulator is bound to T of column.

I always thought it could be possible to implement sub-class columns to 
allow special renderings of table-cells.


But how can I achieve this, if also ICellPopulator is bound to T of the 
rowModel?


kind regards
Patrick

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



Re: New committer - Sebastien Briquet

2015-02-16 Thread Patrick Davids

Yeah, congratulations Sebastien!
:-)

Am 13.02.2015 um 22:02 schrieb Martin Grigorov:

The Project Management Committee (PMC) for Apache Wicket
has asked Sebastien Briquet to become a committer and we are pleased
to announce that he has accepted.

Sebastien has been involved with Wicket for several years now by developing
one of the most successful integrations with JavaScript libraries,
namely Wicket
jQuery UI , reporting bugs,
contributing fixes and participating in discussions.

Being a committer will enable him to help us even easier in the future.

Please welcome Sebastien Briquet to our team!

Bienvenue Sebastien!




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



Re: FormComponentFeedbackBorder / missing message display / Bug or Feature?

2014-12-09 Thread Patrick Davids

Ok, done, WICKET-5788.

Thanx a lot...
Patrick

Am 08.12.2014 22:55, schrieb Martin Grigorov:

Now the question is more clear! Thanks!
I don't see anything in FormComponentFeedbackBorder code that consumes the
feedback message, i.e. marks it as rendered.
Please create a quickstart and attach it to a ticket in JIRA and we will
take a look.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Dec 8, 2014 at 3:23 PM, Patrick Davids 
>wrote:
>Yes, FormComponentFeedbackBorder itself just shows an asterisk.
>
>So, ok, my question was still unclear.;-)
>Is it a feature or a bug, that a FormComponentFeedbackBorder surpresses
>the messages of its child formcomponent, which possibly could be shown by a
>FeedbackPanel somewhere else in the upper component hierarchy?
>:-)
>
>Patrick


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



Re: FormComponentFeedbackBorder / missing message display / Bug or Feature?

2014-12-08 Thread Patrick Davids

Yes, FormComponentFeedbackBorder itself just shows an asterisk.

So, ok, my question was still unclear. ;-)
Is it a feature or a bug, that a FormComponentFeedbackBorder surpresses 
the messages of its child formcomponent, which possibly could be shown 
by a FeedbackPanel somewhere else in the upper component hierarchy?

:-)

Patrick

Am 08.12.2014 14:37, schrieb Martin Grigorov:

Well, according to
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/validation/FormComponentFeedbackBorder.html
this border is supposed to show only a red asterisk in case the form
component is invalid. Nothing more. So it is by design.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Dec 8, 2014 at 2:33 PM, Patrick Davids 
wrote:



I wrapped a formcomponent into a FormComponentFeedbackBorder to get an
asterisk in case of errors.

I am asking if this is a bug or a feature, because currently I am
implementing a custom behavior, which adds an error message in a
special-case to the component CustomBehavior.onConfigure(Component
component).

My error message is not displayed, the asterisk is working.
I would expect it is displayed as the asterisk is displayed as well.


Patrick


Am 08.12.2014 14:14, schrieb Martin Grigorov:

  Hi,


Please give more information.
The question is not very clear.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Dec 8, 2014 at 12:06 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

  Hi all,

is it a correct behavior, a FormComponentFeedbackBorder (asterisks for
form inputs) does not display a / the message in a feedbackpanel (if
available somewhere)?

kind regards
Patrick

-
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: FormComponentFeedbackBorder / missing message display / Bug or Feature?

2014-12-08 Thread Patrick Davids
I wrapped a formcomponent into a FormComponentFeedbackBorder to get an 
asterisk in case of errors.


I am asking if this is a bug or a feature, because currently I am 
implementing a custom behavior, which adds an error message in a 
special-case to the component CustomBehavior.onConfigure(Component 
component).


My error message is not displayed, the asterisk is working.
I would expect it is displayed as the asterisk is displayed as well.


Patrick


Am 08.12.2014 14:14, schrieb Martin Grigorov:

Hi,

Please give more information.
The question is not very clear.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Dec 8, 2014 at 12:06 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi all,
is it a correct behavior, a FormComponentFeedbackBorder (asterisks for
form inputs) does not display a / the message in a feedbackpanel (if
available somewhere)?

kind regards
Patrick

-
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



FormComponentFeedbackBorder / missing message display / Bug or Feature?

2014-12-08 Thread Patrick Davids

Hi all,
is it a correct behavior, a FormComponentFeedbackBorder (asterisks for 
form inputs) does not display a / the message in a feedbackpanel (if 
available somewhere)?


kind regards
Patrick

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



Re: form submit / parameters sometimes missing

2014-11-13 Thread Patrick Davids
Hi all,
can maybe someone else help?

Otherwise I would try to reproduce this with a quickstart and create an 
issue/bug report...
Would that be ok?

kind regards
Patrick


Am 12.11.2014 14:37, schrieb Patrick Davids:
> Huh, good idea... I didn't think about that.
>
> Ok, but I dont always miss my last parameters.
> I also miss randomly in the middle. So, its not a case of truncation at
> the end.
>
> And its POST, not GET.
> Shouldnt be a problem...
>
> Patrick
>
> Am 12.11.2014 13:51, schrieb Sven Meier:
>> Url length exceeded?
>>
>> http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
>>
>>
>> Sven
>>
>> On 11/12/2014 11:32 AM, Patrick Davids wrote:
>>> ormdd_hf_0=
>>> &tabs:components:3:attributeComponent:form:pibiChoice=0
>>> &tabs:components:3:attributeComponent:form:di17:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di16:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di15:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di14:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di13:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di12:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di11:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di21:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di22:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di23:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di24:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di25:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di26:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di27:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di47:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di46:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di45:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di44:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di43:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di42:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di41:statebottom=OK
>>> &tabs:components:3:attributeComponent:form:di31:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di32:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di33:statetop=OK
>>> &tabs:components:3:attributeComponent:form:di34:statetop=OK
>>>
>>> formdd_hf_0=&tabs:components:4:attributeComponent:form:pibiChoice=0
>>> &tabs:components:4:attributeComponent:form:di17:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di16:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di15:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di14:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di13:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di12:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di11:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di21:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di22:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di23:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di24:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di25:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di26:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di27:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di47:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di46:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di45:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di44:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di43:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di42:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di41:statebottom=OK
>>> &tabs:components:4:attributeComponent:form:di31:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di32:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di33:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di34:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di35:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di36:statetop=OK
>>> &tabs:components:4:attributeComponent:form:di37:statetop=OK
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>

Re: form submit / parameters sometimes missing

2014-11-12 Thread Patrick Davids
Huh, good idea... I didn't think about that.

Ok, but I dont always miss my last parameters.
I also miss randomly in the middle. So, its not a case of truncation at 
the end.

And its POST, not GET.
Shouldnt be a problem...

Patrick

Am 12.11.2014 13:51, schrieb Sven Meier:
> Url length exceeded?
>
> http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
>
>
> Sven
>
> On 11/12/2014 11:32 AM, Patrick Davids wrote:
>> ormdd_hf_0=
>> &tabs:components:3:attributeComponent:form:pibiChoice=0
>> &tabs:components:3:attributeComponent:form:di17:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di16:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di15:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di14:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di13:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di12:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di11:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di21:statetop=OK
>> &tabs:components:3:attributeComponent:form:di22:statetop=OK
>> &tabs:components:3:attributeComponent:form:di23:statetop=OK
>> &tabs:components:3:attributeComponent:form:di24:statetop=OK
>> &tabs:components:3:attributeComponent:form:di25:statetop=OK
>> &tabs:components:3:attributeComponent:form:di26:statetop=OK
>> &tabs:components:3:attributeComponent:form:di27:statetop=OK
>> &tabs:components:3:attributeComponent:form:di47:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di46:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di45:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di44:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di43:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di42:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di41:statebottom=OK
>> &tabs:components:3:attributeComponent:form:di31:statetop=OK
>> &tabs:components:3:attributeComponent:form:di32:statetop=OK
>> &tabs:components:3:attributeComponent:form:di33:statetop=OK
>> &tabs:components:3:attributeComponent:form:di34:statetop=OK
>>
>> formdd_hf_0=&tabs:components:4:attributeComponent:form:pibiChoice=0
>> &tabs:components:4:attributeComponent:form:di17:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di16:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di15:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di14:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di13:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di12:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di11:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di21:statetop=OK
>> &tabs:components:4:attributeComponent:form:di22:statetop=OK
>> &tabs:components:4:attributeComponent:form:di23:statetop=OK
>> &tabs:components:4:attributeComponent:form:di24:statetop=OK
>> &tabs:components:4:attributeComponent:form:di25:statetop=OK
>> &tabs:components:4:attributeComponent:form:di26:statetop=OK
>> &tabs:components:4:attributeComponent:form:di27:statetop=OK
>> &tabs:components:4:attributeComponent:form:di47:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di46:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di45:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di44:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di43:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di42:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di41:statebottom=OK
>> &tabs:components:4:attributeComponent:form:di31:statetop=OK
>> &tabs:components:4:attributeComponent:form:di32:statetop=OK
>> &tabs:components:4:attributeComponent:form:di33:statetop=OK
>> &tabs:components:4:attributeComponent:form:di34:statetop=OK
>> &tabs:components:4:attributeComponent:form:di35:statetop=OK
>> &tabs:components:4:attributeComponent:form:di36:statetop=OK
>> &tabs:components:4:attributeComponent:form:di37:statetop=OK
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



form submit / parameters sometimes missing

2014-11-12 Thread Patrick Davids
Hi all,
I have a strange behavior when submitting a form via Ajax.
Sometimes some form fields are just missing.

As I can see Wicket serializes the form and posts data to the server.
Using FireBug I had a look at the posted data.

The data looks like this (see below). The second post request is ok, the 
first one misses some parameters. In this exmaple its di35, di36, di37.

I am not able to reproduce this savely for e.g. a fix set of parameters.
It's just random.

Can anyone help? I am out of ideas...
Thanx a lot and best regards
Patrick


formdd_hf_0=
&tabs:components:3:attributeComponent:form:pibiChoice=0
&tabs:components:3:attributeComponent:form:di17:statebottom=OK
&tabs:components:3:attributeComponent:form:di16:statebottom=OK
&tabs:components:3:attributeComponent:form:di15:statebottom=OK
&tabs:components:3:attributeComponent:form:di14:statebottom=OK
&tabs:components:3:attributeComponent:form:di13:statebottom=OK
&tabs:components:3:attributeComponent:form:di12:statebottom=OK
&tabs:components:3:attributeComponent:form:di11:statebottom=OK
&tabs:components:3:attributeComponent:form:di21:statetop=OK
&tabs:components:3:attributeComponent:form:di22:statetop=OK
&tabs:components:3:attributeComponent:form:di23:statetop=OK
&tabs:components:3:attributeComponent:form:di24:statetop=OK
&tabs:components:3:attributeComponent:form:di25:statetop=OK
&tabs:components:3:attributeComponent:form:di26:statetop=OK
&tabs:components:3:attributeComponent:form:di27:statetop=OK
&tabs:components:3:attributeComponent:form:di47:statebottom=OK
&tabs:components:3:attributeComponent:form:di46:statebottom=OK
&tabs:components:3:attributeComponent:form:di45:statebottom=OK
&tabs:components:3:attributeComponent:form:di44:statebottom=OK
&tabs:components:3:attributeComponent:form:di43:statebottom=OK
&tabs:components:3:attributeComponent:form:di42:statebottom=OK
&tabs:components:3:attributeComponent:form:di41:statebottom=OK
&tabs:components:3:attributeComponent:form:di31:statetop=OK
&tabs:components:3:attributeComponent:form:di32:statetop=OK
&tabs:components:3:attributeComponent:form:di33:statetop=OK
&tabs:components:3:attributeComponent:form:di34:statetop=OK

formdd_hf_0=&tabs:components:4:attributeComponent:form:pibiChoice=0
&tabs:components:4:attributeComponent:form:di17:statebottom=OK
&tabs:components:4:attributeComponent:form:di16:statebottom=OK
&tabs:components:4:attributeComponent:form:di15:statebottom=OK
&tabs:components:4:attributeComponent:form:di14:statebottom=OK
&tabs:components:4:attributeComponent:form:di13:statebottom=OK
&tabs:components:4:attributeComponent:form:di12:statebottom=OK
&tabs:components:4:attributeComponent:form:di11:statebottom=OK
&tabs:components:4:attributeComponent:form:di21:statetop=OK
&tabs:components:4:attributeComponent:form:di22:statetop=OK
&tabs:components:4:attributeComponent:form:di23:statetop=OK
&tabs:components:4:attributeComponent:form:di24:statetop=OK
&tabs:components:4:attributeComponent:form:di25:statetop=OK
&tabs:components:4:attributeComponent:form:di26:statetop=OK
&tabs:components:4:attributeComponent:form:di27:statetop=OK
&tabs:components:4:attributeComponent:form:di47:statebottom=OK
&tabs:components:4:attributeComponent:form:di46:statebottom=OK
&tabs:components:4:attributeComponent:form:di45:statebottom=OK
&tabs:components:4:attributeComponent:form:di44:statebottom=OK
&tabs:components:4:attributeComponent:form:di43:statebottom=OK
&tabs:components:4:attributeComponent:form:di42:statebottom=OK
&tabs:components:4:attributeComponent:form:di41:statebottom=OK
&tabs:components:4:attributeComponent:form:di31:statetop=OK
&tabs:components:4:attributeComponent:form:di32:statetop=OK
&tabs:components:4:attributeComponent:form:di33:statetop=OK
&tabs:components:4:attributeComponent:form:di34:statetop=OK
&tabs:components:4:attributeComponent:form:di35:statetop=OK
&tabs:components:4:attributeComponent:form:di36:statetop=OK
&tabs:components:4:attributeComponent:form:di37:statetop=OK
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: hiding a bit of markup

2014-11-07 Thread Patrick Davids
Hi Garret,
did you try this?


   foo
   bar


Everything can be a WebMarkupContainer. No need to always use s or 
s.

have a nice weekend
Patrick

Am 07.11.2014 17:32, schrieb Garret Wilson:
> All,
>
> I have a little list in HTML:
>
> 
>foo
>bar
> 
>
>
> There are some  tags, but no components on the page. I
> want only to show the "foo" list item if the flag variable is set to
> true. What's the easiest way to do this in Wicket?
>
> I've read the documentation on controlling HTML
> . It seems I can
> use a WebMarkupContainer, but only if I add some extra HTML. Obviously I
> don't want this:
>
> 
>foo
>bar
> 
>
>
> It seems I can also use a Fragment (which presumably wouldn't require
> the extra HTML because it would use , but the
> constructor for that component requires that I specify the Wicket ID of
> the "container", which doesn't exist.
>
> How can I simply reference some piece of HTML so that I can show or hide
> it based on some flag?
>
> Garret
>



[SOLVED] Re: PropertyModel / PropertyResolver / Map or List access

2014-11-07 Thread Patrick Davids
Hi Sven, Hi Paul,
thanx, now its working.

I thought the PropertyModel/PropertyResolver will unpack the 
model-object itself, so there is no need to adress getObject by ".object".
Maybe a small note in javadoc could help others not running into this issue.

So...
All ways (mentioned in javadoc) are working, tested:
(@Sven: I think you had some typos in your mail, so I will repeat my 
working tests)

new PropertyModel(MyPage.this, "list.object[1].anyProperty")
new PropertyModel(MyPage.this, "list.object.1.anyProperty")

new PropertyModel(list, "[1].anyProperty")
new PropertyModel(list, "1.anyProperty")

as well, navigation further, such an expression is working, too.
new PropertyModel(list, "1.anyProperty[any-string-key]")


Thanx for help... best regards
Patrick
P.s.
Short question for string-key-access on maps.
The syntax is quite equal to associative arrays in javascript.
I like the way it is in wicket, no need paying attention for additional 
quotation marks, and its ok for me, but shouldnt it also support
new PropertyModel(list, "1.anyProperty['any-string-key']")?



Am 06.11.2014 21:01, schrieb Sven Meier:
> Hi,
>
> you're telling PropertyModel to look up property "list" from MyPage, but
> "list" is not a list, it's a model, models don't have a property "1".
>
> Use this instead:
>
>new Label("myLabel", new PropertyModel(list, "[1],anyProperty"))
>
> ... or:
>
>new Label("myLabel", new PropertyModel(MyPage.this,
> "list.object.[1].anyProperty"))
>
> Regards
> Sven
>
>
>
> On 11/06/2014 05:03 PM, Patrick Davids wrote:
>> Hi all,
>>
>> the javadoc of PropertyResolver says, map or list access is possible via
>> keys or index.
>> Accessing an map via key is no problem, but I dont get it working for
>> lists and index.
>>
>> for instance:
>>
>> MyPage extends Page{
>>
>> private IModel> list;
>>
>> public MyPage(IModel> list){
>>   super();
>>   this.list = list;
>>
>>  add(new Label("mylabel", new PropertyModel(MyPage.this,
>> "list[1].anyProperty")));
>>
>> }
>>
>> }
>>
>> ends up in a Exception like this:
>> Last cause: No get method defined for class: class MyPage$1 expression: 1
>>
>> I also made a try with "list.1.anyProperty".
>> Not working...
>>
>> Any ideas?
>>
>> best regards
>> Patrick
>> -
>> 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: PropertyModel / PropertyResolver / Map or List access

2014-11-06 Thread Patrick Davids
Hi Paul,
v6.17.0.

Maybe, I made a too reduced example.
My property navigates further... its more like this: 
"list[1].anyProperty[key]"

Is such a combination allowed?

Patrick

Am 06.11.2014 17:24, schrieb Paul Bors:
> I think that should have worked as per:
> http://wicket.apache.org/guide/guide/modelsforms.html#modelsforms_2
>
> Label label = new Label("firstChildName", new PropertyModel(person,
> "children.0.name"));
>
> What version of Wicket are you using?
>
>
>
> On Thu, Nov 6, 2014 at 11:03 AM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi all,
>>
>> the javadoc of PropertyResolver says, map or list access is possible via
>> keys or index.
>> Accessing an map via key is no problem, but I dont get it working for
>> lists and index.
>>
>> for instance:
>>
>> MyPage extends Page{
>>
>> private IModel> list;
>>
>> public MyPage(IModel> list){
>>   super();
>>   this.list = list;
>>
>>  add(new Label("mylabel", new PropertyModel(MyPage.this,
>> "list[1].anyProperty")));
>>
>> }
>>
>> }
>>
>> ends up in a Exception like this:
>> Last cause: No get method defined for class: class MyPage$1 expression: 1
>>
>> I also made a try with "list.1.anyProperty".
>> Not working...
>>
>> Any ideas?
>>
>> best regards
>> Patrick
>


PropertyModel / PropertyResolver / Map or List access

2014-11-06 Thread Patrick Davids
Hi all,

the javadoc of PropertyResolver says, map or list access is possible via 
keys or index.
Accessing an map via key is no problem, but I dont get it working for 
lists and index.

for instance:

MyPage extends Page{

   private IModel> list;

   public MyPage(IModel> list){
 super();
 this.list = list;

add(new Label("mylabel", new PropertyModel(MyPage.this, 
"list[1].anyProperty")));

   }

}

ends up in a Exception like this:
Last cause: No get method defined for class: class MyPage$1 expression: 1

I also made a try with "list.1.anyProperty".
Not working...

Any ideas?

best regards
Patrick

FeedbackPanel / just showing one error message / missing messages

2014-10-21 Thread Patrick Davids
Hi all,
I'm struggling around with a feedback panel.

What I would like to implement is a single global feedback panel in the 
top hierarchy of my page inheritence.

Its a sort of fallback-panel. If no other feedback panel catches the 
messages, it should display them, so its a FencedFeedback. A form or 
other component can have an own feedback panel with the component as a 
fence.

This global feedback panel should display only one single message.
Independent of how many e.g. form validation errors occur.
So its configured setMaxMessages(1).

To avoid displaying all other messages in sequence as long the user 
reloads the page, I have implemented a FeedbackCollector marking all of 
them rendered (onDetach()).

This all works quite good in the past.
But just one page, I have implemented once, does not show any messages 
at all by entering the page.

And I really really dont know why.

Also Session.get().error("my error message") does not work.

It seems to me, onDetach() is called earlier on this page, as on other 
pages, so my markRendered() of the FeedbackCollector is executed to 
early, but I am not sure.

Does anyone have an hint to me, what can force an early detach()?
Or what can force a cleanup of feedback messages?
Where should I put a breakpoint to have a deeper look?

Really thanx for help!

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



Re: alternative solution for addOrReplace()?

2014-10-08 Thread Patrick Davids
 > I think you might have over-complicated your design.
Yes, I also think so, but unfortunately currently I'm not able to 
redesign it, and I try to find a quick solution. :-/
(please have a look at my reply to andreas mail. There is some code...)

 > should be simple to update the parent which in turn delegates that 
responsibility to the children.
It is -somehow- the way you described. I think... hmm... but not very 
good implemented it seems.

 > Take a quick look over how Decebal implemented his Wicket-Dashboards
Ok, thanx, I will do...

 > Otherwise I suggest you get rid of the addOrReplace() and move that logic
 > into your onBeforeRender() methods for those panels to update themself.

Are markup modifications handled different by onBeforeRender() / add() 
compared to onConfigure() / addOrReplace()?

Or do I also have to use addOrReplace() in onBeforeRender()?

Patrick

Am 07.10.2014 21:47, schrieb Paul Bors:
> I think you might have over-complicated your design.
> Your use-case is quite simple, you have user input that filters the
> display. It might be that there are a lot of panels to be updated but then
> again it should be simple to update the parent which in turn delegates that
> responsibility to the children.
>
> Take a quick look over how Decebal implemented his Wicket-Dashboards as in
> his project the entire dashboard is refreshed when adding a new panel which
> in turn can be quite complicated.
>
> His code and examples are at:
> https://github.com/decebals/wicket-dashboard
>
> Study his design and see how much of that you can apply to your page.
>
> Otherwise I suggest you get rid of the addOrReplace() and move that logic
> into your onBeforeRender() methods for those panels to update themself.
>
> On Tue, Oct 7, 2014 at 12:43 PM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi Paul,
>> thanx for replying.
>>
>> Oh, I use Ajax very heavily in this case. Thats why I said: "the panel
>> works quite good for ajax rendering and refreshing use-cases"
>>
>> Hmm... ok... I think I missed some details. I try to explain.
>>
>> My page contains two sections seperated from each other.
>> A kind of data-entry and a kind of displaying the results.
>>
>> The section which displays the results is a quite complicated panel,
>> having an RefreshingView for about 30 (I will name them) sub-panels.
>>
>> These sub-panels addOrReplace() an inner container while rendering itself.
>> And the replacement depends on my model object type.
>>
>> So, my sub-panel class has a hugh knowledge about how to render the
>> results.
>>
>> On entering some data on the data-entry section I refresh the whole
>> panel in the display section with all its sub-panels using Ajax. And
>> this works great.
>> Some of the sub-panels also rerender/refresh own there own, by listening
>> to events etc pepe. All this behaviours are working very well.
>>
>> The only disadvantage is, using addOrReplace(), I have a heavy
>> detaching/attaching situation and a performance problem.
>>
>> So, the best solution for now would be, keeping my panel implementation
>> as it is, but just having my models detached only once, not for iteration.
>>
>> And here I dont have any idea how to solve that... :-/
>>
>> thanx and kind regards
>> Patrick
>>
>> Am 07.10.2014 17:52, schrieb Paul Bors:
>>> Why not use Ajax?
>>>
>>> addOrReplace() is really for when you need the full request cycle and
>> have
>>> the page rendered on the server side. With Ajax you get your target for
>>> which you can add all the components you want to refresh on the page.
>>>
>>> Given the day and age we live in, I don't think there is a need to even
>>> worry about browsers that do not support Ajax. Than again, that depends
>> on
>>> your product's requirements.
>>>
>>> Otherwise, you can keep on using addOrReplace() but stop using instaceof
>>> and start using Generics.
>>> If you need an example code-snippet of that let me know and I'll dig some
>>> out for you.
>>>
>>> On Tue, Oct 7, 2014 at 9:51 AM, Patrick Davids <
>> patrick.dav...@nubologic.com
>>>> wrote:
>>>
>>>> Hi all,
>>>> I have a panel, which renders a inner markupcontainer (different panels
>>>> for different ways of displaying my model object) depending on its model
>>>> objects type.
>>>>
>>>> I do this by addOrReplace() the inner panel in an onConfigure() having
>>>> an "if instanceof"; 

Re: alternative solution for addOrReplace()?

2014-10-08 Thread Patrick Davids
Hi Andrea,
this is the code (a bit pseudo-like...) I am quite sure it is not the 
way it should be and full of wicket anti-patterns. But still exists 
since my first wicket experiences 2 years ago. ;-)


This panel gets rendered via RefreshingView about 30 times.

public ElementPanel(String id, IModel 
elementState){  
super(id, elementState);

container = new WebMarkupContainer("innerElementContainer", 
elementState){
private static final long serialVersionUID = 1L;

@Override
protected void onConfigure() {
super.onConfigure();

ElementState s = (ElementState)getDefaultModelObject();

if(s instanceof DefaultState){

container.addOrReplace(new 
DefaultStatePanel(REPLACE_CONTAINER_ID, s));

}else if(s instanceof SpecialState){

container.addOrReplace(new 
SpecialStatePanel(REPLACE_CONTAINER_ID, s));

}else if(s instanceof AnotherSpecialState){

container.addOrReplace(new 
AnotherSpecialStatePanel(REPLACE_CONTAINER_ID, s));

...

}else{
String error = "No panel registered for class 
"+getDefaultModelObject().getClass().getSimpleName();
container.addOrReplace(new 
Label(REPLACE_CONTAINER_ID, error));
error(error);
}
}
add(container);
}

Patrick


Am 07.10.2014 19:42, schrieb Andrea Del Bene:
> Hi,
>
> could you post the code you use inside onConfigure to addOrReplace inner
> container? Maybe you could avoid detaching/attaching overriding method
> detachModels in your inner containers.
>> Hi Paul,
>> thanx for replying.
>>
>> Oh, I use Ajax very heavily in this case. Thats why I said: "the panel
>> works quite good for ajax rendering and refreshing use-cases"
>>
>> Hmm... ok... I think I missed some details. I try to explain.
>>
>> My page contains two sections seperated from each other.
>> A kind of data-entry and a kind of displaying the results.
>>
>> The section which displays the results is a quite complicated panel,
>> having an RefreshingView for about 30 (I will name them) sub-panels.
>>
>> These sub-panels addOrReplace() an inner container while rendering
>> itself.
>> And the replacement depends on my model object type.
>>
>> So, my sub-panel class has a hugh knowledge about how to render the
>> results.
>>
>> On entering some data on the data-entry section I refresh the whole
>> panel in the display section with all its sub-panels using Ajax. And
>> this works great.
>> Some of the sub-panels also rerender/refresh own there own, by listening
>> to events etc pepe. All this behaviours are working very well.
>>
>> The only disadvantage is, using addOrReplace(), I have a heavy
>> detaching/attaching situation and a performance problem.
>>
>> So, the best solution for now would be, keeping my panel implementation
>> as it is, but just having my models detached only once, not for
>> iteration.
>>
>> And here I dont have any idea how to solve that... :-/
>>
>> thanx and kind regards
>> Patrick
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


Re: alternative solution for addOrReplace()?

2014-10-07 Thread Patrick Davids
Hi Paul,
thanx for replying.

Oh, I use Ajax very heavily in this case. Thats why I said: "the panel 
works quite good for ajax rendering and refreshing use-cases"

Hmm... ok... I think I missed some details. I try to explain.

My page contains two sections seperated from each other.
A kind of data-entry and a kind of displaying the results.

The section which displays the results is a quite complicated panel, 
having an RefreshingView for about 30 (I will name them) sub-panels.

These sub-panels addOrReplace() an inner container while rendering itself.
And the replacement depends on my model object type.

So, my sub-panel class has a hugh knowledge about how to render the results.

On entering some data on the data-entry section I refresh the whole 
panel in the display section with all its sub-panels using Ajax. And 
this works great.
Some of the sub-panels also rerender/refresh own there own, by listening 
to events etc pepe. All this behaviours are working very well.

The only disadvantage is, using addOrReplace(), I have a heavy 
detaching/attaching situation and a performance problem.

So, the best solution for now would be, keeping my panel implementation 
as it is, but just having my models detached only once, not for iteration.

And here I dont have any idea how to solve that... :-/

thanx and kind regards
Patrick

Am 07.10.2014 17:52, schrieb Paul Bors:
> Why not use Ajax?
>
> addOrReplace() is really for when you need the full request cycle and have
> the page rendered on the server side. With Ajax you get your target for
> which you can add all the components you want to refresh on the page.
>
> Given the day and age we live in, I don't think there is a need to even
> worry about browsers that do not support Ajax. Than again, that depends on
> your product's requirements.
>
> Otherwise, you can keep on using addOrReplace() but stop using instaceof
> and start using Generics.
> If you need an example code-snippet of that let me know and I'll dig some
> out for you.
>
> On Tue, Oct 7, 2014 at 9:51 AM, Patrick Davids > wrote:
>
>> Hi all,
>> I have a panel, which renders a inner markupcontainer (different panels
>> for different ways of displaying my model object) depending on its model
>> objects type.
>>
>> I do this by addOrReplace() the inner panel in an onConfigure() having
>> an "if instanceof"; and it also iterates over a list...
>>
>> I'm not sure, if it is a good solution (I dont like the instanceof
>> approach), but the panel works quite good for ajax rendering and
>> refreshing use-cases.
>>
>> But, the addOrReplace() has one big disadvantage.
>> It forces to detach the model on each iteration, so on each iteration I
>> get a database access to retrieve it again.
>>
>> Is there anyway to keep the model attached until the entire request
>> cycle is finished?
>>
>>
>> Or should I try to find complete other solution for this kind of "high
>> dynamic iterating panel"?
>> Is it better to use e.g. Fragments to display a model object in
>> different ways depending on its state?
>>
>> Please give some inspirations... I ran out of ideas. Help!
>>
>> kind regards :-)
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


alternative solution for addOrReplace()?

2014-10-07 Thread Patrick Davids
Hi all,
I have a panel, which renders a inner markupcontainer (different panels 
for different ways of displaying my model object) depending on its model 
objects type.

I do this by addOrReplace() the inner panel in an onConfigure() having 
an "if instanceof"; and it also iterates over a list...

I'm not sure, if it is a good solution (I dont like the instanceof 
approach), but the panel works quite good for ajax rendering and 
refreshing use-cases.

But, the addOrReplace() has one big disadvantage.
It forces to detach the model on each iteration, so on each iteration I 
get a database access to retrieve it again.

Is there anyway to keep the model attached until the entire request 
cycle is finished?


Or should I try to find complete other solution for this kind of "high 
dynamic iterating panel"?
Is it better to use e.g. Fragments to display a model object in 
different ways depending on its state?

Please give some inspirations... I ran out of ideas. Help!

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



Re: Wicket / OAuth2

2014-09-02 Thread Patrick Davids
 > "Is Shiro still alive?"

I hope so... just used it google-guice integrated.
But, by the way... if not alive... any alternatives to shiro?

Patrick

Am 02.09.2014 11:42, schrieb Martin Grigorov:
> Hi,
>
> Apache Shiro seems to be in a very bad state at the moment.
> There is no active development in the last year and its dev@ list is very
> quite - no one responds to users' questions like "Is Shiro still alive?"
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
>
> On Tue, Sep 2, 2014 at 12:37 PM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi Sebastien,
>> did you have a look at Apache Shiro?
>>
>> http://shiro.apache.org/integration.html
>> There is a OAuth link... but I did not look deeper...
>>
>> And what I additionally have found seems to be in progress.
>> https://issues.apache.org/jira/browse/SHIRO-119
>>
>> kind regards
>> Patrick "Brown"
>>
>>
>> Am 01.09.2014 17:58, schrieb Sebastien:
>>> Hi all,
>>>
>>> AFAIS, there is nothing about a OAuth2 client in Wicket out-of-the-box or
>>> through a satellite project...
>>>
>>> Does somebody knows a *simple* solution for integrating OAuth2 into
>> Wicket
>>> (like a OAuthWebApplication, or maybe a ready-to-use Filter, just giving
>>> Consumer Key, Consumer Secret & URLs), without using spring-security and
>>> still keeping advantage of the role-based @AuthorizeInstantiation
>>> annotation for instance?
>>>
>>> Thanks a lot in advance,
>>> Sebastien.
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: Wicket / OAuth2

2014-09-02 Thread Patrick Davids
Hi Sebastien,
did you have a look at Apache Shiro?

http://shiro.apache.org/integration.html
There is a OAuth link... but I did not look deeper...

And what I additionally have found seems to be in progress.
https://issues.apache.org/jira/browse/SHIRO-119

kind regards
Patrick "Brown"


Am 01.09.2014 17:58, schrieb Sebastien:
> Hi all,
>
> AFAIS, there is nothing about a OAuth2 client in Wicket out-of-the-box or
> through a satellite project...
>
> Does somebody knows a *simple* solution for integrating OAuth2 into Wicket
> (like a OAuthWebApplication, or maybe a ready-to-use Filter, just giving
> Consumer Key, Consumer Secret & URLs), without using spring-security and
> still keeping advantage of the role-based @AuthorizeInstantiation
> annotation for instance?
>
> Thanks a lot in advance,
> Sebastien.
>
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Button and AutoTextLabelResolver

2014-07-30 Thread Patrick Davids
Hi all,
it seems it is not possible to use AutoTextLabelResolver with buttons?

I always get errors like
java.lang.IllegalStateException: no related component found for 

  at 
org.apache.wicket.markup.html.form.AutoLabelTextResolver.resolve(AutoLabelTextResolver.java:258)

Button b = new Button("previous");
b.setLabel(Model.of("Next Step"));

[next Step]

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



Re: How to init a Wizard with a particular step?

2014-07-28 Thread Patrick Davids
Hi Sebastien,
thanx, I have seen the DynamicWizardModel.

Its not exactly, what I need... will help for other reasons, but does 
not help not to unpack and evaluate my step while constructing.

My current implementation (I gave setActiveStep() a new chance) uses an 
onConfigure() of my Wizard calling getWizardModel().setActiveStep(...).

So, it also works with an usual WizardModel (dont know, what I made 
wrong some weeks ago).
I'm thinking about to keep this way...

thank you and kind regards
Patrick

Am 28.07.2014 11:21, schrieb Sebastien:
> Hi Patrick,
>
> Use a DynamicWizardModel
>
> private final IDynamicWizardStep step0;
>
> public MyWizard(String id)
> {
>  super(id);
>  final IWizardModel wizardModel = new DynamicWizardModel(this.step0); /*
> the start step */
>  this.init(wizardModel);
> }
>
> You have a complete demo here (using wicket-jquery-ui's wizard, but it's
> the same with the built-in wizard):
> http://www.7thweb.net/wicket-jquery-ui/wizard/DynamicWizardPage
>
> Hope this helps,
> Sebastien.
>
>
>
>
> On Mon, Jul 28, 2014 at 11:05 AM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi all,
>> what I have here is an persistent workflow and I use a wizard to
>> visualize this workflow.
>>
>> On entering my page I wanna push the wizard into a specific step
>> depending on my persistent workflow state/(step).
>>
>> Until now I only was able to achieve this, by manually calling
>> wizardModel.next(); as many times I need to reach my particular active
>> step.
>>
>> (I will give a new try for calling setActiveStep(), but as far as I
>> remember I wasnt able todo this, Not sure, why...
>> Anyway...)
>> My main reason, I dont want to do it this way is, I have to unpack my
>> model-object on construction-time and I have to implement a kind of "if,
>> else, if else..." and I have to do this after wizard.init(wizardModel)
>> because the wizard resets itself. So I have to pay attention for
>> call-sequence etc. First init(), than next(), next(), next()...
>>
>> Is there any better way to achieve this?
>> Maybe, I just dont see the wood for the trees...
>> An override of "amITheActiveStep()"-method of WizardStep evaluated by
>> the wizard to show an active step depending on conditions?
>>
>> Thanx for feedback
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

How to init a Wizard with a particular step?

2014-07-28 Thread Patrick Davids
Hi all,
what I have here is an persistent workflow and I use a wizard to 
visualize this workflow.

On entering my page I wanna push the wizard into a specific step 
depending on my persistent workflow state/(step).

Until now I only was able to achieve this, by manually calling 
wizardModel.next(); as many times I need to reach my particular active step.

(I will give a new try for calling setActiveStep(), but as far as I 
remember I wasnt able todo this, Not sure, why...
Anyway...)
My main reason, I dont want to do it this way is, I have to unpack my 
model-object on construction-time and I have to implement a kind of "if, 
else, if else..." and I have to do this after wizard.init(wizardModel) 
because the wizard resets itself. So I have to pay attention for 
call-sequence etc. First init(), than next(), next(), next()...

Is there any better way to achieve this?
Maybe, I just dont see the wood for the trees...
An override of "amITheActiveStep()"-method of WizardStep evaluated by 
the wizard to show an active step depending on conditions?

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



Re: DropDownChoice closes on target.add(...)

2014-07-21 Thread Patrick Davids
Hi Rune,
for me it looks like the feature of updating parts of your 
UploadFormPanel by using a timer should be a behavior of your 
UploadFormPanel itself.

Put it inside, and you have access the particular container to refresh. 
No need to refresh the whole panel from outside, which side-affects your 
dropdown choice and clicks etc.

kind regards
Patrick

Am 21.07.2014 15:29, schrieb Rune Stilling:
> Hi list
>
> I’m using the TabbedPanel component to show a couple of tabs each of them 
> containing a form. The form among other things contains a DropDownChoice. I 
> have also set up a AbstractAjaxTimerBehavior instance to do some updates 
> along the way. On of the updates i the TabbedPanel, that I add to my target 
> in AbstractAjaxTimerBehavior::onTimer.
>
> Now what happens is that if I have selected/pulled down my drop down choice 
> in the browser the target.add(tabPanel); instruction makes the drop down roll 
> in again, so that I have to click it again. Is there a way I can avoid this 
> by setting some flag on the DropDownChoice so that it doesn’t rerender on the 
> AjaxRequestTarget.add(tabbePanel)?
>
> Here’s some code:
>
>>  tabs.add(new AbstractTab(new Model("Filupload")) {
>>  private static final long serialVersionUID = 1L;
>>
>>  @Override
>>  public Panel getPanel(String panelId) {
>>  UploadFormPanel uploadPanel = new 
>> UploadFormPanel(panelId, version, editionDirPath, mandatoryInputFiles);
>>  uploadPanel.setOutputMarkupId(true);
>>  return uploadPanel;
>>  }
>>  });
>   
>>  final TabbedPanel tabPanel = new TabbedPanel("versionTabPanel", 
>> tabs);
>>  tabPanel.setOutputMarkupId(true);
>>  add(tabPanel);
>
>> final AbstractAjaxTimerBehavior timer = new 
>> AbstractAjaxTimerBehavior(Duration.milliseconds(1000)) {
>>  @Override
>>  public void onTimer(AjaxRequestTarget target) {
>>  target.add(tabPanel); //Doesn't update panels (so whats 
>> the use? Det er nødvendigt for at opdatere PropertyModels, er det ikke?)
>>  }
>
> I was also considering to add only parts of the tabPanel, but I don’t know 
> how to access the uploadPanel in the AbstractTab instance.
>
> \Rune
> -
> 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



[SOLVED] Re: StringResourceModel with a defaultValue as model

2014-07-21 Thread Patrick Davids
Yes, already implemented this way. :-)
Added a todo now, waiting for wicket7 to improve it.
Thanx for the hint anyway...

regards
Patrick

 >For now you can workaround it with: add(new Label("", new 
 >StringResourceModel("key.${someInfoFromBean}",
 >Component.this, Model.of(anyBean), new
 >StringResourceModel("key.default", Component.this).*getObject()*));



Am 21.07.2014 09:43, schrieb Martin Grigorov:
> For now you can workaround it with:
>   add(new Label("", new StringResourceModel("key.${someInfoFromBean}",
> Component.this, Model.of(anyBean), new
> StringResourceModel("key.default", Component.this).*getObject()*));


Re: StringResourceModel with a defaultValue as model

2014-07-21 Thread Patrick Davids
Hi François,
what I try to do is a bit different... I would like to provide a default 
per component sub-class, before wicket cascades the property files up to 
application.properties.

Something like this:
add(new Label("", new StringResourceModel("key.${someInfoFromBean}", 
Component.this, Model.of(anyBean), new 
StringResourceModel("key.default", Component.this)));

Hi Martin,
ok, this will solve my problem, next.
 > In Wicket 7 the API is changed to IModel with
 > https://issues.apache.org/jira/browse/WICKET-4972

kind regards
Patrick

Am 18.07.2014 19:02, schrieb Francois Meillet:
> In your Application.properties
> you add the key key.to.be.good=theValue
>
> and you can use the StringResourceModel like that
>
> add( new Label("",  new StringResourceModel("key.to.be.good", null)));
>
>
> François Meillet
> Formation Wicket - Développement Wicket
>
>
>
>
>
> Le 18 juil. 2014 à 18:14, Patrick Davids  a 
> écrit :
>
>> Hi all,
>> is there any way to implement a StringResourceModel which allows to give
>> a defaultValue as model?
>>
>> First I tried to override getDefaultModelAsString() of Label. (is final)
>> Than I tried to implement an extending
>> ModeledDefaultValueStringResourceModel, catching a
>> MissingResourceException on getObject() or load() and retrieving my own
>> Model defaultValue, but everthing is final here, too.
>>
>> So, Im not able to achieve this, right now.
>>
>> I would like to do this, because I have a dynamic way of giving buttons
>> a label depending of my Wizard-subclass (have my own
>> SpecialWizardButtonBar).
>>
>> And if a button label is not availabe I want to fallback somewhere, but
>> the default cannot be a StringResourceModel.
>>
>> Can someone help? Or is this a feature request and have to open a ticket?
>>
>> kind regards, nice weekend
>> PatrickB�CB��[��X��ܚX�KK[XZ[�\�\��][��X��ܚX�P�X��]�\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\��Z[�X��]�\X�K�ܙ�B�
>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



StringResourceModel with a defaultValue as model

2014-07-18 Thread Patrick Davids
Hi all,
is there any way to implement a StringResourceModel which allows to give 
a defaultValue as model?

First I tried to override getDefaultModelAsString() of Label. (is final)
Than I tried to implement an extending 
ModeledDefaultValueStringResourceModel, catching a 
MissingResourceException on getObject() or load() and retrieving my own 
Model defaultValue, but everthing is final here, too.

So, Im not able to achieve this, right now.

I would like to do this, because I have a dynamic way of giving buttons 
a label depending of my Wizard-subclass (have my own 
SpecialWizardButtonBar).

And if a button label is not availabe I want to fallback somewhere, but 
the default cannot be a StringResourceModel.

Can someone help? Or is this a feature request and have to open a ticket?

kind regards, nice weekend
Patrick

Re: Question / Best Practise / (List)Model vs. (List)DataProvider

2014-05-22 Thread Patrick Davids
Hi Colin,
and thanx to all responders...

Ok, I think I got it... somehow... ;-)

Got a new question then...
A RefreshingView, due to its method getItemModels(), also acts as a 
'Model Factory' for me... hmm...

Ähm, so, does anyone ever created a RefreshingView with a default model?
new RefreshingView("id", any_other_model_than_a_car?){
protected Iterator>getItemModels(){

}
}

Maybe, my first question relates to that.
But I am not sure... the RefreshingView is still a bit confusing to me...

Patrick


Am 19.05.2014 06:51, schrieb Colin Rogers:
> The way I see (right or wrong!) is,
>
> You create/manage Models for individual components on a case-by-case basis.
>
> For Repeaters which internal components are dynamically created, you need a 
> DataProvider to create and manage those Models for the components and the 
> Collections that comprise their data.
>
> DataProvider could be described as a 'Model Factory', and is not a Model in 
> itself.
>
> Cheers,
> Col.
>
> -Original Message-
> From: Sven Meier [mailto:s...@meiers.net]
> Sent: Friday, 16 May 2014 6:17 AM
> To: users@wicket.apache.org
> Subject: Re: Question / Best Practise / (List)Model vs. (List)DataProvider
>
> IDataProvider is all about efficiency, it provides efficient access to a 
> subset of the data.
>
> Perhaps we can make it even more efficient with the recent proposal on the 
> @dev list.
>
> Regards
> Sven
>
>
> On 05/08/2014 01:37 PM, Patrick Davids wrote:
>> Hi all,
>>
>> what I often think about, and I cannot really say is; when to use
>> Model or DataProvider as data providing object for components they
>> repeat some thing?
>>
>> Javadoc says, DataProvider are (good) for DataViews.
>> Hmm... ok, and they allow easer iterating (first index, count).
>>
>> I also can achieve this by using a LoadableDetachableModel>
>> combined with a ModelIteratorAdapater.
>>
>> Both have detaching logic... both featuring extension, both have a
>> sort of "load"-method (getObject() vs. getData()).
>>
>> Sometimes I think, they are so similar to each other... where is the
>> key difference?
>>
>> Would be cool if some of yours just reply his "two cents" of daily
>> programming experience... so I can get some new point of views.
>>
>> When do you use DataProvider or Model>?
>> Did you experienced the same, not to exactly know which one you will
>> use for your new page/panel/component?
>> And often think about pro and cons using it with RepeatingViews? And
>> later on, you see... "I could have used both... hmm..."
>>
>> thanx a lot for feedback and kind regards Patrick
>> -
>> 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
>
> EMAIL DISCLAIMER This email message and its attachments are confidential and 
> may also contain copyright or privileged material. If you are not the 
> intended recipient, you may not forward the email or disclose or use the 
> information contained in it. If you have received this email message in 
> error, please advise the sender immediately by replying to this email and 
> delete the message and any associated attachments. Any views, opinions, 
> conclusions, advice or statements expressed in this email message are those 
> of the individual sender and should not be relied upon as the considered 
> view, opinion, conclusions, advice or statement of this company except where 
> the sender expressly, and with authority, states them to be the considered 
> view, opinion, conclusions, advice or statement of this company. Every care 
> is taken but we recommend that you scan any attachments for viruses.
>
> -
> 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



SOLVED / Re: problem with resource lookup for css files

2014-05-19 Thread Patrick Davids
H*** S***...

I hate friday afternoons.

Read the chapter for resource bundles about 10 times and didnt "see" the 
underscores.

Thanx Sven, it works...

Patrick

Am 16.05.2014 19:49, schrieb Sven Meier:
> Try with myCss_blue.css
>
> Regards
> Sven
>
>
> On 05/16/2014 03:51 PM, Patrick Davids wrote:
>> Hi all,
>> I have problems with resource look up for styles css... and I dont know,
>> what I am doing wrong.
>>
>> Can someone have a look, please...
>>
>> myPackage.
>> BasePage.java
>> BasePage.html
>> myCss.css
>> myCss.blue.css
>> myCss.orange.css
>>
>> As far as I know, the resource lookup for all kind of resources is the
>> same.
>>
>> I set the style to my Session via
>> Session.get().setStyle("blue");
>>
>> and I can see the correct style string while debugging.
>>
>>
>> I tried to include my css into the BasePage via
>>
>> BasePage.html
>> 
>> 
>>   
>> 
>> 
>>
>> and also via
>>
>> BasePage.java:
>> @Override
>> public void renderHead(HtmlHeaderContainer container) {
>> super.renderHead(container);
>> IHeaderResponse response = container.getHeaderResponse();
>> response.render(CssHeaderItem.forReference(new
>> CssResourceReference(BasePage.class, "myCss.css", getLocale(),
>> getStyle(), getVariation(;
>> }
>>
>> Both ways always look up the normal myCss.css and not myCss.blue.css.
>> Whats wrong with my code?
>> Help please...
>>
>> Thanx a lot.
>> kind regards
>> Patrick
>> -
>> 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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Question / Best Practise / (List)Model vs. (List)DataProvider

2014-05-16 Thread Patrick Davids
Hi all,

what I often think about, and I cannot really say is; when to use Model 
or DataProvider as data providing object for components they repeat some 
thing?

Javadoc says, DataProvider are (good) for DataViews.
Hmm... ok, and they allow easer iterating (first index, count).

I also can achieve this by using a LoadableDetachableModel> 
combined with a ModelIteratorAdapater.

Both have detaching logic... both featuring extension, both have a sort 
of "load"-method (getObject() vs. getData()).

Sometimes I think, they are so similar to each other... where is the key 
difference?

Would be cool if some of yours just reply his "two cents" of daily 
programming experience... so I can get some new point of views.

When do you use DataProvider or Model>?
Did you experienced the same, not to exactly know which one you will use 
for your new page/panel/component?
And often think about pro and cons using it with RepeatingViews? And 
later on, you see... "I could have used both... hmm..."

thanx a lot for feedback and kind regards
Patrick
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



problem with resource lookup for css files

2014-05-16 Thread Patrick Davids
Hi all,
I have problems with resource look up for styles css... and I dont know, 
what I am doing wrong.

Can someone have a look, please...

myPackage.
BasePage.java
BasePage.html
myCss.css
myCss.blue.css
myCss.orange.css

As far as I know, the resource lookup for all kind of resources is the same.

I set the style to my Session via
Session.get().setStyle("blue");

and I can see the correct style string while debugging.


I tried to include my css into the BasePage via

BasePage.html

   
 
   


and also via

BasePage.java:
@Override
public void renderHead(HtmlHeaderContainer container) {
   super.renderHead(container);
   IHeaderResponse response = container.getHeaderResponse();
   response.render(CssHeaderItem.forReference(new 
CssResourceReference(BasePage.class, "myCss.css", getLocale(), 
getStyle(), getVariation(;
}

Both ways always look up the normal myCss.css and not myCss.blue.css.
Whats wrong with my code?
Help please...

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



Re: Question / l18n / property substitution / formatting

2014-04-30 Thread Patrick Davids
Hi Sven,

 > Java's MessageFormat
Ah, yes, thanx...

regards
Patrick


Am 30.04.2014 11:21, schrieb Sven Meier:
> Hi,
>
> StringResourceModel uses Java's MessageFormat for its parameters, so
> only the {0} syntax is supported.
>
> Use ${dateOfCreation} for Wicket's placeholder replacement - this one
> uses Wicket's converters instead.
>
> Regards
> Sven
>
> On 04/30/2014 11:03 AM, Patrick Davids wrote:
>> Hi all,
>> I'm not sure, if I do something wrong, but I never get such a property
>> working.
>>
>> Is this way not possible?
>>
>> Code:
>> new StringResourceModel("label", this, model);
>>
>> properties file:
>> label=${dateOfCreation, date, dd.MM.yy}
>>
>>
>> This is working...
>>
>> Code:
>> new StringResourceModel("label", this, null, new PropertyModel(model,
>> "dateOfCreation"));
>>
>> properties file:
>> label={0, date, dd.MM.yy}
>>
>> Is there any reason?
>> Could be a nice feature... I think...
>>
>> Or am I just doing something wrong?
>>
>> kind regards
>> Patrick
>> -
>> 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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Question / l18n / property substitution / formatting

2014-04-30 Thread Patrick Davids
Hi all,
I'm not sure, if I do something wrong, but I never get such a property 
working.

Is this way not possible?

Code:
new StringResourceModel("label", this, model);

properties file:
label=${dateOfCreation, date, dd.MM.yy}


This is working...

Code:
new StringResourceModel("label", this, null, new PropertyModel(model, 
"dateOfCreation"));

properties file:
label={0, date, dd.MM.yy}

Is there any reason?
Could be a nice feature... I think...

Or am I just doing something wrong?

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



SOLVED / Re: Evaluating wickets ajax-response programatically

2014-04-23 Thread Patrick Davids
Martin, you made my day.

Thank you very much!
Patrick
P.s. concerning your other mail...
"self" member... dont really know, but does not lead into any script 
errors, so I thought it might be correct. Was just a try... ;-)

Am 23.04.2014 15:19, schrieb Martin Grigorov:
> Hi,
>
> See
> https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js#L31
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Wed, Apr 23, 2014 at 4:01 PM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi all,
>>
>> due to a very complex gui panel with many javascript we are using a
>> quite pure AbstractAjaxBehavior.
>>
>> I print out a callback url, I call it, and so on... and having an
>> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
>> (just a bit different).
>> Its copy-paste, but I dont know how to solve it in a better way.
>>
>> Everything looks good, so far...
>>
>> BUT...
>> when I add some components to the AjaxRequestTarget, the client-side
>> does not evaluate it.
>>
>> So, I had another look at wicket javascripts and found a js method
>> named, which is used on success:
>>
>> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>>
>> "Hmm... should do what I want"...
>>
>> So I put it in my manuall Ajax.Calling scripts as success function, but
>> still nothing happens.
>>
>>
>> Is there any magic evaluating the ajax-responses?
>> Can someone give my an hint?
>>
>> Thanx a lot
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: Evaluating wickets ajax-response programatically

2014-04-23 Thread Patrick Davids
Hi Ernesto,

I read the url-member by script from an attribute, we prev. added via 
AttributeAppender.


This is how I execute my ajax call:
$.ajax({
url : url,
type : 'POST',
.
.
.
success: function(data, textStatus, 
jqXHR){
self.processAjaxResponse(data, 
textStatus, jqXHR, data, textStatus);
},
error: function() { alert("error"); }

});

Patrick

Am 23.04.2014 15:09, schrieb Ernesto Reinaldo Barreiro:
> How do you "call" server side AJAX behavior?
>
>
> On Wed, Apr 23, 2014 at 3:01 PM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi all,
>>
>> due to a very complex gui panel with many javascript we are using a
>> quite pure AbstractAjaxBehavior.
>>
>> I print out a callback url, I call it, and so on... and having an
>> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
>> (just a bit different).
>> Its copy-paste, but I dont know how to solve it in a better way.
>>
>> Everything looks good, so far...
>>
>> BUT...
>> when I add some components to the AjaxRequestTarget, the client-side
>> does not evaluate it.
>>
>> So, I had another look at wicket javascripts and found a js method
>> named, which is used on success:
>>
>> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>>
>> "Hmm... should do what I want"...
>>
>> So I put it in my manuall Ajax.Calling scripts as success function, but
>> still nothing happens.
>>
>>
>> Is there any magic evaluating the ajax-responses?
>> Can someone give my an hint?
>>
>> Thanx a lot
>> Patrick
>> -
>> 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



Evaluating wickets ajax-response programatically

2014-04-23 Thread Patrick Davids
Hi all,

due to a very complex gui panel with many javascript we are using a 
quite pure AbstractAjaxBehavior.

I print out a callback url, I call it, and so on... and having an 
onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors 
(just a bit different).
Its copy-paste, but I dont know how to solve it in a better way.

Everything looks good, so far...

BUT...
when I add some components to the AjaxRequestTarget, the client-side 
does not evaluate it.

So, I had another look at wicket javascripts and found a js method 
named, which is used on success:

self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);

"Hmm... should do what I want"...

So I put it in my manuall Ajax.Calling scripts as success function, but 
still nothing happens.


Is there any magic evaluating the ajax-responses?
Can someone give my an hint?

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



Re: jquery ui DatePicker

2014-04-17 Thread Patrick Davids
Hi Dirk,
have a look at http://jqueryui.com/datepicker/#date-formats
and
http://api.jqueryui.com/datepicker/#option-dateFormat
to change the javascript-side jquery date formatting pattern to 
4-letter-year.
(Pay attention, it is a bit different to java date patterns.)

To do so, you have to apply the jquery date pattern as an Option to your 
DatePicker instance on java-side.
Something like this:
new Options("dateFormat", Options.asString("dd.mm.")

kind regards
Patrick

Am 17.04.2014 15:48, schrieb Dirk Wichmann:
> Hi,
>
> is's quite frustrating, I use the jquery ui DatePicker for a valid to
> filed on a user form.
> Everything seems to be ok, but
> I want to display that a user don't expire and so I save 31.12.
> (german date format dd.MM.) in database.
> Now I try to edit a user and the init of the form is OK, but the
> datepicker input field shows always 31.12.99 (two digits in year)
> normally no problem
> If I try to save the data I get a validation error, because the internal
> representation of the date is 31.12.1999.
> After asking google I found a view tips but nothing works for me??
>
> Any help or idea ??
>
> Thanks in advance
> Cheers
> Dirk
>
>
> -
> 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: Handling with Feedback Messages / setMaxMessages(1)-Problem / best practise

2014-03-06 Thread Patrick Davids
Hi Martin,
this works... thanx for your feedback.

kind regards
Patrick

Am 05.03.2014 10:22, schrieb Martin Grigorov:
> Hi,
>
> I don't know what is the idea behind #setMaxMessages(). I hoped someone
> else would explain ...
> To clear the messages you set to mark them as rendered:
>
> fc = new FeedbackCollector(page);
> fc.collect().foreach(fm -> fm.markRendered())  // Java 8 syntax
>
> You can put this code in some #onDetach() method.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Wed, Mar 5, 2014 at 11:14 AM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi François,
>> unfortunately this does not have any affect.
>>
>> Still have all messages in sequence on reloading.
>>
>> kind regards
>> Patrick
>>
>> Am 04.03.2014 17:03, schrieb francois meillet:
>>> Session.get().getFeedbackMessages().clear();
>>>
>>> François
>>>
>>>
>>> On Tue, Mar 4, 2014 at 10:07 AM, Patrick Davids <
>>> patrick.dav...@nubologic.com> wrote:
>>>
>>>> Hi all,
>>>> I would like to have a FeedbackPanel always showing only one error
>> message.
>>>>
>>>> As seen in FeedbackPanel code setMaxMessages() does this.
>>>> But it seems it does not clear the rest of messages after doing its job.
>>>>
>>>> When I have put 3 error messages on a page, only the first one is shown.
>>>> This is what I want, but reloading the page, all other messages are
>>>> shown in sequence as long as I reload the page and until all are
>> processed.
>>>>
>>>> Is setMaxMessage() not the recommended way for what I want to do?
>>>> How can I force a clear?
>>>>
>>>> thanx in advance :-)
>>>> Patrick
>>>> ---------
>>>> 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
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: Best practice for updating JPA object without persisting changes

2014-03-05 Thread Patrick Davids
Hi Chris,
does the Guice's PersistFilter really automatically find and re-attach 
the backed object in the request while leaving the in-place-edit situation?

I thought... as long as "nothing"/nobody finds and re-attach the backed 
object, your changes are "naturally" temporary and only stored on page 
cache.

I would expect, it should already work out-of-the-box... But I did not 
work with Guice's PersistFilter, yet. May I miss something...

kind regards
Patrick

Am 05.03.2014 12:47, schrieb Chris Snyder:
> I'm dealing with an issue that I'm sure has been solved by many people on
> this list, but I'm struggling to ascertain the best way to solve it.
>
> I'm working on implementing in-place-edit functionality for some of our
> site content. The content is stored in a database and mapped via JPA. The
> edit form has the JPA entity as the backing model object.
>
> One of the features I'm implementing is the ability to preview what's been
> entered in the form without the updates being committed to the database
> (until the user explicitly clicks on the "Save" button). I can think of a
> few ways to accomplish this:
>
> 1. Rollback the transaction when not saving - This would require me to
> manage the transaction manually (right now, they're being managed
> automatically by Guice's PersistFilter).
>
> 2. Detach the object from the persistence context, merge it to save - This
> seems like the most elegant solution, but I can see how there could be
> issues (not intractable) with lazy loading.
>
> 3. Prevent the form from updating the model until save - This would break
> my preview panel, and seems to be contrary to how forms normally behave.
>
> 4. Copy the data into a non-managed DTO, copying it back to the JPA object
> on save - Would require a lot of clone/copy code.
>
> This seems like such a common problem to solve - I think my relative
> unfamiliarity with JPA is the main stumbling block here. How have others
> implemented it? Is there a best-practice pattern that my Googling didn't
> discover?
>
> Thanks in advance for the help. I hope that it isn't too off-topic since it
> is mainly JPA-related.
>
> Best,
> Chris
>

Re: Handling with Feedback Messages / setMaxMessages(1)-Problem / best practise

2014-03-05 Thread Patrick Davids
Hi François,
unfortunately this does not have any affect.

Still have all messages in sequence on reloading.

kind regards
Patrick

Am 04.03.2014 17:03, schrieb francois meillet:
> Session.get().getFeedbackMessages().clear();
>
> François
>
>
> On Tue, Mar 4, 2014 at 10:07 AM, Patrick Davids <
> patrick.dav...@nubologic.com> wrote:
>
>> Hi all,
>> I would like to have a FeedbackPanel always showing only one error message.
>>
>> As seen in FeedbackPanel code setMaxMessages() does this.
>> But it seems it does not clear the rest of messages after doing its job.
>>
>> When I have put 3 error messages on a page, only the first one is shown.
>> This is what I want, but reloading the page, all other messages are
>> shown in sequence as long as I reload the page and until all are processed.
>>
>> Is setMaxMessage() not the recommended way for what I want to do?
>> How can I force a clear?
>>
>> thanx in advance :-)
>> Patrick
>> -
>> 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



Handling with Feedback Messages / setMaxMessages(1)-Problem / best practise

2014-03-04 Thread Patrick Davids
Hi all,
I would like to have a FeedbackPanel always showing only one error message.

As seen in FeedbackPanel code setMaxMessages() does this.
But it seems it does not clear the rest of messages after doing its job.

When I have put 3 error messages on a page, only the first one is shown.
This is what I want, but reloading the page, all other messages are 
shown in sequence as long as I reload the page and until all are processed.

Is setMaxMessage() not the recommended way for what I want to do?
How can I force a clear?

thanx in advance :-)
Patrick
-
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-18 Thread Patrick Davids
Hi Paul,
thanx for your answer.

I will have a look at extending it. :-)

kind regards
Patrick

Am 17.02.2014 22:44, schrieb 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
>>
>>
>
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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



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 
getDefaultModel().setObject(object), this
  * method checks authorisation and model comparator, and invokes 
modelChanging and
  * modelChanged 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: Wicket Wizzard Question / Custom Overview Bars

2014-02-10 Thread Patrick Davids
Hi Paul,
thanx a lot for your detailed answer. :-)
Helped much, but my primary question was, why the overviewbar is on the 
left hand side, not on the top.

Possibly the header is what I am looking for, showing the current step 
information(?).

But then, I still do not know, what the overviewbar was originally meant 
for.

Patrick :-)

Am 08.02.2014 19:36, schrieb Paul Bors:
> Find the panel you want to modify, say the WizardButtonBar and extend it:
>
> public class MyWizardButtonBar extends WizardButtonBar {
>  private static final long serialVersionUID = 1L;
>
>  public MyWizardButtonBar(String id, Wizard wizard, final boolean
> finishOnAnyStep) {
>  super(id, wizard);
>  addOrReplace(new MyFinishButton("finish", wizard) {
>  private static final long serialVersionUID = 1L;
>  @Override
>  public boolean isEnabled() {
>  return (super.isEnabled() || finishOnAnyStep);
>  }
>  });
>  }
> }
>
> Then change its HTML to whatever you want, ie MyWizardButtonBar.html I have
> as:
> http://wicket.apache.org";>
>   
>   
> class="toolbox-form-submit" value="[Previous]" />
> class="toolbox-form-submit" value="[Next]" />
> class="toolbox-form-submit" value="[Last]" />
> class="toolbox-form-submit" value="[Cancel]" />
> class="toolbox-form-submit" value="[Finish]" />
>
>   
> 
>
> Finally, extend the Wizard itself and override the factory method you need
> changed:
>
> public class MyWizard extends Wizard {
> ...
> @Override
>  protected Component newButtonBar(String id) {
>  return new MyWizardButtonBar(id, this, finishOnAnyStep());
>  }
> ...
> }
>
> Then change the Wizard's HTML as you please but preserve the Wicket
> component tree hirarachy.
> Something like this:
>
> http://wicket.apache.org";>
>  
>  
>  
>  
>  
>  [[Overview]]
>  
>  
>  
>  
>   class="wicketExtensionsWizardHeader"> wicket:id="header">[[Header]]
>  
>  
>   class="wicketExtensionsWizardView"> class="wicketExtensionsWizardViewInner">[[View]]
>  
>  
>   class="wicketExtensionsWizardFeedback"> wicket:id="feedback">[[Feeback]]
>  
>  
>   class="wicketExtensionsWizardButtonBar"> wicket:id="buttons">[[Buttons]]
>  
>  
>  
>  
>  
>  
>  
> 
>
> On a side note, I didn't like the default of the Finish button so I changed
> that too:
>
> public class MyFinishButton extends WizardButton {
>  private static final long serialVersionUID = 1L;
>
>  public MyFinishButton(String id, IWizard wizard) {
>  super(id, wizard, "org.apache.wicket.extensions.wizard.finish");
>  }
>
>  /**
>   * @see org.apache.wicket.Component#isEnabled()
>   */
>  public boolean isEnabled() {
>  IWizardStep activeStep = getWizardModel().getActiveStep();
>  return (activeStep != null &&
> getWizardModel().isLastStep(activeStep));
>  }
>
>  /**
>   * @see org.apache.wicket.extensions.wizard.WizardButton#onClick()
>   */
>  public final void onClick() {
>  IWizardModel wizardModel = getWizardModel();
>  IWizardStep step = wizardModel.getActiveStep();
>
>  // let the step apply any state
>  step.applyState();
>
>  // if the step completed after applying the state, notify the wizard
>  if(step.isComplete()) {
>  getWizardModel().finish();
>  } else {
>  error(getLocalizer().getString(
>
> "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete",
> this)
>  );
>  }
>  }
> }
>
>
> On Fri, Feb 7, 2014 at 9:04 AM, Patrick Davids > wrote:
>
>> Hi all,
>> did someone already noticed, a custom overriden overview-bar of wickets
>> wizzard is displayed in a  left of the Step contents ?
>>
>> I thought it would be on the top...
>>
>> Or did I misunderstood the meaning of the overview bar?
>> Is it meant as kind of menu?!
>>
>> kind regards
>> Patrick
>
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket Wizzard Question / Custom Overview Bars

2014-02-07 Thread Patrick Davids
Hi all,
did someone already noticed, a custom overriden overview-bar of wickets 
wizzard is displayed in a  left of the Step contents ?

I thought it would be on the top...

Or did I misunderstood the meaning of the overview bar?
Is it meant as kind of menu?!

kind regards
Patrick

Re-Usable Panel with RefreshingView

2013-11-07 Thread Patrick Davids
Hi all,
I would like to implement a reusable panel, containing a refreshing view.

The goal is to delegate the polulateItem(Item item) of the refreshing 
view to the outer client, e.g. the page which uses my panel.
(I force overriding using abstract method).

So far so good.

My problem now is:
My inner refreshing view must provide a webmarkup container, I must use 
to add my custom components from outside (populateItem(item){ 
item.add(myCUstomComponent) }).

Quite ok... but I need to know the inner id in the outer client (kind of 
LazyLoadingPanel), but I dont want having it in this way, providing my 
inner id to the outer "world".

What kind of Repeating/RefreshingView should I use?

I think, I need some sort of mixed Repeating&RefreshignView feature.

RepeatingView works with newChildId(), and can have outer markup (hope I 
understood right),but is not very refreshing.
RefreshingView works in a refreshing way, but must hold its own markup.

Can anyone give some inspiration and help for my reusable panel?

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



Re: Question / Wicket 6 Events / generic payload

2013-10-11 Thread Patrick Davids
Hi Martin,
ok, thanx for your feedback.

kind regards
Patrick

Am 10.10.2013 17:16, schrieb Martin Grigorov:
> Hi,
>
> Wicket's default #onEvent() cannot use the event type due to technical
> problems.
> But different impls of IEventDispatcher can give you the proper type. See
> https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/annotationeventdispatcher-parent
> for
> example.
>
>
> On Mon, Oct 7, 2013 at 3:47 PM, Patrick Davids > wrote:
>
>> Hi all,
>> why does component send method uses generic payload T, but onEvent of
>> Components receives  events?
>>
>> I need to cast it anyway?
>>
>> Whats the benefit of having generics here?
>>
>> kind regards
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.dav...@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Question / Wicket 6 Events / generic payload

2013-10-10 Thread Patrick Davids
Hi all,
why does component send method uses generic payload T, but onEvent of 
Components receives  events?

I need to cast it anyway?

Whats the benefit of having generics here?

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



Re: Wicket DropDownChoice Question about Constructors and its Behavior

2013-09-26 Thread Patrick Davids
Hmm... ok,
does that mean, in forms I do not have to wrap my model(object) into a 
CompundPropertyModel, because DropDownList (or even all FormComponents?) 
automatically joins IComponentInheritedModel hierarchy?

So, as conclusion, by using a constuctor with an empty model (id, new 
Model(), List choices) a exclude my DropDownChoice from the hierarchy?

Patrick

Am 26.09.2013 09:47, schrieb Martin Grigorov:
> Hi,
>
> This use case will work only when the DropDownChoice has a parent in the
> hierarchy with org.apache.wicket.model.IComponentInheritedModel,
> like org.apache.wicket.model.CompoundPropertyModel.
> In this case the dropdown will use a slot from its parent's
> IComponentInheritedModel.
>
>
> On Thu, Sep 26, 2013 at 9:39 AM, Patrick Davids 
> wrote:
>
>> Hi all,
>>
>> since I'm working with Wicket I am a bit confused about the Constructors
>> of DropDownChoice Class.
>>
>> DropDownChoice provides Constructors without any Model or ModelObject.
>> e.g. (id, List choices)
>>
>> This is logical in an use-case, for instance, having just a page with a
>> SelectBox and my first click is about to choose something.
>> And I may do not have any "parent" model object of the page, so I did
>> not bind my DropDownChoice by PropertyModel expressions.
>>
>> So, in such cases...
>>
>> Why Wicket always complaints about "try to set ModelObject of null model"?
>>
>> Yes, I explicitly decided to use DropDownChoice without a model.
>> Since nothing is chosen, the model object of the DropDownChoice is null.
>> The behavior I expect is, the model object is the chosen option (object)
>> after selecting one.
>>
>> But it seems, it does not work like this.
>>
>> Can someone please "light" me. :-)
>>
>> kind regards
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



Wicket DropDownChoice Question about Constructors and its Behavior

2013-09-26 Thread Patrick Davids
Hi all,

since I'm working with Wicket I am a bit confused about the Constructors 
of DropDownChoice Class.

DropDownChoice provides Constructors without any Model or ModelObject.
e.g. (id, List choices)

This is logical in an use-case, for instance, having just a page with a 
SelectBox and my first click is about to choose something.
And I may do not have any "parent" model object of the page, so I did 
not bind my DropDownChoice by PropertyModel expressions.

So, in such cases...

Why Wicket always complaints about "try to set ModelObject of null model"?

Yes, I explicitly decided to use DropDownChoice without a model.
Since nothing is chosen, the model object of the DropDownChoice is null.
The behavior I expect is, the model object is the chosen option (object) 
after selecting one.

But it seems, it does not work like this.

Can someone please "light" me. :-)

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



SOLVED / Re: How to make an own panel work like an e.g. TextField / joining the model hierarchy of page/form

2013-07-25 Thread Patrick Davids
Hi Martin,
thanx, its working, now.

I had some additional convenience constructors in my panel with empty 
model object inits, because some days ago I always ran into "try to set 
on empty model object exceptions". I kept them and I think they forced 
side-effects.

Just having one, only with an id, made it work.

kind regards
Patrick

Am 24.07.2013 09:53, schrieb Martin Grigorov:
> Hi Patrick,
>
>
> On Wed, Jul 24, 2013 at 10:36 AM, Patrick Davids
> wrote:
>
>> Hi Martin,
>> concerning the IComponentInheritedModel I did not not try anything in my
>> panel since yet, because I suppose it should work from the scratch, when
>> a manually wrap the ModelObject on form level into CompundPropertyModel.
>>
>> As I can see CompoundPropertyModel is an IComponentInheritedModel, and I
>> understand, why this works.
>>
>> Form f = new Form("anyid", new CompoundPropertyModel(PersonObject));
>> f.add(new TextField("personName"));
>>
>>
>>
>> My question focused more on, what I should implement in
>> MyOwnTextFieldPanel("personName") to act the same way like an usual
>> textfield, not what I have to do on the parent component/form.
>> An ususal TextField "joins" the Form and its inner CompundPropertyModel
>> (Handling) in a magic way, and I would like to have the same feature for
>> MyOwnTextField.
>>
>
> It should work the same way.
> Just make sure your panel "participates" in the component path.
> For example:
>
> Form f = new Form("anyid", new CompoundPropertyModel(personObject));
> f.add(new YourPanel("namesObject"));
>
> class YourPanel extends Panel {
>public YourPanel(Sting id) {
>   super(id);
>
>   add(new TextField("first"));
>   add(new TextField("last"));
>}
> }
>
>
> With this code the text field's model would be:
> personObject.getNamesObject().getFirst()
>
>
>> regards
>> Patrick
>>
>> Am 23.07.2013 15:21, schrieb Martin Grigorov:
>>> Hi,
>>>
>>>
>>> On Tue, Jul 23, 2013 at 4:17 PM, Patrick Davids <
>> patrick.dav...@nuboit.de>wrote:
>>>
>>>> Hi all,
>>>> I implemented a "TextField-Panel".
>>>> Its kind of FormComponentPanel, but not really... do not have a
>>>> convertInput() situation.
>>>> Just additional behaviors and some own l18n stuff...
>>>>
>>>> Its already working fine, but what I always have to to is, getting the
>>>> modelobject manually and forward into my form (model object), where it
>>>> is used.
>>>>
>>>> I would like to implement it in a way, behaving like CompundProperty
>>>> modeled forms.
>>>>
>>>> I read about an IComponentInheritance marker interface, but I do not
>>>>
>>>
>>> Do you mean org.apache.wicket.model.IComponentInheritedModel ?
>>> It has a demo code in its javadoc.
>>> Show us what you tried.
>>>
>>>
>>>> know, how to use it.
>>>>
>>>> Can some one help?
>>>>
>>>> kind regards and thanx
>>>> Patrick
>>>> -
>>>> 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 make an own panel work like an e.g. TextField / joining the model hierarchy of page/form

2013-07-24 Thread Patrick Davids
Hi Martin,
concerning the IComponentInheritedModel I did not not try anything in my 
panel since yet, because I suppose it should work from the scratch, when 
a manually wrap the ModelObject on form level into CompundPropertyModel.

As I can see CompoundPropertyModel is an IComponentInheritedModel, and I 
understand, why this works.

Form f = new Form("anyid", new CompoundPropertyModel(PersonObject));
f.add(new TextField("personName"));



My question focused more on, what I should implement in 
MyOwnTextFieldPanel("personName") to act the same way like an usual 
textfield, not what I have to do on the parent component/form.
An ususal TextField "joins" the Form and its inner CompundPropertyModel 
(Handling) in a magic way, and I would like to have the same feature for 
MyOwnTextField.

regards
Patrick

Am 23.07.2013 15:21, schrieb Martin Grigorov:
> Hi,
>
>
> On Tue, Jul 23, 2013 at 4:17 PM, Patrick Davids 
> wrote:
>
>> Hi all,
>> I implemented a "TextField-Panel".
>> Its kind of FormComponentPanel, but not really... do not have a
>> convertInput() situation.
>> Just additional behaviors and some own l18n stuff...
>>
>> Its already working fine, but what I always have to to is, getting the
>> modelobject manually and forward into my form (model object), where it
>> is used.
>>
>> I would like to implement it in a way, behaving like CompundProperty
>> modeled forms.
>>
>> I read about an IComponentInheritance marker interface, but I do not
>>
>
> Do you mean org.apache.wicket.model.IComponentInheritedModel ?
> It has a demo code in its javadoc.
> Show us what you tried.
>
>
>> know, how to use it.
>>
>> Can some one help?
>>
>> kind regards and thanx
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


How to make an own panel work like an e.g. TextField / joining the model hierarchy of page/form

2013-07-23 Thread Patrick Davids
Hi all,
I implemented a "TextField-Panel".
Its kind of FormComponentPanel, but not really... do not have a 
convertInput() situation.
Just additional behaviors and some own l18n stuff...

Its already working fine, but what I always have to to is, getting the 
modelobject manually and forward into my form (model object), where it 
is used.

I would like to implement it in a way, behaving like CompundProperty 
modeled forms.

I read about an IComponentInheritance marker interface, but I do not 
know, how to use it.

Can some one help?

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



Re: Wicket/JQuery internals advanced problem / LazyLoadedPanel with AjaxLink / AjaxLink on click not executed

2013-07-18 Thread Patrick Davids
Hi Sven, it's a simple .

Patrick

Am 18.07.2013 16:08, schrieb Sven Meier:
> What's the markup of the component you're binding the AjaxLink to?
>
> Sven
>
> On 07/18/2013 03:53 PM, Patrick Davids wrote:
>> Hi all,
>>
>> I have a very special problem with ajax lazy loaded panels, which
>> contains ajax links.
>>
>> Problem: AjaxLink does not execute "onclick". Does not reach server / no
>> client-side execution in browser occurs.
>>
>> What I investigated until now:
>> - client-side script evaluation of lazy loading panel works.
>>
>> I can see script like this:
>> {Wicket.Ajax.ajax({"u":"./page?6-8.IBehaviorListener.VERY_LONG_ID","e":"click","c":"edtc5"});})();
>>
>>
>> - I stepped into the evaluated javascript code Wicket.Ajax.ajax(attrb)
>> with firebug.
>>
>> - inside a jquerys each() iterates over all elements, and adds onclick
>> event handling to the particular element/a-link ("c":"edtc5" of script
>> above).
>>
>> see:
>> wicket-ajax-jquery-ver-xyz.js
>> line: 1800
>> jQuery.each(attrs.e, function (idx, evt) {
>>Wicket.Event.add(attrs.c, evt, function (jqEvent, data) {
>>  var call = new Wicket.Ajax.Call();
>>   var attributes = jQuery.extend({}, attrs);
>>   attributes.event = Wicket.Event.fix(jqEvent);
>> ...
>>
>>
>> So far so good...
>> At this point it gets to deep for me. :-/
>>
>>
>> Can any wicket pro please help, why the onclick (I think its binded
>> correctly) of my link does not get fired to let execute the ajax request?
>>
>>
>> I already made a quickstart with different lazyloaded panels, and all
>> ajaxlinks are working fine.
>>
>> kind regards
>> Patrick
>> ---------
>> 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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Wicket/JQuery internals advanced problem / LazyLoadedPanel with AjaxLink / AjaxLink on click not executed

2013-07-18 Thread Patrick Davids
Hi all,

I have a very special problem with ajax lazy loaded panels, which 
contains ajax links.

Problem: AjaxLink does not execute "onclick". Does not reach server / no 
client-side execution in browser occurs.

What I investigated until now:
- client-side script evaluation of lazy loading panel works.

I can see script like this:
{Wicket.Ajax.ajax({"u":"./page?6-8.IBehaviorListener.VERY_LONG_ID","e":"click","c":"edtc5"});})();

- I stepped into the evaluated javascript code Wicket.Ajax.ajax(attrb) 
with firebug.

- inside a jquerys each() iterates over all elements, and adds onclick 
event handling to the particular element/a-link ("c":"edtc5" of script 
above).

see:
wicket-ajax-jquery-ver-xyz.js
line: 1800
jQuery.each(attrs.e, function (idx, evt) {
  Wicket.Event.add(attrs.c, evt, function (jqEvent, data) {
var call = new Wicket.Ajax.Call();
 var attributes = jQuery.extend({}, attrs);
 attributes.event = Wicket.Event.fix(jqEvent);
...


So far so good...
At this point it gets to deep for me. :-/


Can any wicket pro please help, why the onclick (I think its binded 
correctly) of my link does not get fired to let execute the ajax request?


I already made a quickstart with different lazyloaded panels, and all 
ajaxlinks are working fine.

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



Re: conditional component / as singleton on page

2013-07-05 Thread Patrick Davids
Hi Sebastien, Hi Martin,
the dialog was just an example.

My question was more focused on a feature similar to the javascript or 
css resource "wicket feature".
Putting a resource only once into the page header no matter how many 
components "requested" to do that.

But on component level.

(I am in a case with a repeating view.)

Patrick

Am 05.07.2013 11:55, schrieb Sebastien:
> Hi Patrick,
>
> I am using the same approach as Martin.
>
> Just a little additional note: if you want to have only one dialog
> placeholder for different dialogs/purposes and as I am thinking you are
> using jQuery UI's dialog, I would suggest you to have a look at this issue
> for the dialog to open correctly (it is a common problem while using jQuery
> UI's dialog)
>
> https://github.com/sebfz1/wicket-jquery-ui/issues/44
>
> Explanations here:
> http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/
>
> Best regards,
> Sebastien.
>
>
> On Fri, Jul 5, 2013 at 11:39 AM, Martin Grigorov wrote:
>
>> Hi,
>>
>> We use something similar for showing dialog/flyout.
>> The component is always in the page, but it renders itself only when it has
>> contents.
>> You can put your component anywhere in the page hierarchy and use Wicket
>> events to update it.
>>
>>
>> On Fri, Jul 5, 2013 at 12:15 PM, Patrick Davids >> wrote:
>>
>>> Hi all,
>>> does anyone have a best practice putting a component on a page (as
>>> singleton) independendly how many other components on that page "needs"
>> it?
>>>
>>> e.g. a global dialog, which can be used from different components.
>>> Not to have 20 invisible dialogs aleady rendered and opened on request.
>>>
>>> In out special to achieve this we do not want use page inheritence.
>>> This component shouldn't be on page, if no other component needs it.
>>>
>>> thanx for help...
>>> kind regards
>>> Patrick
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



conditional component / as singleton on page

2013-07-05 Thread Patrick Davids
Hi all,
does anyone have a best practice putting a component on a page (as 
singleton) independendly how many other components on that page "needs" it?

e.g. a global dialog, which can be used from different components.
Not to have 20 invisible dialogs aleady rendered and opened on request.

In out special to achieve this we do not want use page inheritence.
This component shouldn't be on page, if no other component needs it.

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



Solved / Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Whem I'm using Wicket.Ajax.get(...) to execute my AjaxCall via 
JavaScript it works.

Previously I used pure jquery $.ajax(...) and that does not work.

kind regards
Patrick

Am 07.06.2013 14:02, schrieb Patrick Davids:
> Runs into WicketRuntimeExceptions (but they are catched).
>
> e.g.
> org.apache.wicket.WicketRuntimeException: Error attaching this container
> for rendering: [Menu [Component id = offices]]
>
> Patrick
>
> Am 07.06.2013 13:33, schrieb Sven Meier:
>> Put a break point on RequestCycle#execute() and debug what's happening
>> when you're Javascript is firing.
>>
>> Sven
>>
>> On 06/07/2013 01:27 PM, Patrick Davids wrote:
>>> Hmm... "select", but is fired via jquery on client side, and I do the
>>> ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my
>>> own.
>>>
>>> (Im working with jquerys autocomplete.)
>>>
>>> Patrick
>>>
>>>
>>>
>>> Am 07.06.2013 12:48, schrieb Sven Meier:
>>>> On what JavaScript event is your behavior listening?
>>>>
>>>> Sven
>>>>
>>>> On 06/07/2013 12:38 PM, Patrick Davids wrote:
>>>>> Hi all,
>>>>> I implemented a panel having its own AbstractAjaxBehavior.
>>>>>
>>>>> I provided the callback url to my pagepanel, the ajax request works;
>>>>> everything seems fine.
>>>>>
>>>>> Than I implemented an abstract method onSelect() to my panel to let an
>>>>> implementation do some custom thinks (the onRequest() of my internal
>>>>> behavior just delegates to abstract onSelect() of my panel)
>>>>>
>>>>> My first test... simply doing a:
>>>>>
>>>>> add(new MyPanel("foo"){
>>>>>   public void onSelect(){
>>>>> setResponsePage(some where)
>>>>>   }
>>>>> )
>>>>>
>>>>> but nothing happens...
>>>>>
>>>>> Using AbstractAjaxDefaultBehavior overriding respond() and
>>>>> delegating to
>>>>> onSelect() does not work, too.
>>>>>
>>>>> Do I have to do something special, to behave like an e.g. AjaxLink?!?
>>>>> setResponsePage() is working there...
>>>>>
>>>>> kind regards
>>>>> Patrick
>>>>> -
>>>>> 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
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Runs into WicketRuntimeExceptions (but they are catched).

e.g.
org.apache.wicket.WicketRuntimeException: Error attaching this container 
for rendering: [Menu [Component id = offices]]

Patrick

Am 07.06.2013 13:33, schrieb Sven Meier:
> Put a break point on RequestCycle#execute() and debug what's happening
> when you're Javascript is firing.
>
> Sven
>
> On 06/07/2013 01:27 PM, Patrick Davids wrote:
>> Hmm... "select", but is fired via jquery on client side, and I do the
>> ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my
>> own.
>>
>> (Im working with jquerys autocomplete.)
>>
>> Patrick
>>
>>
>>
>> Am 07.06.2013 12:48, schrieb Sven Meier:
>>> On what JavaScript event is your behavior listening?
>>>
>>> Sven
>>>
>>> On 06/07/2013 12:38 PM, Patrick Davids wrote:
>>>> Hi all,
>>>> I implemented a panel having its own AbstractAjaxBehavior.
>>>>
>>>> I provided the callback url to my pagepanel, the ajax request works;
>>>> everything seems fine.
>>>>
>>>> Than I implemented an abstract method onSelect() to my panel to let an
>>>> implementation do some custom thinks (the onRequest() of my internal
>>>> behavior just delegates to abstract onSelect() of my panel)
>>>>
>>>> My first test... simply doing a:
>>>>
>>>> add(new MyPanel("foo"){
>>>>  public void onSelect(){
>>>>setResponsePage(some where)
>>>>  }
>>>> )
>>>>
>>>> but nothing happens...
>>>>
>>>> Using AbstractAjaxDefaultBehavior overriding respond() and
>>>> delegating to
>>>> onSelect() does not work, too.
>>>>
>>>> Do I have to do something special, to behave like an e.g. AjaxLink?!?
>>>> setResponsePage() is working there...
>>>>
>>>> kind regards
>>>> Patrick
>>>> -
>>>> 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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Hmm... "select", but is fired via jquery on client side, and I do the 
ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my 
own.

(Im working with jquerys autocomplete.)

Patrick



Am 07.06.2013 12:48, schrieb Sven Meier:
> On what JavaScript event is your behavior listening?
>
> Sven
>
> On 06/07/2013 12:38 PM, Patrick Davids wrote:
>> Hi all,
>> I implemented a panel having its own AbstractAjaxBehavior.
>>
>> I provided the callback url to my pagepanel, the ajax request works;
>> everything seems fine.
>>
>> Than I implemented an abstract method onSelect() to my panel to let an
>> implementation do some custom thinks (the onRequest() of my internal
>> behavior just delegates to abstract onSelect() of my panel)
>>
>> My first test... simply doing a:
>>
>> add(new MyPanel("foo"){
>> public void onSelect(){
>>   setResponsePage(some where)
>> }
>> )
>>
>> but nothing happens...
>>
>> Using AbstractAjaxDefaultBehavior overriding respond() and delegating to
>> onSelect() does not work, too.
>>
>> Do I have to do something special, to behave like an e.g. AjaxLink?!?
>> setResponsePage() is working there...
>>
>> kind regards
>> Patrick
>> -
>> 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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Hi all,
I implemented a panel having its own AbstractAjaxBehavior.

I provided the callback url to my pagepanel, the ajax request works; 
everything seems fine.

Than I implemented an abstract method onSelect() to my panel to let an 
implementation do some custom thinks (the onRequest() of my internal 
behavior just delegates to abstract onSelect() of my panel)

My first test... simply doing a:

add(new MyPanel("foo"){
   public void onSelect(){
 setResponsePage(some where)
   }
)

but nothing happens...

Using AbstractAjaxDefaultBehavior overriding respond() and delegating to 
onSelect() does not work, too.

Do I have to do something special, to behave like an e.g. AjaxLink?!?
setResponsePage() is working there...

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



Re: AutoCompleteTextField issues

2013-05-15 Thread Patrick Davids
Hi,
as far as I remember I solved that by using one of the avalaible ACTF 
constructors with Class type.

new AutoCompleteTextField("code", xYZTypeModel, renderer, XYZ.class)

Patrick

Am 14.05.2013 23:26, schrieb saty:
> I have used this before as a simple String model which works fine but with
> other types i have some isues going on any help would be appreciated.
>
> using:
>
> final AutoCompleteTextField something = new
> AutoCompleteTextField("code", xYZTypeModel, renderer)
>
> the options are displayed correctly selects fine too but
>
> XYZ.getObject() call throws exception:
>
> java.lang.ClassCastException: java.lang.String cannot be cast to XYZ
>
> not sure how it is able to Set String in a XYZ type.
>
>
> I am using below renderer
>
> IAutoCompleteRenderer renderer = new
> AbstractAutoCompleteTextRenderer()
>   {
>   private static final long serialVersionUID = 1L;
>   @Override
>   protected String getTextValue(XYZ object)
>   {
>   return XYX.getDisplayText();
>   }
>   
>   };
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-issues-tp4658798.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
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



Need help with FeedbackMessageFilter

2013-04-19 Thread Patrick Davids
Hi all,

I have a FeedbackPanel in my page and a FeedbackPanel in the form of my 
page.

Both feedback panels show feedback messages of the form.

I tried formfeedbackPanel.setFilter(new 
ComponentFeedbackMessageFilter(theForm)).

I tried formfeedbackPanel.setFilter(new 
ContainerFeedbackMessageFilter(theForm)).

But nothing works...
Thanx for help.

regards
Patrick

Re: Question / extracting models in constructors

2013-04-10 Thread Patrick Davids
Thank you. :-)
Interesting concept...

Unfortunately still have the question:
Why is it recommended not to extract a given model (1), if it is just 
needed to create another empty model (2) via a servicecall in a 
constructor (I do not hold a reference to model (1) as member in the 
page or component)?

And why should I explicitly not do an extract in a constructor?

I'm asking because our discussion always ends into "we have to extract 
it anyway, just somewhere else."

regards
Patrick


Am 10.04.2013 17:04, schrieb Sven Meier:
> public abstract class CreateAndSetIfNull extends
> AbstractReadOnlyModel {
>
>private T model;
>
>public CreateAndSetIfNull(IModel model) {
>  this.model = model;
>}
>
>public T getObject() {
>  T t = model.getObject();
>  if (t == null) {
>t = onCreate();
>model.setObject(t);
>  }
>  return t;
>}
>
>public void detach() {
>  model.detach();
>    }
>
>    protected abstract T onCreate();
> }
>
>
> On 04/10/2013 04:47 PM, Patrick Davids wrote:
>> Hi Sven,
>> and who calls onCreate() and when is it called?
>>
>> regards
>> Patrick
>>
>> Am 10.04.2013 16:20, schrieb Sven Meier:
>>>> extracting model [objects] in constructors of components.
>>>> Best practices says: DONT
>>> How about creating the address lazily?
>>>
>>> IModel address = new CreateAndSetIfNull(new
>>> PropertyModel(person, "address")) {
>>>   protected Address onCreate() {
>>>  return addressService.newAddress();
>>>   }
>>> };
>>>
>>> Regards
>>> Sven
>>>
>>>
>>>
>>> On 04/10/2013 03:56 PM, Patrick Davids wrote:
>>>> Hi together,
>>>>
>>>> I'm in a discussion with my collegues about extracting models in
>>>> constructors of components.
>>>>
>>>> Best practices says: DONT, because of accidently holding references of
>>>> extrated objects / out of mems / etc.
>>>>
>>>> But, if we want to have a component containing a form is responsable to
>>>> create its own emtpy model, if not created yet.
>>>>
>>>> Is it ok, to extract a model "temporary"?
>>>>
>>>> here an axample:
>>>>
>>>> A person has an address.
>>>> An extra component panel with form fields for creating/editing
>>>> addresses
>>>> exists (nested forms pattern).
>>>> The AdressComponent gets a model of person.
>>>>
>>>> In case of: person does not have an address, yet.
>>>>
>>>> Is it allowed to extract the person model, to make a service call
>>>> somewhere to let create an empty address object for this particular
>>>> person and then setting the model object on my own?
>>>>
>>>> We would like to have the knowledge about creation and saving addresses
>>>> put toghether in the AddressComponent instead of having the knowledge
>>>> about saving inside (onSubmit() of form), and the knowledge about
>>>> creation outside the AddressComponent.
>>>>
>>>> kind regards
>>>> Patrick
>>>> -
>>>> 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
>>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



Question / extracting models in constructors

2013-04-10 Thread Patrick Davids
Hi together,

I'm in a discussion with my collegues about extracting models in 
constructors of components.

Best practices says: DONT, because of accidently holding references of 
extrated objects / out of mems / etc.

But, if we want to have a component containing a form is responsable to 
create its own emtpy model, if not created yet.

Is it ok, to extract a model "temporary"?

here an axample:

A person has an address.
An extra component panel with form fields for creating/editing addresses 
exists (nested forms pattern).
The AdressComponent gets a model of person.

In case of: person does not have an address, yet.

Is it allowed to extract the person model, to make a service call 
somewhere to let create an empty address object for this particular 
person and then setting the model object on my own?

We would like to have the knowledge about creation and saving addresses 
put toghether in the AddressComponent instead of having the knowledge 
about saving inside (onSubmit() of form), and the knowledge about 
creation outside the AddressComponent.

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



Re: Solved / Re: Need help setting visibility via AjaxFormChoiceComponentUpdatingBehavior

2013-03-28 Thread Patrick Davids
I read this article and my first approach was like

"If an outside component controls another’s visibility the best way is 
to override the controlling component’s onConfigure() and call 
controlled.setVisible()"

But this doesnt worked, because onConfigure() of my RadioChoice runs 
only once.

What I can do to force onConfigure() of RadioChoice again is, also 
adding it to the AjaxRequestTarget.

r.add(new AjaxFormChoiceComponentUpdatingBehavior(){
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
->   target.add(r);
  target.add(wmc);
  }
  }

This works, too...

I am not sure now, whats the better way... *lol*

Determine "my" visibility in my onConfigure() by watching the state of 
the controller by myself, and adding only one object to the 
AjaxRequestTarget.

or

Let set the visibility of "me" by a controller and adding two objects to 
the AjaxRequestTarget, so the onConfigure() of the controller can do its 
visibility setting job.

Pull or Push?

regards
Patrick


Am 28.03.2013 14:40, schrieb Martin Grigorov:
> See
> http://wicketinaction.com/2011/11/implement-wicket-component-visibility-changes-properly/
>
>
> On Thu, Mar 28, 2013 at 3:36 PM, Patrick Davids 
> wrote:
>
>> I am not sure what exactly was wrong.
>> Perhaps I had too much code with several active setVisibility...() XYZs
>> code parts.
>>
>> I started from the beginning and found the beautiest way for me, looking
>> like this.
>>
>> final RadioChoice r = new RadioChoice("id",
>> Model.of(""), Arrays.asList(new String[{"visible","invisible"}));
>>
>> r.setModelObject("visible");
>>
>> final WebMarkupContainer wmc = new WebMarkupContainer("wmc"){
>>  @Override
>>  protected void onConfigure() {
>>  if(r.getValue().equals("0")){
>>  setVisibilityAllowed(true);
>>  }
>>  if(r.getValue().equals("1")){
>>  setVisibilityAllowed(false);
>>  }
>> }
>> wmc.setOutputMarkupPlaceholderTag(true);
>>
>> r.add(new AjaxFormChoiceComponentUpdatingBehavior(){
>>  @Override
>>  protected void onUpdate(AjaxRequestTarget target) {
>>  target.add(wmc);
>>  }
>>  }
>> );
>>
>>
>> 
>> onConfigure() is always be executed, and can toggle the visibility.
>>
>> AjaxFormChoiceComponentUpdatingBehavior.onUpdate() just pushes back the
>> wmc, and due to onConfigure() of the wmc it determines its visibility
>> depending on the new state of RadioCoice r.
>>
>> kind regards
>> Patrick
>>
>>
>> Am 28.03.2013 13:44, schrieb Martin Grigorov:
>>> Hi,
>>>
>>> All you have explained should just work.
>>> It seems the component is still invisible after setVisible(true). Maybe
>> you
>>> override it later ?! As you said in #onConfigure() or #isVisible()
>> returns
>>> false ?
>>> Please show some code.
>>>
>>>
>>> On Thu, Mar 28, 2013 at 12:30 PM, Patrick Davids
>>> wrote:
>>>
>>>> Additional info:
>>>>
>>>> Its now working partially...
>>>>
>>>> I removed the onConfigure() of the markup container to determine the
>>>> initial visibility of itself depending on the radio default choice.
>>>>
>>>> So, my question changes to:
>>>> Whats the best way todo such an initial visibility without affecting the
>>>> ajax visibility changing?
>>>>
>>>> Patrick
>>>>
>>>>
>>>> Am 28.03.2013 11:18, schrieb Sven Meier:
>>>>>> My behavior on the gui is:
>>>>>> - the first render process of the page itself shows the container once
>>>>>> - on clicking my radiochoice the webmarkupcontainer disappears but is
>>>>>> still available, due to outPutMarkUpPlaceHolder true, but the content
>> is
>>>>>> completly removed and the visibility of the container is always
>>>>>> display:none.
>>>>>>
>>>>>> Using setVisible or using setVisibilityAllowed does not make any
>>>> changes.
>>>>>
>>>>> So your container disappears but does not show up again after setting
>> it
>>>>> vis

Solved / Re: Need help setting visibility via AjaxFormChoiceComponentUpdatingBehavior

2013-03-28 Thread Patrick Davids
I am not sure what exactly was wrong.
Perhaps I had too much code with several active setVisibility...() XYZs 
code parts.

I started from the beginning and found the beautiest way for me, looking 
like this.

final RadioChoice r = new RadioChoice("id", 
Model.of(""), Arrays.asList(new String[{"visible","invisible"}));

r.setModelObject("visible");

final WebMarkupContainer wmc = new WebMarkupContainer("wmc"){
@Override
protected void onConfigure() {
if(r.getValue().equals("0")){
setVisibilityAllowed(true);
}
if(r.getValue().equals("1")){
setVisibilityAllowed(false);
}
}
wmc.setOutputMarkupPlaceholderTag(true);

r.add(new AjaxFormChoiceComponentUpdatingBehavior(){
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(wmc);
}
}
);



onConfigure() is always be executed, and can toggle the visibility.

AjaxFormChoiceComponentUpdatingBehavior.onUpdate() just pushes back the 
wmc, and due to onConfigure() of the wmc it determines its visibility 
depending on the new state of RadioCoice r.

kind regards
Patrick


Am 28.03.2013 13:44, schrieb Martin Grigorov:
> Hi,
>
> All you have explained should just work.
> It seems the component is still invisible after setVisible(true). Maybe you
> override it later ?! As you said in #onConfigure() or #isVisible() returns
> false ?
> Please show some code.
>
>
> On Thu, Mar 28, 2013 at 12:30 PM, Patrick Davids
> wrote:
>
>> Additional info:
>>
>> Its now working partially...
>>
>> I removed the onConfigure() of the markup container to determine the
>> initial visibility of itself depending on the radio default choice.
>>
>> So, my question changes to:
>> Whats the best way todo such an initial visibility without affecting the
>> ajax visibility changing?
>>
>> Patrick
>>
>>
>> Am 28.03.2013 11:18, schrieb Sven Meier:
>>>> My behavior on the gui is:
>>>> - the first render process of the page itself shows the container once
>>>> - on clicking my radiochoice the webmarkupcontainer disappears but is
>>>> still available, due to outPutMarkUpPlaceHolder true, but the content is
>>>> completly removed and the visibility of the container is always
>>>> display:none.
>>>>
>>>> Using setVisible or using setVisibilityAllowed does not make any
>> changes.
>>>
>>> So your container disappears but does not show up again after setting it
>>> visible?
>>>
>>> Sven
>>>
>>> On 03/28/2013 11:12 AM, Patrick Davids wrote:
>>>> Hi together,
>>>> I searched the web for several hours and always get the same results for
>>>> setting the visibilty for components via ajax, but I cannot get it work.
>>>>
>>>> The "should work" solution is:
>>>> - Creat an extra a WebMarkupContainer in your page
>>>> - add your subcomponents to this container
>>>> - setOutPutMarkUpIdPlacerHolderTag(true) for the container
>>>> - implement ajax anywhere (in my case its an
>>>> AjaxFormChoiceComponentUpdatingBehavior)
>>>> - override its onUpdate and setVisibilty of the container true or false
>>>> depending on something
>>>> - do target.add( the webmarkupcontainer )
>>>>
>>>> Tada... but nothing happens.
>>>>
>>>> My problems are:
>>>> All solutions I found are about 2-5 years old, so:
>>>> - the usage of setVisibilty has changed (setVisible vs.
>>>> setVisibilityAllowed() discussion)
>>>> - target does not have an addComponent() method anymore (but this is
>>>> easy, should be add(...))
>>>> - perhaps the hole "SetVisibilityViaAjax"-way has changed since newer
>>>> wicket versions?
>>>>
>>>> My behavior on the gui is:
>>>> - the first render process of the page itself shows the container once
>>>> - on clicking my radiochoice the webmarkupcontainer disappears but is
>>>> still available, due to outPutMarkUpPlaceHolder true, but the content is
>>>> completly removed and the visibility of the container is always
>>>> display:none.
>>>>
>>>> Using setVisible or using setVisibilityAllowed does not make any
>> changes.
>>>>
>>>> Whats wrong

  1   2   >