0

I have the issue described at http://wiki.apache.org/myfaces/Facelets_with_Trinidad. More specifically:

"There is an issue in the id generation for components when a PPR is executed. The symptom is that a click on an command does not execute the desired action but only reloads the whole page. Any subsequent click on any command succeeds.

To work around this issue manually set the id's for at least all commands on the affected pages.".

I already tried the above method but the problem keeps arising. Does anybody have any solution to this?

Puma
  • 135
  • 1
  • 12
  • Do you have valueChangeListeners involved on your site? – lkdg Jul 10 '13 at 12:38
  • I have valueChangeListeners only in one page. In the page where I have the above problem, there is no valueChangeListener. – Puma Jul 15 '13 at 09:58
  • I had this problem, that's why I was asking. I had a commandButton and some tr:inputText with a valueChangeListener. The user changes the value of the field and keeps the mousecursor in the field. Then the user would click the command, but this is the moment when the valueChangeEvent is fired and the action of the button is lost. So you have to click it twice. – lkdg Jul 15 '13 at 11:50

1 Answers1

0

Finally, I solved the above problem by calling the function below on load page.

// Override function to solve ppr problems
function overrideFunc() {
    TrPage.prototype._updateViewState = function(a59, a60, a61) {
    var a62 = null;
    if (a61)
        a62 = a59.getElementById(a61);

    for ( var i = 0; i < a59.forms.length; i++) {
        a62 = a59.forms[i];
        if (!a62)
            return;

        var a63 = a62.elements[TrPage._VIEW_STATE_ID];
        if (!a63) {
            a63 = a59.createElement("input");
            a63.type = 'hidden';

            if(_agent.isIE && _agent.version < 8) {
                a63.id = TrPage._VIEW_STATE_ID;
            }

            a63.name = TrPage._VIEW_STATE_ID;
            a62.appendChild(a63);
        }

        a63.value = TrPage._getTextContent(a60); 
    }
};

}

Puma
  • 135
  • 1
  • 12