Topic
  • 4 replies
  • Latest Post - ‏2012-09-24T19:00:30Z by Nagarjun
TPReddy
TPReddy
20 Posts

Pinned topic Invalid argument when I click on h:commandLink

‏2011-06-15T18:04:41Z |
Hi,

I'm upgrading WAS 6.1 to was 7.0 and when I click on commandLink I'm seeing 'Invalid argument ' at line 90

that line 90 contains

function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp[i]);}}};function apf(f, pvp)

which is autogenerated, I have a form with name and id..

No idea what's causing this issue..
any help/suggestion around would be aprreciated.

Thanks
Updated on 2012-09-24T19:00:30Z at 2012-09-24T19:00:30Z by Nagarjun
  • SystemAdmin
    SystemAdmin
    6420 Posts

    Re: Invalid argument when I click on h:commandLink

    ‏2011-06-15T23:27:10Z  
    JSF 1.2 usually throws an error of this sort when the link is either not in a form or the form structure is invalid (e.g., it's inside a form nested in another form). It can also occur if the markup surrounding the link is invalid (e.g., an HTML table that's missing closing tags for td and tr tags).
  • TPReddy
    TPReddy
    20 Posts

    Re: Invalid argument when I click on h:commandLink

    ‏2011-07-01T12:54:06Z  
    JSF 1.2 usually throws an error of this sort when the link is either not in a form or the form structure is invalid (e.g., it's inside a form nested in another form). It can also occur if the markup surrounding the link is invalid (e.g., an HTML table that's missing closing tags for td and tr tags).
    Resolved it by overwring the behaviour of JSF auto generated code in CommandLinkRendered.

    Thanks
  • TPReddy
    TPReddy
    20 Posts

    Re: Invalid argument when I click on h:commandLink

    ‏2011-07-08T13:49:45Z  
    • TPReddy
    • ‏2011-07-01T12:54:06Z
    Resolved it by overwring the behaviour of JSF auto generated code in CommandLinkRendered.

    Thanks
    Created a UICOmponent Render for commandLink and overwrite the default behaviour.
    It resolved my issue.
  • Nagarjun
    Nagarjun
    1 Post

    Re: Invalid argument when I click on h:commandLink

    ‏2012-09-24T19:00:30Z  
    JSF 1.2 usually throws an error of this sort when the link is either not in a form or the form structure is invalid (e.g., it's inside a form nested in another form). It can also occur if the markup surrounding the link is invalid (e.g., an HTML table that's missing closing tags for td and tr tags).
    After viewing this post I corrected my page as shown below to overcome the error.

    Original page:
    <head>
    ...
    </head>
    <script>
    ...
    </script>
    ...


    <f:view >
    <hx:scriptCollector>
    <h:form id="XXXXX">
    <h:inputHidden id="close" value="#{backbean.doPerofm1}"></h:inputHidden>
    <body>
    .....

    </body>

    </h:form>
    </hx:scriptCollector>
    </f:view>
    Changed it to:
    <head>
    ...

    <script>
    ...
    </script>

    </head>

    <body>
    ...


    <f:view >
    <hx:scriptCollector>
    <h:form id="XXXXX">
    <h:inputHidden id="close" value="#{backbean.doPerofm1}"></h:inputHidden>

    .....

    </h:form>
    </hx:scriptCollector>
    </f:view>

    </body>