• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Object Expected Error

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont see where you are calling function A()???
 
zaxxon25
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
funcA() is called by some third party javascript. The issue is not with it but with function clickLink(linkId)
 
Divya Guttikonda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have resolved the issue. I was using tomahawk component which was creating javascript issue. Thanks Divya for your help.
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic