Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Not loading text during "Page_Load". (Read 2568 times)
rlira
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2011
Not loading text during "Page_Load".
Mar 1st, 2012 at 11:29pm
Print Post  
Hello!

I have a aspx page where the user input data and the result is displayed in a Graph. For every input I do the necessary modifications on the object that holds all data on a session variable and then call the single function responsible for reading the session variable, clear and update the diagram.

What happens is that this page is also used for the "edit record" option where I bring all the data from the database into an object, save it into session and call the same function as before.

This all worked properly when I was working with Image mode. Once I changed it to Applet mode the text inside nodes are not showing up. The only difference is that when loading the page on edit mode I call the function who insert elements from the Page_Load event.

If the user input any data (forcing a postback), then the diagram is displayed properly (as the function refreshes all diagram for every postback).

So, as I mentioned the only difference is that on edit mode I call the function from Page_Load. I just don't understand why only the text isn't being dislpayed.

Any hints? Maybe someway I could find out what's happening?

Ps.: Debug shows that the text is being inserted into the node. I also checked to see if it could be a browser issue but problem remains on Firefox and IE.

Appreciate any input on that.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Not loading text during "Page_Load".
Reply #1 - Mar 2nd, 2012 at 9:04am
Print Post  
Hi,

Could you attach here a sample project that shows the problem?

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
rlira
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2011
Re: Not loading text during "Page_Load".
Reply #2 - Mar 2nd, 2012 at 7:37pm
Print Post  
Stoyo wrote on Mar 2nd, 2012 at 9:04am:
Could you attach here a sample project that shows the problem?


Hello!

As you requested, I isolated everything into a new project and the problem is still happening.

I'm attaching the sample project. You can see the problem following these steps:

1) Open "Default.aspx";
2) Press button "Create Diagram" (Diagram will be empty and waiting for user input);
3) Input data. In my example (A,B,OneWayArrow ; B,C,OneWayArrow ; C,D,DoubleCircle ; D,E,OneWayArrow);

You will notice what I said on the first post. Every time you add a connection there is a postback wich forces the diagram to refresh.

At this point on the original application there is a button to save the data into the database. Now you can simulate the user going back to edit the data (displayed graphically on the diagram).

4) Open "Default.aspx";
5) Press button "Edit diagram" (on this sample it will simulate loading data from the database. Loaded data will be the same specified at step 3).

Data will be put into session variable and sent to the diagram on the Page Load event.

Diagram nodes do not have their text. But if you add another connection (wich forces another postback) the text will be displayed. Previous added nodes will have the text displayed correctly as the function clear the diagram and generate it back together every postback.

In order to reduce the file size, the following files were deleted from the project folder:

JDiagram.jar
bin\MindFusion.Common.dll
bin\MindFusion.Common.dll.refresh
bin\MindFusion.Diagramming.dll
bin\MindFusion.Diagramming.dll.refresh
bin\MindFusion.Diagramming.WebForms.dll
bin\MindFusion.Diagramming.WebForms.dll.refresh
bin\MindFusion.Diagramming.WebForms.xml
bin\MindFusion.Diagramming.xml
bin\MindFusion.Extenders.dll
bin\MindFusion.Extenders.dll.refresh
bin\MindFusion.Graphs.dll
bin\MindFusion.Svg.dll

Also, I think it is worth to mention my dlls versions:

MindFusion.Common.dll - 1.2.4027.25720
MindFusion.Diagramming.dll - 5.6.0.17418
MindFusion.Diagramming.WebForms.dll - 4.0.0.17495
MindFusion.Extenders.dll - 4.0.0.17495
MindFusion.Graphs.dll - 2.0.0.21679
MindFusion.Svg.dll - 1.0.4037.20089

I appreciate any help on this matter. Thanks in advance.
  

NetDiagramPostBack__NoDLLsNoJAR_.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Not loading text during "Page_Load".
Reply #3 - Mar 5th, 2012 at 7:51am
Print Post  
Hi,

The text is there but doesn't show after edit because the 24 point font size doesn't fit into the nodes. I'm not sure what's the exact workflow involved with these response.Redirects, but in some cases the code passes through the if (!Postback) which initializes the font to 24 points, in other cases you get the 9 point font from the default diagram on the page (that's when you see the labels).

Just set a smaller font size, and perhaps move it outside of the !Postback block so the fonts are the same both after postback and redirect:

Code
Select All
protected void Page_Load(object sender, EventArgs e)
{
	Diagram diagram = diagramViewSample.Diagram;
	diagram.Font = new Font("Microsoft Sans Serif", 9, GraphicsUnit.Point);

	if (!IsPostBack)
	...
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint