You need to sign in to do that
Don't have an account?
Aruna06
How to render values in the same Vf page?
Hi,
My requirement is whenever I clicked on a image in a vf page appropriate values should be displayed in th e same vf page.Now i can get the image in a vf page but When I clicked the image its doing nothing....can anyone explain me how should i acheive this.........any reply would be sincerely appreciated
Thanks in advance,
Hi arun,
the following is the process.
When you click a image some information should get hidden or to be displayed,
the following is the example.
<apex:pageblocksection id="pbs" render="{!flag}">
;
;;
;
</apex:pageblocksection>
<apex:image .................................. onclick=" define some javascript method for setting flag to true " reRender="pbs">
It can be used for hiding the existing one or display the hidden one.
If you have any question regarding this post it i will help you.
It this answers your question,PLz Mark it as solution.
<apex:pageBlockSection >
<apex:outputPanel id="selector" >
If above is code you want to reRender then try as follows
<apex:pageBlockSection id="selector">
<apex:outputPanel >
actually i did not understandwhat you want to do
are you jst refreshing that section , hiding it or displaying it after you click the image (where it is in hidden mode when the page loads)
If it is to be hide or display follow my first reply, if you still want some clarity i can give you.
What actually I want to do is whenever I click on the image which is displayed by doing action.......I need to display the values as
FacebookUrl = (Textbox) (This values are dynamically from xml).
but whenever Im clicking on the image nothing is getting displayed....
Thanks sureee,
got my requirement......I made a blunder mistake in my code....checked it now itself
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm
hi aruna,
why cant you post that correct code so every one can get help of it.
Its upto you.
Thanks.
suresh
ya sure....Here we go with the code
public class visual4 {
public visual4() {
flag=false;
} public class Network {
String image;
String name;
string field;
}
Network[] parsesocialnetwork(XmlStreamReader reader) {
Network[] socialnetwork= new Network[0];
while(reader.hasNext()) {
if (reader.getEventType() == XmlTag.START_ELEMENT) {
if ('Network' == reader.getLocalName()) {
Network widget = parseImages(reader);
socialnetwork.add(widget);
}
}
reader.next();
}
return socialnetwork;
}
Network parseImages(XmlStreamReader reader) {
Network widget = new Network();
while(reader.hasNext()) {
if (reader.getEventType() == XmlTag.START_ELEMENT) {
if (reader.getLocalName() == 'Image') {
reader.next();
if (reader.getEventType() == XmlTag.characters) {
widget.image= reader.getText();
}
}
if (reader.getLocalName() == 'Fieldlabel') {
reader.next();
if (reader.getEventType() == XmlTag.characters) {
widget.name= reader.getText();
}
}
if (reader.getLocalName() == 'Fieldtype') {
reader.next();
if (reader.getEventType() == XmlTag.characters) {
widget.field= reader.getText();
}
}
}
reader.next();
}
return widget ;
}
public boolean flag{get;set;}
public String ImageUr{ get; set; }
public String url{ get; set; }
public String typeurl{ get; set; }
public void refer() {
flag=true;
visual4 demo = new visual4 ();
String str = '<socialnetwork><Image>https://encryptedtbn2.google.com/imagesq=tbn:ANd9GcR6N8xoTIVjKPjpdpvLZjzwrDEAIodzZTpD1ybSXHZskxE1F0e</Image><Fieldlabel>FaceBookUrl</Fieldlabel><Fieldtype>TextBox</Fieldtype></socialnetwork>'; XmlStreamReader reader = new XmlStreamReader(str);
Network socialnetwork = demo.parseImages(reader);
ImageUr=string.valueof(socialnetwork.image);
url = string.valueOf(socialnetwork.name);
typeurl=string.valueOf(socialnetwork.field);
typeurl='';
system.debug('-----------'+socialnetwork);
}
}