PageExpiredException not being thrown

2010-01-07 Thread Ryan O'Hara
After letting a session expire on a Search page using  
QueryStringUrlCodingStrategy, hovering on a Link with an onmouseover  
AjaxEventBehavior event throws a PageExpiredException, as expected.   
However, after allowing the session to expire in the same  
circumstance, and then clicking another link with only onclick  
overridden (containing one line: setResponsePage(Search.class,  
params)), no PageExpiredException is thrown.  Instead, the following  
is thrown:


org.apache.wicket.WicketRuntimeException unable to find component with  
path  on stateless page [Page class = edu.chop.bic.cnv.ui.Search, id =  
0, version = 0] it could be that the component
is inside a repeater make your component return false in  
getStatelessHint()


Any ideas why PageExpiredException is not being thrown in this case?

Also, resubmitting the Search form after the session expires does not  
cause the PageExpiredException, either.


Thanks,
Ryan

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Restarting AjaxLazyLoadingPanel

2009-11-13 Thread Ryan O'Hara

Finally got this working by changing the following line of code:


   newPanel.setOutputMarkupId(true);


to :


newPanel.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true);


Hopefully this helps someone.

Ryan

On Nov 12, 2009, at 2:57 PM, rjohara wrote:



We are after the same behavior, as well.  During the initial page  
load, the
AjaxLazyLoadPanel works great.  However, after hiding/showing the  
image
(using an AjaxLink), the panel no longer loads.  I tried using the  
custom
ReloadingAjaxLazyPanel, too, and the results were the same as  
replacing with

a new panel instance.  Any ideas?  Below is a code snippet:

   final Label gbrowseHideShowLabel = new  
Label(gbrowseHideShowLabel,

new LoadableDetachableModel() {
   protected Object load() {
   return gbrowseHideShowText;
   }
   });
   gbrowseHideShowLabel.setOutputMarkupId(true);
   gbrowseLazyLoaded = getNewGbrowseLazyLoaded();
   add(gbrowseLazyLoaded);
   AjaxLink gbrowseHideShow = new AjaxLink(gbrowseHideShow) {
   public void onClick(AjaxRequestTarget target) {
   if (!gbrowseVisible) {
   gbrowseVisible = true;
   gbrowseHideShowText = Hide image;
   user.setImageViewer(true);
   } else {
   gbrowseVisible = false;
   gbrowseHideShowText = Show image;
   user.setImageViewer(false);
   }
   target.addComponent(gbrowseHideShowLabel);
   AjaxLazyLoadPanel newPanel = getNewGbrowseLazyLoaded();
   newPanel.setOutputMarkupId(true);
   getGbrowseLazyLoaded().replaceWith(newPanel);
   setGbrowseLazyLoaded(newPanel);
   target.addComponent(newPanel);
   }
   };
   gbrowseHideShow.add(gbrowseHideShowLabel);
   add(gbrowseHideShow);

Thanks,
Ryan


igor.vaynberg wrote:


you can just replace the entire panel with a new instance.

-igor

On Sat, May 30, 2009 at 3:11 AM, Antony Stubbs antony.stu...@gmail.com 


wrote:
We use AjaxLazyLoadingPanel, and want to be able to trigger the  
process

of
showing the indicator, and requesting the panels contents with a  
separate
Ajax request, after the first complete render has finished. I.e.  
do the
whole process over and over, without having to reload the entire  
page.


I came up with this, which I was surprised actually worked first  
try :)

gotta love Wicket.

But perhaps there's a better way to do it ? A simpler way?  
Something I'm

missing? I tried simply replacing the lazy loading panel with a new
instance
of one but that didn't seem to have an effect - I think the magic  
is in

the
adding a new AbstractAjaxBehaviour on each request.


import org.apache.wicket.Component;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import  
org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;

import org.apache.wicket.markup.html.IHeaderResponse;

/**
 * An {...@link AjaxLazyLoadPanel} extension which allows it to
 * {...@link #restart(AjaxRequestTarget)} the process of showing the  
loading

 * indicator, then load it's contents using a separate Ajax request.
 *
 * @author Antony Stubbs
 */
abstract public class ReloadingAjaxLazyPanel extends  
AjaxLazyLoadPanel {


   private static final long serialVersionUID = 1L;

   public ReloadingAjaxLazyPanel(String id) {
   super( id );
   }

   /**
* Causes the {...@link AjaxLazyLoadPanel} to re-display the loading
indicator,
* then in a seperate ajax request, get it's contents.
*
* @param target
*/
   public void restart(AjaxRequestTarget target) {
   target.addComponent( this );

   // replace panel contents with loading icon
   Component loadingComponent =  
getLoadingComponent( content );


   this.replace( loadingComponent );

   // add ajax behaviour to install call back
   loadingComponent.add( new AbstractDefaultAjaxBehavior() {

   private static final long serialVersionUID = 1L;

   @Override
   protected void respond(AjaxRequestTarget target) {
   Component component =
ReloadingAjaxLazyPanel.this.getLazyLoadComponent( content );
   ReloadingAjaxLazyPanel.this.replace(
component.setRenderBodyOnly( true ) );
   target.addComponent( ReloadingAjaxLazyPanel.this );
   // setState((byte)2);
   }

   @Override
   public void renderHead(IHeaderResponse response) {
   super.renderHead( response );
   response.renderOnDomReadyJavascript(
getCallbackScript().toString() );
   }

   } );
   }

}

As you can see, there is duplication from AjaxLazyLoadingPanel -  
which

would
need re-factoring in order to remove. - no problem there.
But also, because the setState method is private, I can't use that  
state

Update parent component from child component

2009-09-17 Thread Ryan O'Hara
I'm trying to update a parent's, parent's, parent component using  
AJAX.  I tried combing the archives and came up with some seemingly  
useful stuff (http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568 
), although I'm still have trouble.  Below is a code snippet:


AjaxSubmitLink asl = new AjaxSubmitLink(submitButton) {
public void onSubmit(AjaxRequestTarget target, Form form) {
target.addComponent(this.getParent().getParent().getParent());
}
};

'this' is an AjaxSubmitLink
1st getParent() is a Form
2nd getParent() is a Panel
3rd getParent() is a SecureWebPage

I'd like to reload SecureWebPage, so that all of its Panel child  
components (and their child components) are reloaded.  I've tried  
explicitly calling setOutputMarkupId(true) on each Form, Panel, and  
SecureWebPage component.  I've also tried wrapping the Panels with a  
WebMarkupContainer and updating that, but that didn't seem to work  
either.  Any advice?


Thanks,
Ryan

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Reloading HeadersToolbar

2009-01-21 Thread Ryan O'Hara
Thanks for the response, Jeremy.  CnvDataTable.onSortChanged() now  
subclasses CnvOrderByLink.onSortChanged().  I've tried adding the  
cnvDataTable and a WebMarkupContainer wrapper to the target, but I  
wasn't successful with either.  Any other ideas?  Thanks for the help.


Unrelated question:  If reloading a parent object, is it necessary  
for its children objects to call setOutputMarkupId(true) in order for  
the them to reload?


Thanks,
Ryan


On Jan 20, 2009, at 7:01 PM, Jeremy Thomerson wrote:


This is your problem (I think):

In DataTable, when a toolbar is added, it is calling:
toolbar.setRenderBodyOnly(true);
Hence, the error message.

Try seeing if you can add the entire table to the AJAX target (or  
any outer

container of it) so that the entire thing is repainted.

--
Jeremy Thomerson
http://www.wickettraining.com

On Tue, Jan 20, 2009 at 4:27 PM, Ryan O'Hara  
oh...@genome.chop.edu wrote:



I've created a customized CnvHeaderToolbar which like HeadersToolbar
extends AbstractToolbar.  In addition to the header title, I also  
have
inserted a triangle image that helps to display sort order and  
sort order
direction.  The problem I am having is that I have been unable to  
figure out
how to reload CnvHeaderToolbar when an OrderByLink is clicked, so  
that the
new sort order triangle image can be displayed.  I've have also  
created
custom CnvOrderByBorder and CnvOrderByLink objects.  I have hooked  
into

these two classes onClick/onSortChanges, so that I have access to the
AjaxRequestTarget from CnvOrderByLink in CnvHeaderToolbar.  Below  
is some

code:

CnvHeaderToolbar:

protected WebMarkupContainer newSortableHeader(String headerId,  
String

property,
  ISortStateLocator
locator, PageParameters params, Class page) {
   return new CnvOrderByBorder(headerId, property, locator) {

   private static final long serialVersionUID = 1L;

   public void onClick() {
   System.out.println(In newSortableHeader: OnClick());
   ((CnvDataTable) getTable()).setHeaderClicked(true);
   }

   protected void onSortChanged(AjaxRequestTarget target) {
   System.out.println(In newSortableHeader:  
OnSortChanged());

   ((CnvDataTable) getTable()).setHeaderClicked(true);
   //target.addComponent();
   }
   };

   }

The latest I error I got when trying to reload CnvHeaderToolbar in  
the

onSortChanged() method above is:

Ajax render cannot be called on component that has setRenderBodyOnly
enabled.

Any advice on how to reload the HeadersToolbar?  The actual  
sorting is
working, it's just that the triangle images are not being  
reloaded.  Any

help would be greatly appreciated.

Thanks,
Ryan


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Reloading HeadersToolbar

2009-01-20 Thread Ryan O'Hara
I've created a customized CnvHeaderToolbar which like HeadersToolbar  
extends AbstractToolbar.  In addition to the header title, I also  
have inserted a triangle image that helps to display sort order and  
sort order direction.  The problem I am having is that I have been  
unable to figure out how to reload CnvHeaderToolbar when an  
OrderByLink is clicked, so that the new sort order triangle image can  
be displayed.  I've have also created custom CnvOrderByBorder and  
CnvOrderByLink objects.  I have hooked into these two classes onClick/ 
onSortChanges, so that I have access to the AjaxRequestTarget from  
CnvOrderByLink in CnvHeaderToolbar.  Below is some code:


CnvHeaderToolbar:

protected WebMarkupContainer newSortableHeader(String headerId,  
String property,
   ISortStateLocator  
locator, PageParameters params, Class page) {

return new CnvOrderByBorder(headerId, property, locator) {

private static final long serialVersionUID = 1L;

public void onClick() {
System.out.println(In newSortableHeader: OnClick());
((CnvDataTable) getTable()).setHeaderClicked(true);
}

protected void onSortChanged(AjaxRequestTarget target) {
System.out.println(In newSortableHeader:  
OnSortChanged());

((CnvDataTable) getTable()).setHeaderClicked(true);
//target.addComponent();
}
};

}

The latest I error I got when trying to reload CnvHeaderToolbar in  
the onSortChanged() method above is:


Ajax render cannot be called on component that has setRenderBodyOnly  
enabled.


Any advice on how to reload the HeadersToolbar?  The actual sorting  
is working, it's just that the triangle images are not being  
reloaded.  Any help would be greatly appreciated.


Thanks,
Ryan


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



PrototipBehaviour problems

2009-01-12 Thread Ryan O'Hara

I'm trying to use PrototipBehaviour.  Below is my code:

Link detailsLink = new Link(Sample, new Model(sample));
Label label = new Label(sampleid, sample);
detailsLink.add(label);
PrototipBehaviour pb = new PrototipBehaviour(hallelujah!!);
label.add(pb);
add(detailsLink);

And below is the source that is produced:

script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function() { new Tip($ 
('sampleid1'),'hallelujah!!');;});

/*--]]*//script

link rel=stylesheet type=text/css href=../../../../../../ 
resources/org.wicketstuff.minis.prototipbehaviour.PrototipBehaviour/ 
prototip.css media=screen /
script type=text/javascript src=../../../../../../resources/ 
org.wicketstuff.minis.prototipbehaviour.PrototipBehaviour/prototip- 
min.js/script

script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function() { new Tip($ 
('sampleid2'),'hallelujah!!');;});

/*--]]*//script

script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function() { new Tip($ 
('sampleid3'),'hallelujah!!');;});

/*--]]*//script

...

I would expect hallelujah!! to pop up during onmouseover of the  
label, but I'm not seeing it.  Any help would be greatly  
appreciated.  I'm using wicketstuff-minis-1.4.0-SNAPSHOT and Wicket  
1.3.3.


Thanks,
Ryan

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AJAX readyState property equivalent

2009-01-08 Thread Ryan O'Hara
I was just wondering if there is an equivalent to the AJAX  
xmlHttp.readyState.  I'm interested in display a Loading... message  
to the user while waiting for the response.  Thanks in advance.


Ryan


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Referencing Request in Spring bean definitions

2008-11-03 Thread Ryan O'Hara

Hello,

Is there anyway to reference Wicket's request object in the Spring  
bean definitions XML?  I'm trying to define a session bean, which has  
two parameters in the contructor - a SwarmWebApplication and a  
Request.  Thanks in advance.


bean id=myApplication
  class=edu.chop.bic.cnv.CnvApplication
/bean

bean id=myRequest
  class=some.request.location
/bean

bean id=mySession
  class=edu.chop.bic.cnv.session.MySession
constructor-arg ref=myApplication/
constructor-arg ref=myRequest/
/bean

Ryan

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



Re: AjaxSubmitlink vs AjaxButton

2008-08-12 Thread Ryan O'Hara

I think you'll need to call form.setDefaultButton(submitLink).

Ryan

On Aug 12, 2008, at 11:13 AM, Milan Křápek wrote:


Hi
  In my web application I realized form submiting by AjaxButtons.  
This wokrs great. I love the possibility to refresh just part of my  
page after submiting the form. Then  I decided to refactor my  
webapp tu use AjaxSubmitLink because I want to use some images and  
texts instead of buttons.
  This works too, but one thing make me confused. When I was using  
buttons I can submit my forms just by pressing the enter key, but  
with AjaxSubmitlink this  feathure does not work.
  I try to debug it and get this results. When I use buttons and  
press enter, Wicket call onSubmit method implemented by AjaxButton,  
but when I use AjaxSubmitLinks and press enter, wicket call  
onSubmit method on the form not on the link.


Why? Has it some purpose, should I use AjaxSubmitLinks by another  
way, or it is some bug?

Thanks for any response.

Milan

-
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]



Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Ryan O'Hara
Thank for the response, Johan.  I don't think this is what we're  
looking for, however.  If the user changes a form parameter, it will  
not be reflected in the old page parameters.  Any other ideas?


Thanks,
Ryan

On Aug 12, 2008, at 8:34 AM, Johan Compagner wrote:


call super(parameters) in the page constructor
then getPage().getParameters() should have the parameter map

johan


On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara  
[EMAIL PROTECTED] wrote:



We are trying to figure out the best way to make our URLs portable.
 Currently, we mount a QueryStringUrlEncodingStrategy in our  
application
class.  Then, in the beginning of the page's constructor, page  
parameters
are mapped to instance variables.  Then, when the form button is  
clicked, a

map of parameters is created to pass to setResponsePage(Class,
PageParameters).  It seems like mapping the parameters to  
variables and
creating a map of parameters to setResponsePage() can be avoided  
by using
setResponsePage(this.getPage()), but the URL produced is not  
portable.
 Having to map parameters to instance variables and maintain a map  
to pass
in is high maintenance.  Is there a better way to do this?  Thanks  
for the

help.

Ryan

public Search(PageParameters params) {
   //TODO:
   //it would be nice if this could be done automatically...
   //if there are parameters, map them to instance variables
   if (params.size()  0) {
   setSourceSelection(params.getString(source));
   setPosition(params.getString(position));
   setSizeStart(params.getString(sizeStart));
   setSizeEnd(params.getString(sizeEnd));
   setSnpStart(params.getString(snpStart));
   setSnpEnd(params.getString(snpEnd));
   setSortorderSelection(params.getString(sortorder));
   setVariationTypeSelection(params.getString 
(variationType));


   if (params.getInt(pagesize, -1) != -1) {
   setPagesize(params.getInt(pagesize));
   }

   //populate the result list now that the instance
   //variables have been set
   try {
   resultlist =
annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
getSortorderSelection(), getVariationTypeSelection());
   } catch (CnvException e) {
   e.printStackTrace();
   error(e.getMessage());
   }
   }

//submit button
   Button asl = new Button(submit) {
   public void onSubmit() {
   try {
   //TODO:
   //it would be nice if we could make the url of
   //setresponsepage(this.getPage()) to look nice
   //as it would handle all of the parameter  
business.. ugh

   HashMap params = new HashMapString, String();
   params.put(source, getSourceSelection());
   params.put(position, getPosition());
   params.put(sortorder, getSortorderSelection());
   params.put(variationType,
getVariationTypeSelection());
   if (getSizeStart() != null) {
   params.put(sizeStart, getSizeStart());
   }
   if (getSizeEnd() != null) {
   params.put(sizeEnd, getSizeEnd());
   }
   if (getSnpStart() != null) {
   params.put(snpStart, getSnpStart());
   }
   if (getSnpEnd() != null) {
   params.put(snpEnd, getSnpEnd());
   }
   setPagesize((Integer)  
results_page.getModelObject());

   params.put(pagesize, getPagesize().toString());

   System.out.println(getSortorderSelection());
   setResponsePage(Search.class, new
PageParameters(params));
   } catch (Exception e) {
   error(e.getMessage());
   }
   }
   };

-
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]



Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Ryan O'Hara
Argh.  I just tested the this.getPage(), and although it worked at  
some point, it doesn't work now - I apologize.  We need portable  
URLs, but we were looking for a method requiring less maintenance.   
Thanks, again for the response.


Ryan

On Aug 12, 2008, at 2:29 PM, Johan Compagner wrote:


how would setPage(this.getPage()) then work???
If you want those kind of urls with state in the urls you have to  
create a

PageParameter object
you can reuse existing or tweak an existing or create a new one

Or do you just want nice urls that dont have to work when there is no
session?
use Hybridurlencoder to mound the page then you can do setPage()


johan


On Tue, Aug 12, 2008 at 6:31 PM, Ryan O'Hara  
[EMAIL PROTECTED] wrote:


Thank for the response, Johan.  I don't think this is what we're  
looking

for, however.  If the user changes a form parameter, it will not be
reflected in the old page parameters.  Any other ideas?

Thanks,
Ryan


On Aug 12, 2008, at 8:34 AM, Johan Compagner wrote:

 call super(parameters) in the page constructor

then getPage().getParameters() should have the parameter map

johan


On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara [EMAIL PROTECTED]
wrote:

 We are trying to figure out the best way to make our URLs portable.
 Currently, we mount a QueryStringUrlEncodingStrategy in our  
application
class.  Then, in the beginning of the page's constructor, page  
parameters
are mapped to instance variables.  Then, when the form button is  
clicked,

a
map of parameters is created to pass to setResponsePage(Class,
PageParameters).  It seems like mapping the parameters to  
variables and
creating a map of parameters to setResponsePage() can be avoided  
by using
setResponsePage(this.getPage()), but the URL produced is not  
portable.
 Having to map parameters to instance variables and maintain a  
map to

pass
in is high maintenance.  Is there a better way to do this?   
Thanks for

the
help.

Ryan

public Search(PageParameters params) {
  //TODO:
  //it would be nice if this could be done automatically...
  //if there are parameters, map them to instance variables
  if (params.size()  0) {
  setSourceSelection(params.getString(source));
  setPosition(params.getString(position));
  setSizeStart(params.getString(sizeStart));
  setSizeEnd(params.getString(sizeEnd));
  setSnpStart(params.getString(snpStart));
  setSnpEnd(params.getString(snpEnd));
  setSortorderSelection(params.getString(sortorder));
  setVariationTypeSelection(params.getString 
(variationType));


  if (params.getInt(pagesize, -1) != -1) {
  setPagesize(params.getInt(pagesize));
  }

  //populate the result list now that the instance
  //variables have been set
  try {
  resultlist =
annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
getSortorderSelection(), getVariationTypeSelection());
  } catch (CnvException e) {
  e.printStackTrace();
  error(e.getMessage());
  }
  }

//submit button
  Button asl = new Button(submit) {
  public void onSubmit() {
  try {
  //TODO:
  //it would be nice if we could make the url of
  //setresponsepage(this.getPage()) to look nice
  //as it would handle all of the parameter  
business..

ugh
  HashMap params = new HashMapString, String();
  params.put(source, getSourceSelection());
  params.put(position, getPosition());
  params.put(sortorder, getSortorderSelection());
  params.put(variationType,
getVariationTypeSelection());
  if (getSizeStart() != null) {
  params.put(sizeStart, getSizeStart());
  }
  if (getSizeEnd() != null) {
  params.put(sizeEnd, getSizeEnd());
  }
  if (getSnpStart() != null) {
  params.put(snpStart, getSnpStart());
  }
  if (getSnpEnd() != null) {
  params.put(snpEnd, getSnpEnd());
  }
  setPagesize((Integer)  
results_page.getModelObject());

  params.put(pagesize, getPagesize().toString());

  System.out.println(getSortorderSelection());
  setResponsePage(Search.class, new
PageParameters(params));
  } catch (Exception e) {
  error(e.getMessage());
  }
  }
  };

--- 
--

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





-
To unsubscribe, e-mail

Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-11 Thread Ryan O'Hara
We are trying to figure out the best way to make our URLs portable.   
Currently, we mount a QueryStringUrlEncodingStrategy in our  
application class.  Then, in the beginning of the page's constructor,  
page parameters are mapped to instance variables.  Then, when the  
form button is clicked, a map of parameters is created to pass to  
setResponsePage(Class, PageParameters).  It seems like mapping the  
parameters to variables and creating a map of parameters to  
setResponsePage() can be avoided by using setResponsePage(this.getPage 
()), but the URL produced is not portable.  Having to map parameters  
to instance variables and maintain a map to pass in is high  
maintenance.  Is there a better way to do this?  Thanks for the help.


Ryan

public Search(PageParameters params) {
//TODO:
//it would be nice if this could be done automatically...
//if there are parameters, map them to instance variables
if (params.size()  0) {
setSourceSelection(params.getString(source));
setPosition(params.getString(position));
setSizeStart(params.getString(sizeStart));
setSizeEnd(params.getString(sizeEnd));
setSnpStart(params.getString(snpStart));
setSnpEnd(params.getString(snpEnd));
setSortorderSelection(params.getString(sortorder));
setVariationTypeSelection(params.getString 
(variationType));


if (params.getInt(pagesize, -1) != -1) {
setPagesize(params.getInt(pagesize));
}

//populate the result list now that the instance
//variables have been set
try {
resultlist = annotatedQuery.getAnnotations 
(getSourceSelection(), getPosition(), getSizeStart(), getSizeEnd(),  
getSnpStart(), getSnpEnd(), getSortorderSelection(),  
getVariationTypeSelection());

} catch (CnvException e) {
e.printStackTrace();
error(e.getMessage());
}
}

//submit button
Button asl = new Button(submit) {
public void onSubmit() {
try {
//TODO:
//it would be nice if we could make the url of
//setresponsepage(this.getPage()) to look nice
//as it would handle all of the parameter  
business.. ugh

HashMap params = new HashMapString, String();
params.put(source, getSourceSelection());
params.put(position, getPosition());
params.put(sortorder, getSortorderSelection());
params.put(variationType,  
getVariationTypeSelection());

if (getSizeStart() != null) {
params.put(sizeStart, getSizeStart());
}
if (getSizeEnd() != null) {
params.put(sizeEnd, getSizeEnd());
}
if (getSnpStart() != null) {
params.put(snpStart, getSnpStart());
}
if (getSnpEnd() != null) {
params.put(snpEnd, getSnpEnd());
}
setPagesize((Integer) results_page.getModelObject 
());

params.put(pagesize, getPagesize().toString());

System.out.println(getSortorderSelection());
setResponsePage(Search.class, new PageParameters 
(params));

} catch (Exception e) {
error(e.getMessage());
}
}
};

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



SecureMarkupContainer

2008-08-07 Thread Ryan O'Hara
I created a SecureMarkupContainer following Maurice's example (http:// 
www.nabble.com/Swarm%3A-Authorization--for-WebMarkupContainer- 
td17206272.html#a17219441), with the only difference being it's its  
own class (not subclass).  For some reason, the component doesn't  
seem to be added to the page after authenticating.  The correct  
values are returned by typeOfData.isAuthenticated().  However, it  
seems whatever hides/displays the component is not getting executed  
or executed correctly.  Below are some snippets of code:



Search:

SecureMarkupContainer typeOfData = new SecureMarkupContainer 
(typeOfData);

add(typeOfData);

Search.html:

div wicket:id=typeOfDatasecurity works!/div

cnv.hive:

	permission  
org.apache.wicket.security.hive.authorization.permissions.ComponentPermi 
ssion ${cnv}.Search:typeOfData, inherit, render, enable;



Also, I have a few other secure components working fine (ie  
SecureLink).  Any ideas?


Thanks,
Ryan


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



Mapping url params to instance variables

2008-07-30 Thread Ryan O'Hara
When using setResponsePage(SearchPage.class, PageParameters) in a  
page with a QueryStringUrlCodingStrategy, is there a way to  
automatically map parameters values from the url to the instance  
variables in the response page component?

How to update custom Panel via AJAX

2008-07-29 Thread Ryan O'Hara
I have a custon class extending Panel.  The constructor accepts two  
parameters which are passed to another method that sets the content  
of the label.  I have been able to get the initial loading of the  
custom Panel to work, but it doesn't seem to be updating via AJAX.   
Below is some of the code to help you better understand what I'm  
dealing with:


public Gbrowse(String id, String position, String[] sources) {
super(id);
Label label = new Label(gbrowse, getGbrowse 
(position,sources));

label.setEscapeModelStrings(false);
add(label);
}


Page using Gbrowse:

gbrowse = new Gbrowse(gbrowse, position, new String [] 
{CHOPCNVs,CHOPCNVRs,CHOPCNVBlocks});

gbrowse.setOutputMarkupId(true);
form.add(gbrowse);

//submit button
AjaxSubmitLink asl = new AjaxSubmitLink(submit) {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
target.addComponent(gbrowse);
...


Thanks for the help.

Ryan


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



Re: How to update custom Panel via AJAX

2008-07-29 Thread Ryan O'Hara
Thank you, Marijn.  I've actually looked over the model page a few  
times in the past.  I guess I just don't have a full handle on  
models, in general.  Using the LoadableDetachableModel did resolve my  
problem - thanks!  Below are the working code snippets:


public Gbrowse(String id, String position, String[] sources) {
super(id);
setPosition(position);
setSources(sources);
Label label = new Label(gbrowse, new  
LoadableDetachableModel() {

@Override
protected Object load() {
return getGbrowse(getPosition(), getSources());
}
});
label.setEscapeModelStrings(false);
add(label);
}

gbrowse = new Gbrowse(gbrowse, getPosition(), new String[] 
{CHOPCNVs, CHOPCNVRs, CHOPCNVBlocks});

gbrowse.setOutputMarkupId(true);
form.add(gbrowse);
...

//submit button
AjaxSubmitLink asl = new AjaxSubmitLink(submit) {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
gbrowse.setPosition(position);
target.addComponent(gbrowse);
...

I'd like for the position to automatically get updated, instead of  
having to call setPosition().  I feel like this can be accomplished  
using LoadableDetachableModel, as well.  I tried replacing getPosition 
() with a LoadableDetachableModel that returns getPosition() in the  
load() method during the instantiation of Gbrowse, but it looks to  
always be null.  I'm happy to have it working, but I'd like to use  
the LDM if that's that way to go.  Any advice?  Thanks, again.


Ryan

On Jul 29, 2008, at 11:43 AM, Martijn Dashorst wrote:

Read this page: http://cwiki.apache.org/WICKET/working-with-wicket- 
models.html


And after that:

public Gbrowse(String id, final String position, final String[]  
sources) {

   super(id);
   Label label = new Label(gbrowse, new
LoadableDetachableModel() { @Override Object load() { return
getGbrowse(position,sources); });
   label.setEscapeModelStrings(false);
   add(label);
   }



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



AJAX changes preserved in portable URL

2008-07-24 Thread Ryan O'Hara

Is it possible for AJAX changes to be preserved in a portable URL?

Thanks,
Ryan


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



Re: AJAX changes preserved in portable URL

2008-07-24 Thread Ryan O'Hara
It might be better to explain what we are trying to do.  We have a  
Search page containing a DataTable that is updated via AJAX.  We  
would like some way of preserving the latest AJAX change so the exact  
result set can be reconstructed with a portable URL.  If anyone has  
any ideas, we'd be very interested.  Thanks in advance.


Ryan

On Jul 24, 2008, at 1:31 PM, Ryan O'Hara wrote:


Is it possible for AJAX changes to be preserved in a portable URL?

Thanks,
Ryan


-
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]



Re: Updating ListView via AJAX

2008-06-25 Thread Ryan O'Hara
Thanks, again, Igor.  I'm certain that getGroupMemberships() is  
returning good data, so it seems the listview isn't refreshing.  I'll  
play around with it some more.  Thanks for the help.  I'll let you  
know if/when I find a solution.


Ryan

On Jun 24, 2008, at 5:01 PM, Igor Vaynberg wrote:


is it that the listview doesnt refresh or that your
getGroupMemberships() returns stale data? why dont you set up a
breakpoint and see what its doing

-igor

On Tue, Jun 24, 2008 at 1:08 PM, Ryan O'Hara
[EMAIL PROTECTED] wrote:
Thanks for the quick response, Igor.  Unfortunately, the ListView  
is still

not updating after making those changes.  Any other ideas?

Thanks again,
Ryan

On Jun 24, 2008, at 3:46 PM, Igor Vaynberg wrote:


protected void populateItem(final ListItem item) {
 GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
 item.add(new Label(group, new PropertyModel(item.getmodel(),  
group));

 item.add(new CheckBox(member, new PropertyModel(item.getmodel(),
selected)));
}

-igor

On Tue, Jun 24, 2008 at 10:28 AM, Ryan O'Hara
[EMAIL PROTECTED] wrote:


Also, tried using a LoadableDetachableModel in the ListView:

ListView groupMemberRows = new ListView(groupMemberRow, new
LoadableDetachableModel(){
  protected Object load(){
  return getGroupMemberships();
  }
  }) {
  protected void populateItem(final ListItem item) {
  GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
  item.add(new Label(group,  
groupMembership.getGroup()));

  item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
  }
  };

Still no luck.

Ryan

On Jun 24, 2008, at 1:21 PM, Ryan O'Hara wrote:

I'm trying to update a ListView via AJAX.  I've looked over a  
bunch of
examples in the archives, but I'm still having some trouble.   
I'm trying

to
wrap the ListView with a WebMarkupContainer and then update that
WebMarkupContainer.  I also created a GroupMembership object,  
which is

passed into the ListView.  When the form is submitted, the
ListGroupMembership is populated fine, it's just not  
rendering.  Below

is
the Java and HTML.  Any help would be greatly appreciated.   
Thanks!


-Ryan

Java:

  groupManager = new WebMarkupContainer(groupManager);
  groupManager.setOutputMarkupId(true);
  form.add(groupManager);

  AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
  public void onSubmit(AjaxRequestTarget target, Form  
form) {

  try {
  setGroupMemberships();
  target.addComponent(groupManager);
  } catch (Exception e) {
  error(Unable to get groups for user  +  
email + .);

  }
  target.addComponent(feedbackPanel);
  }
  };
  form.add(submit);

  ListView groupMemberRows = new ListView(groupMemberRow,
getGroupMemberships()) {
  protected void populateItem(final ListItem item) {
  GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
  item.add(new Label(group,  
groupMembership.getGroup()));

  item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
  }
  };
  groupManager.add(groupMemberRows);

public void setGroupMemberships() {
  groupMemberships.clear();
  ListString userGroups = groupQuery.getGroupsByUser 
(getEmail());

  ListString allGroups = groupQuery.getGroups(*);
  GroupMembership groupMembership;
  for (String group : allGroups) {
  groupMembership = new GroupMembership();
  if (userGroups.contains(group)) {
  groupMembership.setGroup(group);
  groupMembership.setSelected(true);
  } else {
  groupMembership.setGroup(group);
  groupMembership.setSelected(false);
  }
  groupMemberships.add(groupMembership);
  }
  }

  public ListGroupMembership getGroupMemberships() {
  return groupMemberships;
  }


HTML:

  form wicket:id=manageGroups name=manageGroups
table align=center width=50% wicket:id=groupManager
  tr
  thGroup/th
  thMember/th
  /tr
  tr wicket:id=groupMemberRow class=hideRow
  tdspan wicket:id=group/span/td
  tdinput wicket:id=member type=checkbox//td
  /tr
  tr
  td/td
  td align=righta wicket:id=save
class=formButtonAlignedRightSave/a/td
  /tr
  /table
  /form





 
-

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

Updating ListView via AJAX

2008-06-24 Thread Ryan O'Hara
I'm trying to update a ListView via AJAX.  I've looked over a bunch  
of examples in the archives, but I'm still having some trouble.  I'm  
trying to wrap the ListView with a WebMarkupContainer and then update  
that WebMarkupContainer.  I also created a GroupMembership object,  
which is passed into the ListView.  When the form is submitted, the  
ListGroupMembership is populated fine, it's just not rendering.   
Below is the Java and HTML.  Any help would be greatly appreciated.   
Thanks!


-Ryan

Java:

groupManager = new WebMarkupContainer(groupManager);
groupManager.setOutputMarkupId(true);
form.add(groupManager);

AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
setGroupMemberships();
target.addComponent(groupManager);
} catch (Exception e) {
error(Unable to get groups for user  + email +  
.);

}
target.addComponent(feedbackPanel);
}
};
form.add(submit);

ListView groupMemberRows = new ListView(groupMemberRow,  
getGroupMemberships()) {

protected void populateItem(final ListItem item) {
GroupMembership groupMembership = (GroupMembership)  
item.getModelObject();
item.add(new Label(group, groupMembership.getGroup 
()));
item.add(new CheckBox(member, new PropertyModel 
(groupMembership, selected)));

}
};
groupManager.add(groupMemberRows);

public void setGroupMemberships() {
groupMemberships.clear();
ListString userGroups = groupQuery.getGroupsByUser(getEmail 
());

ListString allGroups = groupQuery.getGroups(*);
GroupMembership groupMembership;
for (String group : allGroups) {
groupMembership = new GroupMembership();
if (userGroups.contains(group)) {
groupMembership.setGroup(group);
groupMembership.setSelected(true);
} else {
groupMembership.setGroup(group);
groupMembership.setSelected(false);
}
groupMemberships.add(groupMembership);
}
}

public ListGroupMembership getGroupMemberships() {
return groupMemberships;
}


HTML:

form wicket:id=manageGroups name=manageGroups
table align=center width=50% wicket:id=groupManager
tr
thGroup/th
thMember/th
/tr
tr wicket:id=groupMemberRow class=hideRow
tdspan wicket:id=group/span/td
tdinput wicket:id=member type=checkbox//td
/tr
tr
td/td
td align=righta wicket:id=save  
class=formButtonAlignedRightSave/a/td

/tr
/table
/form

Re: Updating ListView via AJAX

2008-06-24 Thread Ryan O'Hara

Also, tried using a LoadableDetachableModel in the ListView:

ListView groupMemberRows = new ListView(groupMemberRow, new  
LoadableDetachableModel(){

protected Object load(){
return getGroupMemberships();
}
}) {
protected void populateItem(final ListItem item) {
GroupMembership groupMembership = (GroupMembership)  
item.getModelObject();
item.add(new Label(group, groupMembership.getGroup 
()));
item.add(new CheckBox(member, new PropertyModel 
(groupMembership, selected)));

}
};

Still no luck.

Ryan

On Jun 24, 2008, at 1:21 PM, Ryan O'Hara wrote:

I'm trying to update a ListView via AJAX.  I've looked over a bunch  
of examples in the archives, but I'm still having some trouble.   
I'm trying to wrap the ListView with a WebMarkupContainer and then  
update that WebMarkupContainer.  I also created a GroupMembership  
object, which is passed into the ListView.  When the form is  
submitted, the ListGroupMembership is populated fine, it's just  
not rendering.  Below is the Java and HTML.  Any help would be  
greatly appreciated.  Thanks!


-Ryan

Java:

groupManager = new WebMarkupContainer(groupManager);
groupManager.setOutputMarkupId(true);
form.add(groupManager);

AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
public void onSubmit(AjaxRequestTarget target, Form  
form) {

try {
setGroupMemberships();
target.addComponent(groupManager);
} catch (Exception e) {
error(Unable to get groups for user  + email  
+ .);

}
target.addComponent(feedbackPanel);
}
};
form.add(submit);

ListView groupMemberRows = new ListView(groupMemberRow,  
getGroupMemberships()) {

protected void populateItem(final ListItem item) {
GroupMembership groupMembership = (GroupMembership)  
item.getModelObject();
item.add(new Label(group, groupMembership.getGroup 
()));
item.add(new CheckBox(member, new PropertyModel 
(groupMembership, selected)));

}
};
groupManager.add(groupMemberRows);

public void setGroupMemberships() {
groupMemberships.clear();
ListString userGroups = groupQuery.getGroupsByUser 
(getEmail());

ListString allGroups = groupQuery.getGroups(*);
GroupMembership groupMembership;
for (String group : allGroups) {
groupMembership = new GroupMembership();
if (userGroups.contains(group)) {
groupMembership.setGroup(group);
groupMembership.setSelected(true);
} else {
groupMembership.setGroup(group);
groupMembership.setSelected(false);
}
groupMemberships.add(groupMembership);
}
}

public ListGroupMembership getGroupMemberships() {
return groupMemberships;
}


HTML:

form wicket:id=manageGroups name=manageGroups
table align=center width=50% wicket:id=groupManager
tr
thGroup/th
thMember/th
/tr
tr wicket:id=groupMemberRow class=hideRow
tdspan wicket:id=group/span/td
tdinput wicket:id=member type=checkbox//td
/tr
tr
td/td
td align=righta wicket:id=save  
class=formButtonAlignedRightSave/a/td

/tr
/table
/form




Re: Updating ListView via AJAX

2008-06-24 Thread Ryan O'Hara
Thanks for the quick response, Igor.  Unfortunately, the ListView is  
still not updating after making those changes.  Any other ideas?


Thanks again,
Ryan

On Jun 24, 2008, at 3:46 PM, Igor Vaynberg wrote:


protected void populateItem(final ListItem item) {
  GroupMembership groupMembership = (GroupMembership)  
item.getModelObject();
  item.add(new Label(group, new PropertyModel(item.getmodel(),  
group));

  item.add(new CheckBox(member, new PropertyModel(item.getmodel(),
selected)));
}

-igor

On Tue, Jun 24, 2008 at 10:28 AM, Ryan O'Hara
[EMAIL PROTECTED] wrote:

Also, tried using a LoadableDetachableModel in the ListView:

ListView groupMemberRows = new ListView(groupMemberRow, new
LoadableDetachableModel(){
   protected Object load(){
   return getGroupMemberships();
   }
   }) {
   protected void populateItem(final ListItem item) {
   GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
   item.add(new Label(group, groupMembership.getGroup 
()));

   item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
   }
   };

Still no luck.

Ryan

On Jun 24, 2008, at 1:21 PM, Ryan O'Hara wrote:

I'm trying to update a ListView via AJAX.  I've looked over a  
bunch of
examples in the archives, but I'm still having some trouble.  I'm  
trying to

wrap the ListView with a WebMarkupContainer and then update that
WebMarkupContainer.  I also created a GroupMembership object,  
which is

passed into the ListView.  When the form is submitted, the
ListGroupMembership is populated fine, it's just not  
rendering.  Below is

the Java and HTML.  Any help would be greatly appreciated.  Thanks!

-Ryan

Java:

   groupManager = new WebMarkupContainer(groupManager);
   groupManager.setOutputMarkupId(true);
   form.add(groupManager);

   AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
   public void onSubmit(AjaxRequestTarget target, Form  
form) {

   try {
   setGroupMemberships();
   target.addComponent(groupManager);
   } catch (Exception e) {
   error(Unable to get groups for user  + email  
+ .);

   }
   target.addComponent(feedbackPanel);
   }
   };
   form.add(submit);

   ListView groupMemberRows = new ListView(groupMemberRow,
getGroupMemberships()) {
   protected void populateItem(final ListItem item) {
   GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
   item.add(new Label(group,  
groupMembership.getGroup()));

   item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
   }
   };
   groupManager.add(groupMemberRows);

public void setGroupMemberships() {
   groupMemberships.clear();
   ListString userGroups = groupQuery.getGroupsByUser 
(getEmail());

   ListString allGroups = groupQuery.getGroups(*);
   GroupMembership groupMembership;
   for (String group : allGroups) {
   groupMembership = new GroupMembership();
   if (userGroups.contains(group)) {
   groupMembership.setGroup(group);
   groupMembership.setSelected(true);
   } else {
   groupMembership.setGroup(group);
   groupMembership.setSelected(false);
   }
   groupMemberships.add(groupMembership);
   }
   }

   public ListGroupMembership getGroupMemberships() {
   return groupMemberships;
   }


HTML:

   form wicket:id=manageGroups name=manageGroups
table align=center width=50% wicket:id=groupManager
   tr
   thGroup/th
   thMember/th
   /tr
   tr wicket:id=groupMemberRow class=hideRow
   tdspan wicket:id=group/span/td
   tdinput wicket:id=member type=checkbox//td
   /tr
   tr
   td/td
   td align=righta wicket:id=save
class=formButtonAlignedRightSave/a/td
   /tr
   /table
   /form





-
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]



Re: Testing components not added directly to page

2008-05-27 Thread Ryan O'Hara
Nice.  The wicket id of the parent component (in this case  
'advancedSearch') needs to be prepended along with a ':' as you  
said.  The following returned without errors:


tester.assertComponent(advancedSearch:feedbackPanel,  
FeedbackPanel.class);


Thanks, again Martijn!

On May 27, 2008, at 12:29 PM, Martijn Dashorst wrote:


check the code for WicketTester, I thought the ID for the panel would
be test, but could be panel or something else. Apparently my
memory sucks

Martijn

On Tue, May 27, 2008 at 6:24 PM, Ryan O'Hara  
[EMAIL PROTECTED] wrote:

Hey Martijn,

I've tried the following:

   tester.assertComponent(test:feedbackPanel,  
FeedbackPanel.class);


However, I got:

   org.apache.wicket.WicketRuntimeException: path:  
'test:feedbackPanel'

does not exist for page: AdvancedSearch
   at
org.apache.wicket.util.tester.BaseWicketTester.fail 
(BaseWicketTester.java:1341)


Any ideas?

Thx again,
Ryan

On May 27, 2008, at 10:33 AM, Martijn Dashorst wrote:


testing a panel separately will cause wicket tester to add the panel
to a test page with component id test. you can then test the panel
by asserting things like assertLabel(test:mycomponentid, hello,
world); etc.

Martijn

On Tue, May 27, 2008 at 4:18 PM, Ryan O'Hara [EMAIL PROTECTED]
wrote:


Thx for the response, Maurice.  I have been able to run tests on
components
added to the page.  However, when I try to test the  
FeedbackPanel (which

is
added to the Form not the page) below using WicketTester, I get  
an error

about Wicket not finding that component.  I thought matching the
hierarchy
might do the trick, but there are no methods in formTester to  
test the

FeebackPanel.  Thanks again for the help.

Ryan

On May 25, 2008, at 1:56 PM, Maurice Marrink wrote:

An easy way would be to check them against the expected html  
output.

See for example WicketTestCase#assertResultPage

Maurice

On Fri, May 23, 2008 at 7:56 PM, Ryan O'Hara  
[EMAIL PROTECTED]

wrote:


Hello,

I'm trying to test a component that is added to another  
component that

is
added to the page.  For example, I'd like to test the  
FeedbackPanel

below
that is added to the Form which is added to the page.  I'm  
unsure of

how
to
do this.  Any help would be appreciated.  Thanks!

Ryan


public AdvancedSearch() {
 add(new TabbedHeader(advancedSearchTabbedHeader));
 Form form = new Form(advancedSearch, new
CompoundPropertyModel(this));
 add(form);

 //feedbackPanel
 FeedbackPanel feedbackPanel = new FeedbackPanel 
(feedbackPanel);

 feedbackPanel.add(new AttributeModifier(class, true, new
Model(feedbackPanel)));
 feedbackPanel.setFilter(new ContainerFeedbackMessageFilter 
(form));

 form.add(feedbackPanel);

public void testDisplayAdvancedSearch(){
 //create a tester and go to acknowledgements
 WicketTester tester = new WicketTester(new CnvApplication 
());

 tester.startPage(AdvancedSearch.class);

 //check to make sure all components exist with correct  
names and

types
 tester.assertComponent(advancedSearchTabbedHeader,
TabbedHeader.class);
 FormTester formTester = tester.newFormTester 
(advancedSearch);

 //*tester.assertComponent(feedbackPanel,
FeedbackPanel.class);

- 


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]





--- 
--

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






--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

 
-

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]






--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
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]



Testing components not added directly to page

2008-05-23 Thread Ryan O'Hara

Hello,

I'm trying to test a component that is added to another component  
that is added to the page.  For example, I'd like to test the  
FeedbackPanel below that is added to the Form which is added to the  
page.  I'm unsure of how to do this.  Any help would be appreciated.   
Thanks!


Ryan


public AdvancedSearch() {
add(new TabbedHeader(advancedSearchTabbedHeader));
Form form = new Form(advancedSearch, new  
CompoundPropertyModel(this));

add(form);

//feedbackPanel
FeedbackPanel feedbackPanel = new FeedbackPanel 
(feedbackPanel);
feedbackPanel.add(new AttributeModifier(class, true, new  
Model(feedbackPanel)));
feedbackPanel.setFilter(new ContainerFeedbackMessageFilter 
(form));

form.add(feedbackPanel);

public void testDisplayAdvancedSearch(){
//create a tester and go to acknowledgements
WicketTester tester = new WicketTester(new CnvApplication());
tester.startPage(AdvancedSearch.class);

//check to make sure all components exist with correct names  
and types
tester.assertComponent(advancedSearchTabbedHeader,  
TabbedHeader.class);

FormTester formTester = tester.newFormTester(advancedSearch);
//*tester.assertComponent(feedbackPanel,  
FeedbackPanel.class);


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



FeedbackPanel not displaying message

2008-05-01 Thread Ryan O'Hara
I'm having trouble getting messages to display in the FeedbackPanel.   
Also, any idea how to get the form to submit after the user presses  
enter/return in a textfield (when using AjaxSubmitLink)?  Any ideas?   
Below is my code.


   //feedbackPanel
FeedbackPanel feedbackPanel = new FeedbackPanel 
(feedbackPanel);
feedbackPanel.add(new AttributeModifier(class, true, new  
Model(feedbackPanel)));
feedbackPanel.setFilter(new ContainerFeedbackMessageFilter 
(form));

form.add(feedbackPanel);
form.add(new TextField(name));

//submit button

AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
groupsDisplay.add(new AttributeModifier(class,  
true, new Model(groupsDisplay)));

target.addComponent(groupsDisplay);
info(Groups for  + name + .);
} catch (Exception e) {
error(Unable to get groups for  + name + .);
}
}
};
form.add(submit);

Thanks,
Ryan

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



Re: Using AJAX to change style of component

2008-04-28 Thread Ryan O'Hara

Cool, that worked.  Thanks, Frank.

Ryan

On Apr 25, 2008, at 2:25 AM, Frank Bille wrote:


You have to set outMarkupId when creating the component. It's too late
to do it in the ajax callback.

Frank


On Thu, Apr 24, 2008 at 9:32 PM, Ryan O'Hara  
[EMAIL PROTECTED] wrote:
I'm fairly new to Wicket and was wondering if there is a way to  
use AJAX to
change the style of a WebMarkupContainer?  Below is a snippet of  
my code:


IModel sourceModel = new Model() {
public Object getObject() {
return sourceOptions;
}
};
final DropDownChoice source = new DropDownChoice(source,  
new

PropertyModel(this, sourceSelection), sourceModel);
source.add(new AjaxFormComponentUpdatingBehavior 
(onchange) {

protected void onUpdate(AjaxRequestTarget target) {
variationMetricRow.add(new AttributeModifier 
(style, true,

new Model(sourceSelection.equals(CHOP_Normals) ? display:block :
display:none)));
variationMetricRow.setOutputMarkupId(true);
target.addComponent(variationMetricRow);
}
});

 In this example,  I would like to change the display to show/hide a
particular component.  Any help would be appreciated.

 Thanks,
 Ryan

  
-

 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]





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



Using AJAX to change style of component

2008-04-24 Thread Ryan O'Hara
I'm fairly new to Wicket and was wondering if there is a way to use  
AJAX to change the style of a WebMarkupContainer?  Below is a snippet  
of my code:


IModel sourceModel = new Model() {
public Object getObject() {
return sourceOptions;
}
};
final DropDownChoice source = new DropDownChoice(source,  
new PropertyModel(this, sourceSelection), sourceModel);

source.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
variationMetricRow.add(new AttributeModifier 
(style, true, new Model(sourceSelection.equals(CHOP_Normals) ?  
display:block : display:none)));

variationMetricRow.setOutputMarkupId(true);
target.addComponent(variationMetricRow);
}
});

In this example,  I would like to change the display to show/hide a  
particular component.  Any help would be appreciated.


Thanks,
Ryan

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



Tabs - hovering and clicking

2008-03-25 Thread Ryan O'Hara

Hey,

I'm new to Wicket.  I'm trying to create a tabbed header, which will  
load Tab classes when hovered.  The tab classes are panels, as well.   
I tried making hoverMenu a panel, but I was getting some errors about  
it not finding markup.  Any help would be greatly appreciated.  Below  
is a code snippet.


Thanks,
Ryan

public class TabbedHeader extends Panel {
private Label hoverMenu;

public TabbedHeader(final String panelId){
super(panelId);
hoverMenu = new Label(hoverMenu, new Model());
hoverMenu.setOutputMarkupId(true);

Link link = new Link(loginLink) {
public void onClick(){
setResponsePage(Login.class);
}
};
add(link);
link.add(new Label(login, Login));
link.add(new AjaxEventBehavior(onmouseover) {
protected void onEvent(AjaxRequestTarget target){
hoverMenu.setModelObject(LoginTab.class);
target.addComponent(hoverMenu);
}
});

//more tab links below
...
}

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



Re: Tabs - hovering and clicking

2008-03-25 Thread Ryan O'Hara
Sorry, I should've been more clear.  The code actually compiles and  
runs as is (with hoverMenu being of type Label, rather than Panel).   
When the links are hovered, edu.chop.bic.cnv.ui.LoginTab is  
displayed.  The behavior I'm looking for is for the content of  
LoginTab to be displayed.  This class extends Panel.  If you need  
anything else, please let me know.  Thanks again.


Ryan

On Mar 25, 2008, at 12:55 PM, Igor Vaynberg wrote:


seeing the actual stacktrace would be more helpful...

-igor


On Tue, Mar 25, 2008 at 8:59 AM, Ryan O'Hara  
[EMAIL PROTECTED] wrote:

Hey,

 I'm new to Wicket.  I'm trying to create a tabbed header, which will
 load Tab classes when hovered.  The tab classes are panels, as well.
 I tried making hoverMenu a panel, but I was getting some errors  
about
 it not finding markup.  Any help would be greatly appreciated.   
Below

 is a code snippet.

 Thanks,
 Ryan

 public class TabbedHeader extends Panel {
 private Label hoverMenu;

 public TabbedHeader(final String panelId){
 super(panelId);
 hoverMenu = new Label(hoverMenu, new Model());
 hoverMenu.setOutputMarkupId(true);

 Link link = new Link(loginLink) {
 public void onClick(){
 setResponsePage(Login.class);
 }
 };
 add(link);
 link.add(new Label(login, Login));
 link.add(new AjaxEventBehavior(onmouseover) {
 protected void onEvent(AjaxRequestTarget target){
 hoverMenu.setModelObject(LoginTab.class);
 target.addComponent(hoverMenu);
 }
 });

//more tab links below
...
 }

  
-

 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]





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



Panel Question

2008-03-25 Thread Ryan O'Hara

Can a class extending a panel contain a panel?

Thanks,
Ryan

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



Panel problem

2008-03-25 Thread Ryan O'Hara

Hello,

I have a Login.html/Login.java which adds a TabbedHeader component  
(which extends Panel).  When I try to add a panel component to  
TabbedHeader, I  get the following exception:


WicketMessage: Markup of type 'html' for component  
'org.apache.wicket.markup.html.panel.Panel' not found. Enable debug  
messages for org.apache.wicket.util.resource to get a list of all  
filenames tried:
[MarkupContainer [Component id = hoverMenu, page =  
edu.chop.bic.cnv.ui.Login, path =  
0:loginTabbedHeader:hoverMenu.Panel, isVisible = true, isVersioned =  
true]]


Root cause:

org.apache.wicket.markup.MarkupNotFoundException: Markup not found.  
Component class: org.apache.wicket.markup.html.panel.Panel Enable  
debug messages for org.apache.wicket.util.resource to get a list of  
all filenames tried


TabbedHeader.html:

html
xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.apache.org;
wicket:panel
a wicket:id=loginLinkspan wicket:id=loginTab will  
appear here/span/a

div wicket:id=hoverMenu/div
/wicket:panel
/html

TabbedHeader.java:

public TabbedHeader(String panelId){
super(panelId);
add(new Panel(hoverMenu));
Link link = new Link(loginLink) {
public void onClick(){
setResponsePage(Login.class);
}
};
add(link);
link.add(new Label(login, Login));
}

Any ideas?

Thanks,
Ryan

Re: Panel problem

2008-03-25 Thread Ryan O'Hara
Thx!  That fixed the problem I was experiencing.  I want to replace  
the hoverMenu WebMarkupContainer with different classes extending  
panels (or should they now be extending WebMarkupContainers, as  
well?) when particular tabs are hovered.  Thanks again for being so  
responsive.


Ryan

On Mar 25, 2008, at 5:33 PM, Timo Rantalaiho wrote:


On Tue, 25 Mar 2008, Ryan O'Hara wrote:

WicketMessage: Markup of type 'html' for component
'org.apache.wicket.markup.html.panel.Panel' not found. Enable debug
messages for org.apache.wicket.util.resource to get a list of all
filenames tried:
[MarkupContainer [Component id = hoverMenu, page =
edu.chop.bic.cnv.ui.Login, path =
0:loginTabbedHeader:hoverMenu.Panel, isVisible = true, isVersioned =
true]]

...

public TabbedHeader(String panelId){
super(panelId);
add(new Panel(hoverMenu));
Link link = new Link(loginLink) {
public void onClick(){
setResponsePage(Login.class);
}
};
add(link);
link.add(new Label(login, Login));
}


Put add(new WebMarkupContainer(hoverMenu)); instead of
Panel.

...or better yet remove the whole hoverMenu component if it
contains nothing? Or are you going to replace it with
something with content?

Best wishes,
Timo

--
Timo Rantalaiho
Reaktor Innovations OyURL: http://www.ri.fi/ 

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




===
Ryan O'Hara
Programmer, Center for Biomedical Informatics
The Children's Hospital of Philadelphia
3535 Market Street, Room 1406
(215)590-3243
===