AjaxLink not work

2012-10-08 Thread Marco Di Sabatino Di Diodoro
Hi

I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
AjaxLinks from the console not work. 

final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

private static final long serialVersionUID = -7978723352517770644L;

@Override
public void onClick(final AjaxRequestTarget target) {
editModalWin.setPageCreator(new ModalWindow.PageCreator() {

private static final long serialVersionUID = 
-7834632442532690940L;
  
@Override
public Page createPage() {
return new 
EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
}
});

editModalWin.show(target);
}
};

What am I forgetting?

Regards
Marco
--

Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PPMC Member
http://people.apache.org/~mdisabatino






Re: AjaxLink not work

2012-10-08 Thread Martin Grigorov
Hi,

The code looks OK.
What exactly doesn't work ?

On Mon, Oct 8, 2012 at 5:06 PM, Marco Di Sabatino Di Diodoro
marco.disabat...@tirasa.net wrote:
 Hi

 I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
 AjaxLinks from the console not work.

 final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

 private static final long serialVersionUID = 
 -7978723352517770644L;

 @Override
 public void onClick(final AjaxRequestTarget target) {
 editModalWin.setPageCreator(new ModalWindow.PageCreator() {

 private static final long serialVersionUID = 
 -7834632442532690940L;

 @Override
 public Page createPage() {
 return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
 }
 });

 editModalWin.show(target);
 }
 };

 What am I forgetting?

 Regards
 Marco
 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: AjaxLink not work

2012-10-08 Thread Marco Di Sabatino Di Diodoro

On Oct 8, 2012, at 4:31 PM, Martin Grigorov wrote:

 Hi,
 
 The code looks OK.
 What exactly doesn't work ?

When I click on the link does nothing. All Links into the console not work.
Here you can find source code from console ( 
http://svn.apache.org/viewvc/incubator/syncope/trunk/console/ )

 
 On Mon, Oct 8, 2012 at 5:06 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi
 
 I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
 AjaxLinks from the console not work.
 
final AjaxLink createLink = new IndicatingAjaxLink(createLink) {
 
private static final long serialVersionUID = 
 -7978723352517770644L;
 
@Override
public void onClick(final AjaxRequestTarget target) {
editModalWin.setPageCreator(new ModalWindow.PageCreator() {
 
private static final long serialVersionUID = 
 -7834632442532690940L;
 
@Override
public Page createPage() {
return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
}
});
 
editModalWin.show(target);
}
};
 
 What am I forgetting?
 
 Regards
 Marco
 --
 
 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570
 
 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net
 
 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino
 
 
 
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

--

Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PPMC Member
http://people.apache.org/~mdisabatino






Re: AjaxLink not work

2012-10-08 Thread Martin Grigorov
Hi,

I have no time to debug the whole app.
Check for JavaScript errors.

Also check the produced HTML. Find the a tag for the link, get its
'id' and search for Wicket.Ajax.get({u: 'someUrl', c: 'theLinkId', e:
'click'});
Check with Firebug/Dev tools that and Ajax call is fired when you click.

On Mon, Oct 8, 2012 at 5:40 PM, Marco Di Sabatino Di Diodoro
marco.disabat...@tirasa.net wrote:

 On Oct 8, 2012, at 4:31 PM, Martin Grigorov wrote:

 Hi,

 The code looks OK.
 What exactly doesn't work ?

 When I click on the link does nothing. All Links into the console not work.
 Here you can find source code from console ( 
 http://svn.apache.org/viewvc/incubator/syncope/trunk/console/ )


 On Mon, Oct 8, 2012 at 5:06 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi

 I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
 AjaxLinks from the console not work.

final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

private static final long serialVersionUID = 
 -7978723352517770644L;

@Override
public void onClick(final AjaxRequestTarget target) {
editModalWin.setPageCreator(new ModalWindow.PageCreator() {

private static final long serialVersionUID = 
 -7834632442532690940L;

@Override
public Page createPage() {
return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new 
 UserTO());
}
});

editModalWin.show(target);
}
};

 What am I forgetting?

 Regards
 Marco
 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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


 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: AjaxLink not work

2012-10-08 Thread Marco Di Sabatino Di Diodoro
Martin,

In the Page Source 
Wicket.Ajax.get({u: 'someUrl', c: 'theLinkId', e:'click'}); 
is not present.

Do I Have to include something?

M


On Oct 8, 2012, at 4:48 PM, Martin Grigorov wrote:

 Hi,
 
 I have no time to debug the whole app.
 Check for JavaScript errors.
 
 Also check the produced HTML. Find the a tag for the link, get its
 'id' and search for Wicket.Ajax.get({u: 'someUrl', c: 'theLinkId', e:
 'click'});
 Check with Firebug/Dev tools that and Ajax call is fired when you click.
 
 On Mon, Oct 8, 2012 at 5:40 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 
 On Oct 8, 2012, at 4:31 PM, Martin Grigorov wrote:
 
 Hi,
 
 The code looks OK.
 What exactly doesn't work ?
 
 When I click on the link does nothing. All Links into the console not work.
 Here you can find source code from console ( 
 http://svn.apache.org/viewvc/incubator/syncope/trunk/console/ )
 
 
 On Mon, Oct 8, 2012 at 5:06 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi
 
 I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
 AjaxLinks from the console not work.
 
   final AjaxLink createLink = new IndicatingAjaxLink(createLink) {
 
   private static final long serialVersionUID = 
 -7978723352517770644L;
 
   @Override
   public void onClick(final AjaxRequestTarget target) {
   editModalWin.setPageCreator(new ModalWindow.PageCreator() {
 
   private static final long serialVersionUID = 
 -7834632442532690940L;
 
   @Override
   public Page createPage() {
   return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new 
 UserTO());
   }
   });
 
   editModalWin.show(target);
   }
   };
 
 What am I forgetting?
 
 Regards
 Marco
 --
 
 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570
 
 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net
 
 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino
 
 
 
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 --
 
 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570
 
 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net
 
 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino
 
 
 
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

--

Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PPMC Member
http://people.apache.org/~mdisabatino






Re: AjaxLink not work

2012-10-08 Thread Martin Grigorov
No. Wicket should do this for you.
Is your link disabled ?
Did you add it to a parent component ?

Create a quickstart and attach it to Jira.

On Mon, Oct 8, 2012 at 6:21 PM, Marco Di Sabatino Di Diodoro
marco.disabat...@tirasa.net wrote:
 Martin,

 In the Page Source
 Wicket.Ajax.get({u: 'someUrl', c: 'theLinkId', e:'click'});
 is not present.

 Do I Have to include something?

 M


 On Oct 8, 2012, at 4:48 PM, Martin Grigorov wrote:

 Hi,

 I have no time to debug the whole app.
 Check for JavaScript errors.

 Also check the produced HTML. Find the a tag for the link, get its
 'id' and search for Wicket.Ajax.get({u: 'someUrl', c: 'theLinkId', e:
 'click'});
 Check with Firebug/Dev tools that and Ajax call is fired when you click.

 On Mon, Oct 8, 2012 at 5:40 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:

 On Oct 8, 2012, at 4:31 PM, Martin Grigorov wrote:

 Hi,

 The code looks OK.
 What exactly doesn't work ?

 When I click on the link does nothing. All Links into the console not work.
 Here you can find source code from console ( 
 http://svn.apache.org/viewvc/incubator/syncope/trunk/console/ )


 On Mon, Oct 8, 2012 at 5:06 PM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi

 I'm upgrading Apache Syncope console from Wicket 1.5.8 to wicket 6.x. All 
 AjaxLinks from the console not work.

   final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

   private static final long serialVersionUID = 
 -7978723352517770644L;

   @Override
   public void onClick(final AjaxRequestTarget target) {
   editModalWin.setPageCreator(new ModalWindow.PageCreator() {

   private static final long serialVersionUID = 
 -7834632442532690940L;

   @Override
   public Page createPage() {
   return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new 
 UserTO());
   }
   });

   editModalWin.show(target);
   }
   };

 What am I forgetting?

 Regards
 Marco
 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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


 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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


 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Listview in a listview refresh with AjaxLink don't work

2009-11-17 Thread pieter claassen
Pedro,

Improved version now works. Here is my onclick for the AjaxFallBackLink.
Much of it I think is not best practice. Any tips on making this code
better?

Thanks a million for your help!

P

 AjaxFallbackLink up = new AjaxFallbackLink(up) {

@Override
public void onClick(AjaxRequestTarget target) {
AbstractDataSet dataset = datasetmodel.getEntity();
MarkupContainer container=null;
container=getParent();
while(!container.getId().equals(rows)){
container=container.getParent();
}
ListView view=null;
if (container instanceof ListView){
view=(ListView)container;
}
dataset.moveQuestionUp(question); //update the domain model
List list=QuestionProcessor.getMatrixToList(view.getList());
//extract the listview model data
QuestionProcessor.moveQuestionUp(list, question);
view.setList(QuestionProcessor.getListToMatrix(list,
Boolean.TRUE)); //reset the listview model data
adsf.store(dataset); //store my domain data to persist
target.addComponent(outercontainer); //repaint the whole lot
}
};



On Tue, Nov 17, 2009 at 1:47 PM, Pedro Santos pedros...@gmail.com wrote:
 Hi Pieter,
 When you call template.moveQuestionUp(question) you are altering the order
 of the template entity questions list. I think this isn't the same list on
 the row listview model, although both have the same objects.
 All lists used by repeaters are created by QuestionProcessor, you can make
 sure of using those lists operation over rowlistview.getlist() on
 moveQuestionUp implementation.

 On Sun, Nov 15, 2009 at 6:56 AM, pieter claassen 
pieter.claas...@gmail.com
 wrote:

 Hi Pedro,


 Here it is.

 So, I basically move the question up or down the array.

public void moveQuestionUp(QuestionBase question) {
int idx = questions.indexOf(question);
if (idx  0) {
questions.remove(question);
questions.add(idx - 1, question);
}
}

 I think that the listview is being redrawn in HTML but the matrix of
 data underlying it (that I retrieve here in the main page)

 ListListQuestionBase rows =


QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);

 does not get refreshed. I think I need to find a way to reload the
 data for the listview, from within my panel on a page.

 Cheers,
 Pieter




 On Sun, Nov 15, 2009 at 12:14 AM, Pedro Santos pedros...@gmail.com
 wrote:
  Can you send the moveQuestionUp implementation?
 
  On Sat, Nov 14, 2009 at 9:03 PM, pieter claassen
  pieter.claas...@gmail.com
  wrote:
 
  I am trying to follow wicket in action advice P263 but
 
  I have a ListView in a ListView with a panel added to my inner
  listview. On that panel, I have  an AjaxLink and I want to move items
  in the order of the listview around. But to display them, I need to
  refresh my matrix. Nothing seems to work. Any tips or references.
 
  QuestionEditPanel.html
  =
 wicket:extend
 div id=document
 span wicket:id=parent
 div wicket:id=rows
 span wicket:id=row
 span wicket:id=question /
 /span
 /div
 /span
 /div
 /wicket:extend
 
  QuestionEditPanel.java
  ==
 
 final WebMarkupContainer parent=new
  WebMarkupContainer(parent);
 add(parent);
 parent.setOutputMarkupId(true);
 ListListQuestionBase rows =
 
 
 
QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
 ListView rowslistview = new ListView(rows, rows) {
 
 @Override
 protected void populateItem(ListItem item) {
 ListQuestionBase row = (ListQuestionBase)
  item.getModelObject();
 ListView rowlistview = new ListView(row, row) {
 
 @Override
 protected void populateItem(ListItem item) {
 final QuestionBase question = (QuestionBase)
  item.getModelObject();
 item.setModel(new
  CompoundPropertyModel(question));
 EditableQuestionPanel questionpanel=new
  EditableQuestionPanel(question, new
  QuestionBaseWebModel(question),templateWebModel,parent);
 item.add(questionpanel);
  
 
 
  and then on my EditableQuestionPanel.java I have :
 
  AjaxLink up = new AjaxLink(up) {
 
 @Override
 public void onClick(AjaxRequestTarget target) {
 target.addComponent(parent);
 Template template = templatemodel.getEntity();
 template.moveQuestionUp(question);
 

Re: Listview in a listview refresh with AjaxLink don't work

2009-11-15 Thread pieter claassen
Hi Pedro,


Here it is.

So, I basically move the question up or down the array.

public void moveQuestionUp(QuestionBase question) {
int idx = questions.indexOf(question);
if (idx  0) {
questions.remove(question);
questions.add(idx - 1, question);
}
}

I think that the listview is being redrawn in HTML but the matrix of
data underlying it (that I retrieve here in the main page)

ListListQuestionBase rows =
QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);

does not get refreshed. I think I need to find a way to reload the
data for the listview, from within my panel on a page.

Cheers,
Pieter




On Sun, Nov 15, 2009 at 12:14 AM, Pedro Santos pedros...@gmail.com wrote:
 Can you send the moveQuestionUp implementation?

 On Sat, Nov 14, 2009 at 9:03 PM, pieter claassen pieter.claas...@gmail.com
 wrote:

 I am trying to follow wicket in action advice P263 but

 I have a ListView in a ListView with a panel added to my inner
 listview. On that panel, I have  an AjaxLink and I want to move items
 in the order of the listview around. But to display them, I need to
 refresh my matrix. Nothing seems to work. Any tips or references.

 QuestionEditPanel.html
 =
        wicket:extend
            div id=document
                span wicket:id=parent
                    div wicket:id=rows
                        span wicket:id=row
                            span wicket:id=question /
                        /span
                    /div
                /span
            /div
        /wicket:extend

 QuestionEditPanel.java
 ==

        final WebMarkupContainer parent=new WebMarkupContainer(parent);
        add(parent);
        parent.setOutputMarkupId(true);
        ListListQuestionBase rows =

 QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
        ListView rowslistview = new ListView(rows, rows) {

           �...@override
            protected void populateItem(ListItem item) {
                ListQuestionBase row = (ListQuestionBase)
 item.getModelObject();
                ListView rowlistview = new ListView(row, row) {

                   �...@override
                    protected void populateItem(ListItem item) {
                        final QuestionBase question = (QuestionBase)
 item.getModelObject();
                        item.setModel(new CompoundPropertyModel(question));
                        EditableQuestionPanel questionpanel=new
 EditableQuestionPanel(question, new
 QuestionBaseWebModel(question),templateWebModel,parent);
                        item.add(questionpanel);
 


 and then on my EditableQuestionPanel.java I have :

 AjaxLink up = new AjaxLink(up) {

           �...@override
            public void onClick(AjaxRequestTarget target) {
                target.addComponent(parent);
                Template template = templatemodel.getEntity();
                template.moveQuestionUp(question);
                tf.store(template);
            }
        };
 --
 Pieter Claassen
 musmato.com

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




 --
 Pedro Henrique Oliveira dos Santos




-- 
Pieter Claassen
musmato.com

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



Listview in a listview refresh with AjaxLink don't work

2009-11-15 Thread pieter claassen
Hi Pedro,

Here it is.

So, I basically move the question up or down the array.

   public void moveQuestionUp(QuestionBase question) {
       int idx = questions.indexOf(question);
       if (idx  0) {
           questions.remove(question);
           questions.add(idx - 1, question);
       }
   }

I think that the listview is being redrawn in HTML but the matrix of
data underlying it (that I retrieve here in the main page)

ListListQuestionBase rows =
QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);

does not get refreshed. I think I need to find a way to reload the
data for the listview, from within my panel on a page.

Cheers,
Pieter




On Sun, Nov 15, 2009 at 12:14 AM, Pedro Santos pedros...@gmail.com wrote:
 Can you send the moveQuestionUp implementation?

 On Sat, Nov 14, 2009 at 9:03 PM, pieter claassen pieter.claas...@gmail.com
 wrote:

 I am trying to follow wicket in action advice P263 but

 I have a ListView in a ListView with a panel added to my inner
 listview. On that panel, I have  an AjaxLink and I want to move items
 in the order of the listview around. But to display them, I need to
 refresh my matrix. Nothing seems to work. Any tips or references.

 QuestionEditPanel.html
 =
        wicket:extend
            div id=document
                span wicket:id=parent
                    div wicket:id=rows
                        span wicket:id=row
                            span wicket:id=question /
                        /span
                    /div
                /span
            /div
        /wicket:extend

 QuestionEditPanel.java
 ==

        final WebMarkupContainer parent=new WebMarkupContainer(parent);
        add(parent);
        parent.setOutputMarkupId(true);
        ListListQuestionBase rows =

 QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
        ListView rowslistview = new ListView(rows, rows) {

           �...@override
            protected void populateItem(ListItem item) {
                ListQuestionBase row = (ListQuestionBase)
 item.getModelObject();
                ListView rowlistview = new ListView(row, row) {

                   �...@override
                    protected void populateItem(ListItem item) {
                        final QuestionBase question = (QuestionBase)
 item.getModelObject();
                        item.setModel(new CompoundPropertyModel(question));
                        EditableQuestionPanel questionpanel=new
 EditableQuestionPanel(question, new
 QuestionBaseWebModel(question),templateWebModel,parent);
                        item.add(questionpanel);
 


 and then on my EditableQuestionPanel.java I have :

 AjaxLink up = new AjaxLink(up) {

           �...@override
            public void onClick(AjaxRequestTarget target) {
                target.addComponent(parent);
                Template template = templatemodel.getEntity();
                template.moveQuestionUp(question);
                tf.store(template);
            }
        };
 --
 Pieter Claassen
 musmato.com

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




 --
 Pedro Henrique Oliveira dos Santos


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



Re: Listview in a listview refresh with AjaxLink don't work

2009-11-15 Thread wicketnewuser

I don't see your up link in the html markup. Doesn't look like you have
enough info here. If you are moving your question row up are you updating
the list for the listview. Also you are updating questionpanel with ajax
target . I think it would have to be your listview. I would use
ajaxsubmitlink as you might want to save the content or questionpanel when
moving your question up or down. Can you please post all relevent code if
this doesn't help

pieter claassen-2 wrote:
 
 I am trying to follow wicket in action advice P263 but
 
 I have a ListView in a ListView with a panel added to my inner
 listview. On that panel, I have  an AjaxLink and I want to move items
 in the order of the listview around. But to display them, I need to
 refresh my matrix. Nothing seems to work. Any tips or references.
 
 QuestionEditPanel.html
 =
 wicket:extend
 div id=document
 
 div wicket:id=rows
 
 
 
 /div
 
 /div
 /wicket:extend
 
 QuestionEditPanel.java
 ==
 
 final WebMarkupContainer parent=new WebMarkupContainer(parent);
 add(parent);
 parent.setOutputMarkupId(true);
 ListListQuestionBase rows =
 QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
 ListView rowslistview = new ListView(rows, rows) {
 
 @Override
 protected void populateItem(ListItem item) {
 ListQuestionBase row = (ListQuestionBase)
 item.getModelObject();
 ListView rowlistview = new ListView(row, row) {
 
 @Override
 protected void populateItem(ListItem item) {
 final QuestionBase question = (QuestionBase)
 item.getModelObject();
 item.setModel(new
 CompoundPropertyModel(question));
 EditableQuestionPanel questionpanel=new
 EditableQuestionPanel(question, new
 QuestionBaseWebModel(question),templateWebModel,parent);
 item.add(questionpanel);
 
 
 
 and then on my EditableQuestionPanel.java I have :
 
 AjaxLink up = new AjaxLink(up) {
 
 @Override
 public void onClick(AjaxRequestTarget target) {
 target.addComponent(parent);
 Template template = templatemodel.getEntity();
 template.moveQuestionUp(question);
 tf.store(template);
 }
 };
 -- 
 Pieter Claassen
 musmato.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Listview-in-a-listview-refresh-with-AjaxLink-don%27t-work-tp26354774p26362678.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



Listview in a listview refresh with AjaxLink don't work

2009-11-14 Thread pieter claassen
I am trying to follow wicket in action advice P263 but

I have a ListView in a ListView with a panel added to my inner
listview. On that panel, I have  an AjaxLink and I want to move items
in the order of the listview around. But to display them, I need to
refresh my matrix. Nothing seems to work. Any tips or references.

QuestionEditPanel.html
=
wicket:extend
div id=document
span wicket:id=parent
div wicket:id=rows
span wicket:id=row
span wicket:id=question /
/span
/div
/span
/div
/wicket:extend

QuestionEditPanel.java
==

final WebMarkupContainer parent=new WebMarkupContainer(parent);
add(parent);
parent.setOutputMarkupId(true);
ListListQuestionBase rows =
QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
ListView rowslistview = new ListView(rows, rows) {

@Override
protected void populateItem(ListItem item) {
ListQuestionBase row = (ListQuestionBase)
item.getModelObject();
ListView rowlistview = new ListView(row, row) {

@Override
protected void populateItem(ListItem item) {
final QuestionBase question = (QuestionBase)
item.getModelObject();
item.setModel(new CompoundPropertyModel(question));
EditableQuestionPanel questionpanel=new
EditableQuestionPanel(question, new
QuestionBaseWebModel(question),templateWebModel,parent);
item.add(questionpanel);



and then on my EditableQuestionPanel.java I have :

AjaxLink up = new AjaxLink(up) {

@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(parent);
Template template = templatemodel.getEntity();
template.moveQuestionUp(question);
tf.store(template);
}
};
-- 
Pieter Claassen
musmato.com

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



Re: Listview in a listview refresh with AjaxLink don't work

2009-11-14 Thread Pedro Santos
Can you send the moveQuestionUp implementation?

On Sat, Nov 14, 2009 at 9:03 PM, pieter claassen
pieter.claas...@gmail.comwrote:

 I am trying to follow wicket in action advice P263 but

 I have a ListView in a ListView with a panel added to my inner
 listview. On that panel, I have  an AjaxLink and I want to move items
 in the order of the listview around. But to display them, I need to
 refresh my matrix. Nothing seems to work. Any tips or references.

 QuestionEditPanel.html
 =
wicket:extend
div id=document
span wicket:id=parent
div wicket:id=rows
span wicket:id=row
span wicket:id=question /
/span
/div
/span
/div
/wicket:extend

 QuestionEditPanel.java
 ==

final WebMarkupContainer parent=new WebMarkupContainer(parent);
add(parent);
parent.setOutputMarkupId(true);
ListListQuestionBase rows =

 QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
ListView rowslistview = new ListView(rows, rows) {

@Override
protected void populateItem(ListItem item) {
ListQuestionBase row = (ListQuestionBase)
 item.getModelObject();
ListView rowlistview = new ListView(row, row) {

@Override
protected void populateItem(ListItem item) {
final QuestionBase question = (QuestionBase)
 item.getModelObject();
item.setModel(new CompoundPropertyModel(question));
EditableQuestionPanel questionpanel=new
 EditableQuestionPanel(question, new
 QuestionBaseWebModel(question),templateWebModel,parent);
item.add(questionpanel);
 


 and then on my EditableQuestionPanel.java I have :

 AjaxLink up = new AjaxLink(up) {

@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(parent);
Template template = templatemodel.getEntity();
template.moveQuestionUp(question);
tf.store(template);
}
};
 --
 Pieter Claassen
 musmato.com

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




-- 
Pedro Henrique Oliveira dos Santos


AjaxLink doesn't work for Wicket 1.3.3 ?

2008-04-14 Thread Tomasz Prus
I have AjaxLink which works good in Wicket 1.3.2 but doens't work whe i
change version to 1.3.3.

package pl.mainseek.car.wicket.components;

import java.util.Arrays;
import java.util.List;

import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.form.StatelessForm;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.spring.injection.annot.SpringBean;

import pl.mainseek.car.dao.CarsDAO;
import pl.mainseek.car.entities.CarModel;
import pl.mainseek.car.entities.CarPart.Condition;
import pl.mainseek.car.wicket.CommonWebPage;
import pl.mainseek.car.wicket.models.SearchCarPartsModel;
import pl.mainseek.car.wicket.pages.AdvertismentsList;
import pl.mainseek.forum.wicket.pages.ForumList;

public class SearchPanel extends Panel {

public static final String FORUM_OPTION = forum;
public static final String ADS_OPTION = ads;

@SpringBean
private CarsDAO carsDAO;

//keys
private static final String ADVANCED_SEARCH_BUTTON_KEY =
advanced.search.button;

//wicket:ids
public static final String SEARCH_FORM = search_form;
public static final String CONDITION = condition;
public static final String CAR_MODEL = carModel;
public static final String CAR_MARK = carMark;
public static final String QUERY = query;
public static final String ADVANCED_SEARCH = advanced_search;
public static final String SEARCH_BUTTON = search_button;
public static final String SEARCH_WHERE = searchWhere;

private final DropDownChoice searchWhereDDC, carMarkDDC, carModelDDC,
conditionDDC;
private final RequiredTextField queryField;

private final String[] searchWhereKeys = new String[] {ADS_OPTION,
FORUM_OPTION};

//model
private SearchCarPartsModel carPartsModel;

public SearchPanel(String id, SearchCarPartsModel model) {
super(id);
this.carPartsModel = model;
final Form searchForm = new StatelessForm(SEARCH_FORM, new
CompoundPropertyModel(carPartsModel)) {
@Override
protected void onSubmit() {
super.onSubmit();
setRedirect(true);
PageParameters pageParameters = new PageParameters();
pageParameters.add(query, carPartsModel.getQuery());
if(carPartsModel.getCarModel() != null) {
pageParameters.add(carModel,
String.valueOf(carPartsModel.getCarModel().getId()));
} else if(carPartsModel.getCarMark() != null) {
pageParameters.add(carMark,
String.valueOf(carPartsModel.getCarMark().getId()));
}
if(carPartsModel.getSearchWhere().equals(ADS_OPTION)) {
if(carPartsModel.getCondition() != null) {
pageParameters.add(condition,
carPartsModel.getCondition().toString().toLowerCase());
}
setResponsePage(AdvertismentsList.class,
pageParameters);
} else
if(carPartsModel.getSearchWhere().equals(FORUM_OPTION)) {
setResponsePage(ForumList.class, pageParameters);
}
}
};
searchForm.setOutputMarkupId(true);
queryField = new RequiredTextField(QUERY);
searchWhereDDC = getSearchWhereDDC(searchForm);
conditionDDC = getConditionDDC(searchForm);
ListCarModel carModels =
carsDAO.getCarModels(carPartsModel.getCarMark());
carModelDDC = getCarModelDDC(carModels);
carMarkDDC = getCarMarkDDC(carModels);
carMarkDDC.setVisible(false);
carModelDDC.setVisible(false);
conditionDDC.setVisible(false);

searchForm.add(queryField);
searchForm.add(searchWhereDDC);
searchForm.add(conditionDDC);
searchForm.add(carMarkDDC);
searchForm.add(carModelDDC);
final AjaxLink advancedSearch = new AjaxLink(ADVANCED_SEARCH) {
@Override public void onClick(AjaxRequestTarget target) {
carMarkDDC.setVisible(!carMarkDDC.isVisible());
carModelDDC.setVisible(!carModelDDC.isVisible());
conditionDDC.setVisible(!carModelDDC.isVisible());
if(carMarkDDC.isVisible()){
carMarkDDC.setChoices(carsDAO.getAllCarMarks());
}
target.addComponent(searchForm);
}
};
searchForm.add(advancedSearch);
searchForm.add(new 

Re: AjaxLink doesn't work for Wicket 1.3.3 ?

2008-04-14 Thread Matej Knopp
Please create a jira issue and attach a page source code that doesn't work.

-Matej

2008/4/14 Tomasz Prus [EMAIL PROTECTED]:
 I have AjaxLink which works good in Wicket 1.3.2 but doens't work whe i
  change version to 1.3.3.

  package pl.mainseek.car.wicket.components;

  import java.util.Arrays;
  import java.util.List;

  import org.apache.wicket.PageParameters;
  import org.apache.wicket.ajax.AjaxRequestTarget;
  import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
  import org.apache.wicket.ajax.markup.html.AjaxLink;
  import org.apache.wicket.markup.html.form.Button;
  import org.apache.wicket.markup.html.form.DropDownChoice;
  import org.apache.wicket.markup.html.form.Form;
  import org.apache.wicket.markup.html.form.IChoiceRenderer;
  import org.apache.wicket.markup.html.form.RequiredTextField;
  import org.apache.wicket.markup.html.form.StatelessForm;
  import org.apache.wicket.markup.html.panel.Panel;
  import org.apache.wicket.model.CompoundPropertyModel;
  import org.apache.wicket.model.Model;
  import org.apache.wicket.spring.injection.annot.SpringBean;

  import pl.mainseek.car.dao.CarsDAO;
  import pl.mainseek.car.entities.CarModel;
  import pl.mainseek.car.entities.CarPart.Condition;
  import pl.mainseek.car.wicket.CommonWebPage;
  import pl.mainseek.car.wicket.models.SearchCarPartsModel;
  import pl.mainseek.car.wicket.pages.AdvertismentsList;
  import pl.mainseek.forum.wicket.pages.ForumList;

  public class SearchPanel extends Panel {

 public static final String FORUM_OPTION = forum;
 public static final String ADS_OPTION = ads;

 @SpringBean
 private CarsDAO carsDAO;

 //keys
 private static final String ADVANCED_SEARCH_BUTTON_KEY =
  advanced.search.button;

 //wicket:ids
 public static final String SEARCH_FORM = search_form;
 public static final String CONDITION = condition;
 public static final String CAR_MODEL = carModel;
 public static final String CAR_MARK = carMark;
 public static final String QUERY = query;
 public static final String ADVANCED_SEARCH = advanced_search;
 public static final String SEARCH_BUTTON = search_button;
 public static final String SEARCH_WHERE = searchWhere;

 private final DropDownChoice searchWhereDDC, carMarkDDC, carModelDDC,
  conditionDDC;
 private final RequiredTextField queryField;

 private final String[] searchWhereKeys = new String[] {ADS_OPTION,
  FORUM_OPTION};

 //model
 private SearchCarPartsModel carPartsModel;

 public SearchPanel(String id, SearchCarPartsModel model) {
 super(id);
 this.carPartsModel = model;
 final Form searchForm = new StatelessForm(SEARCH_FORM, new
  CompoundPropertyModel(carPartsModel)) {
 @Override
 protected void onSubmit() {
 super.onSubmit();
 setRedirect(true);
 PageParameters pageParameters = new PageParameters();
 pageParameters.add(query, carPartsModel.getQuery());
 if(carPartsModel.getCarModel() != null) {
 pageParameters.add(carModel,
  String.valueOf(carPartsModel.getCarModel().getId()));
 } else if(carPartsModel.getCarMark() != null) {
 pageParameters.add(carMark,
  String.valueOf(carPartsModel.getCarMark().getId()));
 }
 if(carPartsModel.getSearchWhere().equals(ADS_OPTION)) {
 if(carPartsModel.getCondition() != null) {
 pageParameters.add(condition,
  carPartsModel.getCondition().toString().toLowerCase());
 }
 setResponsePage(AdvertismentsList.class,
  pageParameters);
 } else
  if(carPartsModel.getSearchWhere().equals(FORUM_OPTION)) {
 setResponsePage(ForumList.class, pageParameters);
 }
 }
 };
 searchForm.setOutputMarkupId(true);
 queryField = new RequiredTextField(QUERY);
 searchWhereDDC = getSearchWhereDDC(searchForm);
 conditionDDC = getConditionDDC(searchForm);
 ListCarModel carModels =
  carsDAO.getCarModels(carPartsModel.getCarMark());
 carModelDDC = getCarModelDDC(carModels);
 carMarkDDC = getCarMarkDDC(carModels);
 carMarkDDC.setVisible(false);
 carModelDDC.setVisible(false);
 conditionDDC.setVisible(false);

 searchForm.add(queryField);
 searchForm.add(searchWhereDDC);
 searchForm.add(conditionDDC);
 searchForm.add(carMarkDDC);
 searchForm.add(carModelDDC);
 final AjaxLink advancedSearch = new AjaxLink(ADVANCED_SEARCH) {
 @Override public void onClick(AjaxRequestTarget target) {
 carMarkDDC.setVisible(!carMarkDDC.isVisible());
 carModelDDC.setVisible(!carModelDDC.isVisible());
 conditionDDC.setVisible(!carModelDDC.isVisible());