Re: [Wicket-user] setVesible for the component after onEvent

2007-07-17 Thread James Law
Here's the pieces that I used. Sounds like Igor's approach is better, 
but here it is if you can't do it that way.
in your css:
.invisible{
display: none;
  }
.visible{
display: inline;
  }



Now, the component side (proficiencyChoice is a dropdown)

proficiencyChoice.setOutputMarkupId(true);
//define the model that will return the stylesheet 
(visible/not visible) for the select box proficiencyChoice
IModel modelForStylesheet = new Model()
 {
 public Object getObject( Component c )
 {
 if (mdl.isSelected())
 return visible;
 else
 return invisible;
 }
 };
 proficiencyChoice.add( new AttributeModifier (  class, 
true, modelForStylesheet  ));
rvitem.add(proficiencyChoice);
--James

kenixwong wrote:
 I am a wicket newbie too:)..

 can i know how u used CSS to control it ? can give any idea to me as well? 

 thanks ar



 James Law wrote:
   
 I am a wicket newbie, but when I had a similar thing I wanted to do, I 
 just used CSS to make the component invisible/visible (display: none). 
 The ajax behavior just changed the style. I am pretty certain setVisible 
 is not the best/easiest way to handle this.

 James

 kenixwong wrote:
 
 I'd like to be able to click a set of radio box and then make a component
 visible or invisible using Ajax or else. Is that any idea for it? 

 As i read the radioGroup and radioChoice, can i know what is the
 different
 btw both? 

 Here is my partial code:
 categoryField = new TextField(category);
 categoryField.setOutputMarkupId(true);

 final RadioGroup radioGroup = new RadioGroup(RadioGroup, new Model());
 listView = new ListView(ListView, optionClassList)
 {
 protected void populateItem (final ListItem item)
 {
 Radio radio = new Radio(radio, item.getModel());
 radio.add (new AjaxEventBehavior(onclick)
  {
  protected void onEvent (AjaxRequestTarget target)
 {
 if(item.getModelObject ().equals(abc)){
 target.addComponent 
 (departmentChoice.setVisible(false));
  }else{
 target.addComponent 
 (categoryField.setVisible(false));
   }
 }
  });
 item.add(radio);
 item.add(new Label(label, (String)item.getModelObject ()));
 }
 };
 radioGroup.add (listView);
 add(radioGroup);
 

 It work, but oaly the first time. Mean after i clicked on the radio few
 times, it nothing happen. 

 thanks for help... 
   
   
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


 

   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] setVesible for the component after onEvent

2007-07-16 Thread James Law
I am a wicket newbie, but when I had a similar thing I wanted to do, I 
just used CSS to make the component invisible/visible (display: none). 
The ajax behavior just changed the style. I am pretty certain setVisible 
is not the best/easiest way to handle this.

James

kenixwong wrote:
 I'd like to be able to click a set of radio box and then make a component
 visible or invisible using Ajax or else. Is that any idea for it? 

 As i read the radioGroup and radioChoice, can i know what is the different
 btw both? 

 Here is my partial code:
 categoryField = new TextField(category);
 categoryField.setOutputMarkupId(true);

 final RadioGroup radioGroup = new RadioGroup(RadioGroup, new Model());
 listView = new ListView(ListView, optionClassList)
 {
   protected void populateItem (final ListItem item)
   {
   Radio radio = new Radio(radio, item.getModel());
   radio.add (new AjaxEventBehavior(onclick)
{
protected void onEvent (AjaxRequestTarget target)
   {
   if(item.getModelObject ().equals(abc)){
   target.addComponent 
 (departmentChoice.setVisible(false));
}else{
   target.addComponent 
 (categoryField.setVisible(false));
 }
   }
  });
   item.add(radio);
   item.add(new Label(label, (String)item.getModelObject ()));
   }
 };
 radioGroup.add (listView);
 add(radioGroup);
   

 It work, but oaly the first time. Mean after i clicked on the radio few
 times, it nothing happen. 

 thanks for help... 
   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] stateless wicket?

2007-07-13 Thread James Law
Thanks Eelco for the response!
I appreciate the update. As I am trying to sell wicket for use on a lot 
of applications, I do see the knee-jerk you describe. I am not concerned 
about memory usage, but more about the ability to persist it (via 
session persistence) efficiently, because I work in health care, a lot 
of people here are all about 99..999 availability, and of course 
appserver clustering always comes up in this discussion.
I am optimistic that having a reasonably sized page history, and using 
idetachable models should keep things to a reasonable size. Do you have 
any experience using session persistence with a medium size app (say 
50-100 pages)? eg what  session size can we expect?

Thanks again

James

Eelco Hillenius wrote:
 On 7/12/07, Johan Compagner [EMAIL PROTECTED] wrote:
   
 the real client side wicket , so storing the data in the browser didn't make
 it
 and i don't think it will make it very soon because no current committer
 really sees
 the big benefit of this approach.
 

 Yep. We played with it a while ago and we have a fair idea how to do
 it but we felt it wasn't worth the energy to keep working on it.

 There are disadvantages to client side state saving:
 * First of all you'd lose the secure-by-default model you have with
 Wicket. For instance, imagine having a detail panel for a product. If
 you pass around objects (or ids) on the server side, there is no way a
 client could get access to the details he/ she is not supposed to see.
 When passing state via the client, you would always have to check the
 incoming state for misuse. This is actually a pretty strong feature
 Wicket has over most other frameworks. The other side of this is that
 if you want to have your whole app bookmarkable, you'll have to do
 some extra work :)
 * Secondly, synchronously serializing, encoding and sending the state
 to the client eats processor time and bandwith. The size of the
 serialized, encoded state will be larger than than on the server. Even
 if we do something really smart, chances are we're sending *at least*
 20KB to the client on each request. Maybe even more. We think using
 RAM is way more favorible.
 * Last but not least, GETs have to be made POSTs or you'd have to run
 the risk that state doesn't fit a request.

 Of course, there are advantages to client state saving as well:
 * No worries about RAM, at least not because of Wicket[1].
 * Pages are recoverable by default. Even when a session times out, you
 could let the client pick up where he/ she left.
 * No need for session affinity[2]

 Conclussion: we don't support client side state saving currently, and
 we don't feel it's a priority at this time. However, if someone does
 feel it is important, we'd be more than happy to look at patches. I
 think the easiest way to achieve this is to implement it as a
 IResponseFilter and a custom session store.

 Eelco


 [1] worrying about using RAM is the typical knee-jerk reaction of
 people. Before worrying, calculate how many concurrent sessions you'll
 have to support, and how much RAM you'd need for that.
 [2] this increases your options when it comes to the way you cluster,
 though not using session affinity can have disadvantages as well (for
 instance when using ORM caches).

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] stateless wicket?

2007-07-11 Thread James Law
Hi,

On the features page of the wicket webpage, there is some indication 
that a stateless, client side wicket will appear at some point. i guess 
eliminating the session usage that typically occurs with wicket. Could 
someone elaborate on how this will be accoomplished, and if this is a 
1.3 feature?

Thanks
James

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] dynamic component generation with no placeholder in markup/html

2007-06-24 Thread James Law
Hi,
I am currently evaluating using wicket on my next project. So far I am 
really impressed with wicket!

Quick question- After using it for a few days, it seems there must 
always be items in the markup(html) for each associated component in a 
webpage java file. In some screens we have built in the past, due to the 
complexity, the widgets are database driven. That is to say, the number 
of select boxes, is driven off a db. It is more complicated than this, 
but basically in struts, we would use nested beans with a lot of nasty 
conditional logic so there would not need a static placeholder in the 
.html file. (jsp).

Is this possible to do with wicket?

Thanks
James

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user