Skip to content

Commit

Permalink
Merge pull request #53 from oetiker/loopblock
Browse files Browse the repository at this point in the history
reload readonly fields when a trigger field is executed.
  • Loading branch information
oetiker authored Jun 3, 2019
2 parents 43ac706 + 87bd81a commit 3271146
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/CallBackery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use CallBackery::Plugin::Doc;
use CallBackery::Database;
use CallBackery::User;

our $VERSION = '0.17.0';
our $VERSION = '0.17.1';

use Mojo::Base 'Mojolicious';

Expand Down
3 changes: 3 additions & 0 deletions lib/CallBackery/GuiPlugin/AbstractForm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ Return all field values of the form.

sub getAllFieldValues {
my $self = shift;
my $parentForm = shift;
my $currentForm = shift;
my %map;
my @promises;
$self->args({currentFormData => $currentForm}) if $currentForm;
for my $key (keys %{$self->formCfgMap}){
my $value = $self->getFieldValue($key);
if (eval { blessed $value && $value->isa('Mojo::Promise')}){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ qx.Class.define("callbackery.ui.plugin.Form", {
var rpc = callbackery.data.Server.getInstance();
var cfg = this._cfg;
var form = this._form;
var reConfFormInProgress;
cfg.form.forEach(function(s){
if (!s.key){
return;
}
var control = form.getControl(s.key);
var reConfFormInProgress;
var callback = function(e){
var data = e.getData();
// handle events from selectboxes
Expand Down Expand Up @@ -174,6 +174,7 @@ qx.Class.define("callbackery.ui.plugin.Form", {
ctrl.set(s.set);
}
},this);
this._loadDataReadOnly();
},
_loadDataReadOnly: function(){
// this.setEnabled(false);
Expand All @@ -198,7 +199,7 @@ qx.Class.define("callbackery.ui.plugin.Form", {
that._form.setData(statusData,true);
}
that._loading--;
},'getPluginData',this._cfg.name,'allFields',parentFormData);
},'getPluginData',this._cfg.name,'allFields',parentFormData,this._form.getData());
},
_loadData: function(){
var that = this;
Expand Down

0 comments on commit 3271146

Please sign in to comment.