You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hailong Zhang <to...@gmail.com> on 2006/06/01 17:15:36 UTC

sandbox problems

1. <s:inputTestAjax> problem
<h:panelGroup rendered="false">
              <s:inputTextAjax value="#{UserBean.nick}" id="nickTextAjax"
validator="#{UserBean.validateNick}" errorStyle="border:1px solid red;
color:red;" />
                        <t:message forceSpan="true"
styleClass="errorMessage" for="nickTextAjax"></t:message>
                    </h:panelGroup>

public void validateNick(FacesContext context, UIComponent toValidate,
Object value)
    {
        if (value != null)
        {
            String valStr = ((String) value).trim();
            if (valStr.length() < 1)
            {
                ((UIInput) toValidate).setValid(false);
                context.addMessage(toValidate.getClientId(context), new
FacesMessage(FacesMessage.SEVERITY_ERROR, "error", null));
            }
        }
    }

I find that validateNick is called but the circle at the right side of the
inputText is always active.

2.<s:valueChangeNotifier> problem
<h:selectOneMenu id="selectSearchType" value="#{SearchBean.searchType}"
onchange="submit()">
                <s:valueChangeNotifier method="#{SearchBean.changeSearchType}"
/>
                <f:selectItems value="#{SearchBean.typeItems}" />
            </h:selectOneMenu>
public void changeSearchType(ValueChangeEvent vce) throws
AbortProcessingException{
        this.searchType = (String)vce.getNewValue();
    }
I want to change the searchType but not refresh the page.
The form is submited, but changeSearchType is never called. Also, when I
change the selection the page is refreshed.

3. It seems that all the sandbox components don't support Chinese(charset
GBK or GB2312)

Any solutions to these problems?

Thank you very much!