setValue only working for Submit ? | Forum

Clement Peronneaud Apr 5 '12
Hi all,


I'm trying to create an edit page with fields filled with the database informations by default.

My problem is that the setValue does not work except for the submit field.

So I have to use the addAttribute method to create the default value.

But with this solution, I can't choose the default value for the SelectBox and RadioBox.


Is there something I misunderstood ?

I checked the core code, but even by setting the value property to public and forcing it in my controller, the option won't be selected by default to the one I want.


Any help is welcome and it's quite urgent.

Team
Michael I. Apr 9 '12
Topic was moved from Bug reports and troubleshooting.
Clement Peronneaud Apr 10 '12
Still no news for this problem ? 


I thought the answer would be fast :/


To make it easier :


How do I choose the selected value for a selectbox and radiobox in oxwall ?


Thanks

Clement Peronneaud Apr 18 '12
Up again...


I can't believe nobody has at least an answer or an explanation for this problem.


When I check the core code for the custom questions which are also selectbox, they also use the setValue method and it's working...


When I do the same in my plugin, it's not.


Is it an Oxwall core bug ? Or am I doing this ? Could someone even give me some hint on how it should be working ?

It's not an surprise that new developers does not get response for the questions.

I am also looking for a solution for this kind of problem.

Clement Peronneaud Apr 23 '12
Well, the only solution at the moment is to not use their built-in class for radio and select. Just put your values and labels in an array and create the input directly in smarty...
Stupid solution but at least it works...