You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Richard Yee <ri...@gmail.com> on 2010/10/29 19:11:37 UTC

Issue with tr:selectOneRadio and PPR

Hi,
I'm using Trinidad 1.2.11 and MyFaces 1.2.9 and IE 8.
We recently upgraded from Trinidad 1.0.5 to 1.2.11. We are not using
facelets.

I've noticed that PPR is not working for me for the tr:selectOneRadio
component. I have a valueChangeListener and autoSubmit="true" in the
selectOneRadio. The event listener is being called correctly. I have a
tr:switcher and an outputText component that are not updated with the value
of the selectOneRadio. The only way I can get the page updated is to:
1) hit the refresh button on the browser
2) do a full refresh of the view root with this code in the listener.
      FacesContext context = FacesContext.getCurrentInstance();
      String viewId = context.getViewRoot().getViewId();
      ViewHandler handler = context.getApplication().getViewHandler();
      UIViewRoot root = handler.createView(context, viewId);
      root.setViewId(viewId);
      context.setViewRoot(root);

This was working with Trinidad 1.0.5 without adding the code above.

Has anyone else seen this problem?

Thanks,

Richard



        <tr:panelBox text="Provider" styleClass="panelBoxStyle"
                     partialTriggers="provider "
                     id="providerpanel">
          <tr:spacer height="10"/>
          <tr:panelHorizontalLayout>
            <tr:selectOneRadio id="provider" onchange="addListener();"
                               binding="#{bean.providerDataSelect}"
                               layout="horizontal"
                               autosubmit="true"
valueChangeListener="#{bean.selectProvider}"
                               immediate="true"
                               value="#{pcmSearch.providerOption}">
              <f:selectItems value="#{pcmSearch.providerOptionList}"/>
            </tr:selectOneRadio>
            <tr:commandButton id="hiddenCommandButton"
action="#{bean.providerOptionUpdateAction}" inlineStyle="visibility:hidden"
              partialSubmit="true"/>
            <tr:spacer width="10" height="10"/>
          </tr:panelHorizontalLayout>
          <tr:message message="#{bundle.bean_search_info_message}"
                      messageType="info" inlineStyle="margin-left:10px;"
                      rendered="#{bean.anyProviderOptionEnabled}"/>
          <tr:spacer height="10"/>
          <tr:panelHorizontalLayout id="search" partialTriggers="membertable
providerpanel">
            <tr:spacer height="15"/>
            <tr:outputText value="Provider Option: #{bean.providerOption}"
partialTriggers="provider" id="fooTest"/>
            <tr:switcher defaultFacet="default" binding="#{bean.switcher}">
....

  public void selectProvider(ValueChangeEvent event) {
    PhaseId phaseId = event.getPhaseId();
    if (phaseId.equals(PhaseId.ANY_PHASE))
    {
    event.setPhaseId(PhaseId.INVOKE_APPLICATION);
    event.queue();
    } else if (phaseId.equals(PhaseId.INVOKE_APPLICATION))
    {
      String eventValue = (String)event.getNewValue();

...

      setProviderOption(eventValue);
      _switcher.setFacetName(eventValue);
/* The next two lines were added to force the components to be refreshed but
do not work as expected
      doPartialRefresh(findComponent("providerpanel"));  // This is not
getting updated
      doPartialRefresh(findComponent("foo"));   // This is not getting
updated
/* If this code is uncommented, the entire component tree is refreshed and
the new values are displayed. I would like to avoid doing this, though. */
 /*
      FacesContext context = FacesContext.getCurrentInstance();
      String viewId = context.getViewRoot().getViewId();
      ViewHandler handler = context.getApplication().getViewHandler();
      UIViewRoot root = handler.createView(context, viewId);
      root.setViewId(viewId);
      context.setViewRoot(root);
*/
    }
  }