You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alexander Panzhin <ja...@balticum-tv.lt> on 2006/04/13 15:36:12 UTC

JavaScript set values and model update

I have a problem with JavaScript set values.
<t:selectOneMenu id="moduleSelect" forceId="true" value="#{search.module}">
<f:selectItems value="#{search.modules}" />
</t:selectOneMenu>

Than I add options to this select menu via js.
        var a = document.getElementById("moduleSelect").options;
        a[0] = new Option("","", false);
and so on...

My #{search.modules} also returns a SelectItem list(when appropriate).
But the problem is unless #{search.modules} is not empty, whatever i
choose update my model with that data.

Is there anything that I'm missing here?

I use Facelets/MyFaces.

Re: JavaScript set values and model update

Posted by Alexander Panzhin <ja...@balticum-tv.lt>.
I found what's the problem.
> I have a problem with JavaScript set values.
> <t:selectOneMenu id="moduleSelect" forceId="true" 
> value="#{search.module}">
> <f:selectItems value="#{search.modules}" />
> </t:selectOneMenu>
>
> Than I add options to this select menu via js.
>        var a = document.getElementById("moduleSelect").options;
>        a[0] = new Option("","", false);
> and so on...
>
> My #{search.modules} also returns a SelectItem list(when appropriate).
> But the problem is unless #{search.modules} is not empty, whatever i
> choose update my model with that data.
>
> Is there anything that I'm missing here?
>
> I use Facelets/MyFaces.


-- 
   Su pagarba,
      Aleksandr Panzin
      IT sistemu architektas.

   With best regards,
      Alexander Panzhin
      IT systems architect