From ed891546bc30b53dd56546008e28b1bd596b799a Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 4 Aug 2015 13:21:07 +0200 Subject: [PATCH] Updated set_value for WSF_FORM_SELECTABLE_INPUT (for example a checkbox). Call the feature set_checked_by_value iff the the current value exist in the list of values, in other case set checked in Flase. If we call set_checked_by_value without filter, previous checked values will be set in False. --- .../wsf_html/form/wsf_form_selectable_input.e | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/library/server/wsf_html/form/wsf_form_selectable_input.e b/library/server/wsf_html/form/wsf_form_selectable_input.e index 37c58366..19b00d7d 100644 --- a/library/server/wsf_html/form/wsf_form_selectable_input.e +++ b/library/server/wsf_html/form/wsf_form_selectable_input.e @@ -72,18 +72,28 @@ feature -- Change set_value (v: detachable WSF_VALUE) -- Set value `v' if applicable to Current + local + l_found: BOOLEAN do if attached {ITERABLE [WSF_VALUE]} v as lst then across lst as c + until + l_found loop - set_checked_by_value (c.item) + if attached {WSF_STRING} c.item as s and then is_same_value (s.value) then + set_checked_by_value (c.item) + l_found := True + end + end + if not l_found then + set_checked (False) end else set_checked_by_value (v) Precursor (v) end - end + end feature {NONE} -- Implementation