function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aadit_13aadit_13 

Set rows property of apex:pageBlockTable

Hi,

 

I want to set the rows property of apex.pageBlockTable using Javascript.

 

Please advice how to access properties of component in Javascript.

 

Thanks in advance.

Aditya

Pradeep_NavatarPradeep_Navatar

Find below a JavaScript sample code to set the row attribute in a PageBlockTable :

 

            <apex:pageBlockTable rows="">

            </apex:pageBlockTable>

             <script>

                        document.getElementById("pageId:PageBlockId").setAttribute("row","5");

            </script>

 

Hope this helps.

aadit_13aadit_13

Hi Pradeep,

 

Thank you for you advise. I tried to follow your way but was not able to get to the result:

 

 <apex:pageBlockTable id="CampaignHistoryTable" value="{!cmph}" var="c" rendered="{!NOT(ISNULL(cmph))}" rows="5">

 

This is the block table and I want to increase the number of rows using Javascript.

 

Could you please let me know how to code it in terms of

 

document.getElementById("pageId:PageBlockId").setA​ttribute("row","5");

 

Thanks in advance.

Aditya