Re: How to set Javascript error handler for Wicket Ajax error

2012-10-31 Thread Istvan Jozsa
I'm using Wicket-1.5.
Figured out that an AjaxCallDecorator with failure handler almost
solves my problem.

What parameters are passed to failure handler of an Ajax call decorator ?
(to be able to figure out type of failure)

stefan

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



Re: Status of wicketstuff jquery integration

2012-05-02 Thread Istvan Jozsa
Try this: http://code.google.com/p/jqwicket/

Allow high/low level jQuery/UI access.
(sometimes low level JavaScripting is required).
Tried all libraries you mentioned but JqWicket
looks to be the most promising.
To make my life easier I modified it,
JQBehavior extends AbstractDefaultAjaxBehavior
(instead Behavior).

stefan

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



Re: ModalWindow update size

2010-11-22 Thread Istvan Jozsa
// add to your ModalWindow constructor:
setWidthUnit("em");
setHeightUnit("em");
setResizable(false);
setOutputMarkupId(true);

@Override
public void show(AjaxRequestTarget target) {
super.show(target);
// ...
int width = ...;
int height = ...;
target.appendJavascript(""//
+ "var thisWindow = Wicket.Window.get();\n"//
+ "if (thisWindow) {\n"//
+ "thisWindow.window.style.width = \"" + width + "em\";\n"//
+ "thisWindow.content.style.height = \"" + height + "em\";\n"//
+ "thisWindow.center();\n"//
+ "}"//
);
}


Re: setDefaultButton works in all browsers?

2010-09-22 Thread Istvan Jozsa
Had/have problems on IE7.
Never worked in a form being in a modal window (panel).

Stefan


On Tue, Sep 21, 2010 at 4:54 PM, Anna Simbirtsev wrote:

> I am using setDefaultButton to submit the form using enter key. It
> seems to be working ok, but I have read on the internet that people
> are having problems in some browsers. Does anybody have any
> recommendations?
>
> Thanks
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Welcome Martin Grigorov as a core team member

2010-08-04 Thread Istvan Jozsa
Congrats Martin !


Re: jQuery Accordion implementation

2010-06-10 Thread Istvan Jozsa
Go ahead,

Istvan

On Thu, Jun 10, 2010 at 2:12 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> "Just do it" ;)
>
> 2010/6/10 Stefan Lindner :
> > I'm starting to implement jQuery's Accordion for jWicket now. Any
> > suggestions/wishes?
> >
> > Stefan
> >
> > -
> > 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: drag and drop

2010-06-07 Thread Istvan Jozsa
My seqnums are persistently stored,
when items are retrieved so the seqnum.
I used models to pass and get item data:

@Override
public void populateItem(final Item item) {
final ItemData itemData = item.getModelObject();
item.add(new MyLink("title", new DraggableModel(itemData) {
@Override
public String getObject() {
return itemData.getTitle();
}
@Override
public DraggableModel onDrop(AjaxRequestTarget target,
DroppableModel droppableModel) {
// check where the item was dropped (my items can be dropped in
more containers)
if (droppableModel.getType() == Droppable.RESEQUENCER) {
// clip D&D-ed into clip seqnum updater
Integer newSeqnum = (Integer) (droppableModel.getMobject());
if (newSeqnum.equals(itemData.getSeqnum())) {
return null;
}
// update your data in persistent store
return null;
} // else (if any)
}
}
add(new DraggableBehavior() {
{
setName(Draggable.PRODUCT.name());
setRevert(DraggableBehavior.DragRevertMode.ALWAYS);
setRevertDuration(0);
setHelper(DragHelperMode.CLONE);
setOpacity(Opacity.LOW);
}
});
add(new DroppableBehavior() {
{
setHoverClass("resequencerHover");
setTolerance(DropTolerance.POINTER);
setDraggablesAcceptedByDroppable(new
DraggablesAcceptedByDroppable(Draggable.PRODUCT.name()));
}
@Override
protected void onDrop(AjaxRequestTarget target, final Component
component, final SpecialKeys keys) {
DraggableModel model = (DraggableModel)
component.getDefaultModel();
// the container invokes the onDrop() callback of item, passing
container's data, so that
// the item can figure out where was dropped
model.onDrop(target, new
DroppableModel(Droppable.RESEQUENCER, itemData.getSeqnum()));
}
});
add(new AttributeAppender("class", true, new
AbstractReadOnlyModel() {
@Override
public String getObject() {
return "resequencer";
}
}, " "));
}
public abstract class DraggableModel extends
AbstractReadOnlyModel {
protected Draggable type;
protected T mobject;
public DraggableModel(Draggable type) {
this.type = type;
}
public DraggableModel(T object) {
this.mobject = object;
}
public DraggableModel(Draggable type, T object) {
this.type = type;
this.mobject = object;
}
public final T getMobject() {
return mobject;
}
public Draggable getType() {
return type;
}
@Override
public String getObject() {
return null;
}
/**
 * Callback, invoked by 'droppable' when it accepts this draggable.
 * Implementers should call droppable's onDrop() if droppable is not
null.
 * @param target
 * @param droppableModel
 * @return
 */
public abstract DraggableModel onDrop(AjaxRequestTarget target,
DroppableModel droppableModel);
}
public class DroppableModel extends AbstractReadOnlyModel {
protected Droppable type;
protected T mobject;
public DroppableModel(Droppable type) {
this.type = type;
}
public DroppableModel(T object) {
this.mobject = object;
}
public DroppableModel(Droppable type, T object) {
this.type = type;
this.mobject = object;
}
public DroppableModel() {
throw new UnsupportedOperationException("Type required");
}
public final T getMobject() {
return mobject;
}
public Droppable getType() {
return type;
}
@Override
public String getObject() {
return null;
}
/**
 * Callback, invoked by 'draggable' after this droppable invoked
draggable's onDrop().
 * Implementers should call draggable's onDrop() if draggable is not
null.
 * @param target
 * @param draggableModel
 * @return
 */
public DroppableModel onDrop(AjaxRequestTarget target,
DraggableModel draggableModel) {
return null;
}
}
public enum Droppable {
TRASH, RESEQUENCER /* etc */;
}
public enum Draggable {
PRODUCT, USER /* etc */;
}

Hoping that copy&paste&adjustments are OK,

Istvan

On Mon, Jun 7, 2010 at 3:02 PM, DerBernd  wrote:

>
> Ok,
> I think I understood, but how do you get the seqnum?
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2245847.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: drag and drop

2010-06-07 Thread Istvan Jozsa
You can implement by adding DraggableBehavior *and* DroppableBehavior to
each item,
something like this:

add(new DraggableBehavior() {
{
setName("someName");
setRevert(DraggableBehavior.DragRevertMode.ALWAYS);
setRevertDuration(0);
setHelper(DragHelperMode.CLONE);
setOpacity(Opacity.LOW);
}
});
add(new DroppableBehavior() {
{//{
setHoverClass("resequencerHover");
setTolerance(DropTolerance.POINTER);
setDraggablesAcceptedByDroppable(new
DraggablesAcceptedByDroppable("someName"));
}//}
@Override
protected void onDrop(AjaxRequestTarget target, final Component
component, final SpecialKeys keys) {
// get seqnum (sequence number)
// if source and target seqnum are the same then ignore
// update data (maybe even in persistent store, AKA database)
// refresh container containing your list
(target.addComponent(listContainer);)
}
});
add(new AttributeAppender("class", true, new AbstractReadOnlyModel()
{
@Override
public String getObject() {
return "resequencer";
}
}, " "));

CSS:
.resequencer {
border-top: 3px solid transparent;
}
.resequencerHover {
border-top: 3px solid #00;
}

This is just the rough idea (my case is more complicated).

Istvan (aka Stefan)


On Mon, Jun 7, 2010 at 12:26 PM, DerBernd  wrote:

>
> Hi,
> another question of mine:
> Is there any implementation of an "Sortable" where I can change order of
>  items within an  by dragging and dropping. Or what would even be
> better: change order of Components in an RepeatingView.
>
>
> I found the org.wicketstuff.jquery.dnd.DnDSortableHandler. But do not
> really
> know how to make it work, cause I found no examples on the web.
>
> Thanks a lot
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2245708.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Opening a new modal window when OK is clicked on currently open modal window

2010-06-03 Thread Istvan Jozsa
Yes, by opening the second window *when* the first is closed.
Try something like this:

abstract class Modal1 extends ModalWindow {
   public Modal1(id) {
  // ...
  setWindowClosedCallback(new ModalWindow.CloseButtonCallback() {
 @Override
 public void onClose(AjaxRequestTarget target) {
Modal1.this.onClose(target);
 }
  });
   }
   protected abstract void onClose(AjaxRequestTarget target);
   public Modal1 showMe(target) {
  // ...
  super.show();
  return this;
   }
}

// somewhere in the page:
ModalWindow modal1, modal2;
// ...
add(modal1 = new Modal1("w1") {
   @Override
   void onClose(AjaxRequestTarget target) {
 modal2.show(target);
   }
});
add(modal2 = new Modal2("w2"));
// ...
modal1.showMe(target);

The more flexible solution is by
setting the close callback *when* the window is shown:

modal1.showMe(target).setWindowClosedCallback(new
ModalWindow.CloseButtonCallback() {
   @Override
   public void onClose(AjaxRequestTarget target) {
   modal2.show(target);
   }
});


On Thu, Jun 3, 2010 at 3:48 PM, Chris Colman
wrote:

> Is it possible to replace the currently open Modal window with a
> different modal window from within the OK click handler of the currently
> open modal window?
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


RE: wicketstuff-jwicket, drag-and-drop, Internet Explorer 7/8

2010-02-23 Thread Istvan Jozsa
I'm interrested in using jWicket,
please use this email for whatever announce,

thanks once again,
Stefan