Results 1 to 7 of 7

Thread: How to rerender a jsf component using javascript

  1. #1
    Join Date
    Apr 2010
    Posts
    80

    How to rerender a jsf component using javascript

    I am just trying to make a request for a JSP page so this will then submit automatically after occurring the event on the server. Do you have any idea about the method through which I can trigger the server submit through the javascript. I have searched at all the location where I can get something but everywhere I am unable to get the perfect answers regarding the same , only one that I got was iceFaces associated . Mostly searching for a partial submit though a standard submit would be well .

  2. #2
    Join Date
    Apr 2010
    Posts
    28

    Re: How to rerender a jsf component using javascript

    I am not completely sure about this .But I have already tagged the code on another forums to just be sure that we are running on the same exact page. Any suggestion regarding a good javascript documentation library through which you can be able to know about the same and I can familiarize myself with some of the javascript techniques ?:

    function setSelectedMapLayer(point, mapLayer) {
    selectedMapLayer = mapLayer.name;
    document.getElementById("selectedFeatureForm:selectedFeature").value = selectedMapLayer;

  3. #3
    Join Date
    Dec 2007
    Posts
    1,547

    Re: How to rerender a jsf component using javascript

    Adrut, I wanted to say you something just as form.submit() doesn't do it for you in the same issue ?

    According to me, The code that you have posted here is not more meaningfulf ro me to measure the issue . But if you have just trying to find a form to submit within the script control, the form.submit() function is the best method to perform this. According to JavaScript docs suggested , T=the JavaRanch Bunkhouse is a fine place to start to get books onn this type of objects ..

  4. #4
    Join Date
    Apr 2010
    Posts
    80

    Re: How to rerender a jsf component using javascript

    The form.submit() does indeed perform a complete scale submit but did not yield the evaluation and I was just hoping for. There maybe one possibility, you could indicate me in the appropriate way in regards to what I require as I didn't got any information on something I felt would be common place.

    From JSF, it will interact with the getters and setters of the backing bean when the components has been rendered or any type of changes would be made . I have configured a hidden value through my javascript though as far as the JSP is described nothing has happened. I would need to fire up the page to 'recheck' itself so it can think that one of its values has been edited , therefore referencing the valueChangeListener on the element and configuring the latest value in the backing bean. Any methid to render an components through the javascript or if nothing that particular an the page 'recheck' itself in a sense?

  5. #5
    Join Date
    Dec 2007
    Posts
    1,736

    Re: How to rerender a jsf component using javascript

    Hello Adrut, I am just searching for my another issue and got this one interesting thread. So, I decided to post the replies here for this issue . Let me find out if I got what is going on. You are running with a hidden section with a valueChangeListener. The hidden section is bound to a property in the backing bean. When you replace the value with another , the hidden section via JavaScript the valueChangeListener is not being accessed . Is this the situation ?

  6. #6
    Join Date
    Apr 2010
    Posts
    80

    Re: How to rerender a jsf component using javascript

    Thanks for considering my issue and situation here.Thats exactly same what's going on . I don't have any issues in the case of the jsf and when it comes to jsf or javascript but consider that if I could render the hidden section then I could hopefully issue the valueChangeListener or at the very least configure the value to the backing bean.

  7. #7
    Join Date
    Dec 2007
    Posts
    1,736

    Re: How to rerender a jsf component using javascript

    I would try associating this.form.submit( ); to the end of the function that you have stated above. It should force the hidden section value to be configured in the backing bean. But you stated that you have tried it w/o success.

    This would be fine if you could put a onChange="this.form.submit( );" in the hidden section tag. Just be sure that your are running with the proper name of the field. JSF can associate the stuff to your field id and getElementById() may not search this . Check the html generated if not have proper confirmation. Could you tag the post the code for the hidden field tag and a skeleton of your listener?

Similar Threads

  1. Replies: 2
    Last Post: 17-07-2011, 03:09 PM
  2. PS3 Component with VGA: Will it Work?
    By Moon Walker in forum Hardware Peripherals
    Replies: 4
    Last Post: 13-10-2010, 06:00 PM
  3. Replies: 2
    Last Post: 03-07-2010, 04:34 AM
  4. What is a EOL Component
    By Abbie in forum Monitor & Video Cards
    Replies: 6
    Last Post: 12-03-2010, 11:09 AM
  5. How to register a component in vb?
    By REEMAD in forum Software Development
    Replies: 3
    Last Post: 28-02-2009, 09:01 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,243,469.14124 seconds with 17 queries