Re: pannels with diffrent width and height

2009-08-17 Thread burnst...@burnstone.ch

Gerald Fernando schrieb:

i used table but it will not be placed in the full page even i put table
height and width = 100%
if possible please explain little bit about

div with CSS float: etc. in the page template.


div with CSS float means, that you use the float: CSS attribute to 
layout the div elements, like this:


htmlbody
div style=background-color:red; float:left;width:30%left/div
div style=background-color:blue; float: right;width:30%right/div
div style=background-color:greencenter/div
/body/html

You can find more information about that here:
* http://webdesign.about.com/od/advancedcss/a/aa010107.htm
* http://www.w3schools.com/css/pr_class_float.asp


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



Problems with CheckGroup

2009-08-03 Thread burnst...@burnstone.ch

Hi all

I'm trying to use CheckGroup, but encounter some problems. First, my code:

class NameValueListViewT extends ParameterValueProvider? extends 
ListViewT {


U void displayItem(ListItemT listItem, ParameterValueProviderU 
parameter) {

...
ListU enumItems = new ArrayListU(parameter.getEnumCodes());
addMultiSelectPanelListItem(listItem, enumItems, labelModel, new 
PropertyModelCollectionU(parameter,

 valueList), parameter);
}

U void addMultiSelectPanelListItem(ListItemT listItem,
   ListU enumItems, IModelString labelModel,
   IModelCollectionU model,
   final ParameterValueProviderU parameter) {

  CheckGroupU comp = new CheckGroupU(value);
  comp.setType(parameter.getType());
  comp.setRequired(!parameter.isOptional());
  comp.setLabel(labelModel);

  ListViewU enumListView = new ListViewU(values, enumItems) {
 @Override
 protected void populateItem(ListItemU item) {
item.add(new CheckU(check, item.getModel()));
item.add(new Label(value,
   item.getDefaultModelObjectAsString()));
 }
  };
  enumListView.setReuseItems(true);
  comp.add(enumListView);

  // Add panel
  MultiCheckBoxPanelU panelMCB = new
   MultiCheckBoxPanelU(COMPONENT_ID, comp);
  listItem.add(panelMCB);
}
}

ParameterValueProvider has the mehtods {get,set}Value[List].

The html looks like this:
html xmlns:wicket
wicket:panel
   span wicket:id=value
  span wicket:id=values
 input type=checkbox wicket:id=check /
 span wicket:id=value/span
 br/
  /span
   /span
/wicket:panel
/html

So far, so good. Values are getting displayed and the correct check 
boxes are selected. However, when submitting the form, I get an exception:


---
WicketMessage: Method onFormSubmitted of interface 
org.apache.wicket.markup.html.form.IFormSubmitListener targeted at 
component [MarkupContainer [Component id = cardDetailForm]] threw an 
exception


Root cause:

java.lang.ClassCastException: java.lang.String
at 
org.apache.wicket.markup.html.form.CheckGroup.updateModel(CheckGroup.java:171)
at 
org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:225)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:514)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493)
at 
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:465)
at 
org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:2051)
at 
org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:2019)

at org.apache.wicket.markup.html.form.Form.process(Form.java:984)
at org.apache.wicket.markup.html.form.Form.process(Form.java:911)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
at 
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1241)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at 
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
at 
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
at org.mortbay.http.HttpServer.service(HttpServer.java:879)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
at