Re: ModalWindows in a listView

2018-10-31 Thread JavaTraveler
Yes thank you. By putting it outside and setting the content in the link, it
worked. Thank you very much :)

--
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: ModalWindows in a listView

2018-10-31 Thread Ernesto Reinaldo Barreiro
Put modal outside repeater and reuse it?

On Wed, Oct 31, 2018, 2:01 PM JavaTraveler  Ok, so how would you do it ?
>
> --
> 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: ModalWindows in a listView

2018-10-31 Thread Francois Meillet
have a look at Component setMarkupId(String markupId)

François



> Le 31 oct. 2018 à 14:01, JavaTraveler  a écrit :
> 
> Ok, so how would you do it ?
> 
> --
> 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: ModalWindows in a listView

2018-10-31 Thread JavaTraveler
Ok, so how would you do it ?

--
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: ModalWindows in a listView

2018-10-31 Thread Francois Meillet
because all yours modakwindow have the same id.

François



> Le 31 oct. 2018 à 09:47, JavaTraveler  a écrit :
> 
> Hello everyone,
> 
> I have a question. Is it possible to add modal windows in a listView. I have
> tried, but it doesn't on wich line I click, the corresponding modal window
> will always concern the last item of my list.
> Here's how I do it :
> 
> 
> lArt = new ListView("articles", new
> LoadableDetachableModel>() {
>@Override
>protected List load() {
>  return BusinessFactory.getArticleEjb().searchDto(ARTICLESEARCH,
> ARTICLELOAD);
>}
>  }) {
>@Override
>protected void populateItem(final ListItem _itemRow) {
>  _itemRow.setOutputMarkupId(true);
>  _itemRow.add(new Label("code",
> _itemRow.getModelObject().getCode()));
> modalWindowLibelle = new ModalWindow("modalWindowLibelle");
>  modalWindowLibelle.setContent(new
> ModifierArticlePanel(modalWindowLibelle.getContentId(),
> _itemRow.getModelObject()));
>  modalWindowLibelle.setTitle("Modifier le libellé d'article ?");
>  modalWindowLibelle.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>@Override
>public void onClose(AjaxRequestTarget target){
>target.add(tabArticles);
>}
>  }); 
>  AjaxLink btnLib = new AjaxLink("btnLib") {
>@Override
>public void onClick(AjaxRequestTarget art) {
>  modalWindowLibelle.show(art);
>}
>  };
>  btnLib.add(new Image("imgLib", new
> PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
> 
>  modalWindowPrix = new ModalWindow("modalWindowPrix");
>  modalWindowPrix.setContent(new
> ModifierPrixArticlePanel(modalWindowPrix.getContentId(),   
> _itemRow.getModelObject()));
>  modalWindowPrix.setTitle("Modifier le libellé d'article ?");
>  modalWindowPrix.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>@Override
>public void onClose(AjaxRequestTarget target){
>target.add(tabArticles);
>}
>  }); 
>  AjaxLink btnPrix = new AjaxLink("btnPrix") {
>@Override
>public void onClick(AjaxRequestTarget art) {
>  modalWindowPrix.show(art);
>}
>  };
>  btnPrix.add(new Image("imgPrix", new
> PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
> 
>  _itemRow.add(btnLib);
>  _itemRow.add(btnPrix);
>  _itemRow.add(modalWindowLibelle);
>  _itemRow.add(modalWindowPrix);
>};
> 
> 
> Any ideas ?
> 
> Thank you very much in advance.
> 
> --
> 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
> 


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



ModalWindows in a listView

2018-10-31 Thread JavaTraveler
Hello everyone,

I have a question. Is it possible to add modal windows in a listView. I have
tried, but it doesn't on wich line I click, the corresponding modal window
will always concern the last item of my list.
Here's how I do it :


lArt = new ListView("articles", new
LoadableDetachableModel>() {
@Override
protected List load() {
  return BusinessFactory.getArticleEjb().searchDto(ARTICLESEARCH,
ARTICLELOAD);
}
  }) {
@Override
protected void populateItem(final ListItem _itemRow) {
  _itemRow.setOutputMarkupId(true);
  _itemRow.add(new Label("code",
_itemRow.getModelObject().getCode()));
modalWindowLibelle = new ModalWindow("modalWindowLibelle");
  modalWindowLibelle.setContent(new
ModifierArticlePanel(modalWindowLibelle.getContentId(),
_itemRow.getModelObject()));
  modalWindowLibelle.setTitle("Modifier le libellé d'article ?");
  modalWindowLibelle.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
@Override
public void onClose(AjaxRequestTarget target){
target.add(tabArticles);
}
  }); 
  AjaxLink btnLib = new AjaxLink("btnLib") {
@Override
public void onClick(AjaxRequestTarget art) {
  modalWindowLibelle.show(art);
}
  };
  btnLib.add(new Image("imgLib", new
PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
  
  modalWindowPrix = new ModalWindow("modalWindowPrix");
  modalWindowPrix.setContent(new
ModifierPrixArticlePanel(modalWindowPrix.getContentId(),   
_itemRow.getModelObject()));
  modalWindowPrix.setTitle("Modifier le libellé d'article ?");
  modalWindowPrix.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
@Override
public void onClose(AjaxRequestTarget target){
target.add(tabArticles);
}
  }); 
  AjaxLink btnPrix = new AjaxLink("btnPrix") {
@Override
public void onClick(AjaxRequestTarget art) {
  modalWindowPrix.show(art);
}
  };
  btnPrix.add(new Image("imgPrix", new
PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
  
  _itemRow.add(btnLib);
  _itemRow.add(btnPrix);
  _itemRow.add(modalWindowLibelle);
  _itemRow.add(modalWindowPrix);
};


Any ideas ?

Thank you very much in advance.

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