ICEfaces
  1. ICEfaces
  2. ICE-3531

inputRichText saves data inconsistently on saveOnSubmit

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      inputRichText + saveOnSubmit

      Description

      [Leray Fab]
      I confirm the saveOnSubmit option added to the 1.7.1 is not working for me too, or at least, not every times...

      I use icefaces 1.7.1 + Seam.

      If I try to submit my form using :

       <ui:define name="contentData">
      <s:validateAll>
      <table class="splitPane_70_30">
      <tr>
      <td>
      <ice:inputRichText id="axisDescription" height="400px"
      value="#{searchAxisCreate.newSearchAxis.description}" language="fr" skin="silver"
      saveOnSubmit="true" toolbar="Athena Simple" customConfigPath="/js/athena/fckConfig.js" />
      </td>
      </tr>
      </table>
      </s:validateAll>
      </ui:define>

          <ice:commandLink id="validate" action="#{searchAxisCreate.chooseRecipients()}" type="submit">
                 <ice:outputText value="#{messages['athena.commons.action.Next']}" />
                 <s:conversationId />
         </ice:commandLink>

      it is not working everi time i try : some times, the backing bean setter is called, some times not... Threrefore I use this workaround:

        <ice:commandLink id="validate" action="#{searchAxisCreate.chooseRecipients()}" type="submit"
               onclick="Athena.commons.icefaces.saveRichInputText();">
               <ice:outputText value="#{messages['athena.commons.action.Next']}" />
               <s:conversationId />
           </ice:commandLink>

      with the given java script function (extracted from the fckeditor javascript code):


      /**
       * Trigger a submit for all rich input text editors on the page.
       */
      Athena.commons.icefaces.saveRichInputText = function()
      {
          var all = Ice.Repository.getAll();

          for (i=0; i < all.length; i++)
          {
              var instanceName = all[i].thirdPartyObject.InstanceName;
              var editIns = FCKeditorAPI.GetInstance(instanceName);

              if (editIns != null)
              {
                  var element = $(instanceName);
                  element.value = editIns.GetXHTML(true);
              }
          }

          var form = Ice.util.findForm(element);
          iceSubmit(form,element,new Object());

          return false;
      }

      When doing this, I force twice the submission for the richInputText and my backing bean setter searchAxisCreate.newSearchAxis.description is called as well. Nevertheless, it works but it is not the way it should work... The saveOnSubmit should already does this job (and, I repeat, it does not every times).

      At that point, I have a problem with my workaround. I have a form with required input texts and I want to add a Cancel button with a popup message to confirm or not this cancelation. With my workaround, I also have to submit the form with ice:commandLink because, if I don't do it and choose not to cancel and go back to my page (using s:link for example), I lose the text I typed in the richInputText... No problem, I use the commandLink : but it means I have to fill in all the required fields just to have the possibility to make the cancel button work!!! (if not all the required fields are filled in, the submission is not performed indeed...)

      Today, I'm quite stuck because I have two possibilities :
      - I keep going on with the buggy saveonSubmit that submit "when it wants to" and my cancel mechanism works fine
      - I use my workaround, but, in case of presence of required fields, I have to fill in the fields just to allow the cancel button to work... which is crazy...

      Thanks for your help.

        Activity

        Adnan Durrani created issue -
        Adnan Durrani made changes -
        Field Original Value New Value
        Assignee Adnan Durrani [ adnan.durrani ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17592 Tue Sep 16 11:41:03 MDT 2008 adnan.durrani Fix for ICE-3531 (inputRichText saves data inconsistently on saveOnSubmit)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputrichtext/fckeditor_ext.js
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/submit.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17593 Tue Sep 16 12:03:29 MDT 2008 adnan.durrani Fix for ICE-3531 (inputRichText saves data inconsistently on saveOnSubmit)
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/bridge/src/submit.js
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/inputrichtext/fckeditor_ext.js
        Adnan Durrani made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Adnan Durrani added a comment -

        trunk revision : 17592
        branch 1.7 revision : 17593

        Show
        Adnan Durrani added a comment - trunk revision : 17592 branch 1.7 revision : 17593
        Adnan Durrani made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 1.7.2 [ 10130 ]
        Resolution Fixed [ 1 ]
        Hide
        Adnan Durrani added a comment -

        Mandeep can you please verify it?

        Show
        Adnan Durrani added a comment - Mandeep can you please verify it?
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Adnan Durrani [ adnan.durrani ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Adnan Durrani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: