~ubuntu-branches/ubuntu/lucid/libebox/lucid

« back to all changes in this revision

Viewing changes to src/templates/ajax/setter/selectSetter.mas

  • Committer: Bazaar Package Importer
  • Author(s): Javier Uruen Val, Javier Uruen Val
  • Date: 2009-08-05 12:29:43 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090805122943-g4xkkbxqjzj72b3w
Tags: 1.3.5-0ubuntu1
[Javier Uruen Val]
* New upstream release. (Closes: #411462)
* debian/control
  - Bump standards version
  - Add dependency on libsoap-lite-perl
  - Remove dependency on dpatch
* debian/libebox.postinst
  - Create log directory
  - Add set -e
* debian/libebox.postrm
  - Add set -e
* debian/patches
  - Drop dpatch system:
      + Drop 01_dbug_gconf.dpatch (Shipped by upstream)
  - Use simple-patchsys
      + Move 02_js_libraries.dpatch to 01_js_libraries.patch
* cdbs/ebox.mk
  - Use simple-patchsys.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
$tableName
3
3
$data
4
4
$cssClass => ''
 
5
$disabled => undef
5
6
</%args>
6
7
<%init>
7
8
  use Data::Dumper;
30
31
    if ( defined ( $model )) {
31
32
        my $field  = $data->fieldName();
32
33
 
33
 
#        my @optionsAlreadyModel = ();
34
 
        my $rows = $model->rows();
35
 
 
36
 
        foreach my $row (@{$rows}) {
 
34
        foreach my $id (@{$model->ids()}) {
37
35
            # Check if the element exists to avoid nasty issues
38
36
            # with union types
 
37
            my $row = $model->row($id);
39
38
            next unless ($row->elementByName($field));
40
39
            push( @optionsAlreadyModel,
41
40
                  $row->valueByName($field) );
45
44
        @filteredOptions = grep { ! ($_->{value} eq any(@optionsAlreadyModel)) } @{$options};
46
45
 
47
46
        # Add the current value if the action is an edition
48
 
        if ( $data->value() ) {
 
47
        if ( $data->isValueSet() ) {
49
48
            push ( @filteredOptions, {
50
49
                                      value => $data->value(),
51
50
                                      printableValue => $data->printableValue(),
59
58
}
60
59
</%init>
61
60
% my $id = $tableName . '_' . $data->fieldName();
 
61
% # my $onChange = "eval('OnChangeOn$id(this)')";
 
62
% my $onChange = "OnChangeOn$id(this)";
62
63
<& /input/select.mas,
63
64
   'name'    => "$id" ,
64
65
   'value'   => $data->value(),
65
66
   'options' => $options,
66
67
   'id'      => "$id",
67
68
   'class'   => "$cssClass",
 
69
   'disabled' => $disabled,
68
70
&>
69
71
<% $data->trailingText() %>
70
72