Results 1 to 5 of 5

Thread: Webflow Richface / check all checkbox in a datatable / render fragments?

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Paris, France
    Posts
    7

    Default Webflow Richface / check all checkbox in a datatable / render fragments?

    Hello all,

    Excuse me for my approximate english;

    I have a datatable to render, and a main checkbox which should check all the others as you can imagine;

    the probleml is that i can execute my action from the xhtml, but the checkbox would'nt be refreshed after this action;
    That action as you probably know, executes a java function that will change the boolean values representing flags true/false for each lines of the table.

    I tried to put render fragments on the id of the checkbox but no matter it doesn't change

    If you need code, i'd be glad to help, but there isn't much to show more than what i described...

    Thanks a lot; And have a nice day;

  2. #2
    Join Date
    Dec 2009
    Location
    Paris, France
    Posts
    7

    Default

    I managed to get arround the problem;

    Using render fragments didn't to work much, even if o tried to reRender the hole dataTable in which there is the checkboxes;

    so i did link an action to the main checkbox, that will change the values of the different checkboxes for the different lines of the table; and with a simple reRender on "theForm:TheTable" in an a4j:support it worked...

    I tried to use render fragments in the flow file, with a different and more simple xhtml file and it worked... So finally i don't really understand how does the render fragments works... but i managed to make my page work so...

    Thanks

  3. #3
    Join Date
    Feb 2011
    Posts
    1

    Default

    Hello jamesleouf,

    I am also in need of the exact requirement, since i am new to JSF/Richaces + Seam framework i am breaking my head for the past coulple of days., it would be so helpful to me if you could post your xhtml and backing bean class method, so that i can get to know how you made it to work!.

    Thanks for your valuable help..

  4. #4
    Join Date
    Dec 2009
    Location
    Paris, France
    Posts
    7

    Default

    I'm sorry i don't have the code anymore

    From what i remember, i never found a way to make it work.
    Si i just put come command link on the checkbox so that i could change the whole page to check every checkboxes.

    It's ridiculous but... i had to do something....

    Sorry again.

  5. #5

    Default

    Hello,

    I had a lot of problems with the same issue. I resolved in the next way:

    Code:
    <h:selectBooleanCheckbox id="checkAll">
           <a4j:support event="onclick" action="selectMessageTree" onsubmit="checkUncheckAll(this)" reRender="#{flowRenderFragments}" />
    </h:selectBooleanCheckbox>
    And the javascript function, it checks or unchecks all the check box of the page (you can change only for the checkboxes of the table)

    Code:
    /**
     * Check or uncheck all the check boxes of a view
     * @param checkBoxGeneral
     * @return
     */
    function checkUncheckAll(checkBoxGeneral) {
    	
    	var checkBoxGeneralState = checkBoxGeneral.checked;
    	
    	if(checkBoxGeneralState) {
    		for(i=0; i<document.portalForm.elements.length; i++) {
    			if(document.portalForm.elements[i].type=="checkbox") {
    				document.portalForm.elements[i].checked = true;
    			}
    		}
    	}
    	else {
    		for(i=0; i<document.portalForm.elements.length; i++) {
    			if(document.portalForm.elements[i].type=="checkbox") {
    				document.portalForm.elements[i].checked = false;
    			}
    		}
    	}
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •