This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Object Expected Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Object Expected Error" Watch "Object Expected Error" New topic
Author

Object Expected Error

zaxxon25
Ranch Hand

Joined: Feb 26, 2005
Posts: 35
I am having scrollable table whose rows are not editable. This table is in first half of screen. The bottom half of screen displays detail with respect to each row. So say i click on row 1 the bottom screen gets refreshed with details of row1.
When i am clicking a row i am getting javascript error "object expected". Can anyone help me out...i am putting my piece of code below...

<script>

func A()
{
document.form1.offerid.value = val;
clickLink('hiddenLink');
}

function clickLink(linkId)
{
var fireOnThis = document.getElementById(linkId)
if (document.createEvent)
{
var evObj = document.createEvent('MouseEvents')
evObj.initEvent( 'click', true, false )
fireOnThis.dispatchEvent(evObj)
}
else if (document.createEventObject)
{
fireOnThis.fireEvent("onclick") ---> line which javascript errors out
}
}
</script>



<h:form id="form1">
<input type="hidden" name="offerid" />
<t:commandLink id="hiddenLink" forceId="true" style="display:none; visibility: hidden;" action="#{TestBean.openClickOffer}"/>
</h:form>
Divya Guttikonda
Ranch Hand

Joined: Mar 09, 2005
Posts: 47
I dont see where you are calling function A()???
zaxxon25
Ranch Hand

Joined: Feb 26, 2005
Posts: 35
funcA() is called by some third party javascript. The issue is not with it but with function clickLink(linkId)
Divya Guttikonda
Ranch Hand

Joined: Mar 09, 2005
Posts: 47
Which version of JSF are you using ?? I read somewhere that for h:commandLink, onclick is present in JSF version 1.2, but not 1.1.
zaxxon25
Ranch Hand

Joined: Feb 26, 2005
Posts: 35
I have resolved the issue. I was using tomahawk component which was creating javascript issue. Thanks Divya for your help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Object Expected Error
 
Similar Threads
Using Up/Down Arrow Key to Move in a table
get id of selected rows
getElementById() issue with hidden t:commandLink
Split Pane effect with JSF 1.2, Facelets, Javascript, RichFaces
getting forceId in h:commandLink