Java Wickets Delete Multiple Entries CheckboxGroup

2017-02-22 Thread ASHU_JAVA
Hello All,

I've been using CheckBoxGroup in my application and followed the below
example URL:-
http://examples7x.wicket.apache.org/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.CheckGroupPage;jsessionid=A65260928022BEDC4A2943D0F5FD6996?0

  

I need to remove single, multiple or all entries from database by selecting
checkbox.

 

On clicking the delete button, I was able to fetch the corresponding entries
like "Manoj", "Neeraj" and then I performed below operation in my panel:-



For first username record, deleteUserStoreDomain() method return TRUE but
for each next username record it returns FALSE.

Thus, I'm unable to perform 'multiple' and 'all' username records deletion.

Kindly suggest solutions for this issue.
Thanks in advance. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Delete-Multiple-Entries-CheckboxGroup-tp4677171.html
Sent from the Users forum 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



AW: AW: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Christoph.Manig
I found the line which set the modalWindow to null. Thanks for your help

Mit freundlichen Grüßen
Christoph Manig


-Ursprüngliche Nachricht-
Von: Manfred Bergmann [mailto:m...@software-by-mabe.com] 
Gesendet: Mittwoch, 22. Februar 2017 14:19
An: users@wicket.apache.org
Betreff: Re: AW: NullPointerException on submitting a form in a modal window

It it's that line, than only the modalWindow instance variable can be null.
Can you confirm that by either adding a log line or debug into there.

If it is indeed null something in the surrounding of the classes you show makes 
it null, or cleans it up. Some concurrency going on maybe?


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677167.html
Sent from the Users forum 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


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



Re: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Francois Meillet
When the RemarkForm is instancied, addButtons() is called. 
At this point the modalWindow is null.
So the modalWindow argument given to the AddRemarkButton constructor is null. 

You should modify the RemarkForm constructor to something like 
public RemarkForm(String id, ModalWindow modalWindow) {

François





> Le 22 févr. 2017 à 14:19, Manfred Bergmann  a 
> écrit :
> 
> It it's that line, than only the modalWindow instance variable can be null.
> Can you confirm that by either adding a log line or debug into there.
> 
> If it is indeed null something in the surrounding of the classes you show
> makes it null, or cleans it up. Some concurrency going on maybe?
> 
> 
> Manfred
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677167.html
> Sent from the Users forum 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
> 


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



Re: AW: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Manfred Bergmann
It it's that line, than only the modalWindow instance variable can be null.
Can you confirm that by either adding a log line or debug into there.

If it is indeed null something in the surrounding of the classes you show
makes it null, or cleans it up. Some concurrency going on maybe?


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677167.html
Sent from the Users forum 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: NullPointerException on submitting a form in a modal window

2017-02-22 Thread christophManig
The line which throws the exception is modalWindow.close(target); in
AddRemarkButton. I do not copy the import statements so there are less lines
in my copied code.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677166.html
Sent from the Users forum 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



AW: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Christoph.Manig
The line which throws the exception is modalWindow.close(target); in 
AddRemarkButton. I do not copy the import statements so there are less lines in 
my copied code.


Mit freundlichen Grüßen
Christoph Manig

-Ursprüngliche Nachricht-
Von: Manfred Bergmann [mailto:m...@software-by-mabe.com] 
Gesendet: Mittwoch, 22. Februar 2017 11:41
An: users@wicket.apache.org
Betreff: Re: NullPointerException on submitting a form in a modal window

Maybe not all of those classes are in separate files.

Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677164.html
Sent from the Users forum 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


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



Re: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Manfred Bergmann
Maybe not all of those classes are in separate files.

Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677164.html
Sent from the Users forum 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: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Francois Meillet
The AddRemarkButton source code you show is not the one who generated the 
exception.
The exception has been thrown line 32 in the submit method.
The source code you show has only 22 lines

Put a breakpoint in the onSubmit method.

François




> Le 22 févr. 2017 à 11:16, Manfred Bergmann  a 
> écrit :
> 
> Hi.
> 
> What's on line 32 of AddRemarkButton.java?
> 
> 
> Manfred
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677162.html
> Sent from the Users forum 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
> 


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



Re: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Manfred Bergmann
Hi.

What's on line 32 of AddRemarkButton.java?


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677162.html
Sent from the Users forum 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



NullPointerException on submitting a form in a modal window

2017-02-22 Thread Christoph.Manig
Hello,

I have a page which contains a table form. Inside this table there are some 
message objects and their data shown. Moreover the user can select some of the 
messages and trigger some action on them. Then there should be a modal window 
where the user have to set a remark for the selected messages.

The modal window:
public class RemarkModalWindow extends ModalWindow{

/** serialVersionUID */
private static final long serialVersionUID = 8798141972520682460L;

/**
 * Constructor for the modal window.
 *
 * @param id the id of the modal window
 */
public RemarkModalWindow(String id) {
super(id);

RemarkPanel remarkPanel = new RemarkPanel(this.getContentId(), 
this);
this.setContent(remarkPanel);

this.setCloseButtonCallback(new 
ModalWindow.CloseButtonCallback() {
/** serialVersionUID */
private static final long serialVersionUID = 
4018212161671004354L;

@Override
public boolean onCloseButtonClicked(AjaxRequestTarget 
target) {
DAPForm remarkForm = 
remarkPanel.getRemarkForm();

remarkForm.error(getString("remarkModalClose.errorMessage"));
target.add(remarkForm);
return false;
}
});
}

@Override
public boolean isResizable(){
return false;
}

@Override
public int getInitialWidth(){
return 500;
}

@Override
public int getInitialHeight(){
return 100;
}

@Override
public IModel getTitle(){
return Model.of(getString("remarkModal.title"));
}
}

So I created a modal window which contains a panel. Inside the panel there is a 
form with the textfield for the remark and an "add" button. If I click the 
"add" button the window should be closed and the message objects should get the 
remark.
The panel inside the modal window:
public class RemarkPanel extends Panel {

/** serialVersionUID */
private static final long serialVersionUID = -8422969117822175332L;

RemarkForm remarkForm;

/**
 * Constructor which creates the panel.
 *
 * @param id the id of the panel
 * @param remarkModalWindow
 */
public RemarkPanel(String id, RemarkModalWindow remarkModalWindow) {
super(id);

remarkForm = (RemarkForm)FormFactory.getForm(DAPType.REMARK);
remarkForm.setModalWindow(remarkModalWindow);
add(remarkForm);
}

public DAPForm getRemarkForm() {
return (DAPForm) this.remarkForm;
}
}

The Form inside the panel:
public class RemarkForm extends DAPForm {

/** serialVersionUID */
private static final long serialVersionUID = -3714702420141947828L;
private ModalWindow modalWindow;

/**
 * Constructor which creates a form to set the remark of a fault 
message.
 *
 * @param id the id of the form
 */
public RemarkForm(String id) {
super(id);

setDefaultModel(new CompoundPropertyModel(new 
FaultModel()));

addTextfields();
addButtons();
}

/**
 * Adds the additional textfields.
 */
private void addTextfields() {
TextField faultRemark = new TextField<>("faultRemark");

add(faultRemark);
}

/**
 * Adds the buttons to the form.
 */
private void addButtons() {
add(new AddRemarkButton("addRemarkButton", this, modalWindow));
}


public void setModalWindow(ModalWindow modalWindow) {
this.modalWindow = modalWindow;
}
}

This is my "add" button:
public class AddRemarkButton extends AjaxButton {

/** serialVersionUID */
private static final long serialVersionUID = -8702103017249783842L;


private ModalWindow modalWindow;

public AddRemarkButton(String id, Form form, ModalWindow 
modalWindow) {
super(id, form);
this.modalWindow = modalWindow;
}

@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
FaultModel faultModel = (FaultModel)form.getModelObject();
String remark = faultModel.getFaultRemark();
System.out.println("Remark: " + remark);

modalWindow.close(target);
}
}

If I click the "add" button in the modal window I get the following exception:

java.lang.NullPointerException
 at 
com.tsystems.dap.console.components.button.AddRemarkButton.onSubmit(AddRemarkButton.java:32)
 at 

Re: Java Wickets Delete and Checkbox

2017-02-22 Thread ASHU_JAVA
Thanks Martin.
It worked now.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Delete-and-Checkbox-tp4677014p4677159.html
Sent from the Users forum 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