How to set dropdown back to initial state

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

How to set dropdown back to initial state

Post by MegumiSawada »

Hi,

Regarding using dropdown element.
The customer would like to clear the selected dropdown item and set it back to the initial state( which is no item selected).
What is the best way to acheive this?

I was not able to find the way to clear the selected item.
ShowClearButton seems to be not suitable to this case...

I appreciate your kind advice...!

Best Regards,
Megumi Sawada
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: How to set dropdown back to initial state

Post by tsupartono »

RPG:

Code: Select all

LRNG_AssignNullToProp('/Form.Fields.MYDROPDOWN.Value');
RDML:

Code: Select all

#COM_OWNER.Using Element('/Form.Fields')
#COM_OWNER.Set Property(MYDROPDOWN.Value)  To('')
#COM_OWNER.EndUsing
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

Re: How to set dropdown back to initial state

Post by MegumiSawada »

Hi Tony,

Thank you for your quick reply.

I'm sorry my question is not clear.
I know how to clear the value, but I don't know where to do this.

The customer would like to clear the value triggered by some user action.
For example, the user chooses one item from dropdown ...then he notices that item shouldn't be selected and would like to set it back to no-item-selected state.
How can we implement this?

Best Regards,
megumi
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: How to set dropdown back to initial state

Post by tsupartono »

If they want an immediate feedback (after end-user change the value of the drop-down), then they can clear the value in the 'OnValueChange' event handler.

Or if they do a validation on form submit (e.g. they have a submit button), they can clear the dropdown value when selected value is not valid (this would be in the button click handler)

I hope that answers your question.
Post Reply