Re: LambdaModel use

2018-11-08 Thread Bas Gooren
Hi,

The LambdaModel method you are referring to is dependant on another model:

public static  IModel of(IModel target, SerializableFunction getter, SerializableBiConsumer setter)

Since the setter depends on the target model, the target model object needs
to be non-null for the setter to be able to do anything (you can’t set a
property on a null object reference).

If I look at the current master branch [1], I see that the functionality
you probably are looking for is present:

public static  IModel of(SerializableSupplier getter,
SerializableConsumer setter)

… which is simply a model which delegates getting and setting the value to
the specified supplier and consumer, without having a target model.

1)
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/model/LambdaModel.java

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 9 november 2018 bij 08:30:39, Илья Нарыжный (phan...@ydn.ru) schreef:

Hello,

How it was expected to use LambdaModel with setters?
Right now it seems to be not quite usable, because, of the following code
inside:

@Override
public void setObject(R r)
{
X x = target.getObject();
if (x != null)
{
setter.accept(x, r);
}
}

As you can see, if previous value of target model is null, there is no way
to change it. Why?
And also it will be interesting to know why SerializableBiConsumer was used
for a setter?

Thanks,
Ilia

-
Orienteer(http://orienteer.org) - open source Business Application Platform


LambdaModel use

2018-11-08 Thread Илья Нарыжный
Hello,

How it was expected to use LambdaModel with setters?
Right now it seems to be not quite usable, because, of the following code
inside:

@Override
public void setObject(R r)
{
   X x = target.getObject();
   if (x != null)
   {
  setter.accept(x, r);
   }
}

As you can see, if previous value of target model is null, there is no way
to change it. Why?
And also it will be interesting to know why SerializableBiConsumer was used
for a setter?

Thanks,
Ilia

-
Orienteer(http://orienteer.org) - open source Business Application Platform


Re: Wicket 8 ModalWindow autosizing problem

2018-11-08 Thread daniel
Thanks for the tip.

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

--
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



Re: Wicket 8 ModalWindow autosizing problem

2018-11-08 Thread daniel
Thanks for the tip.

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

--
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