My suggestion is to try it with an actionListener.   I think you'll
find that the model is populated with the current value of the list
box by the time it executes, but you'll know for sure if you try it :)

I converted a facelets page to ajax using only <a4j:support> and
<a4j:region>, and it seemed to work well enough.  I  would not expect
any difference for JSP.

The only issue I did hit was that reRendering a different part of the
page after doing a resetValue() on components in the different part of
the failed to fetch the model value for the component -- it continued
to use the submitted value at the time of the ajax submit.

On Fri, Jun 11, 2010 at 3:03 PM, sudeivas <[email protected]> wrote:
>
> I reason I didn't try with actionListener in a4j:support is that I am not
> sure whether it gives the list of values I have selected in the
> SelectManyListBox. But valueChangeListener gives me the new value selected.
>
> I have the same code working for an input text box but I am facing this
> issue with SelectManyListBox.
>
> I am adding this SelectManyListBox to an existing JSP page. Do I have to do
> anything specifically to overcome these types of warning message?
>
> regards,
> Suresh
>
>
> Mike Kienenberger wrote:
>>
>> I think the problem is that your valueChangeListener is not getting
>> called as it's not an ajax call.   Can you try changing it to an
>> actionListener and putting the actionListener tag on your a4j:support?
>>
>> Also, I don't think you need to have immediate specified if you are
>> using ajaxSingle="true"
>>
>> Other than that, what you are doing looks similar to an
>> h:selectOneListbox I have.
>>
>> On Fri, Jun 11, 2010 at 2:43 PM, sudeivas <[email protected]> wrote:
>>>
>>> Hi,
>>>  below is my JSF code,
>>>
>>> <h:column>
>>> <h:selectManyListbox size="3" rendered="true" id="serviceTypes"
>>> immediate="true"
>>> valueChangeListener="#{hostInfoBean.changeServiceTypes}">
>>>                <f:selectItems value="#{hostInfoBean.serviceTypeItems}" />
>>>                <a4j:support event="onchange"
>>> reRender="hostInfo:gateKeeperendPointReference" ajaxSingle="true"/>
>>> </h:selectManyListbox>
>>> </h:column>
>>>
>>> instead of form.submit(), i am using a4j to listen to the 'onchange'
>>> event.
>>> I am not getting any errors during the execution of the program. But when
>>> 'onchange' event occurs, its not calling the appropriate bean method.
>>> Instead I am getting an warning in the console,
>>>
>>> WARNING: There are some unhandled FacesMessages, this means not every
>>> FacesMessage had a chance to be rendered.
>>> These unhandled FacesMessages are:
>>> - hostInfo:serviceTypes: Validation Error: Value is not valid
>>>
>>> I am not sure may be because of this it's not calling the bean method.
>>>
>>> Please advise.
>>>
>>> regards,
>>> Suresh
>>> --
>>> View this message in context:
>>> http://old.nabble.com/SelectManyListBox-not-working-with-aj4-tp28858806p28858806.html
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/SelectManyListBox-not-working-with-aj4-tp28858806p28858996.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Reply via email to