[yast-devel] WebYaST: Only write back actual changes !
Hi, since I was just thrown out of WebYaST because network restarted DHCP ... !! WebYaST modules must only write back those value !! which were actually changed ! To pick up the initial example, leaving 'automatic' IP assigment must not restart the network. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
I think this is general issue of all rest modules as we don't check previous status. Also we don't make difference between create and update call to rest- service. Josef Klaus Kaempf write:
Hi,
since I was just thrown out of WebYaST because network restarted DHCP ...
!! WebYaST modules must only write back those value !! which were actually changed !
To pick up the initial example, leaving 'automatic' IP assigment must not restart the network.
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Friday 13 November 2009 16:19:09 Josef Reidinger wrote:
I think this is general issue of all rest modules as we don't check previous status. Also we don't make difference between create and update call to rest- service. Josef
I don't know patterns to solve this problem, but one option could be to use a jQuery plugin to make the forms dirty, that way we can highlight what the user changed, and enable/disable the save button http://www.swartzfager.org/thoughts/post.cfm/new-jquery-plugin-dirtyfields- bring-attention-to-changed-unsaved-fields (you have to look in the comments where he comments the formIsDirty callback) Now, network saves when one press next button, but there should be a way of passing this dirty value forwards. Duncan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Duncan Mac-Vicar Prett write:
On Friday 13 November 2009 16:19:09 Josef Reidinger wrote:
I think this is general issue of all rest modules as we don't check previous status. Also we don't make difference between create and update call to rest- service. Josef
I don't know patterns to solve this problem, but one option could be to use a jQuery plugin to make the forms dirty, that way we can highlight what the user changed, and enable/disable the save button
http://www.swartzfager.org/thoughts/post.cfm/new-jquery-plugin-dirtyfields- bring-attention-to-changed-unsaved-fields (you have to look in the comments where he comments the formIsDirty callback)
Now, network saves when one press next button, but there should be a way of passing this dirty value forwards.
Duncan
I think it should not be job for javascript. I think that his should solve ActiveResource. If you use find...and then call update and values doesn't change should not be sent back (not have enough rest knowledge to find recommended way). -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Josef Reidinger write:
Duncan Mac-Vicar Prett write:
On Friday 13 November 2009 16:19:09 Josef Reidinger wrote:
I think this is general issue of all rest modules as we don't check previous status. Also we don't make difference between create and update call to rest- service. Josef
I don't know patterns to solve this problem, but one option could be to use a jQuery plugin to make the forms dirty, that way we can highlight what the user changed, and enable/disable the save button
http://www.swartzfager.org/thoughts/post.cfm/new-jquery-plugin-dirtyfield s- bring-attention-to-changed-unsaved-fields (you have to look in the comments where he comments the formIsDirty callback)
Now, network saves when one press next button, but there should be a way of passing this dirty value forwards.
Duncan
I think it should not be job for javascript. I think that his should solve ActiveResource. If you use find...and then call update and values doesn't change should not be sent back (not have enough rest knowledge to find recommended way).
few sources for partial rest update: http://stackoverflow.com/questions/232041/how-to-submit-restful-partial- updates http://bitworking.org/news/296/How-To-Do-RESTful-Partial-Updates so I feel, that problem is that there is no unified way, but I think that if we send only changed elements to rest-service it is quite good way. Josef -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Josef Reidinger <jreidinger@suse.cz> [Nov 13. 2009 17:16]:
so I feel, that problem is that there is no unified way, but I think that if we send only changed elements to rest-service it is quite good way.
Solving this on the REST layer seems to be over-engineering. The service endpoints (i.e the YaPI) should be able to detect change and if a new value has to be applied (resp. a service restarted) or not. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Klaus Kaempf write:
* Josef Reidinger <jreidinger@suse.cz> [Nov 13. 2009 17:16]:
so I feel, that problem is that there is no unified way, but I think that if we send only changed elements to rest-service it is quite good way.
Solving this on the REST layer seems to be over-engineering.
The service endpoints (i.e the YaPI) should be able to detect change and if a new value has to be applied (resp. a service restarted) or not.
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
But if we solve it on REST-layer and ActiveResource detects that there is no change, he can avoid calling to rest-service which could save same time (question is who send form with no data change). -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Josef Reidinger <jreidinger@suse.cz> [Nov 13. 2009 17:26]:
But if we solve it on REST-layer and ActiveResource detects that there is no change, he can avoid calling to rest-service which could save same time (question is who send form with no data change).
You can move the detection even before the REST-layer and do it completely on the Browser-Client level. Add hidden input fields to each form, containing the original values, and have the client do the comparison on each <submit ...> Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Friday 13 November 2009 17:29:05 Klaus Kaempf wrote:
* Josef Reidinger <jreidinger@suse.cz> [Nov 13. 2009 17:26]:
But if we solve it on REST-layer and ActiveResource detects that there is no change, he can avoid calling to rest-service which could save same time (question is who send form with no data change).
You can move the detection even before the REST-layer and do it completely on the Browser-Client level.
Add hidden input fields to each form, containing the original values, and have the client do the comparison on each <submit ...>
Which is what the jquery plugins do, automatically, without need to do those acrobatics on every form. -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On 13.11.2009 18:07, Duncan Mac-Vicar Prett wrote:
On Friday 13 November 2009 17:29:05 Klaus Kaempf wrote:
Add hidden input fields to each form, containing the original values, and have the client do the comparison on each <submit ...>
Which is what the jquery plugins do, automatically, without need to do those acrobatics on every form.
That's nice, but if javascript is turned off (or the browser doesn't support JS) than the problem is back. Hidden fields work even with disabled JS. So it depends whether disabled JS is a supported scenario. -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Friday 13 November 2009 18:18:04 Ladislav Slezak wrote:
That's nice, but if javascript is turned off (or the browser doesn't support JS) than the problem is back. Hidden fields work even with disabled JS.
We don't support javascript turned off. Half of the functionality would go away, and I doubt anybody can think of a browser with js turned off nowadays. And every browser we officially support, has js. Duncan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Duncan Mac-Vicar Prett <dmacvicar@suse.de> [Nov 13. 2009 18:41]:
On Friday 13 November 2009 18:18:04 Ladislav Slezak wrote:
That's nice, but if javascript is turned off (or the browser doesn't support JS) than the problem is back. Hidden fields work even with disabled JS.
We don't support javascript turned off. Half of the functionality would go away, and I doubt anybody can think of a browser with js turned off nowadays.
I couldn't agree more. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Duncan Mac-Vicar Prett <dmacvicar@suse.de> [Nov 13. 2009 18:07]:
On Friday 13 November 2009 17:29:05 Klaus Kaempf wrote:
Add hidden input fields to each form, containing the original values, and have the client do the comparison on each <submit ...>
Which is what the jquery plugins do, automatically, without need to do those acrobatics on every form.
Sounds like the perfect solution to our problem. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Josef Reidinger <jreidinger@suse.cz> [Nov 13. 2009 16:22]:
I think this is general issue of all rest modules as we don't check previous status.
Exactly. That's why I sent this to yast-devel instead of creating individual bug reports.
Also we don't make difference between create and update call to rest- service.
For most module this 'just' adds a(n annoying) delay. But for network, its a blocker if the DHCP server decides to assign a new address every time. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (4)
-
Duncan Mac-Vicar Prett
-
Josef Reidinger
-
Klaus Kaempf
-
Ladislav Slezak