cancel
Showing results for 
Search instead for 
Did you mean: 

Missing InputField values on RadioButton Action (very strange) !!

fabio_bellocchio
Participant
0 Kudos

Hi SDN,

I'm facing a very strange error!

When I select an option of a RadioButtonGroupByKey (it calls a method), the value of an InputField disappears!! Or if I have changed the value of the InputField before selecting the Radio, the old value appears instead of the new!

And the worst problem is that it happens sometimes, and sometimes doesn't.

Some points:

1: Even with an empty method it happens!!

2: Wthout calling a methos it doesn't happen!!

3: If I click on a button, calling the same method, the problem doesn't happen (only with the Radio)!!

I've tried everything, like pulling the value from the InputField element and forcing it in the context (before, during and after the method), but nothing has solved the problem! Because the value already comes empty (or old) from the InputField!!

Please, has anybody already faced this problem??

Kind regards!

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Fabio, post context structure and UI elements (radio button group and input fileds) binding.

fabio_bellocchio
Participant
0 Kudos

Hi Maksim,

InputField:

value: V_NomeObj (type: com.sap.cadastrosolicitacaolista.model.types.Zznome_Obj)

RadioButtonGroupByKey:

selectedKey: RadioCompraCentFixo (type: String)

onSelect: Teste (this Action calls an empty method, just for test)

On wdDoInit I'm filling values in the "RadioCompraCentFixo" attribute.

=================================

(...)

ISimpleTypeModifiable myType1 = wdThis.wdGetAPI().getContext().getModifiableTypeOf("RadioCompraCent");

IModifiableSimpleValueSet values1 = myType1.getSVServices().getModifiableSimpleValueSet();

values1.put("S","Sempre");

values1.put("N","Nunca");

values1.put("C","Condicional");

wdContext.currentContextElement().setRadioCompraCent("S");

(...)

=================================

Is it sufficient?

Thanks a lot!

former_member182372
Active Contributor
0 Kudos

Fabio, first of all - selectedKey is bound to RadioCompraCentFixo but you are extending RadioCompraCent. Second - what is model nodes structure for attribute V_NomeObj (parent nodes, cardinality, sigleton etc.)

fabio_bellocchio
Participant
0 Kudos

Sorry Maksim,

I was using RadioCompraCentFixo to try defining fixed values from the Dictionary (enumeration) in the RadioButton, instead of extending in runtime.

(my mistake, you can discard the code I sent)

But it didn't change anything!

About the attribute V_NomeObj, it's not bound to a node. It's an attribute directly in the Context.

Thank you!!

fabio_bellocchio
Participant
0 Kudos

Hi Maksim,

I think you won´t believe it !!!

When we click on the label of an option of the RadioGroup, the option get selected, but that´s when the inputField misses its value!!

For me it´s a bug, because everything works when you click on the label (the option get selected...), but the error I mentioned occurs.

When we click INSIDE the option (the little circle) everything goes fine.

So, the solution was replace the RadioGroup with a set of single RadioButtons, and put labels in front of them, so if the user clicks on the labels nothing happens, and he is forced to click INSIDE the RadioButton

Thank you!!

Answers (0)