Problem with

2015-12-22 Thread Malte Neumann

Hi all,

I habe a problem with the  element inside a list. If I 
add the element to my markup, the design of the list is broken in 
firefox and Chrome (windows) during designtime. Runs the markup inside 
wicket, everything works.


Here is an example of my Problem. If you open the markup in your 
browser, you see that the two lists looks different, although they 
should look the same.




ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
}

li {
border: solid red thin;
width: 25vw;
}





Item 1
Item 2
Item 3
Item 4


Item 1

Item 2
Item 3
Item 4






Does anyone have an idea on how to fix that? Otherwise I always get 
problems with my markup designer.


Regards
Malte




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



Re: Custom Component Converter not called

2013-09-08 Thread Malte Neumann

Am 07.09.2013 22:19, schrieb Sven Meier:
if you don't specify the type, a TextField will try to resolve the 
type from its model, see AbstractTextComponent#resolveType() and 
IObjectClassAwareModel.

Thanks for this hint.

During further tests after my mail, I found a situtation where the 
convertToString is called, but not the convertToObject. The initial 
situation is the same as described in the first mail. Then the model is 
updated by an ajax-call from null to a value, the output call my 
ToString-Method, but a later form submit doesn't call the 
ToObject-Method. It seems the problem occurs in 
AbstractTextComponent.resolveType. This function tries only once to 
resolve the type. In the first call the function sets type to null.


This is not my problem anymore. I can solve my special problem with the 
IObjectClassAwareModel.


Malte




Shouldn't there be a pre-examination wheter a component converter is 
available?


Without type there can't be a converter.

Sven

On 09/07/2013 08:42 PM, Malte Neumann wrote:

Hello!

I've got a problem with a TextField and the depending 
CustomConverter. The converter of the component is not been called. 
So the default converter takes the task and fails.


In my case this problem occurs when my IModel.getObject returns null.

The problem arises in the FormComponent.convertInput method. Because 
of the null value, the typeName is null and a generic typcast is made 
and fails. Shouldn't there be a pre-examination wheter a component 
converter is available?


If I explicitly set  a type through TextField.setType my converter is 
called correctly.


Is that behaviour intended this way?

Malte

-
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



Custom Component Converter not called

2013-09-07 Thread Malte Neumann

Hello!

I've got a problem with a TextField and the depending CustomConverter. 
The converter of the component is not been called. So the default 
converter takes the task and fails.


In my case this problem occurs when my IModel.getObject returns null.

The problem arises in the FormComponent.convertInput method. Because of 
the null value, the typeName is null and a generic typcast is made and 
fails. Shouldn't there be a pre-examination wheter a component converter 
is available?


If I explicitly set  a type through TextField.setType my converter is 
called correctly.


Is that behaviour intended this way?

Malte

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



AjaxEventBehavior that catch only some keypresses

2013-01-23 Thread Malte

Hi!

I want write an AjaxEventBehavior that calls the server if an function
key is pressed. Im also need to know on serverside which key is
pressed.

I'd tried it with this code:
public HomePage(final PageParameters parameters) {
super(parameters);

add(new AjaxEventBehavior(keydown){
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes 
attributes) {

super.updateAjaxAttributes(attributes);

IAjaxCallListener listener = new AjaxCallListener(){
@Override
public CharSequence getPrecondition(Component component) {
//this javascript code evaluates wether an
//ajaxcall is necessary.
//Here only by keyocdes for F9 and F10
return  var keycode = 
Wicket.Event.keyCode(attrs.event); +

if ((keycode == 120) || (keycode == 121)) +
return true; +
else +
return false;;
}
};
attributes.getAjaxCallListeners().add(listener);

//Append the pressed keycode to the ajaxrequest
attributes.getDynamicExtraParameters()
.add(var eventKeycode = 
Wicket.Event.keyCode(attrs.event); +

 return {keycode: eventKeycode};);
}

@Override
protected void onEvent(AjaxRequestTarget target) {
//Extract the keycode parameter from RequestCycle
final Request request = RequestCycle.get().getRequest();
final String jsKeycode = request.getRequestParameters()
.getParameterValue(keycode).toString();

target.appendJavaScript(alert('from wicket ajax. you
pressed +jsKeycode+'));
}

});

My Problem is, that this blocking all Inputevents on all Inputfields
on the page. I find out, that the result false in the
Preconditionscript cause in a stopping of Eventhandling.

What can I do, that only the keys 120 and 121 result in an
ajaxcallback and leave all other keyevents untouched?


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