سؤال

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?

هل كانت مفيدة؟

المحلول

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); 
    }
};

}

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top