Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: not able to call java method from setonchange() event

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default not able to call java method from setonchange() event

    Hi

    I used java and jsf.
    I created dynamic datatable in java file.
    can i call java method from setOnchange() event?

    I am able to call java script function from setOnchange() event.
    see the below code which is working fine for java script.

    HtmlSelectOneMenu selectOneMenu = new HtmlSelectOneMenu();
    selectOneMenu.setStyleClass("dropdownStyleTwo");
    selectOneMenu.setOnchange("openWin(this);IGNORE_UN LOAD=false");

    i wrote openwin() function in java script.

    but i am not able to call java method change().
    code which is not working.
    HtmlSelectOneMenu selectOneMenu = new HtmlSelectOneMenu();
    selectOneMenu.setStyleClass("dropdownStyleTwo");
    selectOneMenu.setOnchange("myclass.change();IGNORE _UNLOAD=false");

    myclass is the bean of class Test.
    If user select any value from dropdown i want to call change java method.
    This function will apply the same selected dropdown value to the other record also.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,469
    My Mood
    Mellow
    Thanks
    151
    Thanked 608 Times in 595 Posts

    Default Re: not able to call java method from setonchange() event

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Similar Threads

  1. How can I call doGet method?
    By Nuha_IT in forum Java Servlet
    Replies: 4
    Last Post: November 27th, 2012, 06:27 AM
  2. Only if one method is true does it call the other?
    By ColeTrain in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 29th, 2012, 03:28 PM
  3. How to call a value from a different method to main
    By CrimsonFlash in forum What's Wrong With My Code?
    Replies: 13
    Last Post: October 22nd, 2011, 06:29 PM
  4. How do I call a method from the main method?
    By JavaStudent1988 in forum Java Theory & Questions
    Replies: 5
    Last Post: October 19th, 2011, 08:37 PM
  5. Can i call init() method in destroy method.?
    By muralidhar in forum Java Servlet
    Replies: 1
    Last Post: October 22nd, 2010, 11:18 AM

Tags for this Thread