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);
> List<List<QuestionBase>> rows =
> QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
> ListView rowslistview = new ListView("rows", rows) {
>
> @Override
> protected void populateItem(ListItem item) {
> List<QuestionBase> row = (List<QuestionBase>)
> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
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: [email protected]
For additional commands, e-mail: [email protected]