Re: wicket:enclosure ( setting visible when hidden on render )

2009-10-23 Thread James McLaughlin
.


 Then I set visible(true) during runtime and at the component to the
 AjaxTarget.

 The component is not rendered.

 Is there a way to get this to work?



Add the parent component that contains the wicket:enclosure markup to the
AjaxRequestTarget.


Re: LinkTree will not be updated

2009-04-22 Thread James McLaughlin
add tree.updateTree(target) before adding the tree to the target.

hth,
jim



 tree.addTreeListener(new TreeListener() {

@Override
public void onActivityClicked(String nameOfNode,AjaxRequestTarget
target){
...
target.addComponent(tree);
}
@Override
public void onProcessClicked(AjaxRequestTarget target) {
...
target.addComponent(tree);
}

 });








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




Re: Dynamically update TreeTable model

2009-04-22 Thread James McLaughlin
You should not recreate the TreeModel and for most cases DefaultTreeModel is
what you want. If you are adding a node, add it with:

http://java.sun.com/javase/6/docs/api/javax/swing/tree/DefaultTreeModel.html#insertNodeInto(javax.swing.tree.MutableTreeNode,%20javax.swing.tree.MutableTreeNode,%20int)

which will notify all the listeners, such as the wicket tree

On Wed, Apr 22, 2009 at 10:56 AM, CrocodileShoes mark.do...@logica.comwrote:


 I have the same problem but with a different tree use case.  I'm
 implementing
 a facet search which needs to update the tree after a user selects a tree
 node (facet).  If I recreate the tree model like you were doing it doesn't
 persistent the selection, obviously.

 I'm not experienced with Swings trees but I think I may have to implment my
 own TreeModel.

 Does anybody have the solution for this?


 jchappelle wrote:
 
  I have a TreeTable and I have links within it. When a user clicks a link
  they are presented with a modal window with a FileUpload component in it.
  When they upload a new file and click close on the modal window, the
  TreeTable is not updated. I tried to use a LoadableDetachableModel that
  returns a DefaultTreeModel but if I do that then every time I click to
  expand a folder node the tree refreshes the model and the tree state and
  the icon doesn't expand(i'm guessing it's because the treestate gets
  recreated?).
 
  I searched but couldn't find anyone with this specific problem in the
  forum. Can someone please help?
 
  I am using wicket 1.3.4.
 
  Thanks,
 
  Josh
 

 --
 View this message in context:
 http://www.nabble.com/Dynamically-update-TreeTable-model-tp21056846p23175533.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Jim McLaughlin
Lead Software Engineer
Stonewater Control Systems
(o) 847.864.1060 x107
(c) 773.416.0994


Re: Application Context

2008-04-09 Thread James McLaughlin
Have a look at Springs
WebApplicationContextUtils.getWebApplicationContext(...).  This in
conjunction with org.springframework.web.context.ContextLoaderListener
should give you what you need.

best,
jim

On Wed, Apr 9, 2008 at 12:41 PM, Pinger [EMAIL PROTECTED] wrote:

  So I am using wicket annot.

  So I have classes elsewhere in my app that are using JMS and other services
  in a web service. The issue I am having is I need the ApplicationContext in
  non-wicket files.

  When I Do public static ApplicationContext spring = new
  ClassPathXmlApplicationContext(applicationContext.xml);

  this causes issues cause things are created 2 times..


  Thanks
  --
  View this message in context: 
 http://www.nabble.com/Application-Context-tp16592544p16592544.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


  -
  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: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-18 Thread James McLaughlin
 +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3

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



Re: parse directive in velocity template failing

2008-01-22 Thread James McLaughlin
On Jan 21, 2008 11:45 PM, fattymelt [EMAIL PROTECTED] wrote:

 Just to be sure...

 In the Wicket section of web.xml I am going to add the two init-params. One
 of which defines the folder in which to find my properties file, and the
 other is the actual filename. Then I can use that properties file to specify
 what my TEMPLATE_ROOT is.

Yes, that should do it.


 The only I don't get, is that I have working templates now that are in
 WEB-IN/templates. So, it isn't like velocity-contrib isn't finding them. So
 I'm not sure why the parse directive isn't looking there, too?

For some reason, the velocity.properties that comes with
wicket-velocity specifies the root as . . It probably would have
been better left as the default, which behaves as you would expect.
Maybe if you provide the full path to the template you are parsing,
the classpath loader will pick it up. Hope this helps, fattymelt.



 James McLaughlin-3 wrote:
 
  fattymelt,
  It used to work that you could jar up your templates and put them
  under WEB-INF/lib. If that doesn't work, create your own
  velocity.properties file and define the init-params
  velocityPropertiesFolder and velocity.properties in your web.xml. You
  can define there which loaders to use and what root the
  FileResourceLoader should use. Best of luck, fattymelt!
 

 --
 View this message in context: 
 http://www.nabble.com/%22parse%22-directive-in-velocity-template-failing-tp14999823p15013060.html

 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: parse directive in velocity template failing

2008-01-22 Thread James McLaughlin
fattymelt,
yes that looks right. This used to work. I will try to get some time
later today to see what is going on. There should be a velocity.log
somewhere that could be helpful. wicket-velocity has an Initializer
that searches for and loads the properties file, so set a breakpoint
in init to see what is going on.

best,
jim

On Jan 22, 2008 7:56 AM, fattymelt [EMAIL PROTECTED] wrote:

 Thanks for the help, James. I tried adding the following to my web.xml (and
 putting the velocity.properties file in that location). Does this look right
 to you?

 servlet
 servlet-nameClientApplication/servlet-name
 servlet-classwicket.protocol.http.WicketServlet/servlet-class
 init-param
   param-nameapplicationClassName/param-name
   param-valuecom.foo.bar.client.ClientApplication/param-value
 /init-param
 init-param
 param-nameconfiguration/param-name
 param-valuedevelopment/param-value
 /init-param
 init-param
 param-namevelocityPropertiesFolder/param-name
 param-valueWEB-INF/classes/param-value
 /init-param
 init-param
 param-namevelocity.properties/param-name
 param-valuevelocity.properties/param-value
 /init-param
 load-on-startup2/load-on-startup
 /servlet



 James McLaughlin-3 wrote:
 
  On Jan 21, 2008 11:45 PM, fattymelt [EMAIL PROTECTED] wrote:
 
  Just to be sure...
 
  In the Wicket section of web.xml I am going to add the two init-params.
  One
  of which defines the folder in which to find my properties file, and the
  other is the actual filename. Then I can use that properties file to
  specify
  what my TEMPLATE_ROOT is.
 
  Yes, that should do it.
 
 
  The only I don't get, is that I have working templates now that are in
  WEB-IN/templates. So, it isn't like velocity-contrib isn't finding them.
  So
  I'm not sure why the parse directive isn't looking there, too?
 
  For some reason, the velocity.properties that comes with
  wicket-velocity specifies the root as . . It probably would have
  been better left as the default, which behaves as you would expect.
  Maybe if you provide the full path to the template you are parsing,
  the classpath loader will pick it up. Hope this helps, fattymelt.
 
 
 
  James McLaughlin-3 wrote:
  
   fattymelt,
   It used to work that you could jar up your templates and put them
   under WEB-INF/lib. If that doesn't work, create your own
   velocity.properties file and define the init-params
   velocityPropertiesFolder and velocity.properties in your web.xml. You
   can define there which loaders to use and what root the
   FileResourceLoader should use. Best of luck, fattymelt!
  
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/%22parse%22-directive-in-velocity-template-failing-tp14999823p15019014.html

 Sent from the Wicket - User mailing list archive at Nabble.com.


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





-- 
Jim McLaughlin
Director, Software Engineering
Stonewater Control Systems
(o) 847.864.1060 x107
(c) 773.416.0994

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



Re: parse directive in velocity template failing

2008-01-21 Thread James McLaughlin
fattymelt,
It used to work that you could jar up your templates and put them
under WEB-INF/lib. If that doesn't work, create your own
velocity.properties file and define the init-params
velocityPropertiesFolder and velocity.properties in your web.xml. You
can define there which loaders to use and what root the
FileResourceLoader should use. Best of luck, fattymelt!

On Jan 21, 2008 9:27 AM, fattymelt [EMAIL PROTECTED] wrote:

 I am using a velocity template, and within it would like to use velocity's
 parse directive (to include another template within the current template)
 but it complains that it can not find the template in velocity's
 TEMPLATE_ROOT.  I have triple-checked that the template is in the same
 directory as all of my other working templates. Anyone know why velocity
 can't find a template when using parse ?

 Does Wicket specify its own template location? If so, does anyone know where
 the default Velocity TEMPLATE_ROOT would be?

 http://velocity.apache.org/engine/devel/user-guide.html#parse Velocity's
 Parse Directive

 TIA
 --
 View this message in context: 
 http://www.nabble.com/%22parse%22-directive-in-velocity-template-failing-tp14999823p14999823.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: TreeGrid and DataGrid open source

2008-01-14 Thread James McLaughlin
 Looking ahead, I can imagine that as Wicket becomes ever more popular, there
 will be many organisations who will see it as a big plus that there are
 well-respected developers building, selling and maintaining well engineered,
 reliable and high-quality components with interesting features that they
 cannot or cannot afford to build and maintain themselves.

I strongly second this. I would love to have libraries of
sophisticated, well engineered, documented and supported components,
and also see the dev team get something back for all the hard work
they've put into the community. This benefits everyone. It would be a
no brainer to sell my boss on spending a few hundred or thousand on
such a library rather than spending an equivalent amount of time
building it ourselves.

Great looking stuff, Matej (as always)!

best,
jim

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



Re: cannot render a menubar using menu2 package

2007-12-03 Thread James McLaughlin
A quickstart attached to jira would be most appreciated.
http://wicketstuff.org/jira/browse/WSYUI.

Yui menu's distaste for wicket tags has been a long standing issue. To
get around it at first, we did
tMarkupSettings().setStripWicketTags(true). But then I thought that
was changed to calling setRenderBodyOnly on the components? If this
isn't working, maybe we need to hack up a markup filter to have done
with it once and for all.

On Dec 3, 2007 10:49 AM, Doug Leeper [EMAIL PROTECTED] wrote:

 Rik,

 This doesn't make sense...it should work.  Not that it matters...but want to
 ask anyway...are you executing the wicket examples within Eclipse?  If so,
 please verify that your classpath is setup properly (looking for Wicket
 1.3.x...preferably the latest...TRUNK/SNAPSHOT/rc1)

 I am assuming that you are still getting YAHOO not found.  This indicates
 that the proper file has not been found.  Also, there nuances with YUI in
 the order of the files retrieved in the Browser.  Wicket I know for a fact
 handles this correctly.   Could you double check the outputted HTML to
 ensure the links are correct (copy/paste into a browser).  If any are 404,
 then the link formation is incorrect.

 What might be best is to have you send me your example (quick start if
 possible) to reproduce your error on my end.  Otherwise...I am grasping at
 straws here.

 - Doug
 --
 View this message in context: 
 http://www.nabble.com/wicket-success-stories-tf4877640.html#a14133768

 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: cannot render a menubar using menu2 package

2007-12-03 Thread James McLaughlin
Hi Doug,
We definitely don't want to require users to strip wicket tags, if
that still needs to be done. I think we did that just to get it
working. I thought setRenderBodyOnly was enough, but if we still have
issues we should add in a MarkupFilter or use a Transformer. If menu2
only works with stripping wicket tags, then we should fix it. I need
to get back in the game so we can dump menu and elevate menu2 to its
place as the one and only menu (I've been in a c++ house of pain for
the past couple of months)

best,
jim

On Dec 3, 2007 12:15 PM, Doug Leeper [EMAIL PROTECTED] wrote:

 James,

 I was not aware of the issue (or if I was...I forgot)  With this in
 mind...do I need to change the menu2 impl?

 - Doug
 --
 View this message in context: 
 http://www.nabble.com/wicket-success-stories-tf4877640.html#a14135575

 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: cannot render a menubar using menu2 package

2007-11-30 Thread James McLaughlin
rik rik,
you don't need to include the yui libraries. YuiMenuBar will do that
automatically. Remove them from your html and everything should work
fine.

best,
jim

On Nov 30, 2007 3:58 AM, rik rik [EMAIL PROTECTED] wrote:
 Hi to all,
 I've downloaded the sources of menu2 from svn, but I'm not able to make it 
 working properly, because the page is not correctly rendered
 My code (very simple) is this

 YuiMenuBar menubar=new YuiMenuBar(menubar,menubar);
 YuiMenuBarItem fileitem=menubar.addMenu(file);
 YuiMenuBarItem edititem=menubar.addMenu(edit);
 add(menubar);

 and this is the html

 html
 head
 script src=yahoo-dom-event.js type=text/javascript/script
 script src=animation.js type=text/javascript/script
 script src=container.js type=text/javascript/script
 script src=menu.js type=text/javascript/script
 link rel=stylesheet type=text/css href=menu.css/
 /head
 div wicket:id=menubarmenu/div
 /html

 The js files have been downloaded from the yui site, and they are correctly 
 referenced from the html
 Where am I going wrong?
 Thanks

 Rik

 _
 Organizza le tue foto e condividile con i tuoi amici con Raccolta foto di 
 Windows Live!
 http://www.windowslive.it

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



Re: Best practice question

2007-11-02 Thread James McLaughlin
Hi Doug,
It is hard to say without knowing more about your app. As a rule, I
never keep references to data in my components. Components have only
refs to services (injectable) and all the data are encapsulated by
IModels of one sort  or another. The IModels always implement
IDetachable and keep only the minumum of info necessary to rehydrate
the data. Usually, LoadableDetachableModel provides all the
functionality I need. Check to make sure you have followed these rules
of thumb. You should be ok if you have.

best,
jim

On 11/1/07, Doug Leeper [EMAIL PROTECTED] wrote:

 That is good that you do the same thing...so it must be my implementation
 that is wrong.  I use an optimizer to find the issue.  Do you recommend a
 reasonable one?

 Also, is it possible to introspect the serialized data?

 Also, I am using Hibernate.  Would classes obtained via Hibernate that are
 local objects to a page be a problem?
 --
 View this message in context: 
 http://www.nabble.com/Best-practice-question-tf4732767.html#a13534427
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: Ajax question

2007-10-18 Thread James McLaughlin
On 10/18/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I am using 1.3 (Trunk).

 I am calling AjaxRequestTarget.target.appendJavascript() right after i call
 AjaxRequestTarget.target.addComponent().  Is this the right approach?

 Do I have access to IHeaderResponse in an Ajax call?

Have your component implement IHeaderContributor and override
 void renderHead(final IHeaderResponse response);


 Thanks
 - Doug



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



Re: Context menu within a LinkTree?

2007-09-27 Thread James McLaughlin
On 9/27/07, Doug Leeper [EMAIL PROTECTED] wrote:

 Has anyone been able to create a context menu for items on a LinkTree?

 If so, was it all JS based (like YUI)? or did you create a small framework
 to be used in Wicket?

 If the latter, would it be possible to contribute to the wicket-contrib-yui
 (menu2) package?

It would be great if you could put that into wicket-contrib-yui. And
any other contributions you can dream up :). I will need such a
contect menu some time soon,  so I look forward to seeing it. Are you
thinking a right click context menu?


 I am in need of a tree component with the ability to display a context menu
 based on  what node has been selected.


best,
jim

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



WicketTester, FormTester, and AjaxSubmitLink

2007-09-06 Thread James McLaughlin
Hi,
Hacking away at some tests, I figured the proper way to test an
AjaxSubmitLink would have been as follows:

Panel p = tester.startPanel(EventPanel.class);
FormTester ft = tester.newFormTester(p.getId() + :eventForm);
ft.setValue(messageField, ALARM_MESSAGE);
tester.clickLink(p.getId() + :eventFormSubmitLink, true);

However, the values set in the FormTester don't get submitted for some
reason. It works if I change it to:

Panel p = tester.startPanel(EventPanel.class);
tester.setParameterForNextRequest(p.getId() +
:eventForm:messageField, ALARM_MESSAGE);
tester.clickLink(p.getId() + :eventFormSubmitLink, true);

which while 1 line briefer, didn't seem intuitive (to me at least). Is
it possible to make it work like the former, or is it better left as
it is?

best,
jim

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



Re: wicket contrib yui

2007-08-28 Thread James McLaughlin
 Also note that we did something similar in wicket-datetime. Maybe, in
 some future, it would be great to have all the YUI components
 together. For now, we could look whether the projects can at least be
 used together without having them bite. A thread of two weeks ago
 discussed this. The conclusion was that we probably would like
 something like a separate YUI project with all the js dependencies in
 it, so that projects using them can access it in a consistent fashion.
 If someone is up to it, please dig up that discussion and create a
 feature request linking to that discussion (nabble).

 Eelco

Done: https://issues.apache.org/jira/browse/WICKET-902, with some
minor blathering by yours truly.

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



Re: Menu???

2007-08-04 Thread James McLaughlin
I actually have a rough version of yui menu done in
wicket-contrib-yui. It needs to be polished up quite a bit, which I
have been intending on doing for about 5 months now. It works with yui
2.2.2 with the exception that you must strip wicket tags or else the
yui menu parser barfs.

Any help moving it forward would be greatly appreciated. In 2.3.0, yui
added added a feature where by you can retrieve menuitems by domId.
This will make the code significantly simpler. I also think the code
would benefit greatly from the addition of a menuevent/listener
pattern a la swing. Have at it and I will help anyway I can.

best,
jim

On 8/4/07, Doug Leeper [EMAIL PROTECTED] wrote:

 Well I have the itch.

 As I am new to all this, where would I start if the menu menus were to
 utilize yui's menu?  Is there is cheat sheet on how to create components?

 Thanks
 - Doug
 --
 View this message in context: 
 http://www.nabble.com/Menutf4213073.html#a11996192
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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: Dynamically adding tree nodes upon selection

2007-08-03 Thread James McLaughlin
Hi Doug,
First I would make sure your TreeNode implementation creates children
lazily. You probably should only create children when children() is
actually called and provide logic for isLeaf and getChildCount() that
don't require creating the children.

You can create the initial state for the tree by overrriding
newTreeState(). I usually do something like this:

 protected ITreeState newTreeState()
{

ITreeState state = new DefaultTreeState();
state.collapseAll();
TreeModel treeModel = (TreeModel) getModelObject();
OutLineNode root = (OutLineNode) treeModel.getRoot();
if(null != childNodeExpansionStrategy) {
childNodeExpansionStrategy.expandNode(root, state);
} else {
if (log.isInfoEnabled()) {
log.info(childNodeExpansionStrategy is NULL.
expanding root only);
}
state.expandNode(root);
}
return state;
}

where childNodeExpansionStrategy holds the logic to determine the
level to expand to, and recurses through the nodes to get there,
calling state.expandNode(node) until it does.

best,
jim

On 8/3/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I would like to dynamically add tree nodes to an AbstractTree instead of
 loading the entire tree up front.  Not sure how do this.  I thought I would
 be able to override nodeExpanded(TreeNode) and check if the node had been
 loaded ...if not then load 1 level deep.  However, all ITreeStateListeners
 are final in AbstractTree.

 Is there a way to do this without creating my own version of AbstractTree?
 Better yet...is there an example of this...it could mimic the file structure
 of your computer.

 Thanks
 - Doug
 --
 View this message in context: 
 http://www.nabble.com/Dynamically-adding-tree-nodes-upon-selection-tf4212940.html#a11984616
 Sent from the Wicket - User mailing list archive at Nabble.com.


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