0

Update inline

asked 2015-11-23 04:06:55 +0800

smileinheavenn gravatar image smileinheavenn
1

updated 2015-11-23 08:43:52 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Hi all. i have a tutorial about Z. i did show data to textbox.i did update inline but not save to database .here is code

@Command
@NotifyChange("Edit")
public void Edit(@BindingParam("Dep") Department myDepartment) {
    getDepartmentDao().Update(myDepartment);
    departmentModel = (ListModel<Department>) new ListModelList<>(departmentService.listDepartment());
}

@Override 
public void Update(Department department) { 
    openSession(); 
    beginTransaction(); 
    update(department);
    commitTransaction(); 
    closeSession();
}

pls help me.
Thank you so much

delete flag offensive retag edit

Comments

Your notifychanged is wrong. Start edit with lower case and do you have a getEdit()?

chillworld ( 2015-11-23 05:19:27 +0800 )edit

yes. i have a getEdit here is code @Override public void Update(Department department) { openSession(); beginTransaction(); update(department); commitTransaction(); closeSession();

}
smileinheavenn ( 2015-11-23 06:08:32 +0800 )edit

Can you give me account skype or gmail

smileinheavenn ( 2015-11-23 09:15:44 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-11-23 08:47:51 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Oke let's start with the beginning.

Please do not start method names with a capital letter.
This is preserved for classes only.

Now it's time to debug.
First of all, check if your command is triggered.
Simple way is Clients.showNotification("command edit triggered");
If you have a real logger implemented, use that instead.

I have a good feeling your command isn't triggered (and if it's triggered I'm sure the notifychange will not work unless you remove the capital).

Chill.

link publish delete flag offensive edit
0

answered 2015-11-23 08:52:11 +0800

Darksu gravatar image Darksu
1991 1 4

Hello smileinheavenn,

First of all you can remove the following line of code and add a notify change to the model:

departmentModel = (ListModel<Department>) new ListModelList<>(departmentService.listDepartment());

Furthermore hibernate produces detailed log files regarding it's transactions. Could you please post the logs so that we can examine them in detail?

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

lol just saw the casting, that isn't needed also because ListModelList is implementation of ListModel.

chillworld ( 2015-11-23 09:08:52 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-11-23 04:06:55 +0800

Seen: 25 times

Last updated: Nov 23 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More