wicket problem

2007-08-29 Thread bhupat parmar
hi
i am facing problems in retriving the values from a multiple choice box i
made in wicket frame work.I wrote a onSibmit() function but it througes an
exception saying that propertymodel is set to null.
Can somebody tell me how to implement this.
thanks


Wicket-Spring

2007-08-29 Thread bhupat parmar
Hi
i want to integarte my wicket rame work with an existing spring frame work
.Can some body tell how to go about it?
thanks


Re: wicket problem

2007-08-29 Thread Igor Vaynberg
show us your code and we maybe be able to tell you what you are doing wrong

-igor


On 8/28/07, bhupat parmar [EMAIL PROTECTED] wrote:

 hi
 i am facing problems in retriving the values from a multiple choice box i
 made in wicket frame work.I wrote a onSibmit() function but it througes an
 exception saying that propertymodel is set to null.
 Can somebody tell me how to implement this.
 thanks



Re: Wicket-Spring

2007-08-29 Thread Igor Vaynberg
see spring page on the wiki!!

-igor


On 8/28/07, bhupat parmar [EMAIL PROTECTED] wrote:

 Hi
 i want to integarte my wicket rame work with an existing spring frame work
 .Can some body tell how to go about it?
 thanks



Re: Wicket-Spring

2007-08-29 Thread Oliver Henlich

bhupat parmar wrote:

Hi
i want to integarte my wicket rame work with an existing spring frame work
.Can some body tell how to go about it?
thanks



You really should learn to search just a little bit

Quick google search gives you:

http://cwiki.apache.org/WICKET/spring.html

Oliver


smime.p7s
Description: S/MIME Cryptographic Signature


Re: wicket problem

2007-08-29 Thread bhupat parmar
hi
my code goes like this


private static class TabPanel3 extends Panel
{
FileUploadField fileUploadField = null;
TextField styleNameTFld=null;
private String message = ;
/** available sites for the multiple select. */
private static final List SITES =
Arrays.asList(new String[] { The Server Side, Java Lobby,
Java.Net });

public TabPanel3(String id)
{
super(id);
final FileUploadForm simpleUploadForm = new
FileUploadForm(simpleUpload);

add(simpleUploadForm);
}
private class FileUploadForm extends Form
{
private FileUploadField fileUploadField;
private TextField styleNameTFld;

/**
 * Construct.
 *
 * @param name
 * Component name
 */
public FileUploadForm(String name)
{
super(name);

// set this form to multipart mode (always needed for
uploads!)
setMultiPart(true);

// Add one file input field
add(fileUploadField = new FileUploadField(fileInput));
add(styleNameTFld=new TextField(styleNameTFld));

// Set maximum size to 100K for demo purposes
setMaxSize(Bytes.kilobytes(500));
}

/**
 * @see wicket.markup.html.form.Form#onSubmit()
 */
protected void onSubmit()
{
final wicket.markup.html.form.upload.FileUpload upload =
fileUploadField.getFileUpload();

String imgPath = upload.getClientFileName();

if (upload != null)
{

System.out.println(inside onSubmit + imgPath);
  // here i am getting the path but how do i get the value
in the text field??
}

}
}


Re: Re[2]: Alternative to Wicket data binding

2007-08-29 Thread Sam Hough

Perhaps to keep us newbies happy a pointer in the javadoc to what to do if
you want vanilla Java Bean behaviour might be handy. I just pulled a face
and put it on my todo list to change.

Anyway, I still can't decide between the verbose solution with tool support
and concise magic without tool support. Will make my tech lead decide, that
is what he gets the big money for :)


igor.vaynberg wrote:
 
 cmon, there are plenty of things you can abuse in wicket, or any other
 framework. that is just the nature of the beast. as framework developers
 we
 put out features and hope that our users know how to use them responsibly.
 we cannot continuously cater to newbie users, we have to cater to power
 users as well - and that sometimes means making things that newbie users
 might think unclean available anyways so power users can use them easily.
 having two property models might work but it just adds clutter.
 
 we are going about this in circles, so what i propose is that someone who
 really cares about this to put out a vote.
 
 -igor
 
 
 On 8/28/07, Kent Tong [EMAIL PROTECTED] wrote:



 igor.vaynberg wrote:
 
  i really dont think this is breaking encapsulation. i will concede that
  there is one case where it can break encapsulation and that is when you
  start out with what is publically accessible and then later you change
  your
  mind and make it completely private, but forget to remap the property
  model.
  it is a case where it is easy to make the mistake of not updating
 property
  models. all other cases i believe are unimportant because you would
 have
  to
  go poke around the class to even know that private field is there to
 start
  with.

 I think the problem is that by allowing the default, core model in Wicket
 (PropertyModel) to access private fields, you're telling people that it
 is
 OK or even desirable to access private fields, while in fact, in your
 mind
 this power should only be exercised to *keep* encapsulation, instead of
 breaking it.

 For the moment many users don't know about this feature, so there is
 practically little impact on them. But once they learn about it, they
 will
 go ahead to access private fields even though the author of the class
 explicitly indicated that they shouldn't be accessed by not providing
 setters.

 Yes, those users can always access private fields using Java reflection.
 But they had to go through hops to do that. Now Wicket is telling
 them it is perfectly fine to do that and is making it super-easy to do.
 That makes a difference.

 Greater power comes with greater responsibility. The problem is it is
 easy
 to give people power but hard to make them realize the associated
 responsibility (when to use that feature). That's why I always suggest
 to have a PrivateFieldModel class (probably in Wicket extensions)
 extending
 PropertyModel to provide that extra power. Due to the non-default nature
 of PrivateFieldModel, only if one is clear about the responsibilities
 will
 he
 get to power.
 --
 View this message in context:
 http://www.nabble.com/Alternative-to-Wicket-data-binding-tf4322899.html#a12364419
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/Alternative-to-Wicket-data-binding-tf4322899.html#a12381449
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: wicket problem

2007-08-29 Thread Igor Vaynberg
upload.getfileupload() ?

-igor


On 8/28/07, bhupat parmar [EMAIL PROTECTED] wrote:

 hi
 my code goes like this


 private static class TabPanel3 extends Panel
 {
 FileUploadField fileUploadField = null;
 TextField styleNameTFld=null;
 private String message = ;
 /** available sites for the multiple select. */
 private static final List SITES =
 Arrays.asList(new String[] { The Server Side, Java Lobby,
 Java.Net });

 public TabPanel3(String id)
 {
 super(id);
 final FileUploadForm simpleUploadForm = new
 FileUploadForm(simpleUpload);

 add(simpleUploadForm);
 }
 private class FileUploadForm extends Form
 {
 private FileUploadField fileUploadField;
 private TextField styleNameTFld;

 /**
  * Construct.
  *
  * @param name
  * Component name
  */
 public FileUploadForm(String name)
 {
 super(name);

 // set this form to multipart mode (always needed for
 uploads!)
 setMultiPart(true);

 // Add one file input field
 add(fileUploadField = new FileUploadField(fileInput));
 add(styleNameTFld=new TextField(styleNameTFld));

 // Set maximum size to 100K for demo purposes
 setMaxSize(Bytes.kilobytes(500));
 }

 /**
  * @see wicket.markup.html.form.Form#onSubmit()
  */
 protected void onSubmit()
 {
 final wicket.markup.html.form.upload.FileUpload upload =
 fileUploadField.getFileUpload();

 String imgPath = upload.getClientFileName();

 if (upload != null)
 {

 System.out.println(inside onSubmit + imgPath);
   // here i am getting the path but how do i get the value
 in the text field??
 }

 }
 }



handle resource with several formats (minified, gzipped,...)

2007-08-29 Thread David Bernard

Hi,

To avoid runtime/on-the-fly compression (js minification/packing,... gzip 
compression) of static resources (!= dynamic),
I do it at compile time (done via the yuicompressor-maven-plugin) and provide 3 
formats (original, minified, minified+gzip)

But I need to choose the right at runtime.

if !settingsMinifiedSuffixes.isEmpty() {
  foreach minifiedSuffix {
if resource with minifiedSuffix exists {
  resource = resource with minifiedSuffix
}
  }
}
if gzipAllowed {
  if resource with gzip exists {
  resource = resource with gzip
}
  } else compress(resource)
  setHttpHeader(gzip)
}

In your opinion where is right (simplest/best) place to implement the Resource 
Selection Policy (may be later could be generalized with locale and style 
selection).
1/ When resource is requested
2/ When url of the resource is build
3/ In a filter
4/ ...

optionals requirements :
* define settings at Application level (init)
* no need to patch wicket source
* applied and compatible with existing Resource's implementation

What are your suggestions ?

Regards

/David

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



Re: Apache Wicket 1.3.0-beta3 released!

2007-08-29 Thread Erik van Oosten

Great!!

When can we expect it on http://wicketstuff.org/maven/repository/?

Or is there another maven repository?

Regards,
Erik.


Martijn Dashorst-4 wrote:
 
 This is the third beta for Apache Wicket we have prepared for your
 pleasure.

-- 
View this message in context: 
http://www.nabble.com/Apache-Wicket-1.3.0-beta3-released%21-tf4345763.html#a12382570
Sent from the Wicket - User mailing list archive at Nabble.com.


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



bhupat parmar wants to chat

2007-08-29 Thread bhupat parmar
---

bhupat parmar wants to stay in better touch using some of Google's coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-4ed0898d6-8b797b38e3-ed5dacd6a48cb801
You'll need to click this link to be able to chat with bhupat parmar.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with bhupat parmar, visit:
http://mail.google.com/mail/a-4ed0898d6-8b797b38e3-84ffa693fb

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
  emails into conversations
- No pop-up ads or untargeted banners - just text ads and related information
  that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
  client

Gmail and Google Talk are still in beta. We're working hard to add new features
and make improvements, so we might also ask for your comments and suggestions
periodically. We appreciate your help in making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).

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



Re: Apache Wicket 1.3.0-beta3 released!

2007-08-29 Thread Martijn Dashorst
How about the central repository, which is used for all official releases?

Martijn

On 8/29/07, Erik van Oosten [EMAIL PROTECTED] wrote:

 Great!!

 When can we expect it on http://wicketstuff.org/maven/repository/?

 Or is there another maven repository?

 Regards,
 Erik.


 Martijn Dashorst-4 wrote:
 
  This is the third beta for Apache Wicket we have prepared for your
  pleasure.

 --
 View this message in context: 
 http://www.nabble.com/Apache-Wicket-1.3.0-beta3-released%21-tf4345763.html#a12382570
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 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.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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



Re: Apache Wicket 1.3.0-beta3 released!

2007-08-29 Thread Erik van Oosten

Ah, sorry.
My mirror was out of date.

Regards,
   Erik.


Martijn Dashorst wrote:

How about the central repository, which is used for all official releases?

Martijn

On 8/29/07, Erik van Oosten [EMAIL PROTECTED] wrote:
  

Great!!

When can we expect it on http://wicketstuff.org/maven/repository/?

Or is there another maven repository?

Regards,
Erik.





--
Erik van Oosten
http://2008.rubyenrails.nl/
http://www.day-to-day-stuff.blogspot.com/


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



PasswordTextField no longer supports cookies in beta3

2007-08-29 Thread Erik van Oosten

Dear wicketeers,

In 1.3beta3 I can no longer call
  new PasswordTextField(...).setPersistence(true);
as this results in a:
 java.lang.UnsupportedOperationException: FormComponent class 
org.apache.wicket.markup.html.form.PasswordTextField does not support 
cookies


I do not understand why PasswordTextField no longer allows this. Okay, 
it is not super safe, but it is also not very unsafe and very desirable 
in some circumstances.


Could someone provide the rationale for the change?

Regards,
   Erik.



--
Erik van Oosten
http://2008.rubyenrails.nl/
http://www.day-to-day-stuff.blogspot.com/


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



Re: Panel/Localizer issue

2007-08-29 Thread Johan Compagner
i changed it on 2 places.

On 8/29/07, Johan Compagner [EMAIL PROTECTED] wrote:

 yes that should also be lazy through a model
 can you create an jira issue ? (with a patch if possible)

 On 8/29/07, Edvin Syse  [EMAIL PROTECTED] wrote:
 
  I have found that when I create a new Palette with the constructor:
 
  (String id, IModel model, IModel choicesModel, IChoiceRenderer
  choiceRenderer, int rows, boolean allowOrder)
 
  .. it calls add(newAvailableHeader(AVAILABLE_HEADER_ID)) in the
  constructor, which in turn does a:
 
  new Label(componentId, getString(palette.available, null,
  Available));
 
  This gives the same error message, since the Palette is not added to the
  page yet.
 
  Should this be rewritten to
 
  new Label(componentId, new ResourceModel(palette.available));
 
  or something instead or am I missing something?
 
  -- Edvin
 
 
  Edvin Syse wrote:
   Thank you!
  
   That both solved the problem and made my code cleaner :)
  
   -- Edvin
  
   Matej Knopp wrote:
   You should use ResourceModel for this, it does the
  localization/message
   lookup for you.
  
   -Matej
  
   On 8/28/07, Edvin Syse  [EMAIL PROTECTED] wrote:
   Hi,
  
   When I instantiate a Panel that does getLocalizer().getString() in
  the
   constructor, I obviously get the errormessage:
  
   WARN  [Localizer] Tried to retrieve a localized string for a
  component
   that has not yet been added to the page. This can sometimes lead to
  an
   invalid or no localized resource returned. Make sure you are not
  calling
   Component#getString() inside your Component's constructor. Offending
   component: [MarkupContainer [Component id = idHere, page = No
  Page,
   path = path-here]]
  
   This is understandable, since I haven't added the component to a
  page
   before the constructor is run.
  
   In the constructor, I do things like:
  
   add(new Label(articleTitle, new
   Model(getLocalizer().getString(articleTitle, this;
  
   and:
  
   deleteLink.add(new
   ConfirmBehaviour(getLocalizer().getString(confirmDelete, this)));
  
   Is there a way to create the panel and give it a page-instance
  directly,
   or how should I get around this the wicket way?
  
   I use 1.3-SNAPSHOT, btw.
  
   -- Edvin
  
  
  -
   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]
 
 



Re: Presentation and application logic separation

2007-08-29 Thread Gabor Szokoli
On 8/28/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 well, what wicket does is version the state if you keep it inside its model,
 so it all Just Works. But because you are keeping your state outside of
 wicket you have to build your own versioning mechanism, or remove your state
 machine and use wicket.

Assuming the SM state is not too big,  you could keep it in your base
page object.
Then it would get replicated along with the page in the cache, wouldn't it?
Make sure it is serialisable.
Or to get bookmarkable pages, keep it in the PageParameters.

Except for the variables which truly belong to the session, like
logged in user, of course.

More experienced people please correct me if I'm wrong.


Gabor

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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Alex Shneyderman
 I'm in the process of slapping the developers around here, trying to get
 them to wake up.

 Senior dev's recommending struts 1 for gods sake... now that's what i call
 afraid of change
 It's out of ignorance, and their unwillingness to see what else is out
 there.

It could also mean their unwillingness to commit their time and
money on education. Do not rush with this kinds of claims. Everyone
has their reasons - not everyone is lazy. If you have good enough
reasons to make them move to Wicket they will probably do so.
Otherwise, blame yourself for your inability to influence.

Component based frameworks are not obvious. While a reasonable
developer of decent experience could pick up Struts 1/2 and be
efficient with it in a couple of hours. I would definitely drop Struts 1,
and stick with Struts 2 as that is a different kind of animal. I am not
quite sure why Eelco is being so pushy on claiming no OOP is
done there, but I would really stay away from his opnions unless
they are somehow Wicket directed :-)

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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Xavier Hanin
On 8/29/07, neekibo [EMAIL PROTECTED] wrote:


 Thanks to all,

 I will analyse how complex my UI will be and than evaluate if Wicket fits
 in.

 Thanks for pointing at Stripes... I always thought: Spring is so cool,
 everybody says that. So SpringMVC is the way to go, but as mentioned here
 it is quite low-level.

 My today's two favourites :=)

 1. Wicket - SpringCore - Hibernate
 2. Stripes - SpringCore - Hibernate

 Thanks for pointing at  http://databinder.net/site/show/overviewDatabinder
 . I will discuss with myself if abandon Spring is an option. I guess using
 Spring only makes sense when you have to code quite a bit of business
 logic.


Note that databinder can be used with Spring too. It's useful for exposing
your hibernate beans as wicket models.

Xavier

Discussion, especially arguments against Wicket, my case in mind, are
 welcome :=)

 Paul


 --
 View this message in context:
 http://www.nabble.com/Is-Wicket-a-proper-framework-for-a-Webshop---tf4341788.html#a12384390
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/


Re: 1.3 beta2 - beta3 = NullPointerException

2007-08-29 Thread Matej Knopp
Hi, could you please create a jira issue and attach a quickstart project
that can be used to reproduce this? Thanks. I'll look at it ASAP.

-Matej

On 8/29/07, Stojce Dimski [EMAIL PROTECTED] wrote:

 I have a simple app embedded in my jetty (no web.xml, I wire-up the
 components) with:
 - Application (extends SpringWebApplication)
 - 3 Pages (extends WebPage) 2 without instance variables and one with
 one non serializable @SpringBean injected variable
 - Session (extends WebSession) which contains above mentioned
 @SpringBean as instance variable

 with beta2 it worked, but today I updated it to beta3 and I get
 following error, can some kind shed some light ?

 WARN [org.mortbay.log] - failed
 org.apache.wicket.protocol.http.WicketServlet-2080726
 javax.servlet.ServletException: java.lang.NullPointerException
   at
 org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java
 :437)
   at
 org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
   at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
 org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java
 :612)
   at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
   at
 org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
   at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
   at org.mortbay.jetty.Server.doStart(Server.java:217)
   at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at ...
 Caused by: java.lang.NullPointerException
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.init(
 DiskPageStore.java:486)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.init(
 DiskPageStore.java:512)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.init(
 DiskPageStore.java:521)
   at
 org.apache.wicket.protocol.http.WebApplication.newSessionStore(
 WebApplication.java:563)
   at org.apache.wicket.Application.internalInit(Application.java:953)
   at
 org.apache.wicket.protocol.http.WebApplication.internalInit(
 WebApplication.java:475)
   at
 org.apache.wicket.spring.SpringWebApplication.internalInit(
 SpringWebApplication.java:68)
   at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:414)
   at
 org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:153)
   at javax.servlet.GenericServlet.init(GenericServlet.java:241)
   at
 org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java
 :433)
   ... 10 more



   ___
 L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
 http://it.docs.yahoo.com/nowyoucan.html

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




Ajax operations on Panels nested in Fragments

2007-08-29 Thread Oli Evans
I just lost a few hours on a problem where an ajax operation on a Panel 
nested in a Fragment was failing as my nested panel could not find its 
associated markup. It seems this was because a Fragment will only 
reliably find its markup if you explicitly provide it with the Component 
that contains its markup in the Fragment constructor.


If you don't, Fragment.getAssociatedMarkupStream() will find its 
markupProvider field is null, and so have to take a guess at where its 
markup might be. If your fragment usage happens to be as a direct child 
of the component that defines the fragment markup then it will all work 
out, but if you have nested it in something like a ListView then it will 
fail.


...So watch out kids, if you use fragments, use a constructor that tells 
it where its markup is. Would you like to have to guess who your real 
parents are? I think not.


Oli

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



MarkupCache Issue

2007-08-29 Thread Kumarasun Nadar1
Hi All,

In our aplication we are using a filter to populate the HTML base tag 
with the base URL.
But since the markupcache caches the page markup the base tag is getting 
populated incorrectly for 2 different users using different hostnames.

Is there a way wherein we can tell wicket not to cache the base tag and 
populate it for each request.


Thanks
kumar


RadioChoice and ListView

2007-08-29 Thread Alex Pine
Hi all,
I'm trying to use a Radio Choice component inside a Listview so that each
list
item has one RadioGroup with three choices. When the form submit button is
pressed,
each selected choice should set a field in the model object of each list
item.
The code below should explain the problem more fully:


/*
The ultimate goal is to set the status field in each Participation object
in the participationList of the object below.
 */
public class Experiment {

  private String name;

  private ListParticipation participationList;

  /* Other fields, constructors, getters, setters, etc */

}


public class Participation {

public static final int PARTICIPATED = 1;
public static final int NO_SHOW = -1;
public static final int SHOWED = 0;

private User user;

private int status;

public Participation() {
status = SHOWED; // Default value
}

/* getters, setters, etc */
}


/* This is the web page that is supposed to do the setting*/
public class ParticipationPage extends BasePage {

private static final long serialVersionUID = 1L;

@SpringBean
private ExperimentDAO exDAO;

private DetachableExperimentModel exModel;

public ParticipationPage(Experiment ex) {
exModel = new DetachableExperimentModel(ex, exDAO);
add(new ParticipationForm(form));
exModel.detach();
}

class ParticipationForm extends Form {

public ParticipationForm(String id) {
super(id);
ListParticipation participationList = exModel.getEx
().getParticipationList();

ListView subjectListView = new ListView(list,
participationList) {

private static final long serialVersionUID = 1L;

/*
 I imagine the correct code should be something like
this...?
 */
public void populateItem(final ListItem item) {
Participation participation =
(Participation)item.getModelObject();
item.add(new Label(name, participation.getUser
().getName()));
RadioGroup rg = new RadioGroup(choice);
rg.add(new Radio(participated, new Model(
Participation.PARTICIPATED)));
rg.add(new Radio(no show, new Model(
Participation.NO_SHOW)));
rg.add(new Radio(showed, new Model(
Participation.SHOWED)));
item.add(rg);
}
};
subjectListView.setReuseItems(true);
add(subjectListView);
}

@Override
protected void onSubmit() {

  /*
   * Somehow I have to set each Participation object in the user's
participationList
   * to the choice from corresponding the radio group.
   */

exDAO.persistExperiment(exModel.getEx());
exModel.detach();
}
}
}

Does anyone know how to do this easily? I imagine it's not difficult, I just
can't figure it out
from the examples on the web.
Thanks!
-Alex Pine


Re: RadioChoice and ListView

2007-08-29 Thread Igor Vaynberg
problem is here

RadioGroup rg = new RadioGroup(choice);

you are not setting the model for the radiogroup choice so your choices go
no where

RadioGroup rg = new RadioGroup(choice, new PropertyModel(item.getModel(),
status));

or leave it as it is and use PropertyListView instead

-igor


On 8/29/07, Alex Pine [EMAIL PROTECTED] wrote:

 Hi all,
 I'm trying to use a Radio Choice component inside a Listview so that each
 list
 item has one RadioGroup with three choices. When the form submit button is
 pressed,
 each selected choice should set a field in the model object of each list
 item.
 The code below should explain the problem more fully:


 /*
 The ultimate goal is to set the status field in each Participation
 object
 in the participationList of the object below.
 */
 public class Experiment {

   private String name;

   private ListParticipation participationList;

   /* Other fields, constructors, getters, setters, etc */

 }


 public class Participation {

 public static final int PARTICIPATED = 1;
 public static final int NO_SHOW = -1;
 public static final int SHOWED = 0;

 private User user;

 private int status;

 public Participation() {
 status = SHOWED; // Default value
 }

 /* getters, setters, etc */
 }


 /* This is the web page that is supposed to do the setting*/
 public class ParticipationPage extends BasePage {

 private static final long serialVersionUID = 1L;

 @SpringBean
 private ExperimentDAO exDAO;

 private DetachableExperimentModel exModel;

 public ParticipationPage(Experiment ex) {
 exModel = new DetachableExperimentModel(ex, exDAO);
 add(new ParticipationForm(form));
 exModel.detach();
 }

 class ParticipationForm extends Form {

 public ParticipationForm(String id) {
 super(id);
 ListParticipation participationList = exModel.getEx
 ().getParticipationList();

 ListView subjectListView = new ListView(list,
 participationList) {

 private static final long serialVersionUID = 1L;

 /*
  I imagine the correct code should be something like
 this...?
  */
 public void populateItem(final ListItem item) {
 Participation participation =
 (Participation)item.getModelObject();
 item.add(new Label(name, participation.getUser
 ().getName()));
 RadioGroup rg = new RadioGroup(choice);
 rg.add(new Radio(participated, new Model(
 Participation.PARTICIPATED)));
 rg.add(new Radio(no show, new Model(
 Participation.NO_SHOW)));
 rg.add(new Radio(showed, new Model(
 Participation.SHOWED)));
 item.add(rg);
 }
 };
 subjectListView.setReuseItems(true);
 add(subjectListView);
 }

 @Override
 protected void onSubmit() {

   /*
* Somehow I have to set each Participation object in the user's
 participationList
* to the choice from corresponding the radio group.
*/

 exDAO.persistExperiment(exModel.getEx());
 exModel.detach();
 }
 }
 }

 Does anyone know how to do this easily? I imagine it's not difficult, I
 just
 can't figure it out
 from the examples on the web.
 Thanks!
 -Alex Pine



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Nathan Hamblen

Xavier Hanin wrote:

Note that databinder can be used with Spring too. It's useful for exposing
your hibernate beans as wicket models.


The beginning of this thread is not on gmane for some reason. But, yeah 
actually I've done a few web stores with Databinder. As always I find 
Wicket to be helpful no matter how simple the front end is, but where it 
really pays off is on the administration side. You can pile on the 
functionality without the code becoming a nightmare, and reusing 
components is even easier when no one is obsessing over appearance. Even 
on the front end, checkout is a multistep process that I would hate to 
code without managed state.


Nathan


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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Eelco Hillenius
On 8/29/07, William Hoover [EMAIL PROTECTED] wrote:
 Could you elaborate on what is lacking in Wicket when referring to the back 
 button support (when compared to GWT)? I was under the impression that Wicket 
 had robust back button support?

Wicket's back button support is pretty robust for normal (non-ajax)
requests. The problem we have with the Ajax back button comes down to
the fact that we have to synchronize client with server state in such
a fashion that it also keeps working with normal requests. GWT is all
client side and thus doesn't have that problem. It's *Ajax* back
button support is better, though it's not very automatic from what
I've seen, and I wonder how it survives leaving a single page
approach.

We haven't given up on better Ajax back button support for Wicket
though. See https://issues.apache.org/jira/browse/WICKET-271.
Contributions are welcome as always.

Regards,

Eelco

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



Re: Presentation and application logic separation

2007-08-29 Thread fero

Thanks Gabor. I had the same idea. I'll try it soon and leave here a message
how it works. Btw I think many people would appreciate an article about
wicket application architecture.

Fero


Gabor Szokoli wrote:
 
 On 8/28/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 well, what wicket does is version the state if you keep it inside its
 model,
 so it all Just Works. But because you are keeping your state outside of
 wicket you have to build your own versioning mechanism, or remove your
 state
 machine and use wicket.
 
 Assuming the SM state is not too big,  you could keep it in your base
 page object.
 Then it would get replicated along with the page in the cache, wouldn't
 it?
 Make sure it is serialisable.
 Or to get bookmarkable pages, keep it in the PageParameters.
 
 Except for the variables which truly belong to the session, like
 logged in user, of course.
 
 More experienced people please correct me if I'm wrong.
 
 
 Gabor
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Presentation-and-application-logic-separation-tf4341077.html#a12392226
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Gerolf Seitz

 ..., how many component libraries and tools there
 are for them (regardless of the fact the quality of them and whether
 that is a good thing in the first place), ...


that's what i like about wicket, you practically don't need additional tools
(which you have to learn to use, learn to avoid any drawbacks or known
issues of the tool etc...). everything you know about your ide, you can use
to develop with wicket. productivity++ ;)

having said that, i like the feature list of wicketforge (
http://code.google.com/p/wicketforge/) as it seems that . but as i'm on the
eclipse side of the world, ...

  gerolf


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Igor Vaynberg
google wicket-bench

-igor


On 8/29/07, Gerolf Seitz [EMAIL PROTECTED] wrote:

 
  ..., how many component libraries and tools there
  are for them (regardless of the fact the quality of them and whether
  that is a good thing in the first place), ...
 

 that's what i like about wicket, you practically don't need additional
 tools
 (which you have to learn to use, learn to avoid any drawbacks or known
 issues of the tool etc...). everything you know about your ide, you can
 use
 to develop with wicket. productivity++ ;)

 having said that, i like the feature list of wicketforge (
 http://code.google.com/p/wicketforge/) as it seems that . but as i'm on
 the
 eclipse side of the world, ...

   gerolf



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Gerolf Seitz

 google wicket-bench

 -igor


i know wicket-bench, have used it for wicket 1.2 actually.
oh, and i like mark occurences too ;)


wantOnSelectionChangedNotifications causing table redraw

2007-08-29 Thread salmas

I have a DataTable in which I have a panel which contains a textfield and a
radiogroup. When the user changes the selection in the radiogroup I'd like
to populate a value in the textfield. I subclassesed RadioGroup to catch the
selectionChangedEvent

RadioGroup choice = new RadioGroup(workflowFrame_radioPanel_radioGroup,new
Model()){
protected void onSelectionChanged(java.lang.Object newSelection) {
//Figure out what is selected and set value in textfield
}

 protected boolean wantOnSelectionChangedNotifications() { 
   return true; 
} 
};

As soon as I override the wantOnSelectionChangedNotifications method I get
the notifications but the table is redrawn as soon as the user selects an
option in the radiogroup while if I do not override this method the UI does
not do this ugly redraw when the user toggles the selection in the
radiogroup. I am using AJAX to redraw my table in other instances so that
the table redraw is smooth. Is there any way I can catch the selection
changed event and have the table not redraw? I can redraw it myself with an
AJAX target after I set the value in the textfield.

-- 
View this message in context: 
http://www.nabble.com/wantOnSelectionChangedNotifications-causing-table-redraw-tf4350095.html#a12394832
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: RadioChoice and ListView

2007-08-29 Thread Alex Pine
I'm sorry to spam the list like this, but I really need help on this. Igor's
solution doesn't seem to change anything. No information is transferred to
the database upon hitting on submit. If no one knows the solution, does
anyone have any ideas on how I could debug this? Is there some way I can
reference the selections of the radiogroups from the the onSubmit method so
I can see what their values are?
Thanks for any help you can give,
Alex

On 8/29/07, Alex Pine [EMAIL PROTECTED] wrote:

 Thank you for the quick reply, but this fix doesn't seem to work. The
 selections are never persisted on form submit. Any ideas?

 On 8/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 
  problem is here
 
  RadioGroup rg = new RadioGroup(choice);
 
  you are not setting the model for the radiogroup choice so your choices
  go
  no where
 
  RadioGroup rg = new RadioGroup(choice, new PropertyModel(
  item.getModel(),
  status));
 
  or leave it as it is and use PropertyListView instead
 
  -igor
 
 
  On 8/29/07, Alex Pine [EMAIL PROTECTED] wrote:
  
   Hi all,
   I'm trying to use a Radio Choice component inside a Listview so that
  each
   list
   item has one RadioGroup with three choices. When the form submit
  button is
   pressed,
   each selected choice should set a field in the model object of each
  list
   item.
   The code below should explain the problem more fully:
  
  
   /*
   The ultimate goal is to set the status field in each Participation
   object
   in the participationList of the object below.
   */
   public class Experiment {
  
 private String name;
  
 private ListParticipation participationList;
  
 /* Other fields, constructors, getters, setters, etc */
  
   }
  
  
   public class Participation {
  
   public static final int PARTICIPATED = 1;
   public static final int NO_SHOW = -1;
   public static final int SHOWED = 0;
  
   private User user;
  
   private int status;
  
   public Participation() {
   status = SHOWED; // Default value
   }
  
   /* getters, setters, etc */
   }
  
  
   /* This is the web page that is supposed to do the setting*/
   public class ParticipationPage extends BasePage {
  
   private static final long serialVersionUID = 1L;
  
   @SpringBean
   private ExperimentDAO exDAO;
  
   private DetachableExperimentModel exModel;
  
   public ParticipationPage(Experiment ex) {
   exModel = new DetachableExperimentModel(ex, exDAO);
   add(new ParticipationForm(form));
   exModel.detach();
   }
  
   class ParticipationForm extends Form {
  
   public ParticipationForm(String id) {
   super(id);
   ListParticipation participationList = exModel.getEx
   ().getParticipationList();
  
   ListView subjectListView = new ListView(list,
   participationList) {
  
   private static final long serialVersionUID = 1L;
  
   /*
I imagine the correct code should be something like
   this...?
*/
   public void populateItem(final ListItem item) {
   Participation participation =
   (Participation)item.getModelObject();
   item.add(new Label(name, participation.getUser
   ().getName()));
   RadioGroup rg = new RadioGroup(choice);
   rg.add (new Radio(participated, new Model(
   Participation.PARTICIPATED)));
   rg.add(new Radio(no show, new Model(
   Participation.NO_SHOW)));
   rg.add(new Radio(showed, new Model(
   Participation.SHOWED)));
   item.add(rg);
   }
   };
   subjectListView.setReuseItems (true);
   add(subjectListView);
   }
  
   @Override
   protected void onSubmit() {
  
 /*
  * Somehow I have to set each Participation object in the user's
 
   participationList
  * to the choice from corresponding the radio group.
  */
  
   exDAO.persistExperiment(exModel.getEx());
   exModel.detach();
   }
   }
   }
  
   Does anyone know how to do this easily? I imagine it's not difficult,
  I
   just
   can't figure it out
   from the examples on the web.
   Thanks!
   -Alex Pine
  
 




Re: Wicket HTML Simplicity

2007-08-29 Thread Gwyn Evans
No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the page
for previewing them...

Might be a very simple question (but not IMO!) but I'm not sure what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan [EMAIL PROTECTED] wrote:

 It sounds like you want Markup Inheritance.
 http://cwiki.apache.org/WICKET/markup-inheritance.html
 Johan

 Carlos Silva wrote:
 I'm new to wicket and have a very simple question:
 
 Got a usual html template for all my pages:
 
 html
   span wicket:id=headerHEADER/span
   ... page content ...
   span wicket:id=footerFOOTER/span
 /html
 
 Inside my span elements for header and footer I have actual markup and 
 this allows me to see a full page with headers and footers by just 
 opening the html in a browser. The markup gets replaced by wicket once 
 the page is rendered via a web server.
 
 Obviously I don't want to replicate the markup inside my span elements 
 to all my other 100s of pages but I do want to be able to open all the 
 other pages in a browser and see the header and footer.
 
 Is this possible perhaps with some wicket tool?
 
 

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



/Gwyn


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



Re: Wicket HTML Simplicity

2007-08-29 Thread Martijn Dashorst
AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:
 No, it looks to me as if the OP's not worried about the pages while
 running, but is rather looking for something to pre-process the page
 for previewing them...

 Might be a very simple question (but not IMO!) but I'm not sure what
 approaches others use to preview pages, especially when markup
 inheritance might be involved...

 /Gwyn

 On Wednesday, August 29, 2007, 9:12:36 PM, Johan [EMAIL PROTECTED] wrote:

  It sounds like you want Markup Inheritance.
  http://cwiki.apache.org/WICKET/markup-inheritance.html
  Johan

  Carlos Silva wrote:
  I'm new to wicket and have a very simple question:
 
  Got a usual html template for all my pages:
 
  html
span wicket:id=headerHEADER/span
... page content ...
span wicket:id=footerFOOTER/span
  /html
 
  Inside my span elements for header and footer I have actual markup and
  this allows me to see a full page with headers and footers by just
  opening the html in a browser. The markup gets replaced by wicket once
  the page is rendered via a web server.
 
  Obviously I don't want to replicate the markup inside my span elements
  to all my other 100s of pages but I do want to be able to open all the
  other pages in a browser and see the header and footer.
 
  Is this possible perhaps with some wicket tool?
 
 

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



 /Gwyn


 -
 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.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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



Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva

I guess the is just HTML claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:

No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the page
for previewing them...

Might be a very simple question (but not IMO!) but I'm not sure  
what

approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan  
[EMAIL PROTECTED] wrote:



It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:

html
  span wicket:id=headerHEADER/span
  ... page content ...
  span wicket:id=footerFOOTER/span
/html

Inside my span elements for header and footer I have actual  
markup and

this allows me to see a full page with headers and footers by just
opening the html in a browser. The markup gets replaced by  
wicket once

the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span  
elements
to all my other 100s of pages but I do want to be able to open  
all the

other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




 
-

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




/Gwyn


-
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.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

-
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: Wicket HTML Simplicity

2007-08-29 Thread Matej Knopp
Well, it is just HTML. But there is a templating involved. And that has to
hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:

 I guess the is just HTML claim of wicket only goes so far.

 On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:

  AFAIK, wicket-bench (an eclipse plugin) does support some form of
  previewing, but I don't know how far the support actually goes.
 
  Martijn
 
  On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:
  No, it looks to me as if the OP's not worried about the pages while
  running, but is rather looking for something to pre-process the page
  for previewing them...
 
  Might be a very simple question (but not IMO!) but I'm not sure
  what
  approaches others use to preview pages, especially when markup
  inheritance might be involved...
 
  /Gwyn
 
  On Wednesday, August 29, 2007, 9:12:36 PM, Johan
  [EMAIL PROTECTED] wrote:
 
  It sounds like you want Markup Inheritance.
  http://cwiki.apache.org/WICKET/markup-inheritance.html
  Johan
 
  Carlos Silva wrote:
  I'm new to wicket and have a very simple question:
 
  Got a usual html template for all my pages:
 
  html
span wicket:id=headerHEADER/span
... page content ...
span wicket:id=footerFOOTER/span
  /html
 
  Inside my span elements for header and footer I have actual
  markup and
  this allows me to see a full page with headers and footers by just
  opening the html in a browser. The markup gets replaced by
  wicket once
  the page is rendered via a web server.
 
  Obviously I don't want to replicate the markup inside my span
  elements
  to all my other 100s of pages but I do want to be able to open
  all the
  other pages in a browser and see the header and footer.
 
  Is this possible perhaps with some wicket tool?
 
 
 
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  /Gwyn
 
 
  -
  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.0-beta3 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
 
  -
  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: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Matej Knopp
Yeah, we have alrady seen it. But I personally think that responding to
arguments such as I just don't see what Wicket - or possibly any web
framework - buys you. is just a waste of time.

-Matej

On 8/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Over in the Slashdot article about GWT in Action there are some negative
 opinions toward Wicket expressed.  Just thought I'd mention it in case any
 of the gurus want to weigh in too.  (Head over to this link, set the
 threshold to 4, then search for Wicket,
 http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).



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




Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva
I'm actually very interested in this topic and wondering if there are  
any solutions to this problem.


On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:

Well, it is just HTML. But there is a templating involved. And that  
has to

hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:


I guess the is just HTML claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:

No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the  
page

for previewing them...

Might be a very simple question (but not IMO!) but I'm not sure
what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan
[EMAIL PROTECTED] wrote:


It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:

html
  span wicket:id=headerHEADER/span
  ... page content ...
  span wicket:id=footerFOOTER/span
/html

Inside my span elements for header and footer I have actual
markup and
this allows me to see a full page with headers and footers by  
just

opening the html in a browser. The markup gets replaced by
wicket once
the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span
elements
to all my other 100s of pages but I do want to be able to open
all the
other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




-- 
--

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




/Gwyn


--- 
--

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.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

 
-

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]



Re: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Eelco Hillenius
On 8/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Over in the Slashdot article about GWT in Action there are some negative
 opinions toward Wicket expressed.  Just thought I'd mention it in case any
 of the gurus want to weigh in too.  (Head over to this link, set the
 threshold to 4, then search for Wicket,
 http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).

I just did, cheers. There are also a lot of people complaining about
GWT, as there are a bunch defending it. Welcome to Java Land :)

That Wicket and GWT aren't for everyone isn't surprising, since both
make a couple of strong assumptions. And people who complain about
framework bloat are as old as our profession (and they are often right
as well). Let me just say I'm very very glad I don't have to develop
the site I'm working on using Perl. :)

Eelco

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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Matej Knopp
You should use panels for this. You can have panels for 1 link, 2 links a 3
links. Or even put a repeater into panel to generate as many links as you
want. And you then need only one placeholder on the page (for the panel).

-Matej

On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:

 Hey there--
 So I came up with a solution to this, but I suspect it's not very
 Wicket-y, so I'd like some suggestions on best practices:

 We want a header component that can go on different pages, with 1 2 or
 3 links to other pages.
 (Well, I guess ideally any #, but with my approach it was easier to
 match it to the maximum shown in the spec). Visually, the end result
 would be

 Back to:  _LINK1_, _LINK2_ or _LINK3_

 As far as i can tell, the links and their labels should be created by
 the page containing the component. The trouble is, since the HTML and
 wicket:id for displaying each link is in the HTML for the component,
 the page has to know what ID to assign its link  (and it doesn't
 seem like you can change the id of a component object after its
 created, which would have meant the page could just hand a list of
 un-ID'd labeled links in, and the component could have re-IDed them to
 match the HTML)

 So the component has a static callback getIdPrefixForLink() and
 getIdPrefixForLinkLabel(), and the page uses that, and then uses that
 string + 0, 1, or 2 for the links its making and handing to the
 constructor of the Header component.

 So if the Component only gets 1 Labeled Link, it then creates
 placeholder objects for the other 2, to make sure the hierarchy as
 outlined in the HTML is still ok, and then just hides them.

 And there's a tad more logic for the commas and the or.

 So, this all seems really hacky to me. What's a better way? In other
 words: Is having to make place holders for everything that ever MIGHT
 appear on a page or component, and then making them invisible when you
 don't need them, the Wicket way, or is there something more direct?
 And/or is there a standard way of letting parent pages or component
 make subsubcomponents to be added to a subcomponent (e.g the Page
 making PageLinks to be added to the Header component -- incidentally I
 can't just pass in a reference to the class, because of what we had to
 do to make lazy loading links that don't fully instantiate the page
 they go to until that link is clicked.)

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




Re: best practice for a header component with links defined by the page

2007-08-29 Thread Eelco Hillenius
So let me try to rephrase your problem: you have a header component
that shows a variable number of components (links). Use a repeater
(e.g. list view or repeating view) for the variable number of
components, and you probably want to wrap the header component in a
panel so that it is easy to move it around, place it on other pages,
etc. Think a bit about whether those links should be internal or to
bookmarkable pages, and that should do the trick, right?

Eelco

On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:
 Hey there--
 So I came up with a solution to this, but I suspect it's not very
 Wicket-y, so I'd like some suggestions on best practices:

 We want a header component that can go on different pages, with 1 2 or
 3 links to other pages.
 (Well, I guess ideally any #, but with my approach it was easier to
 match it to the maximum shown in the spec). Visually, the end result
 would be

 Back to:  _LINK1_, _LINK2_ or _LINK3_

 As far as i can tell, the links and their labels should be created by
 the page containing the component. The trouble is, since the HTML and
 wicket:id for displaying each link is in the HTML for the component,
 the page has to know what ID to assign its link  (and it doesn't
 seem like you can change the id of a component object after its
 created, which would have meant the page could just hand a list of
 un-ID'd labeled links in, and the component could have re-IDed them to
 match the HTML)

 So the component has a static callback getIdPrefixForLink() and
 getIdPrefixForLinkLabel(), and the page uses that, and then uses that
 string + 0, 1, or 2 for the links its making and handing to the
 constructor of the Header component.

 So if the Component only gets 1 Labeled Link, it then creates
 placeholder objects for the other 2, to make sure the hierarchy as
 outlined in the HTML is still ok, and then just hides them.

 And there's a tad more logic for the commas and the or.

 So, this all seems really hacky to me. What's a better way? In other
 words: Is having to make place holders for everything that ever MIGHT
 appear on a page or component, and then making them invisible when you
 don't need them, the Wicket way, or is there something more direct?
 And/or is there a standard way of letting parent pages or component
 make subsubcomponents to be added to a subcomponent (e.g the Page
 making PageLinks to be added to the Header component -- incidentally I
 can't just pass in a reference to the class, because of what we had to
 do to make lazy loading links that don't fully instantiate the page
 they go to until that link is clicked.)

 -
 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: Wicket HTML Simplicity

2007-08-29 Thread Igor Vaynberg
google wicket:preview

-igor


On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:

 I'm actually very interested in this topic and wondering if there are
 any solutions to this problem.

 On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:

  Well, it is just HTML. But there is a templating involved. And that
  has to
  hinder previewability in a certain way.
 
  -Matej
 
  On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:
 
  I guess the is just HTML claim of wicket only goes so far.
 
  On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:
 
  AFAIK, wicket-bench (an eclipse plugin) does support some form of
  previewing, but I don't know how far the support actually goes.
 
  Martijn
 
  On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:
  No, it looks to me as if the OP's not worried about the pages while
  running, but is rather looking for something to pre-process the
  page
  for previewing them...
 
  Might be a very simple question (but not IMO!) but I'm not sure
  what
  approaches others use to preview pages, especially when markup
  inheritance might be involved...
 
  /Gwyn
 
  On Wednesday, August 29, 2007, 9:12:36 PM, Johan
  [EMAIL PROTECTED] wrote:
 
  It sounds like you want Markup Inheritance.
  http://cwiki.apache.org/WICKET/markup-inheritance.html
  Johan
 
  Carlos Silva wrote:
  I'm new to wicket and have a very simple question:
 
  Got a usual html template for all my pages:
 
  html
span wicket:id=headerHEADER/span
... page content ...
span wicket:id=footerFOOTER/span
  /html
 
  Inside my span elements for header and footer I have actual
  markup and
  this allows me to see a full page with headers and footers by
  just
  opening the html in a browser. The markup gets replaced by
  wicket once
  the page is rendered via a web server.
 
  Obviously I don't want to replicate the markup inside my span
  elements
  to all my other 100s of pages but I do want to be able to open
  all the
  other pages in a browser and see the header and footer.
 
  Is this possible perhaps with some wicket tool?
 
 
 
  --
  --
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  /Gwyn
 
 
  ---
  --
  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.0-beta3 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
 
  
  -
  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]




Re: best practice for a header component with links defined by the page

2007-08-29 Thread Igor Vaynberg
or just write something in perl and call it a day.

-igor


On 8/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote:

 So let me try to rephrase your problem: you have a header component
 that shows a variable number of components (links). Use a repeater
 (e.g. list view or repeating view) for the variable number of
 components, and you probably want to wrap the header component in a
 panel so that it is easy to move it around, place it on other pages,
 etc. Think a bit about whether those links should be internal or to
 bookmarkable pages, and that should do the trick, right?

 Eelco

 On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:
  Hey there--
  So I came up with a solution to this, but I suspect it's not very
  Wicket-y, so I'd like some suggestions on best practices:
 
  We want a header component that can go on different pages, with 1 2 or
  3 links to other pages.
  (Well, I guess ideally any #, but with my approach it was easier to
  match it to the maximum shown in the spec). Visually, the end result
  would be
 
  Back to:  _LINK1_, _LINK2_ or _LINK3_
 
  As far as i can tell, the links and their labels should be created by
  the page containing the component. The trouble is, since the HTML and
  wicket:id for displaying each link is in the HTML for the component,
  the page has to know what ID to assign its link  (and it doesn't
  seem like you can change the id of a component object after its
  created, which would have meant the page could just hand a list of
  un-ID'd labeled links in, and the component could have re-IDed them to
  match the HTML)
 
  So the component has a static callback getIdPrefixForLink() and
  getIdPrefixForLinkLabel(), and the page uses that, and then uses that
  string + 0, 1, or 2 for the links its making and handing to the
  constructor of the Header component.
 
  So if the Component only gets 1 Labeled Link, it then creates
  placeholder objects for the other 2, to make sure the hierarchy as
  outlined in the HTML is still ok, and then just hides them.
 
  And there's a tad more logic for the commas and the or.
 
  So, this all seems really hacky to me. What's a better way? In other
  words: Is having to make place holders for everything that ever MIGHT
  appear on a page or component, and then making them invisible when you
  don't need them, the Wicket way, or is there something more direct?
  And/or is there a standard way of letting parent pages or component
  make subsubcomponents to be added to a subcomponent (e.g the Page
  making PageLinks to be added to the Header component -- incidentally I
  can't just pass in a reference to the class, because of what we had to
  do to make lazy loading links that don't fully instantiate the page
  they go to until that link is clicked.)
 
  -
  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]




Wicket capability for LARGE forms

2007-08-29 Thread Antony Stubbs

I have a couple of pages with _very large forms_, that are also modified
dynamically to set which fields are editable using javascript, dependant on
the value of a drop down list. Please see the example image attached. And
that's only the first page
the application is in - *gasp* - struts.
I love what I've seen so far with Wicket, but I'm unsure what it's like to
use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes to
very large forms.
being that setting up each field in wicket is kinda verbose...


What are people's experiences? How do you find Wicket to use in very large
forms? Thoughts? Ideas? Alternatives?

(disclaimer - I've only written one page in Wicket, and that was just
playing around with Ajax (NCE!! :)))

http://www.nabble.com/file/p12398507/bigForm.png 
-- 
View this message in context: 
http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12398507
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva
Apparently there is a javascript library that allows you to do just  
this.


http://jroller.com/wireframe/entry/auto_previewable_wicket_pages

I'm wondering why such a tool is not part of wicket? I will give it a  
try.


Thank you all for your help.

On Aug 29, 2007, at 4:25 PM, Igor Vaynberg wrote:


google wicket:preview

-igor


On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:


I'm actually very interested in this topic and wondering if there are
any solutions to this problem.

On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:


Well, it is just HTML. But there is a templating involved. And that
has to
hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:


I guess the is just HTML claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans [EMAIL PROTECTED] wrote:
No, it looks to me as if the OP's not worried about the pages  
while

running, but is rather looking for something to pre-process the
page
for previewing them...

Might be a very simple question (but not IMO!) but I'm not sure
what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan
[EMAIL PROTECTED] wrote:


It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:

html
  span wicket:id=headerHEADER/span
  ... page content ...
  span wicket:id=footerFOOTER/span
/html

Inside my span elements for header and footer I have actual
markup and
this allows me to see a full page with headers and footers by
just
opening the html in a browser. The markup gets replaced by
wicket once
the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span
elements
to all my other 100s of pages but I do want to be able to open
all the
other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




 
--

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




/Gwyn


- 
--

--
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.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0- 
beta3/


-- 
--

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






Re: Wicket capability for LARGE forms

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Antony Stubbs [EMAIL PROTECTED] wrote:

 I have a couple of pages with _very large forms_, that are also modified
 dynamically to set which fields are editable using javascript, dependant on
 the value of a drop down list. Please see the example image attached. And
 that's only the first page
 the application is in - *gasp* - struts.
 I love what I've seen so far with Wicket, but I'm unsure what it's like to
 use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes to
 very large forms.
 being that setting up each field in wicket is kinda verbose...

Yeah, you definitively should not just add all these examples by hand :)

What you do is e.g. use a DataTable component. The data provider would
return the rows, and you define the columns on that data table. Rest
should be straightforward. Don't forget to set the itemReuseStrategy
if you're working inside a form (e.g. to use ReuseIfModelsEqual).

Eelco

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



Re: Wicket HTML Simplicity

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Carlos Silva [EMAIL PROTECTED] wrote:
 Apparently there is a javascript library that allows you to do just
 this.

 http://jroller.com/wireframe/entry/auto_previewable_wicket_pages

 I'm wondering why such a tool is not part of wicket? I will give it a
 try.

There is actually an example about this in wicket-examples, though I
think it's not on the index page. For the rest, it's completely
javascript, so we don't need to package it for you to use it.

Eelco

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



Best way to add a MarkupFilter

2007-08-29 Thread David Leangen

What's the best way to add a markup filter to my app?

I noticed that in the settings I can override the MarkupParserFactory
and provide my own filter, but that is not what I want to do. I just
want to use the default factory, but add my own filter.


Thanks!



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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Kirk Israel
Igor, sorry if I've irritated you. I know some of my frustration comes
from A. an ugly reluctance to embrace change and B. Wicket is doing
great things but it's somewhat early days, and the documentation
(tutorial books and recipe collections) is still scanty.

Eelco, thanks, your summary was accurate. I thought about a repeater,
it seemed like overkill, and I thought maybe there  was a  third
way. (I still have to look into how the encompassing page would feed
the links into the component, maybe not that difficult)

So am I correct in thinking that, in general, most HTML pages in
WIcket will have all possible subcomponents listed, and the visibility
will control things that shouldn't be there...

On 8/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 or just write something in perl and call it a day.

 -igor


 On 8/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 
  So let me try to rephrase your problem: you have a header component
  that shows a variable number of components (links). Use a repeater
  (e.g. list view or repeating view) for the variable number of
  components, and you probably want to wrap the header component in a
  panel so that it is easy to move it around, place it on other pages,
  etc. Think a bit about whether those links should be internal or to
  bookmarkable pages, and that should do the trick, right?
 
  Eelco
 
  On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:
   Hey there--
   So I came up with a solution to this, but I suspect it's not very
   Wicket-y, so I'd like some suggestions on best practices:
  
   We want a header component that can go on different pages, with 1 2 or
   3 links to other pages.
   (Well, I guess ideally any #, but with my approach it was easier to
   match it to the maximum shown in the spec). Visually, the end result
   would be
  
   Back to:  _LINK1_, _LINK2_ or _LINK3_
  
   As far as i can tell, the links and their labels should be created by
   the page containing the component. The trouble is, since the HTML and
   wicket:id for displaying each link is in the HTML for the component,
   the page has to know what ID to assign its link  (and it doesn't
   seem like you can change the id of a component object after its
   created, which would have meant the page could just hand a list of
   un-ID'd labeled links in, and the component could have re-IDed them to
   match the HTML)
  
   So the component has a static callback getIdPrefixForLink() and
   getIdPrefixForLinkLabel(), and the page uses that, and then uses that
   string + 0, 1, or 2 for the links its making and handing to the
   constructor of the Header component.
  
   So if the Component only gets 1 Labeled Link, it then creates
   placeholder objects for the other 2, to make sure the hierarchy as
   outlined in the HTML is still ok, and then just hides them.
  
   And there's a tad more logic for the commas and the or.
  
   So, this all seems really hacky to me. What's a better way? In other
   words: Is having to make place holders for everything that ever MIGHT
   appear on a page or component, and then making them invisible when you
   don't need them, the Wicket way, or is there something more direct?
   And/or is there a standard way of letting parent pages or component
   make subsubcomponents to be added to a subcomponent (e.g the Page
   making PageLinks to be added to the Header component -- incidentally I
   can't just pass in a reference to the class, because of what we had to
   do to make lazy loading links that don't fully instantiate the page
   they go to until that link is clicked.)
  
   -
   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]



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Eelco Hillenius
 So am I correct in thinking that, in general, most HTML pages in
 WIcket will have all possible subcomponents listed, and the visibility
 will control things that shouldn't be there...

That's one way to do it. But a better way typically is to build up
your pages dynamically, using panels for content that can change. Or a
combination of the two.

Eelco

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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Igor Vaynberg
I just dont understand how you expect us to continue helping you if you go
and talk trash about something we invest a lot of time in. Based on the
slashdot comments you left I dont really understand why you are using wicket
at all.

-igor


On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:

 Igor, sorry if I've irritated you. I know some of my frustration comes
 from A. an ugly reluctance to embrace change and B. Wicket is doing
 great things but it's somewhat early days, and the documentation
 (tutorial books and recipe collections) is still scanty.

 Eelco, thanks, your summary was accurate. I thought about a repeater,
 it seemed like overkill, and I thought maybe there  was a  third
 way. (I still have to look into how the encompassing page would feed
 the links into the component, maybe not that difficult)

 So am I correct in thinking that, in general, most HTML pages in
 WIcket will have all possible subcomponents listed, and the visibility
 will control things that shouldn't be there...

 On 8/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  or just write something in perl and call it a day.
 
  -igor
 
 
  On 8/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  
   So let me try to rephrase your problem: you have a header component
   that shows a variable number of components (links). Use a repeater
   (e.g. list view or repeating view) for the variable number of
   components, and you probably want to wrap the header component in a
   panel so that it is easy to move it around, place it on other pages,
   etc. Think a bit about whether those links should be internal or to
   bookmarkable pages, and that should do the trick, right?
  
   Eelco
  
   On 8/29/07, Kirk Israel [EMAIL PROTECTED] wrote:
Hey there--
So I came up with a solution to this, but I suspect it's not very
Wicket-y, so I'd like some suggestions on best practices:
   
We want a header component that can go on different pages, with 1 2
 or
3 links to other pages.
(Well, I guess ideally any #, but with my approach it was easier to
match it to the maximum shown in the spec). Visually, the end result
would be
   
Back to:  _LINK1_, _LINK2_ or _LINK3_
   
As far as i can tell, the links and their labels should be created
 by
the page containing the component. The trouble is, since the HTML
 and
wicket:id for displaying each link is in the HTML for the component,
the page has to know what ID to assign its link  (and it doesn't
seem like you can change the id of a component object after its
created, which would have meant the page could just hand a list of
un-ID'd labeled links in, and the component could have re-IDed them
 to
match the HTML)
   
So the component has a static callback getIdPrefixForLink() and
getIdPrefixForLinkLabel(), and the page uses that, and then uses
 that
string + 0, 1, or 2 for the links its making and handing to the
constructor of the Header component.
   
So if the Component only gets 1 Labeled Link, it then creates
placeholder objects for the other 2, to make sure the hierarchy as
outlined in the HTML is still ok, and then just hides them.
   
And there's a tad more logic for the commas and the or.
   
So, this all seems really hacky to me. What's a better way? In other
words: Is having to make place holders for everything that ever
 MIGHT
appear on a page or component, and then making them invisible when
 you
don't need them, the Wicket way, or is there something more direct?
And/or is there a standard way of letting parent pages or component
make subsubcomponents to be added to a subcomponent (e.g the Page
making PageLinks to be added to the Header component -- incidentally
 I
can't just pass in a reference to the class, because of what we had
 to
do to make lazy loading links that don't fully instantiate the
 page
they go to until that link is clicked.)
   
   
 -
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]




Re: Wicket capability for LARGE forms

2007-08-29 Thread Antony Stubbs

Ah yes, DataTable, I see, like a data grid...
And what about changing the fields to enabled / disabled? Staying within
Wicket I suppose the nicest way would be ajax onChange behaviour on the
initial drop down box?


Eelco Hillenius wrote:
 
 On 8/29/07, Antony Stubbs [EMAIL PROTECTED] wrote:

 I have a couple of pages with _very large forms_, that are also modified
 dynamically to set which fields are editable using javascript, dependant
 on
 the value of a drop down list. Please see the example image attached. And
 that's only the first page
 the application is in - *gasp* - struts.
 I love what I've seen so far with Wicket, but I'm unsure what it's like
 to
 use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes
 to
 very large forms.
 being that setting up each field in wicket is kinda verbose...
 
 Yeah, you definitively should not just add all these examples by hand :)
 
 What you do is e.g. use a DataTable component. The data provider would
 return the rows, and you define the columns on that data table. Rest
 should be straightforward. Don't forget to set the itemReuseStrategy
 if you're working inside a form (e.g. to use ReuseIfModelsEqual).
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12399482
Sent from the Wicket - User mailing list archive at Nabble.com.


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



setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I posted this on the Databinder forum but no one seems to know of a
work-around so I thought I'd post it here.

Essentially I have a FocusableTextField that gets set by a DropDownChoice.
If the choice is not other then I setEnabled to false and I place the
string value of the DropDownChoice into the FocusableTextField. However the
model is not persisted when setEnabled is false.

Here is the code: 

// list of existing emailAddresses
final List emailTypeList =
Arrays.asList(EmailAddress.Type.values());
final ListView emailAddresses = new
PropertyListView(emailAddresses) {
@Override
protected void populateItem(final ListItem item) {
final EmailAddress email = (EmailAddress)
item.getModelObject();
final FocusableTextField emailLabel = new
FocusableTextField(label, page);
if (email.getType() != EmailAddress.Type.OTHER)
emailLabel.setEnabled(false);
item.add(emailLabel);
item.add(new DropDownChoice(type, emailTypeList) {
@Override
protected boolean
wantOnSelectionChangedNotifications() {
return true;
}
@Override
protected void onSelectionChanged(final Object
newSelection) {
if (newSelection == EmailAddress.Type.OTHER) {
emailLabel.setEnabled(true);
emailLabel.requestFocus();
} else {
   
emailLabel.setModelValue(newSelection.toString());
emailLabel.setEnabled(false);
}
}
});
  snip 

In this email example the dropdown choices are home, work, and other.
If user selects home or work I want the value of the FocusableTextField to
be home or work and I do not want the user to be able to edit the field.
That's why I set the field's isEnabled to false. On the other hand, if the
user selects other, then I set isEnabled to true so that the user can edit
the field. This works properly (persists the value) because isEnabled is
true.

Is there a workaround for this problem or can someone recommend a different
approach?

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
Sent from the Wicket - User mailing list archive at Nabble.com.


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



VisitChildren bottom-up

2007-08-29 Thread RedFury

Hi all,

I've writing a very heavily javascripted app in wicket and finding wicket
handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
successfully in numerous places but have a problem with a case where I'd
like to use it 'backwards'.  I'm writing some base components which will be
used by our application programmers and our base Panel has an onClose()
method which will contribute javascript to a closing panel  (rendered on
AjaxRequestTarget.prependJavascript())  What I would like to do is have a
closing panel's children automatically call onClose().

So I started with:

protected final void close()
{
  visitChildren(JumbuckPanel.class, new IVisitor()
  {
public Object component(Component c)
{
  ((JumbuckPanel)c).onClose();
  return IVisitor.CONTINUE_TRAVERSAL;
}
  });
}

Then I realized that this had a problem - being onClose() I needed the
children to be traversed from the bottom-up, whereas visitChildren always
seem to go top-down.  That is, from looking at VisitChildren() in
MarkupContainer, it goes..

-visit this node
-if this is a container, visitchildren recursively.

wherease I need:

-if this is a container, visitchildren recursively
-visit this node.

So originally I tried to write reverseVisitChildren() in my sublcass of
MarkupContainer but then realized all of the access functions (children_size
and children_next) are private in markupContainer and my recursive call to
reverseVisitChildren would only work on my custom panel, not generic
MarkupContainers, if that makes.

Is anyone able to suggest a simple solution to this problem, as right now
the best solution I can think of is to add that functionality to
MarkupContainer as I think it might prove useful for other people at some
stage also.

Thanks,
Dean

-- 
View this message in context: 
http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket capability for LARGE forms

2007-08-29 Thread Igor Vaynberg
yeah, with ajax instead of simply disabling them you can remove them
completely, or replace them with something else entirely.

however, if all you really want to do is to make them disabled on clientside
that should work also. might not be as straight forward but should work.

-igor


On 8/29/07, Antony Stubbs [EMAIL PROTECTED] wrote:


 Ah yes, DataTable, I see, like a data grid...
 And what about changing the fields to enabled / disabled? Staying within
 Wicket I suppose the nicest way would be ajax onChange behaviour on the
 initial drop down box?


 Eelco Hillenius wrote:
 
  On 8/29/07, Antony Stubbs [EMAIL PROTECTED] wrote:
 
  I have a couple of pages with _very large forms_, that are also
 modified
  dynamically to set which fields are editable using javascript,
 dependant
  on
  the value of a drop down list. Please see the example image attached.
 And
  that's only the first page
  the application is in - *gasp* - struts.
  I love what I've seen so far with Wicket, but I'm unsure what it's like
  to
  use compared to say, Stripes, Struts 2, Click, Tapestry etc when it
 comes
  to
  very large forms.
  being that setting up each field in wicket is kinda verbose...
 
  Yeah, you definitively should not just add all these examples by hand :)
 
  What you do is e.g. use a DataTable component. The data provider would
  return the rows, and you define the columns on that data table. Rest
  should be straightforward. Don't forget to set the itemReuseStrategy
  if you're working inside a form (e.g. to use ReuseIfModelsEqual).
 
  Eelco
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12399482
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Updating Panels with AjaxLazyLoadingPanel

2007-08-29 Thread Igor Vaynberg
you can also use IndicatingAjaxLink that has a little indicator built in

-igor


On 8/29/07, Evan Chooly [EMAIL PROTECTED] wrote:

 Why not just use the AjaxLazyLoadingPanel?  I'm currently using it and my
 lazy loaded component is updated via AJAX.  So, page comes up, ALLP loads
 the report panel which can take a few seconds.  Then I have an AJAX
 submitted form that updates the filters for the report and refreshes that
 table using (from memory IndicatingAjaxSubmitButton) so while the report
 panel itself doesn't get the spinner on the update, the button gets that
 indicator showing that things are working.

 On 8/29/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED]
 wrote:
 
  Hi list, I have a simple site with a menu on the left and a content in
 the
  center that needs some wicket magic. ;-)
 
  Instead of reloading the page from menu link to menu link, I would like
 to
  have AjaxLinks and a kind of AjaxLazyLoadingPanel that could change by
  each
  click without reloading all pages.
 
  Thankfully one big part is done. All pages basically creates a new panel
  instance that holds its contents, so I already have every panel
 developed.
  I
  just need to load them into the main page by ajax means and if it is
  possible, have the little wheel from the AjaxLazyLoadingPanel.
 
 
  f(t)
 



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Igor Vaynberg
the entire point of disabling the component is that you do not want it to
process submitted input and update its model. you are looking for readonly
behavior rather then disabled i think. why not just set the readonly
attribute on that field.

-igor


On 8/29/07, janders [EMAIL PROTECTED] wrote:


 I posted this on the Databinder forum but no one seems to know of a
 work-around so I thought I'd post it here.

 Essentially I have a FocusableTextField that gets set by a DropDownChoice.
 If the choice is not other then I setEnabled to false and I place the
 string value of the DropDownChoice into the FocusableTextField. However
 the
 model is not persisted when setEnabled is false.

 Here is the code:

 // list of existing emailAddresses
 final List emailTypeList =
 Arrays.asList(EmailAddress.Type.values());
 final ListView emailAddresses = new
 PropertyListView(emailAddresses) {
 @Override
 protected void populateItem(final ListItem item) {
 final EmailAddress email = (EmailAddress)
 item.getModelObject();
 final FocusableTextField emailLabel = new
 FocusableTextField(label, page);
 if (email.getType() != EmailAddress.Type.OTHER)
 emailLabel.setEnabled(false);
 item.add(emailLabel);
 item.add(new DropDownChoice(type, emailTypeList) {
 @Override
 protected boolean
 wantOnSelectionChangedNotifications() {
 return true;
 }
 @Override
 protected void onSelectionChanged(final Object
 newSelection) {
 if (newSelection == EmailAddress.Type.OTHER) {
 emailLabel.setEnabled(true);
 emailLabel.requestFocus();
 } else {

 emailLabel.setModelValue(newSelection.toString());
 emailLabel.setEnabled(false);
 }
 }
 });
   snip

 In this email example the dropdown choices are home, work, and
 other.
 If user selects home or work I want the value of the FocusableTextField to
 be home or work and I do not want the user to be able to edit the field.
 That's why I set the field's isEnabled to false. On the other hand, if the
 user selects other, then I set isEnabled to true so that the user can edit
 the field. This works properly (persists the value) because isEnabled is
 true.

 Is there a workaround for this problem or can someone recommend a
 different
 approach?

 --
 View this message in context:
 http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: VisitChildren bottom-up

2007-08-29 Thread Igor Vaynberg
hrm. i have implemented a postorder traversal for formcomponents (see
FormComponent.visitFormComponentsPostOrder) so you can either take that code
and use it in your app, or we can bring it up to markupcontainer and
generalize it.

the problem is that we already have visitComponents, and having a
visitComponentsPostOrder next to it seems a little inconsistent. what do
other devs think?

-igor


On 8/29/07, RedFury [EMAIL PROTECTED] wrote:


 Hi all,

 I've writing a very heavily javascripted app in wicket and finding wicket
 handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
 successfully in numerous places but have a problem with a case where I'd
 like to use it 'backwards'.  I'm writing some base components which will
 be
 used by our application programmers and our base Panel has an onClose()
 method which will contribute javascript to a closing panel  (rendered on
 AjaxRequestTarget.prependJavascript())  What I would like to do is have a
 closing panel's children automatically call onClose().

 So I started with:

 protected final void close()
 {
   visitChildren(JumbuckPanel.class, new IVisitor()
   {
 public Object component(Component c)
 {
   ((JumbuckPanel)c).onClose();
   return IVisitor.CONTINUE_TRAVERSAL;
 }
   });
 }

 Then I realized that this had a problem - being onClose() I needed the
 children to be traversed from the bottom-up, whereas visitChildren always
 seem to go top-down.  That is, from looking at VisitChildren() in
 MarkupContainer, it goes..

 -visit this node
 -if this is a container, visitchildren recursively.

 wherease I need:

 -if this is a container, visitchildren recursively
 -visit this node.

 So originally I tried to write reverseVisitChildren() in my sublcass of
 MarkupContainer but then realized all of the access functions
 (children_size
 and children_next) are private in markupContainer and my recursive call to
 reverseVisitChildren would only work on my custom panel, not generic
 MarkupContainers, if that makes.

 Is anyone able to suggest a simple solution to this problem, as right now
 the best solution I can think of is to add that functionality to
 MarkupContainer as I think it might prove useful for other people at some
 stage also.

 Thanks,
 Dean

 --
 View this message in context:
 http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: TreeTable...how to refect a label change on TreeNode

2007-08-29 Thread Doug Leeper

After further evaluating what I need done...I don't believe I need AJAX.

The Tree Node needs to be updated to reflect a data change, i.e. name. 
However, the name change occurs in a page...not in the same page as the
tree.

Am I correct in this...no AJAX is needed since I am changing Pages?

If this is correct (no AJAX)...how to tell the nodes in the TreeTable to
update/reload their information?


-- 
View this message in context: 
http://www.nabble.com/TreeTable...how-to-refect-a-label-change-on-TreeNode-tf4300479.html#a12400148
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: VisitChildren bottom-up

2007-08-29 Thread RedFury

Thanks for the quick reply Igor.  For now I'm just going to take your
FormComponent visitor example and adapt that to my case since it looks tidy
and straightforward.  It would be nice if this functionality could somehow
find its way into markupcontainer though.

Cheers,
Dean


igor.vaynberg wrote:
 
 hrm. i have implemented a postorder traversal for formcomponents (see
 FormComponent.visitFormComponentsPostOrder) so you can either take that
 code
 and use it in your app, or we can bring it up to markupcontainer and
 generalize it.
 
 the problem is that we already have visitComponents, and having a
 visitComponentsPostOrder next to it seems a little inconsistent. what do
 other devs think?
 
 -igor
 
 
 On 8/29/07, RedFury [EMAIL PROTECTED] wrote:


 Hi all,

 I've writing a very heavily javascripted app in wicket and finding wicket
 handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
 successfully in numerous places but have a problem with a case where I'd
 like to use it 'backwards'.  I'm writing some base components which will
 be
 used by our application programmers and our base Panel has an onClose()
 method which will contribute javascript to a closing panel  (rendered on
 AjaxRequestTarget.prependJavascript())  What I would like to do is have a
 closing panel's children automatically call onClose().

 So I started with:

 protected final void close()
 {
   visitChildren(JumbuckPanel.class, new IVisitor()
   {
 public Object component(Component c)
 {
   ((JumbuckPanel)c).onClose();
   return IVisitor.CONTINUE_TRAVERSAL;
 }
   });
 }

 Then I realized that this had a problem - being onClose() I needed the
 children to be traversed from the bottom-up, whereas visitChildren always
 seem to go top-down.  That is, from looking at VisitChildren() in
 MarkupContainer, it goes..

 -visit this node
 -if this is a container, visitchildren recursively.

 wherease I need:

 -if this is a container, visitchildren recursively
 -visit this node.

 So originally I tried to write reverseVisitChildren() in my sublcass of
 MarkupContainer but then realized all of the access functions
 (children_size
 and children_next) are private in markupContainer and my recursive call
 to
 reverseVisitChildren would only work on my custom panel, not generic
 MarkupContainers, if that makes.

 Is anyone able to suggest a simple solution to this problem, as right now
 the best solution I can think of is to add that functionality to
 MarkupContainer as I think it might prove useful for other people at some
 stage also.

 Thanks,
 Dean

 --
 View this message in context:
 http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12400529
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

So it sounds like I would use something like:

final AttributeModifier ro = new AttributeModifier(readonly, true, new
Model(readonly)); 
if (email.getType() != EmailAddress.Type.OTHER)
emailLabel.add(ro);

If so, then the question becomes, how would I remove that attribute or reset
emailLabel to editable?




igor.vaynberg wrote:
 
 the entire point of disabling the component is that you do not want it to
 process submitted input and update its model. you are looking for readonly
 behavior rather then disabled i think. why not just set the readonly
 attribute on that field.
 
 -igor
 
 
 On 8/29/07, janders [EMAIL PROTECTED] wrote:


 I posted this on the Databinder forum but no one seems to know of a
 work-around so I thought I'd post it here.

 Essentially I have a FocusableTextField that gets set by a
 DropDownChoice.
 If the choice is not other then I setEnabled to false and I place the
 string value of the DropDownChoice into the FocusableTextField. However
 the
 model is not persisted when setEnabled is false.

 Here is the code:

 // list of existing emailAddresses
 final List emailTypeList =
 Arrays.asList(EmailAddress.Type.values());
 final ListView emailAddresses = new
 PropertyListView(emailAddresses) {
 @Override
 protected void populateItem(final ListItem item) {
 final EmailAddress email = (EmailAddress)
 item.getModelObject();
 final FocusableTextField emailLabel = new
 FocusableTextField(label, page);
 if (email.getType() != EmailAddress.Type.OTHER)
 emailLabel.setEnabled(false);
 item.add(emailLabel);
 item.add(new DropDownChoice(type, emailTypeList) {
 @Override
 protected boolean
 wantOnSelectionChangedNotifications() {
 return true;
 }
 @Override
 protected void onSelectionChanged(final Object
 newSelection) {
 if (newSelection == EmailAddress.Type.OTHER)
 {
 emailLabel.setEnabled(true);
 emailLabel.requestFocus();
 } else {

 emailLabel.setModelValue(newSelection.toString());
 emailLabel.setEnabled(false);
 }
 }
 });
   snip

 In this email example the dropdown choices are home, work, and
 other.
 If user selects home or work I want the value of the FocusableTextField
 to
 be home or work and I do not want the user to be able to edit the field.
 That's why I set the field's isEnabled to false. On the other hand, if
 the
 user selects other, then I set isEnabled to true so that the user can
 edit
 the field. This works properly (persists the value) because isEnabled is
 true.

 Is there a workaround for this problem or can someone recommend a
 different
 approach?

 --
 View this message in context:
 http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400575
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: VisitChildren bottom-up

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 hrm. i have implemented a postorder traversal for formcomponents (see
 FormComponent.visitFormComponentsPostOrder) so you can either take that code
 and use it in your app, or we can bring it up to markupcontainer and
 generalize it.

 the problem is that we already have visitComponents, and having a
 visitComponentsPostOrder next to it seems a little inconsistent. what do
 other devs think?

I would be +1 for generalizing it. The naming wouldn't bother me.

Eelco

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



Re: VisitChildren bottom-up

2007-08-29 Thread Igor Vaynberg
perhaps you can add an rfe into jira so we dont forget.

-igor


On 8/29/07, RedFury [EMAIL PROTECTED] wrote:


 Thanks for the quick reply Igor.  For now I'm just going to take your
 FormComponent visitor example and adapt that to my case since it looks
 tidy
 and straightforward.  It would be nice if this functionality could somehow
 find its way into markupcontainer though.

 Cheers,
 Dean


 igor.vaynberg wrote:
 
  hrm. i have implemented a postorder traversal for formcomponents (see
  FormComponent.visitFormComponentsPostOrder) so you can either take that
  code
  and use it in your app, or we can bring it up to markupcontainer and
  generalize it.
 
  the problem is that we already have visitComponents, and having a
  visitComponentsPostOrder next to it seems a little inconsistent. what do
  other devs think?
 
  -igor
 
 
  On 8/29/07, RedFury [EMAIL PROTECTED] wrote:
 
 
  Hi all,
 
  I've writing a very heavily javascripted app in wicket and finding
 wicket
  handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
  successfully in numerous places but have a problem with a case where
 I'd
  like to use it 'backwards'.  I'm writing some base components which
 will
  be
  used by our application programmers and our base Panel has an onClose()
  method which will contribute javascript to a closing panel  (rendered
 on
  AjaxRequestTarget.prependJavascript())  What I would like to do is have
 a
  closing panel's children automatically call onClose().
 
  So I started with:
 
  protected final void close()
  {
visitChildren(JumbuckPanel.class, new IVisitor()
{
  public Object component(Component c)
  {
((JumbuckPanel)c).onClose();
return IVisitor.CONTINUE_TRAVERSAL;
  }
});
  }
 
  Then I realized that this had a problem - being onClose() I needed the
  children to be traversed from the bottom-up, whereas visitChildren
 always
  seem to go top-down.  That is, from looking at VisitChildren() in
  MarkupContainer, it goes..
 
  -visit this node
  -if this is a container, visitchildren recursively.
 
  wherease I need:
 
  -if this is a container, visitchildren recursively
  -visit this node.
 
  So originally I tried to write reverseVisitChildren() in my sublcass of
  MarkupContainer but then realized all of the access functions
  (children_size
  and children_next) are private in markupContainer and my recursive call
  to
  reverseVisitChildren would only work on my custom panel, not generic
  MarkupContainers, if that makes.
 
  Is anyone able to suggest a simple solution to this problem, as right
 now
  the best solution I can think of is to add that functionality to
  MarkupContainer as I think it might prove useful for other people at
 some
  stage also.
 
  Thanks,
  Dean
 
  --
  View this message in context:
  http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12400529
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Igor Vaynberg
create a dynamic model instead of new Model(readonly)

-igor


On 8/29/07, janders [EMAIL PROTECTED] wrote:


 So it sounds like I would use something like:

 final AttributeModifier ro = new AttributeModifier(readonly, true, new
 Model(readonly));
 if (email.getType() != EmailAddress.Type.OTHER)
 emailLabel.add(ro);

 If so, then the question becomes, how would I remove that attribute or
 reset
 emailLabel to editable?




 igor.vaynberg wrote:
 
  the entire point of disabling the component is that you do not want it
 to
  process submitted input and update its model. you are looking for
 readonly
  behavior rather then disabled i think. why not just set the readonly
  attribute on that field.
 
  -igor
 
 
  On 8/29/07, janders [EMAIL PROTECTED] wrote:
 
 
  I posted this on the Databinder forum but no one seems to know of a
  work-around so I thought I'd post it here.
 
  Essentially I have a FocusableTextField that gets set by a
  DropDownChoice.
  If the choice is not other then I setEnabled to false and I place the
  string value of the DropDownChoice into the FocusableTextField. However
  the
  model is not persisted when setEnabled is false.
 
  Here is the code:
 
  // list of existing emailAddresses
  final List emailTypeList =
  Arrays.asList(EmailAddress.Type.values());
  final ListView emailAddresses = new
  PropertyListView(emailAddresses) {
  @Override
  protected void populateItem(final ListItem item) {
  final EmailAddress email = (EmailAddress)
  item.getModelObject();
  final FocusableTextField emailLabel = new
  FocusableTextField(label, page);
  if (email.getType() != EmailAddress.Type.OTHER)
  emailLabel.setEnabled(false);
  item.add(emailLabel);
  item.add(new DropDownChoice(type, emailTypeList)
 {
  @Override
  protected boolean
  wantOnSelectionChangedNotifications() {
  return true;
  }
  @Override
  protected void onSelectionChanged(final Object
  newSelection) {
  if (newSelection == EmailAddress.Type.OTHER
 )
  {
  emailLabel.setEnabled(true);
  emailLabel.requestFocus();
  } else {
 
  emailLabel.setModelValue(newSelection.toString());
  emailLabel.setEnabled(false);
  }
  }
  });
snip
 
  In this email example the dropdown choices are home, work, and
  other.
  If user selects home or work I want the value of the FocusableTextField
  to
  be home or work and I do not want the user to be able to edit the
 field.
  That's why I set the field's isEnabled to false. On the other hand, if
  the
  user selects other, then I set isEnabled to true so that the user can
  edit
  the field. This works properly (persists the value) because isEnabled
 is
  true.
 
  Is there a workaround for this problem or can someone recommend a
  different
  approach?
 
  --
  View this message in context:
 
 http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400575
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I know how to add the attribute, I just don't know how to later remove it
once added.
- JA


Eelco Hillenius wrote:
 
 So it sounds like I would use something like:

 final AttributeModifier ro = new AttributeModifier(readonly, true, new
 Model(readonly));
 if (email.getType() != EmailAddress.Type.OTHER)
 emailLabel.add(ro);

 If so, then the question becomes, how would I remove that attribute or
 reset
 emailLabel to editable?
 
 Always add the attribute modifier, override isEnabled and let that
 return true if you want to add the attribute, and false if you don't.
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400705
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
 I know how to add the attribute, I just don't know how to later remove it
 once added.

Like I said, override isEnabled in your attribute modifier. When that
returns false, the attribute won't be added. For normal requests,
where a page is rendered everytime again, it simply doesn't show up.
For ajax request, you'll have to add to the ajaxrequest for
re-rendering and the attribute should disappear as well.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I don't understand.  Are you saying that I should use setEnabled(false) or
are you saying that I should use:

  final AttributeModifier rof = new AttributeModifier(readonly, false, new
Model(readonly));

Either way this doesn't seem to work.

- JA



Eelco Hillenius wrote:
 
 I know how to add the attribute, I just don't know how to later remove it
 once added.
 
 Like I said, override isEnabled in your attribute modifier. When that
 returns false, the attribute won't be added. For normal requests,
 where a page is rendered everytime again, it simply doesn't show up.
 For ajax request, you'll have to add to the ajaxrequest for
 re-rendering and the attribute should disappear as well.
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400938
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
 I don't understand.  Are you saying that I should use setEnabled(false) or
 are you saying that I should use:

   final AttributeModifier rof = new AttributeModifier(readonly, false, new
 Model(readonly));

new AttributeModifier(readonly, true, new Model(readonly) {
  public boolean isEnabled(Component c) {
return shouldTheAttributeBeAdded();
  }
}

and don't add the attribute in your markup.

Eelco

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