Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7563867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:46:25+00:00 2026-05-30T13:46:25+00:00

The following event is not getting invoked: <script> $(#inputTxt).change(function() { alert(changed); }); </script> The

  • 0

The following event is not getting invoked:

<script>
        $("#inputTxt").change(function() {
            alert("changed");
        }); 
 </script>

The code for inputTxt is as follows:

<p:inputText id ="inputTxt" name="inputTxt" value="#{article.description}"
                    style="border:none; box-shadow:none;"/>

The coloumn “articleDescription” is defined in a datatable named “articlesInformation” which is placed on a form “articleForm”.

On inspected the element, I found that the id of the inputText becomes – “articlesInformation:0:inputTxt”. Probably that is the issue.

Viewing page info says :

    <td role="gridcell">
       <div class="ui-dt-c">
        <input id="articlesInformation:0:inputTxt" name="articlesInformation:0:inputTxt"
         type="text" value="Description of Article 1"
         style="border:none; box-shadow:none;"
         class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" />
       <script id="articlesInformation:0:inputTxt_s"
  type="text/javascript">PrimeFaces.cw('InputText','widget_articlesInformation_0_inputTxt'
    {id:'articlesInformation:0:inputTxt'});
</script></div></td>

How should the jquery be defined for primefaces components?

Thanks,
Shikha

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:46:26+00:00Added an answer on May 30, 2026 at 1:46 pm

    When inputText is placed in datatable, primefaces gives it id = datatable_id:row_index:inputText_id. That is, the inputText in row 7 is given the id = datatable_id:7:inputText_id. Try the below …

    <p:dataTable id="table_Details" var="dataItem" rowIndexVar="rowIndex">
         <p:column id="articleDescription" headerText="Article Description">
            <p:inputText id="inputTxt" name="inputTxt" value="#{article.description}" onchange="inputTextChanged(#{rowIndex})"/>
         </p:column>
    </p:dataTable>
    
    function inputTextChanged(rowIndex){
        var str = 'table_Details:' + rowIndex + ':inputTxt';
        var selected = $(document.getElementById(str));
        alert (selected.val());
    }
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I call the following function with a mouseover event but it's not working. My
The following code's else part isnt working, i.e. click is not getting enabled. if
Given the following InsertItemTemplate (simplified) I'm not getting anything back in the event object's
The following key event is not working. Any idea? class Frame(wx.Frame): def __init__(self): wx.Frame.__init__(self,
The following code is implemented in Page_Load event to show SaveFileDialog to the user
I am using greasemonkey script and have updating the table using following code. I
I keep getting the following event log descriptions for svcListener and svcListener - Prof
I'm not getting any errors when I run the following files, but the data
I have the following table EVENT_LOG : EVENT_ID: pk, int, not null TYPEID: fk,
The following event can possibly get called hundreds of times a frame. public bool

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.