dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00917
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 277: Using ajax for orgunit association selection for dataset
------------------------------------------------------------
revno: 277
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-05-05 17:38:29 +0200
message:
Using ajax for orgunit association selection for dataset
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectLevelAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectOrganisationUnitGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectLevelAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectOrganisationUnitGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/xwork.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetAssociations.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/associations.js
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectLevelAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectLevelAction.java 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectLevelAction.java 2009-05-05 15:38:29 +0000
@@ -60,11 +60,6 @@
private Integer level;
- public Integer getLevel()
- {
- return level;
- }
-
public void setLevel( Integer level )
{
this.level = level;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectOrganisationUnitGroupAction.java 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/SelectOrganisationUnitGroupAction.java 2009-05-05 15:38:29 +0000
@@ -67,11 +67,6 @@
private Integer organisationUnitGroupId;
- public Integer getOrganisationUnitGroupId()
- {
- return organisationUnitGroupId;
- }
-
public void setOrganisationUnitGroupId( Integer organisationUnitGroupId )
{
this.organisationUnitGroupId = organisationUnitGroupId;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectLevelAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectLevelAction.java 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectLevelAction.java 2009-05-05 15:38:29 +0000
@@ -60,11 +60,6 @@
private Integer level;
- public Integer getLevel()
- {
- return level;
- }
-
public void setLevel( Integer level )
{
this.level = level;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectOrganisationUnitGroupAction.java 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UnselectOrganisationUnitGroupAction.java 2009-05-05 15:38:29 +0000
@@ -67,11 +67,6 @@
private Integer organisationUnitGroupId;
- public Integer getOrganisationUnitGroupId()
- {
- return organisationUnitGroupId;
- }
-
public void setOrganisationUnitGroupId( Integer organisationUnitGroupId )
{
this.organisationUnitGroupId = organisationUnitGroupId;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/xwork.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/xwork.xml 2009-05-05 15:24:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/xwork.xml 2009-05-05 15:38:29 +0000
@@ -233,31 +233,31 @@
<action name="selectLevel"
class="org.hisp.dhis.dataset.action.SelectLevelAction">
- <result name="success" type="chain">getDataSetAssociationOptions</result>
+ <result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSuccess.vm</result>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
<action name="unselectLevel"
class="org.hisp.dhis.dataset.action.UnselectLevelAction">
- <result name="success" type="chain">getDataSetAssociationOptions</result>
- <param name="requiredAuthorities">F_DATASET_UPDATE</param>
- </action>
-
- <action name="unselectAll"
- class="org.hisp.dhis.dataset.action.UnselectAllAction">
- <result name="success" type="chain">getDataSetAssociationOptions</result>
+ <result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSuccess.vm</result>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
<action name="selectOrganisationUnitGroup"
class="org.hisp.dhis.dataset.action.SelectOrganisationUnitGroupAction">
- <result name="success" type="chain">getDataSetAssociationOptions</result>
+ <result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSuccess.vm</result>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
<action name="unselectOrganisationUnitGroup"
class="org.hisp.dhis.dataset.action.UnselectOrganisationUnitGroupAction">
- <result name="success" type="chain">getDataSetAssociationOptions</result>
+ <result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSuccess.vm</result>
+ <param name="requiredAuthorities">F_DATASET_UPDATE</param>
+ </action>
+
+ <action name="unselectAll"
+ class="org.hisp.dhis.dataset.action.UnselectAllAction">
+ <result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSuccess.vm</result>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetAssociations.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetAssociations.vm 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetAssociations.vm 2009-05-05 15:38:29 +0000
@@ -10,25 +10,25 @@
<table id="selectionTable">
<tr>
<td>
- <input type="button" value="$i18n.getString( "select_all_at_level" )" onclick="selectAllAtLevel( $dataSetId )" style="width:12em">
+ <input type="button" value="$i18n.getString( "select_all_at_level" )" onclick="selectAllAtLevel()" style="width:12em">
<select id="levelList" name="levelList" style="width:12em">
#foreach( $lev in $levels )
<option value="$lev.level" #if ( $level == $lev.level )selected="selected"#end>$encoder.htmlEncode( $lev.name )</option>
#end
</select>
- <input type="button" value="$i18n.getString( "unselect_all_at_level" )" onclick="unselectAllAtLevel( $dataSetId )" style="width:12em">
- <input type="button" value="$i18n.getString( "unselect_all" )" onclick="window.location.href='unselectAll.action?dataSetId=$dataSetId'" style="width:12em">
+ <input type="button" value="$i18n.getString( "unselect_all_at_level" )" onclick="unselectAllAtLevel()" style="width:12em">
+ <input type="button" value="$i18n.getString( "unselect_all" )" onclick="unselectAll()" style="width:12em">
</td>
</tr>
<tr>
<td>
- <input type="button" value="$i18n.getString( "select_all_in_group" )" onclick="selectGroup( $dataSetId )" style="width:12em">
+ <input type="button" value="$i18n.getString( "select_all_in_group" )" onclick="selectGroup()" style="width:12em">
<select id="groupList" name="groupList" style="width:12em">
#foreach ( $group in $groups )
<option value="$group.id" #if ( $organisationUnitGroupId == $group.id )selected="selected"#end>$encoder.htmlEncode( $group.name )</option>
#end
</select>
- <input type="button" value="$i18n.getString( "unselect_all_in_group" )" onclick="unselectGroup( $dataSetId )" style="width:12em">
+ <input type="button" value="$i18n.getString( "unselect_all_in_group" )" onclick="unselectGroup()" style="width:12em">
</td>
</tr>
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/associations.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/associations.js 2009-04-30 15:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/associations.js 2009-05-05 15:38:29 +0000
@@ -1,36 +1,44 @@
var numberOfSelects = 0;
-function selectAllAtLevel( dataSetId )
-{
- var level = getListValue( 'levelList' );
- var groupId = getListValue( 'groupList' );
-
- window.location.href = 'selectLevel.action?level=' + level + '&organisationUnitGroupId=' + groupId + '&dataSetId=' + dataSetId;
-}
-
-function unselectAllAtLevel( dataSetId )
-{
- var level = getListValue( 'levelList' );
- var groupId = getListValue( 'groupList' );
-
- window.location.href = 'unselectLevel.action?level=' + level + '&organisationUnitGroupId=' + groupId + '&dataSetId=' + dataSetId;
-}
-
-function selectGroup( dataSetId )
-{
- var level = getListValue( 'levelList' );
- var groupId = getListValue( 'groupList' );
-
- window.location.href = 'selectOrganisationUnitGroup.action?level=' + level + '&organisationUnitGroupId=' + groupId + '&dataSetId=' + dataSetId;
-}
-
-function unselectGroup( dataSetId )
-{
- var level = getListValue( 'levelList' );
- var groupId = getListValue( 'groupList' );
-
- window.location.href = 'unselectOrganisationUnitGroup.action?level=' + level + '&organisationUnitGroupId=' + groupId + '&dataSetId=' + dataSetId;
+function selectAllAtLevel()
+{
+ var request = new Request();
+ request.setCallbackSuccess( selectReceived );
+ request.send( 'selectLevel.action?level=' + getListValue( 'levelList' ) );
+}
+
+function unselectAllAtLevel()
+{
+ var request = new Request();
+ request.setCallbackSuccess( selectReceived );
+ request.send( 'unselectLevel.action?level=' + getListValue( 'levelList' ) );
+}
+
+function selectGroup()
+{
+ var request = new Request();
+ request.setCallbackSuccess( selectReceived );
+ request.send( 'selectOrganisationUnitGroup.action?organisationUnitGroupId=' + getListValue( 'groupList' ) );
+}
+
+function unselectGroup()
+{
+ var request = new Request();
+ request.setCallbackSuccess( selectReceived );
+ request.send( 'unselectOrganisationUnitGroup.action?organisationUnitGroupId=' + getListValue( 'groupList' ) );
+}
+
+function unselectAll()
+{
+ var request = new Request();
+ request.setCallbackSuccess( selectReceived );
+ request.send( 'unselectAll.action' );
+}
+
+function selectReceived()
+{
+ selectionTree.buildSelectionTree();
}
function treeClicked()
--
Trunk
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.