myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: SelectManyListBox not working with aj4
Date Fri, 11 Jun 2010 20:26:09 GMT
Sorry.  I haven't used SelectManyListBox, so I can't be of much more help.

One easy thing to try is to remove the a4j:support, move the
actionListener to the SelectManyListBox, and try it as a non-ajax
request.   That will tell you if it's an ajax issue or a generic
SelectManyListBox usage problem.


On Fri, Jun 11, 2010 at 4:21 PM, sudeivas <sudeivas@indiana.edu> wrote:
>
> I just added value="#{hostInfoBean.serviceType}" to the tag. And in the java
> bean the declaration is like ,
> private List<String> serviceType = new ArrayList<String>();
>
> Is this correct?
>
> But still I am getting the same error,
> hostInfo:serviceTypes: Validation Error: Value is not valid
> hostInfo:serviceTypes: Validation Error: Value is not valid
>
> regards,
> Suresh
>
>
> Mike Kienenberger wrote:
>>
>> Hmm.  I am using Myfaces 1.2.9 and Richfaces 3.3.3, so it's possible
>> that there's something different about it under Myfaces 2.0.
>>
>> Under my environment, using the following insures that messages are
>> always rendered for ajax requests.    But rendering the messages isn't
>> really your problem -- it's that the values aren't considered valid
>> for your input.
>>
>>       <a4j:outputPanel ajaxRendered="true">
>>               <t:messages
>>                globalOnly="true"
>>                showDetail="true" />
>>
>>               <t:messages
>>                globalOnly="false"
>>                showDetail="true" />
>>       </a4j:outputPanel>
>>
>> I just noticed that you don't have a [value="#{}"] tag for your
>> <h:selectManyListbox>.   Could this be the problem?
>>
>>
>>
>> On Fri, Jun 11, 2010 at 3:33 PM, sudeivas <sudeivas@indiana.edu> wrote:
>>>
>>> Now I tried with actionListener as well. But still I am getting the same
>>> warning.
>>>
>>> <h:selectManyListbox size="3" rendered="true" id="serviceTypes">
>>>        <f:selectItems value="#{hostInfoBean.serviceTypeItems}" />
>>>        <a4j:support event="onchange"
>>> actionListener="#{hostInfoBean.changeServiceTypes}"
>>> reRender="hostInfo:gateKeeperendPointReference" ajaxSingle="true"/>
>>> </h:selectManyListbox>
>>>
>>> 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 using Myfaces 2.0. May be there is an issue or a missing step that
>>> we
>>> need to configure before using a4j or valueChangeListener.
>>>
>>> I googled this warning and I got the below source code for this warning.
>>>
>>> http://mail-archives.apache.org/mod_mbox/myfaces-commits/201004.mbox/%3C20100401210944.40F4923889CB@eris.apache.org%3E
>>>
>>> But I didn't any other useful information.
>>>
>>> regards,
>>> Suresh
>>>
>>>
>>>
>>> Mike Kienenberger wrote:
>>>>
>>>> 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 <sudeivas@indiana.edu> 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 <sudeivas@indiana.edu>
>>>>>> 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.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/SelectManyListBox-not-working-with-aj4-tp28858806p28859291.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-tp28858806p28859711.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message