77import org .apache .wicket .ajax .AjaxRequestTarget ;
88import org .apache .wicket .behavior .AttributeAppender ;
99import org .apache .wicket .markup .html .basic .Label ;
10+ import org .apache .wicket .markup .html .WebMarkupContainer ;
1011import org .apache .wicket .model .IModel ;
1112import org .apache .wicket .model .LoadableDetachableModel ;
1213import org .apache .wicket .model .Model ;
@@ -100,16 +101,17 @@ public AmpMEItemFeaturePanel(String id, String fmName, final IModel<IndicatorAct
100101 final boolean hasDisaggregation = indicator .getObject ().getDisaggregation () != null
101102 && !indicator .getObject ().getDisaggregation ().isEmpty ();
102103
103- final Label indicatorBaseValueLabel = new Label ("base" , new LoadableDetachableModel <String >() {
104+ WebMarkupContainer baseTargetContainer = new WebMarkupContainer ("baseTargetContainer" );
105+ baseTargetContainer .setVisible (!hasDisaggregation );
106+
107+ baseTargetContainer .add (new Label ("base" , new LoadableDetachableModel <String >() {
104108 @ Override
105109 protected String load () {
106110 return globalBaseVal .getOriginalValue () != null ? String .valueOf (globalBaseVal .getOriginalValue ()) : "N/A" ;
107111 }
108- });
109- indicatorBaseValueLabel .setVisible (!hasDisaggregation );
110- add (indicatorBaseValueLabel );
112+ }));
111113
112- final Label indicatorBaseDateLabel = new Label ("baseDate" , new LoadableDetachableModel <String >() {
114+ baseTargetContainer . add ( new Label ("baseDate" , new LoadableDetachableModel <String >() {
113115 @ Override
114116 protected String load () {
115117 if (globalBaseVal .getOriginalValueDate () != null ) {
@@ -119,20 +121,16 @@ protected String load() {
119121 return "N/A" ;
120122 }
121123 }
122- });
123- indicatorBaseDateLabel .setVisible (!hasDisaggregation );
124- add (indicatorBaseDateLabel );
124+ }));
125125
126- final Label indicatorTargetValueLabel = new Label ("target" , new LoadableDetachableModel <String >() {
126+ baseTargetContainer . add ( new Label ("target" , new LoadableDetachableModel <String >() {
127127 @ Override
128128 protected String load () {
129129 return globalTargetVal .getOriginalValue () != null ? String .valueOf (globalTargetVal .getOriginalValue ()) : "N/A" ;
130130 }
131- });
132- indicatorTargetValueLabel .setVisible (!hasDisaggregation );
133- add (indicatorTargetValueLabel );
131+ }));
134132
135- final Label indicatorTargetDateLabel = new Label ("targetDate" , new LoadableDetachableModel <String >() {
133+ baseTargetContainer . add ( new Label ("targetDate" , new LoadableDetachableModel <String >() {
136134 @ Override
137135 protected String load () {
138136 if (globalTargetVal .getOriginalValueDate () != null ) {
@@ -142,9 +140,9 @@ protected String load() {
142140 return "N/A" ;
143141 }
144142 }
145- });
146- indicatorTargetDateLabel . setVisible (! hasDisaggregation );
147- add (indicatorTargetDateLabel );
143+ })) ;
144+
145+ add (baseTargetContainer );
148146 AmpMEActualValuesFormTableFeaturePanel valuesTable = new AmpMEActualValuesFormTableFeaturePanel ("valuesSubsection" , indicator , conn , "Actual Values" , false , 7 ) {
149147 @ Override
150148 protected void onConfigure () {
0 commit comments