One Page Load Producing Three GETs

2007-11-02 Thread Devin Venable
I've been trying to figure out why when I hit my wicket page, it loads
three times.  I discovered this while debugging...my constructor was
called three times for my derived WebPage.

I've captured the call stack produced by the three calls.  (See below)
 In my web browser I'm merely pasting the URL and pressing enter once.
  It seems I'm getting three HTTP GETs.  Stranger still, this seems to
be Firefox specific.  IE or WGET only create on GET.  Using "Live HTTP
Headers", the firefox plugin, I've verified that three GET requests
are sent to the server.  By the way, this output appears in the java
console and I haven't been able to track down the source that
generates it.  I can't seem to reproduce this using non-wicket pages,
which is why I'm posting here, just in case anyone has seen anything
like it and has comment.  Any thoughts?

127.0.0.1 - - [02/Nov/2007:14:59:44 -0600] "GET
/myapp?pagemap=main&wicket:bookmarkablePage=mainframe:com.vetsource.web.wholesale.Pro_Search
HTTP/1.1" 200 28367 "http://localhost:8090/"; "Mozilla/5.0 (X11; U;
Linux i686; en-US; rv:1.8.1.8) Gecko/20061201 Firefox/2.0.0.8
(Ubuntu-feisty)" -
127.0.0.1 - - [02/Nov/2007:14:59:47 -0600] "GET
/myapp?pagemap=main&wicket:bookmarkablePage=mainframe:com.vetsource.web.wholesale.Pro_Search
HTTP/1.1" 200 16384
"http://localhost:8090/myapp?pagemap=main&wicket:bookmarkablePage=mainframe:com.vetsource.web.wholesale.Pro_Search";
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20061201
Firefox/2.0.0.8 (Ubuntu-feisty)" -
127.0.0.1 - - [02/Nov/2007:14:59:48 -0600] "GET
/myapp?pagemap=main&wicket:bookmarkablePage=mainframe:com.vetsource.web.wholesale.Pro_Search
HTTP/1.1" 200 28367 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.8) Gecko/20061201 Firefox/2.0.0.8 (Ubuntu-feisty)" -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: communication between frames and customizing LinkTree

2007-11-01 Thread Devin Venable
I'd be happy to not use frames, but I don't have the choice at this
time because the application is already written using frames and time
won't permit a total rewrite---at least that was our thinking when we
decided to leave most of the application as-is.  From my experience so
far, I guess we should have just abandoned frames because it's harder
to work with them using Wicket.  That's no fault of Wicket---it's
designed for panels and not frames.
-Devin

On 11/1/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Why do you use frames anyway? If you want to pass things between
> frames javascript is the only way, but I don't see what's the point of
> using frames when you have framework capable of Ajax partial page
> updates.
>
> -Matej
>
> On 11/1/07, Devin Venable <[EMAIL PROTECTED]> wrote:
> > I posted a question a few days ago on how to best deal with frames, in
> > particular how to pass arguments between a tree view in one frame and
> > a list view in another.  I didn't get any takers.
> >
> > I finally determined that there was no good way other than to use
> > plain-old javascript to push values from the tree up to the parent
> > frame, where they are dispersed to the other frames.
> >
> > I wanted to use LinkTree, but really didn't need most of the features
> > other than the look and feel.  I just needed to be able to insert an
> > onclick link that would pass a value to my parent frame.
> >
> > After a lot of digging I came up with a solution that worked, but
> > seems verbose for the job I'm attempting.  My question for dear reader
> > is this:  Can you propose an more concise solution?
> >
> >
> > public class CategoryTree extends LinkTree
> > {
> > @Override
> > protected Component newNodeComponent(String id, IModel model)
> > {
> > return new LinkIconPanel(id, model, CategoryTree.this)
> > {
> > private static final long serialVersionUID = 1L;
> >
> > protected void onNodeLinkClicked(TreeNode node, 
> > BaseTree tree,
> > AjaxRequestTarget target)
> > {
> > super.onNodeLinkClicked(node, tree, target);
> > CategoryTree.this.onNodeLinkClicked(node, 
> > tree, target);
> > }
> >
> > protected Component newContentComponent(String 
> > componentId,
> > BaseTree tree, IModel model)
> > {
> > Label l = new Label(componentId, model)
> > {
> > private static final long serialVersionUID 
> > = 1L;
> >
> > @Override
> > protected void onComponentTag(ComponentTag tag)
> > {
> > super.onComponentTag(tag);
> > tag.put("onclick",
> > "parent.notifyViews(this.getAttribute('catalogid'))");
> >
> > }
> > };
> >
> > DefaultMutableTreeNode n = 
> > (DefaultMutableTreeNode)model.getObject();
> >
> > if (n.getUserObject() instanceof EcCategoryTreeNode)
> > {
> > EcCategoryTreeNode ec = 
> > (EcCategoryTreeNode)n.getUserObject();
> > l.add(new SimpleAttributeModifier("catalogid", "" + 
> > ec.getId()));
> > }
> >
> > return l;
> > };
> > };
> > }
> >
> >     public CategoryTree(String s, TreeModel tm)
> > {
> > super(s,tm);
> > this.setLinkType(LinkType.REGULAR);
> > }
> >
> > }
> >
> > Devin
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Devin Venable
Senior Programmer Analyst
Vetsource
Work: 503-802-7471
Mobile: 918-946-6806

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



communication between frames and customizing LinkTree

2007-11-01 Thread Devin Venable
I posted a question a few days ago on how to best deal with frames, in
particular how to pass arguments between a tree view in one frame and
a list view in another.  I didn't get any takers.

I finally determined that there was no good way other than to use
plain-old javascript to push values from the tree up to the parent
frame, where they are dispersed to the other frames.

I wanted to use LinkTree, but really didn't need most of the features
other than the look and feel.  I just needed to be able to insert an
onclick link that would pass a value to my parent frame.

After a lot of digging I came up with a solution that worked, but
seems verbose for the job I'm attempting.  My question for dear reader
is this:  Can you propose an more concise solution?


public class CategoryTree extends LinkTree
{
@Override
protected Component newNodeComponent(String id, IModel model)
{
return new LinkIconPanel(id, model, CategoryTree.this)
{
private static final long serialVersionUID = 1L;

protected void onNodeLinkClicked(TreeNode node, 
BaseTree tree,
AjaxRequestTarget target)
{
super.onNodeLinkClicked(node, tree, target);
CategoryTree.this.onNodeLinkClicked(node, tree, 
target);
}

protected Component newContentComponent(String 
componentId,
BaseTree tree, IModel model)
{
Label l = new Label(componentId, model)
{
private static final long serialVersionUID = 1L;

@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
tag.put("onclick",
"parent.notifyViews(this.getAttribute('catalogid'))");

}
};

DefaultMutableTreeNode n = 
(DefaultMutableTreeNode)model.getObject();

if (n.getUserObject() instanceof EcCategoryTreeNode)
{
EcCategoryTreeNode ec = 
(EcCategoryTreeNode)n.getUserObject();
l.add(new SimpleAttributeModifier("catalogid", "" + 
ec.getId()));
}

return l;
};
};
}

public CategoryTree(String s, TreeModel tm)
{
super(s,tm);
this.setLinkType(LinkType.REGULAR);
}

}

Devin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



trouble attaching source

2007-11-01 Thread Devin Venable
Has anyone encountered a problem attacheing wicket-1.3.0-beta2 source
to Eclipse Europa (3.3)?  Each time I attempt Eclipse gives me "An
error occurred while applying the source element.  Failed to execute
runnable (java.lang.NullPointer)".

I've added as a file (apache-wicket-1.3.0-beta2.zip) and as an
extracted folder.  Still having trouble attaching.

Also, we're just switching over to maven builds and we're using the
maven plugin.  In a previous post I read...

>we are working on linking the javadoc...you do know wicket is a maven
>project right? so there is of course javadoc in the maven repo:
>http://repo1.maven.org/maven2/org/apache/wicket/wicket/1.3.0-beta2/
>further, since it is open source simply attach the sources to your ide and
>you are set.
>if you are using maven2 and eclipse add the wicket dep to your pom and do
>mvn eclipse:eclipse -DdownloadSources=true - and you are all set.

Any more info on this?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



dealing with frames and LinkTree

2007-10-31 Thread Devin Venable
I'm using a LinkTree in one frame and I need to change the content in
another frame when a link is clicked.  What's the best wicket pattern for
this?

In plain-old HMTL and Javascript, I would create links with src="#" and add
an onclick handler that calls javascript in the parent frameset, passing an
ID that identifies the desired content in the second frame.  From the parent
javascript function, I would get the target frame by ID and then set its
location attribute and pass the ID.  Something like this:

other_frame.location="pageName.html?newId=" + id;

LinkTree links are ajax---onclick goes back to the server and you handle the
click in JAVA.  But I haven't found a way to make this pattern work on the
server.  So what do I need to override to turn the links into simple links
as described above when constructing my LinkTree?  Or is there a clean
pattern for this that keeps more of the logic in JAVA?




-- 
Devin Venable
Senior Programmer Analyst
Vetsource
Work: 503-802-7471
Mobile: 918-946-6806