This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 91212 - When I drop a page fragment onto a page (visual designer), the entire visual designer becomes unusable
Summary: When I drop a page fragment onto a page (visual designer), the entire visual ...
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 5.x
Hardware: Other Windows XP
: P2 blocker with 1 vote (vote)
Assignee: Peter Zavadsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-18 15:04 UTC by rdelaplante
Modified: 2007-03-12 18:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot showing the VWP designer going blank when it doesn't like a page fragment (28.75 KB, image/gif)
2007-01-10 18:32 UTC, rdelaplante
Details
googlegiffile (8.36 KB, application/octet-stream)
2007-02-22 18:59 UTC, _ krystyna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2006-12-18 15:04:05 UTC
When I say unusable, I mean the visual page designer shows nothing except a
blank grey screen with a small white box inidicating the top/left corner of the
fragment.  If I drag/drop new components onto the page, they do not display and
do not get added to the JSP code. 

I've found the cause of the problem.  After adding the fragment, this was added
to my JSP:

<div style="position: absolute; left: 144px; top: 48px">
     <jsp:directive.include file="header.jspf"/>
</div>

If I change the left: and top: to 0px, the visual designer shows the page again,
and an outline of where the page fragment is.  I can't see what the page
fragment looks like unless I deploy.  I'm not sure if that's normal behavior or
not.
Comment 1 rdelaplante 2006-12-18 15:14:01 UTC
Also, once I have a page fragment on the page I can no longer select any of my
components.  When I hover my mouse over the page the cursor shows an icon of
four arrows pointing to north/south/east/west.  If I try to click on any of my
components they don't appear selected. If I try to drag one of my components
(such as a textbox) and drop it an inch away, the entire visual designer becomes
unusable and the page fragment was moved instead. 
Comment 2 rdelaplante 2007-01-03 20:38:07 UTC
Has anyone confirmed this issue? It is a major problem and makes page fragments
unusable
Comment 3 _ krystyna 2007-01-03 21:20:15 UTC
Cannot duplicate this. Please attach your project/ more details in order 
to reproduce. 
Comment 4 rdelaplante 2007-01-05 19:29:17 UTC
I will create a sample project for you now. 
Comment 5 Peter Zavadsky 2007-01-05 19:36:14 UTC
I can't reproduce those behaviours. Please could you provide the steps how to
reproduce it. 
Also in the case of the first problem a screenshot?
Thanks.
Comment 6 Peter Zavadsky 2007-01-05 19:36:49 UTC
You responded already, yes, the sample project will be the best.
Thanks.
Comment 7 rdelaplante 2007-01-05 19:46:10 UTC
Since I created this ticket I've reinstalled NetBeans and VWP several times.  It
appears to be working now!   Before, it was as simple as:

1) Create a new Visual Web Project
2) Create a new page fragment and drop a few components on it (such as static text)
3) Add a page fragment component to the Page1, select the page fragment you just
created.
4) The page fragment appears at position (0,0) pixels.  If I drag/drop it
anywhere but 0,0 it would hide the whole design of Page1 and display a red/white
error screen.  If I edited the JSP source and changed the div around the
fragment to be 0,0 it would be ok. 

I wonder if NetBeans updates or setups on the website have been silently
updated.  I put a newer version on with some sort of fix and it now works?

I have not yet done testing with fragments beyond this yet because they were
unsuable in the past.


Thanks,
Ryan
Comment 8 Peter Zavadsky 2007-01-05 21:25:27 UTC
So it seems there was an update inbetween, and now it works. Thanks for the
testing. Now I close this as fixed.
If you see it again, please reopen.

If you see the red/white error screen, it indicates some kind of error, which
prevents to build up the designer. It is usualy some syntax error in the source,
but it might be something else. In that case provide the log file.

Thanks for the info provided.
Comment 9 rdelaplante 2007-01-10 18:28:05 UTC
I've made it happen again.  It's not a red/white error screen I see, it's a grey
screen.  I'll take a screenshot.

Below is the page fragment that causes the problem.  The image file that it
refers to does exist in that location.

<?xml version="1.0" encoding="UTF-8"?>
<div style="height: 34px; width: 954px; -rave-layout: grid"
xmlns:f="http://java.sun.com/jsf/core">
    <f:subview id="header">
        
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td rowspan="2" style="width:142px;text-align: right;">
                        <a href="http://www.mycompany.com/index.jsp" target="_new">
                            <img alt="Company logo" src="/resources/logo.gif"
style="margin-top:4px;"/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td class="client-name" colspan="6"></td>
                </tr>
            </table>
        
    </f:subview>
</div>

What is interesting is that if I remove the <img ...> tag, the problem goes
away.  Or, if I remove the entire table leaving only the <img ...> tag, the
problem goes away and I can see the image in the designer. 

Also, if I replace the <img ...> tag with the following, the problem goes away.

<webuijsf:image binding="#{_header.image1}" id="image1" style="position:
absolute; left: 216px; top: 24px" url="/resources/logo.gif"/>

The odd thing is that I used the designer to create that tag and select the
image file to display, yet it does not display the image in the designer. 

Hope this helps. 
Comment 10 rdelaplante 2007-01-10 18:32:57 UTC
Created attachment 37241 [details]
Screenshot showing the VWP designer going blank when it doesn't like a page fragment
Comment 11 rdelaplante 2007-01-10 18:39:41 UTC
When I removed the whole table and left only the <webuijsf:image ...>  the image
displayed in the designer.  There must be something odd with the table?
Comment 12 _ krystyna 2007-01-10 20:36:35 UTC
From your latest comment which has an html table within the fragment, I can't 
duplicate your problem of not seeing the image at designtime. By any chance had 
you done any file renaming/refactoring of the fragment file? With this latest 
html you provided, I did notice a problem after I deployed it was then I could 
not see the image.  I could see the image after deployment when I changed your 
html by removing the leading slash:

<img alt="Company logo" src="resources/logo.gif
Comment 13 Peter Zavadsky 2007-02-20 21:45:45 UTC
Hm, I am not sure I understand this correctly.

If you are trying to move the components which are within the fragment, and that
fragment is inside a page? That is not allowed, you need to go to the fragment
page to do that.

Also if you don't see the fragment inside the page because it was positioned to
certain point. Does it mean, you added the fragment at that point or not? If
yes, then it is as expected.

Please clarify, I need more informantion. I didn't understand what is the 
remaining issue. Thanks.
Until that I mark it as invalid.
Comment 14 rdelaplante 2007-02-20 22:14:56 UTC
When I first created this ticket things were different than they are now. 
First, when I would drop any page fragment onto any page it would force itself
to appear at position 0,0.  If I tried to move the page fragment anywhere but
0,0 the entire designer would become completely unusable and show only a blank
gray screen.  If I left it at position 0,0 and tried to select any component on
my page that was not inside the page fragment, and was not the page fragment
itself, it would end up selecting the page fragment.  I realize you can't select
components inside of the page fragment.  

Months later when I tried again, I was able to drop a page fragment onto my page
and use it normally without issue until I put certain HTML inside of my fragment
that caused unusual behavior.  Depending on how I tweaked the HTML I could make
it display a blank gray screen, or display my page fragment but not render the
image inside of it.  I don't remember what I did but somehow I got the page
fragment to display properly including the image inside. 

The problems I experienced were definitely valid, but it may be hard for you to
reproduce.  They crippled the visual designer producing a completely blank gray
screen.
Comment 15 rdelaplante 2007-02-20 22:17:55 UTC
Look at the attachment to see the blank gray screen I'm talking about
http://www.netbeans.org/nonav/issues/showattachment.cgi/37241/PageFragmentProblem.gif
Comment 16 Peter Zavadsky 2007-02-20 23:42:00 UTC
Thanks for the reply.

So you got the blank gray designer window while doing something with the
fragment inside the page.

When you get that gray window, there should be always some error (exception) in
the log file indicating the real problem. Could you please send the log file
when you got that problem, if you still have it. 
That could help to identify the problem or at least one of more problems leading
to this issue. Thanks.
Comment 17 _ krystyna 2007-02-21 00:42:30 UTC
OK, I duplicated the grey screen and got the Fatal painting error in the log. 

Steps to duplicate:

1) create an EE5 project (will get the error also with ee1.4 but this code works
      for EE5)
 
2) need to get an image file into project so first I dropped an image component
and set url to logo.gif (from saved web page from google)

3) drop a page fragment and create a new fragment called "header".

4) double click to open the fragment and edit its jsp file from the default
width and height of the div to
 
           height: 34px; width: 954px

5) copy and paste this code into the .jspf:


 <f:subview id="header">
        
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td rowspan="2" style="width:142px;text-align: right;">
                        <a href="http://www.google.com">
                            <img alt="Company logo" src="resources/logo.gif"
style="margin-top:4px;"/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td></td>
                </tr>
            </table>
        
    </f:subview>

6) switch to designer tab for the page1 and see grey screen. Note red badge icon 
   indicating the fatal painting error in the log.

Comment 18 Peter Zavadsky 2007-02-22 17:54:41 UTC
Krystyna, I tried to reproduce your example, but I didn't get the fatal painting
error nor the gray screen.
Comment 19 _ krystyna 2007-02-22 18:57:03 UTC
Ok. My given step #4 was in error: should reverse values for height and width, 
ie. width: 34px; height: 954px. This is not what the user supplied but
how I was able to re-produce error.

As a convenience am attaching the logo.gif used.

I was able to duplicate this problem with both 5.5 and current NB6 (VWP 0216).

Comment 20 _ krystyna 2007-02-22 18:59:14 UTC
Created attachment 38825 [details]
googlegiffile
Comment 21 _ krystyna 2007-02-22 22:25:47 UTC
I just tested with today's VWP bits 0222 and NB 070221 the problem is not 
reproducible. Only with VWP 5.5 FCS bits and M7 bits can the problem be 
reproduced.
 
Comment 22 Peter Zavadsky 2007-03-12 18:05:14 UTC
I am marking this as fixed for the 6.0.