Marieke Vandamme wrote:
You are creating a new instance of your Panel.
True, I was just writing how I did it:)
I don't need to create a new ModalWindow or Panel, because all the data on
my ModalWindow is the same.
Mine arent.
Your solution works because setContent sets shown = false.
Yes the idea is that modal window are not shown all the time.. When I
update the internal stuff(in modal window) I just do it the ordinary way
with ajax(how ever you need to setup modal windows for this), by adding
the component to the parent container:
downChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
linkRemove.setVisible(true);
target.addComponent(removeLinkContainer);
formAddNewWeight.setModel(new CompoundPropertyModel(
currentWeightModel));
target.addComponent(formAddNewWeight);
update = true;
}
Shouldn't it work without this call to setContent?
no I need to call set content since I also do this, another place in
another component on the same page:
item.add(new AjaxLink("switchExercise") {
@Override
public void onClick(AjaxRequestTarget target) {
target
modalWindow.setTitle(getString("exerciseOverview"));
modalWindow.setMinimalHeight(700);
modalWindow.setContent(new ExerciseOverviewPanel(
modalWindow.getContentId(),
new BaseEntityDetachableModel(trainingSet),
modalWindow, TrainingSchemePanel.this));
modalWindow.show(target);
}
});
Nino.Martinez wrote:
Im doing it like this:
AjaxLink popupLink = new AjaxLink("manageWeightPop") {
@Override
public void onClick(AjaxRequestTarget target) {
target
modalWindow.setTitle(getString("weightlog"));
modalWindow.setMinimalHeight(700);
modalWindow.setContent(new ManageWeightPanel(modalWindow
.getContentId(), modalWindow,
new BaseEntityDetachableModel(getPerson())));
modalWindow.show(target);
}
};
Marieke Vandamme wrote:
The javascript debug window is printing no error.
The server returns an empty response (<?xml version="1.0"
encoding="UTF-8"?><ajax-response></ajax-response>)
I did some debugging and came to the function in ModalWindow
public void show(AjaxRequestTarget target)
there the boolean shown is tested. The content is only showed when
shown=false, in my case shown=true...
Can you please try the code from my first post? If you say you reuse the
dialog, what am I doing wrong? How do you guys do it?
Thanks !
Johan Compagner wrote:
We reuse the dialog constantly, so i dont know what goes wrong for
you. What does the javascript debug window tell you?
Maybe the modal window some things that is is still shown
On 4/29/08, Marieke Vandamme <[EMAIL PROTECTED]> wrote:
Hello,
Thanks for the reply.
But isn't it possible to reuse the modalwindow? Because in my
application
the window needs to be opened many times, and I thought it would be
better
to reuse the same window multiple times. Or has that no affect to the
memory-usage?
Cristi Manole wrote:
I am 99% certain that if you change your code from :
*final MyChooser myChooser = new MyChooser(modal);*
*modal.setPageCreator(new ModalWindow.PageCreator() {
public Page createPage() {
return myChooser;
}
}
*
to this :
*modal.setPageCreator(new ModalWindow.PageCreator() {
public Page createPage() {
return new MyChooser(modal);
}
}
*
it will work.
Try it.
Cristi Manole
On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme <[EMAIL PROTECTED]>
wrote:
Hello,
can't anyone help me with this problem?
If I need to code it differently, please tell me.
Thanks !!
Marieke Vandamme wrote:
Hello,
i'm having problems with the modal window. It shows up fine when I
click
my link the first time, but after closing the window with the 'X',
it
won't open again.
I don't know if I'm using it wrong or if it's a bug.
Any help is welcome ! thanks. Marieke.
My code :
public class TestModalWindow extends WebPage {
public TestModalWindow() {
final ModalWindow modal = new ModalWindow("dataChooser");
add(modal);
final MyChooser myChooser = new MyChooser(modal);
modal.setPageCreator(new ModalWindow.PageCreator() {
public Page createPage() {
return myChooser;
}
});
add(new AjaxLink("lnkOpen") {
public void onClick(AjaxRequestTarget target) {
myChooser.reload(target);
}
});
}
public class MyChooser extends WebPage {
private ModalWindow window;
public MyChooser(ModalWindow w) {
this.window = w;
}
public void reload(AjaxRequestTarget target) {
this.window.show(target);
}
}
}
--
View this message in context:
http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.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]
--
View this message in context:
http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]