gekrish
gekrish

Reputation: 2191

Problems with javascript and h:commandLink

                <a href="#" onclick="return oamSubmitForm('display_form','display_form:link_prev');" id="display_form:link_prev"> &lt; Prev</a>
                <a href="#" onclick="return oamSubmitForm('display_form','display_form:link_next');" id="display_form:link_next"> Next &gt;</a>
            </div>
        </td>
    </tr>
    <tr>
        <td colspan="14" height="5" nowrap="nowrap" class="WhiteRow"></td>
    </tr>
    <input type="hidden" id="display_form:removeUserId" name="display_form:removeUserId" value="" />
    <input type="hidden" id="display_form:remove111" name="display_form:remove111" value="" />
    <input type="hidden" id="display_form:remove222" name="display_form:remove222" value="" />
    <input type="hidden" id="display_form:showPrev" name="display_form:showPrev" value="true" />
    <input type="hidden" id="display_form:showNext" name="display_form:showNext" value="true" /> 
    <tr>
        <td colspan="14" height="30" nowrap="nowrap" align="center">
            <input type="button" class="disabledfield" id="button_edit" value="Edit Details" onclick="populateEditRow();" />
            <input id="display_form:button_remove" name="display_form:button_remove" type="submit" value="Remove" onclick="populateRemoveRow();;" class="disabledfield" />
        </td>
    </tr>
    <tr>
        <td height="10"></td>
    </tr>
</table>

The above HTML is what the JSF renders. When clicking on Prev / Next , I am getting javascript error as 'invalid Argument' , The JSF has created some functions like oamSubmitForm and several others.

What could be the problem? anything obvious?

Upvotes: 0

Views: 1660

Answers (1)

BalusC
BalusC

Reputation: 1108722

It look like that you're using MyFaces. I don't recognize that function as from Mojarra. At least, this unhelpful JavaScript error is typical for the JS engine of the MSIE browser.

Have you tried a different (better) browser? For example FireFox? Does it work there or not? If not, did you try Firebug's JS debugger to determine the root cause of this JS error? If it's obviously caused by a bug in the JS function generated by MyFaces, then you need to try upgrade MyFaces to the latest version (or just replace by Mojarra). If upgrading MyFaces doesn't help, then report an issue at their issuetracker along with the smallest possible working snippet of the exact JSF code which reproduces this problem, along with detailed version information of the browser(s) used.

Upvotes: 1

Related Questions