Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-7527

h:inputText that has rich:suggestionBox practically cannot be combined with a4j:support event="onBlur" because of 2 annoying problems

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 3.3.1
    • Fix Version/s: None
    • Component/s: component-input
    • Labels:
      None
    • Environment:

      The scenario is for Firefox 3.5 and Opera 9.1, RichFaces >= 3.1

    • Workaround Description:
      Hide

      Workaround for problem 1 from user's perspective):

      Add in rich:suggesstionBox

      <a:support event="onselect" reRender="yyy"
      ajaxSingle="true">
      <f:setPropertyActionListener value="#

      {result.our_column}

      "
      target="#

      {backingBean.our_attribute}

      "/>
      </a:support>

      The data will flash on the screen, but will be at least recovered in a while. Additional ajax request is made .

      Workaround for problem 2 (from user's perspective):

      Surround all code (h:inputText & rich:suggestionbox) with <a4j:outputPanel id="yyy">
      Change in a4j:support reRender="xxx" to reRender="yyy"

      This workaround is not satisfying, because now you get other problem - Scenario 2 for https://jira.jboss.org/jira/browse/RF-7526 which is nasty and not
      always repeatable.

      Show
      Workaround for problem 1 from user's perspective): Add in rich:suggesstionBox <a:support event="onselect" reRender="yyy" ajaxSingle="true"> <f:setPropertyActionListener value="# {result.our_column} " target="# {backingBean.our_attribute} "/> </a:support> The data will flash on the screen, but will be at least recovered in a while. Additional ajax request is made . Workaround for problem 2 (from user's perspective): Surround all code (h:inputText & rich:suggestionbox) with <a4j:outputPanel id="yyy"> Change in a4j:support reRender="xxx" to reRender="yyy" This workaround is not satisfying, because now you get other problem - Scenario 2 for https://jira.jboss.org/jira/browse/RF-7526 which is nasty and not always repeatable.
    • Estimated Difficulty:
      Medium

      Description

      There are 2 problems mentioned here, but I am combining them in one report, because the test scenario I will provide is the same. The workarounds I am providing are not satisfying.

      The two these problems are in construction like:

      <h:inputText style="margin:0px;" id="xxx" value="xxx">
      <a4j:support event="onblur" reRender="xxx" bypassUpdates="true" ajaxSingle="true"/>
      </h:inputText>

      <rich:suggestionbox for="xxx">

      The approach is a4j:support rerender=xxx is very standard (see seam-gen for examples), and it is practically necessary if we want to modify automatically from the server the field after it is changed.

      Problem 1: Display suggestion list and click on some suggestion (with the mouse). The value will be updated for a while, then the old content is recovered (incorrectly ). We have again empty field, which is very annoying. PLEASE notice that if you had used arrows and tab from the keyboard, everything would work correctly - so there is a solution, but it doesn't work when the user clicks with the mouse (our users usually click with the mouse, don't use keyboard

      Problem 2: JavaScript error if you try to display the suggestion again (see your browser console). The suggestionbox stops working until you reload the page.

      Exact steps to reproduce quickly test platform (I am sending an attachment just for refference - it is similar)

      1) Take from Richfaces showcase RichInput:SuggestionBox:ObjectsUsageExample

      2) Add value="#

      {bean.attribute}

      to <h:inputText (create the "bean" in the most quick and easy for you way, in my platform it is seam component in conversation scope)

      3) Inside <h:form> wrap with <a4j:queue> (probably not necessary, but let's not risk the repeatability of the scenario)

      4) From rich:suggestionBox remove:

      usingSuggestObjects=...
      onobjectchange=...

      5) Add in h:inputText <a4j:support event="onblur" reRender="statesinput" bypassUpdates="true" ajaxSingle="true"/>

      You will see that the last step line makes everything unusable

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ilya_shaikovsky Ilya Shaikovsky
                Reporter:
                konstantin_spirov Konstantin Spirov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: