function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
hi..
pageblocksection hide
What about a solution with "innerHTML"..?
<apex:page>
<script>
var contentArray = new Array();
var idArray = new Array();
var isCollapsed = false;
function collapse(ids){
if (isCollapsed) {
fix();
return;
}
isCollapsed = true;
idArray = ids.split(',');
for (var i = 0; i < idArray.length; i++) {
contentArray[i] = document.getElementById(idArray[i]).innerHTML;
document.getElementById(idArray[i]).innerHTML = '';
function fix(){
isCollapsed = false;
document.getElementById(idArray[i]).innerHTML = contentArray[i];
</script>
<apex:form>
<apex:pageblock>
<apex:pageblockSection id="ps1">
This is first pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:pageblockSection id="ps2">
This is second pageblockSection;<br/><br/><br/>
<apex:pageblockSection id="ps3">
This is third pageblockSection;<br/><br/><br/>
<apex:commandButton value="Click" onClick="collapse('{!$Component.ps1},{!$Component.ps2},{!$Component.ps3}');return false;"></apex:commandButton>
</apex:pageblock>
</apex:form>
</apex:page>
hi prageeth,
Use SFDC internal javascript function twistSection. Note that it is not officially exposed to us.
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=566
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=6409
ThomasTT
Hello devamit;
I now again checked my above code with "Firefox", "IE" and "Chrome". It works in all those browsers.
Sometimes the problem may be with the way that you pass the component Ids to the function.
Could you please post a sample piece of your VF markup and then I can try to help you.
It would be nice to have this feature natively.
If you want too, please help to promote this ideia:
http://ideas.salesforce.com/article/show/10098227/Add_Collapsedtrue_option_to_ltapexpageblocksection
What about a solution with "innerHTML"..?
<apex:page>
<script>
var contentArray = new Array();
var idArray = new Array();
var isCollapsed = false;
function collapse(ids){
if (isCollapsed) {
fix();
return;
}
isCollapsed = true;
idArray = ids.split(',');
for (var i = 0; i < idArray.length; i++) {
contentArray[i] = document.getElementById(idArray[i]).innerHTML;
document.getElementById(idArray[i]).innerHTML = '';
}
}
function fix(){
isCollapsed = false;
for (var i = 0; i < idArray.length; i++) {
document.getElementById(idArray[i]).innerHTML = contentArray[i];
}
}
</script>
<apex:form>
<apex:pageblock>
<apex:pageblockSection id="ps1">
This is first pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:pageblockSection id="ps2">
This is second pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:pageblockSection id="ps3">
This is third pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:commandButton value="Click" onClick="collapse('{!$Component.ps1},{!$Component.ps2},{!$Component.ps3}');return false;"></apex:commandButton>
</apex:pageblock>
</apex:form>
</apex:page>
All Answers
What about a solution with "innerHTML"..?
<apex:page>
<script>
var contentArray = new Array();
var idArray = new Array();
var isCollapsed = false;
function collapse(ids){
if (isCollapsed) {
fix();
return;
}
isCollapsed = true;
idArray = ids.split(',');
for (var i = 0; i < idArray.length; i++) {
contentArray[i] = document.getElementById(idArray[i]).innerHTML;
document.getElementById(idArray[i]).innerHTML = '';
}
}
function fix(){
isCollapsed = false;
for (var i = 0; i < idArray.length; i++) {
document.getElementById(idArray[i]).innerHTML = contentArray[i];
}
}
</script>
<apex:form>
<apex:pageblock>
<apex:pageblockSection id="ps1">
This is first pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:pageblockSection id="ps2">
This is second pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:pageblockSection id="ps3">
This is third pageblockSection;<br/><br/><br/>
</apex:pageblockSection>
<apex:commandButton value="Click" onClick="collapse('{!$Component.ps1},{!$Component.ps2},{!$Component.ps3}');return false;"></apex:commandButton>
</apex:pageblock>
</apex:form>
</apex:page>
hi prageeth,
Use SFDC internal javascript function twistSection. Note that it is not officially exposed to us.
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=566
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=6409
ThomasTT
Hello devamit;
I now again checked my above code with "Firefox", "IE" and "Chrome". It works in all those browsers.
Sometimes the problem may be with the way that you pass the component Ids to the function.
Could you please post a sample piece of your VF markup and then I can try to help you.
It would be nice to have this feature natively.
If you want too, please help to promote this ideia:
http://ideas.salesforce.com/article/show/10098227/Add_Collapsedtrue_option_to_ltapexpageblocksection