How can i use jquery code in ExtendedRenderKitService?

i'm try to using jquery like this way,but cause js error.
so,can i use jqeury code in ExtendedRenderKitService? how?
private String jsFunction() {
StringBuilder sb = new StringBuilder();
sb.append("$(document).ready(function(){");
sb.append("var spans = $('span');");
sb.append("alert(spans.length);");
sb.append(" });");
return sb.toString();
public void searchTree(ActionEvent actionEvent) {
favoriteTreeManager.searchTree(searchCriterium);
FacesContext context = FacesContext.getCurrentInstance();
ExtendedRenderKitService extRenderKitSrvc =
Service.getRenderKitService(context, ExtendedRenderKitService.class);
extRenderKitSrvc.addScript(context,
jsFunction());
}

Hi,
$('span') is invoked when the page renders if I remember correctly. Since using JavaScript from a managed bean invokes a function, the use of JQuery does not work. You can run a little test. If you get JQuery working from a URL browser typing javascript:... command ... then the same probably works from a managed bean
Frank

Similar Messages

  • How can i use a code for an app in venezuela that was sent to me from the states?

    Please my cousin sent me an app as a gift but when i try to download it pops a message that says that my code will work just for store in the us, does anybody knows how change that code or any other way to use it here in Venezuela? thanks a lot

    As stated, that code will only work in the US App Store.  Ask your cousin to contact iTunes support, explain your situation and see if they can issue him a code that will work in the Venezuela store.
    http://www.apple.com/support/contact/

  • How can i use ADF code in Trinidad

    Hi,
    I'm having an small Application which is Implemented to some extent using oracle ADF faces components But now, as the Trinidad is an open source i would like to do it in trinidad.
    If i replace the libraries to trinidad does my implement code in ADF Faces components needs to be Change,
    Please Suggest me how can use my ADF code in Trinidad.
    Thanks.

    Hi,
    Thanks for the Information a lot,it will helps me a lot.
    i am unable to navigate to down load the libraries given in oracle site in "How-to configure Apache Trinidad components in Oracle JDeveloper " can u help me,
    how can i get libraries to use in Oracle Jdeveloper for Trinidad.
    Can i use the libraries given on the Apache MyFaces Trinidad site (http://myfaces.apache.org/trinidad/download.html) but the libraries are different than the oracle given.
    Please Help me what libraries to used in Oracle jdeveloper 10g for trinidad.
    Thank You.

  • How  can  I use Javascript code to affect the display of textField?

    Hi All,
    I created a web application using JSF.
    And Placed two controls: one Text Field and one Label.
    On the Javascript onclick event of Label, I wrote the following javascript:
    document.getElementById("form1:textField1").value="test123";
    I run the web application, and click on the label, However, the text of the Text Field does not change.
    But the following code shows text of the Text Field has been changed. it works.
    alert(ocument.getElementById("form1:textField1").value);
    So, why the display of the Text Field does not change? How to update the display of the Text Field?
    Any suggestion will be helpful!
    Thank you.

    here is a full and correct example, enjoy
    1. <html>
    2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    3. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    4. <f:view>
    5. <head>
    6. <title>
    7. <h:outputText value="#{msgs.windowTitle}"/>
    8. </title>
    9. </head>
    10. <body>
    11. <h:form id="registerForm">
    12. <table>
    13. <tr>
    14. <td>
    15. <h:outputText value="#{msgs.namePrompt}"/>
    16. </td>
    17. <td>
    18. <h:inputText/>
    19. </td>
    20. </tr>
    21. <tr>
    22. <td>
    23. <h:outputText value="#{msgs.passwordPrompt}"/>
    24. </td>
    25. <td>
    26. <h:inputSecret id="password"/>
    27. </td>
    28. </tr>
    29. <tr>
    30. <td>
    31. <h:outputText value="#{msgs.confirmPasswordPrompt}"/>
    32. </td>
    33. <td>
    34. <h:inputSecret id="passwordConfirm"/>
    35. </td>
    36. </tr>
    37. </table>
    38. <h:commandButton type="button" value="Submit Form"
    39. onclick="checkPassword(this.form)"/>
    40. </h:form>
    41. </body>
    42. <script type="text/javascript">
    43. <!--
    44. function checkPassword(form) {
    45. var password = form["registerForm:password"].value;
    46. var passwordConfirm = form["registerForm:passwordConfirm"].value;
    47.
    48. if(password == passwordConfirm)
    49. form.submit();
    50. else
    51. alert("Password and password confirm fields don't match");
    52. }
    53. -->
    54. </script>
    55. </f:view>
    56. </html>

  • How can I use this code in Muse?

    Please, tell me with details how to paste this code, which the "add this" widget on Muse to appear...
    <!-- AddThis Smart Layers BEGIN -->
    <!-- Go to http://www.addthis.com/get/smart-layers to customize -->
    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-538d2f0f4872fcfe"></script>
    <script type="text/javascript">
      addthis.layers({
        'theme' : 'transparent',
        'follow' : {
          'services' : [
            {'service': 'facebook', 'id': 'africa.si.zgz'},
            {'service': 'twitter', 'id': 'Africa_Si'},
            {'service': 'google_follow', 'id': 'u/0/b/103262715708033329485/103262715708033329485/posts'},
            {'service': 'linkedin', 'id': 'África-sí', 'usertype': 'company'},
            {'service': 'youtube', 'id': 'africasizgz'}
        'whatsnext' : {} 
    </script>
    <!-- AddThis Smart Layers END -->
    Thank you!

    Thank you, but I still have a problem.... When a copy it directly on Muse through "ctrl + v" I see the whole code as text on Muse and when I paste it thorugh object--> Insert HTML Muse says that they "couldn't generate de miniature", do you know what I'm doing wrong?
    Thank you!

  • HT3775 how can I use this codes? and Where?

    I am trying to watch a Trailer for leapPad2 and I can't. It's showing me a massage that I need a special software for that and for more information press TELL ME MORE. When I do that it just showing me some codes. I don't know what should I do with those!

    You might try installing this Free plugin called "Perian" that has worked for some other Users:
                     http://perian.en.softonic.com/mac

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How can I use iCloud-keychain if i can not find my country in the country code list?

    How can I use iCloud-keychain if i can not find my country in the country code list?

    Welcome to the Apple Community.
    If your country code does not appear in the list…
    Go to System Preferences > iCloud > Keychain and enter your Apple ID password (Settings > iCloud > Keychain, from a mobile device)
    Select the ‘Create Different Code’ option. (Mobile devices only)
    Select the advanced option and choose whether to create a random code or no code, selecting the later allows syncing across devices but not with Apple’s servers.

  • How can I use the QR codes with my iPad 2. do I need to download first an app ?

    How can I use the/read the QR codes with my iPad 2 ? Do I need to download an app ?

    Yes.  There are quite a few available for free in the app store

  • I have a product code for my photoshop c6 under a different account that i cant remember. how can i use my software with the product code that i have with the new user i made?

    I have a product code for my photoshop c6 and i used a different account to register this software. how can i use this product that i have with my new account that i just made?
    please advise
    I dont have the serial number so yeah
    i have a product code

    Contact Adobe Customer Service directly by phone or web chat (they don't do email).  They don't do email.  If you can provide proof of purchase to their satisfaction, they may be able to help you.
    These are user forums, so you're not addressing Adobe here.  We can't help you with this type of issue.

  • How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your repl

    How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your reply. Thanks!

    It's good to read Antoniad's post.  It reassures me that I can use my new iPad as an international communication device which is the reason I purchased the thing.  However, I called Verizon today (my provider of cellular data) who told me that I can't just pop in a SIM card as you suggested.  He also said that he was from the "Pre-Pay" division of Verizon and he was certain that I couldn't do what I planned to do.  I was extremely disappointed as I had called Apple prior to buying the iPad and I read the algorhythm on the website for choosing an iPad before purchasing.  Those sources were quite specific and the information seemed clear.  I would be able to use my iPad to communicate through cellular connections while traveling on the road, literally, abroad.  I was told that I could pop in a data card wherever I was, just as you indicated in your message above, and voila I was good to go.  The Verizon rep definitively rained on that parade, but said that I might be able to do this if I have a "Post-Pay" account, a different area of Verizon.  I haven't had the chance to talk to this division yet, so I looked to Apple's Support for answers.  Maybe I will find out that I can use my iPad as an international communication device while traveling on the road afterall, however, it appears I may need a different type of account (Post-Pay), something I was never warned about. Can I switch to this kind of account?  I don't know.  I have to find out.  If you have any information about this issue, it would be good to share since I strongly suspect there are others who bought the iPad for the same purpose that I have.

  • How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available.

    How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available. I'm using iTunes 11.3 on a MacBook Pro, OS X 10.6.8. I can't save my library in iTunes, the message just keeps popping up.

    From an OS9 reference, error -54 is a software lock on a file or a permissions error. (Although there is no formal list of OSX error code some of the old codes still apply to OSX .)
    First, try simply restarting your computer.
    Try quitting iTunes, then deleting the .xml (not .itl !) version of the library file in the iTunes folder (iTunes will generate a new one).
    iTunes Library cannot be saved (Error -54) - https://discussions.apple.com/thread/1912814 - various things to try.
    Unknown error (-54) while syncing ipod - https://discussions.apple.com/thread/1082953 - problem was locked files
    Why does iTunes keep showing a -54 error when I sync my iPad? - https://discussions.apple.com/thread/3727114
    Error -54 possibly related to Touch Copy - https://discussions.apple.com/thread/3727114 - cleared by deleting preferences on iPad.
    iTunes: Missing folder or incorrect permissions may prevent authorization - http://support.apple.com/kb/ts1277
    Troubleshooting permissions issues in Mac OS X - http://support.apple.com/kb/HT2963

  • How can i change the code in when new form instance trigger using JDAPI

    Hi all,
    Can anyone tell me how can i use JDAPI to modify the when-new-form-instance trigger in all my forms,coz we have around 500 FMB's ,if this is possible by using jdapi it will be better for us..
    Thanks in advance..
    Najeeb

    Hi Najeeb,
    The code I've given you should cover the basic steps - you will need to have a basic knowledge of Java if you want to use the JDAPI, there's no way around that unless you go and buy one of the off-the-shelf products for this kind of thing (I think there's one called orcltoolbox..?)
    I've written an application that does all kinds of things to Forms specific to our needs, so it's a bit tricky to just pull out the code you need, but again, the basics will be:
    String formName="C:\some_dir\some_form.fmb";
    FormModule mForm=FormModule.open(formName);
    Trigger myWNFITrig=Trigger.find(mForm,"WHEN-NEW-FORM-INSTANCE");
    String myText=myWNFITrig.getTriggerText();
    And there you have your trigger text, to do with what you please. You could put this code in the main() method of one class if you want to keep things really simple - but see how you get on, if you have any more specific questions, do come back.
    Eric - that's a very good point about using Regular Expressions. I haven't used them in my JDAPI app because I wanted to keep all my .fmbs 6i-compatible for the short-term, and a posting I saw somewhere recommended sticking to Java 1.3. Which rules out the regex facility, which only appeared in Java 1.4. Now, though, I think I needn't have worried - it surely shouldn't matter which version of Java I use to make the changes to the .fmbs. My stupid!
    James

  • How can i use the project code instead of project xml?

    hello
    i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
    i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
    otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
    thank you very much?

    There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
    When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
    When using the project-class you simply replace the project-xml entry like this:
    <project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
    The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
    Doug Clarke
    Product Manager
    Oracle9iAS TopLink

  • How can i use param in my select query ( see code)

    Hi ,
    I need to use the param instead of hardcoding the value in the select query , when i did that it is working .
    I think the limit of args is only till the end of main and my select query is in a method called Load() .
    How can i use the param in my select query .
    public static void main(String[] args){
    name = args[0];
    class= args[1];
    new Load();
    }//end of main
    public Load()
              try {
                   Class.forName(JDBC_DRIVER);
                   connection = DriverManager.getConnection(DATABASE_URL,"username","pw");
                   statement = connection.createStatement();
                   //First Query : pin and ticket number
                   ResultSet resultSet = statement.executeQuery("SELECT pin , ticketnumber from airport ,year where "+                                                                      "year.year_name= Here i need to use the param (instead of hardcoding) and year.class_year= Here too i need to use param");
    }// end of method Load()Edited by: 1sai on Sep 24, 2008 7:34 AM
    Edited by: 1sai on Sep 24, 2008 7:35 AM

    Might I suggest you change the structure of your program to the following:
    public class Load {
      private Connection conn;
      private PreparedStatement statement;
      public Load(String sql) {
        init(sql);
      protected void init(String sql) throws Exception {
        Class.forName(JDBC_DRIVER);
        conn = DriverManager.getConnection(DATABASE_URL, "username", "pw");
        statement = conn.prepareStatement(sql);
      public ResultSet execute(String p1, String p2) throws Exception {
        statement.setString(1, p1);
        statement.setString(2, p2);
        return statement.executeQuery();
      public void close() throws Exception {
        if (statement != null)
          statement.close();
        statement = null;
        if (conn != null)
          conn.close();
        conn = null;
      public static void main(String[] args) throws Exception {
        String sql = args[0];
        String param1 = args[1];
        String param2 = args[2];
        Load load = new Load(sql);
        ResultSet rs = load.execute(param1, param2);
        while (rs.next())
          System.out.println(rs.get(0));
        rs.close();
        load.close();
    }This allows you to use the same "Load" object for multiple queries with different parameters.
    I do not recommend you actually use the code above in any sort of production application. You should really take a look at Spring Framework along with an ORM tool like Hibernate or Ibatis to simplify your DAO layer.
    Hope this helps,
    David

Maybe you are looking for

  • Problems with connecting to internet

    maybe i won't have internet for long so i have to make this quick: 1. I use bcm43xx kernel module to connect to internet and this has been going OK(sometimes iv'e had to disconnect and reconnect to still get internet however) nut completely died this

  • Ok so i got a new ipod and now i can't put songs on the new one

    so you see i have a shuffle and i sold that one and now i got a nano and i am unable to put songs onto it when every i grab a song to put onto my nano it doesn't light up and i've tried everything to attempt to put songs onto it but it all just bring

  • Is java powerful enough to be used as a Gameserver?

    Simple question. I know that it's probably better to use something else as a backend, like C++, or C#. But, is it realistic to create a gameserver in java? I mean, starting out... I just want to be able to create a chatroom and stuff like that to lea

  • Spread the Love! Be our SS DBE TechNet Guru, this Valentine's

    TechNet loves you! We love your contributions at TechNet Wiki sooo much that we give you more than just love in return... We give you NOTORIETY, GLORY... and VIRTUAL MEDALS! That's not all, this love we have, together, it flows both ways my friend. Y

  • Activation of sapmail

    hi , we have just activated out sap business workplace, the mail we are sending to intranet id its working but when we are sending the same mail to external network , it's not working, so, can any one give suggestion or related program through we can