Re: Wicket 1.4.5 : Spring integration problem?

2010-01-20 Thread Alex Objelean

You could try the wicket-spring library. It allows a very nice integration
using a SpringBean annotation, similar to Autowired from spring.

Alex


Umanga wrote:
 
 Thanks Pierre,
 
 yes,that was a problem with web.xml ,
 
 I forgot to change the filter setting :
 
 init-param
 param-nameapplicationFactoryClassName/param-name
 
 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
 /init-param
 
 Now everything works fine.
 
 Pierre Goupil wrote:
 Maybe it comes from the web.xml : can we ses it, please?

 Regards,

 Pierre


 On Wed, Jan 20, 2010 at 7:41 AM, Ashika Umanga Umagiliya 
 auma...@biggjapan.com wrote:

   
 Greetings all,

 I followed the easy 'Application Object Approach' to integrate Spring
 with
 my Wicket app. (
 http://cwiki.apache.org/WICKET/spring.html#Spring-ApplicationObjectApproach)

 In my application class :

 public class NihonBareApplication extends WebApplication
 { private CommonService commonService;
   public CommonService getCommonService() {
   return commonService;
   }
   public void setCommonService(CommonService cs) {
 this.commonService = cs; }
 }


 And in my pages :

 public class FamiliesPage extends WebPage {
  public CommonService getCommonService(){
   System.out.println(+
 ((NihonBareApplication)getApplication()).getCommonService());
   return
 ((NihonBareApplication)getApplication()).getCommonService();
   }
 }


 But eventhough the bean injected into 'NihonbareApplication' object, the
 getCommonService() method of my page returns null for the bean.

 What could be the problem?

 Thanks in advance.

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


 


   
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Wicket-1.4.5-%3A-Spring-integration-problem--tp27237445p27238481.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



DataTable : Link with dynamically chaning label

2010-01-20 Thread Ashika Umanga Umagiliya

Greetings ,

I have implemented  'AbstractColumn' to display list of 'id's and when 
user click on a 'id',it should take to the Page relevant to that 'id'.


But in the application, the tablecells just display [Cell] and I want 
to display an anchor (a) with the dynamically changing label .

How can i archive this?

Thanks in advance.

populateItem() method of AbstractColumn :

public void populateItem(ItemICellPopulatorFamily cellitem,String 
cellid, IModelFamily model){


 final Family f = model.getObject();
 String id=f.getFamilyId(); //what to display this is an anchor

Link alink = new Link(cellid) {
  @Override
   public void onClick() {
   setResponsePage(new SubFamiliesPage(f));
   }
};
cellitem.add(alink);
}

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



Re: Wicket 1.4.5 : Spring integration problem?

2010-01-20 Thread Pierre Goupil
+1 with Alex. I'm glad to help you, though :-)


On Wed, Jan 20, 2010 at 9:55 AM, Alex Objelean alex_objel...@yahoo.comwrote:


 You could try the wicket-spring library. It allows a very nice integration
 using a SpringBean annotation, similar to Autowired from spring.

 Alex


 Umanga wrote:
 
  Thanks Pierre,
 
  yes,that was a problem with web.xml ,
 
  I forgot to change the filter setting :
 
  init-param
  param-nameapplicationFactoryClassName/param-name
 
 
 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
  /init-param
 
  Now everything works fine.
 
  Pierre Goupil wrote:
  Maybe it comes from the web.xml : can we ses it, please?
 
  Regards,
 
  Pierre
 
 
  On Wed, Jan 20, 2010 at 7:41 AM, Ashika Umanga Umagiliya 
  auma...@biggjapan.com wrote:
 
 
  Greetings all,
 
  I followed the easy 'Application Object Approach' to integrate Spring
  with
  my Wicket app. (
 
 http://cwiki.apache.org/WICKET/spring.html#Spring-ApplicationObjectApproach
 )
 
  In my application class :
 
  public class NihonBareApplication extends WebApplication
  { private CommonService commonService;
public CommonService getCommonService() {
return commonService;
}
public void setCommonService(CommonService cs) {
  this.commonService = cs; }
  }
 
 
  And in my pages :
 
  public class FamiliesPage extends WebPage {
   public CommonService getCommonService(){
System.out.println(+
  ((NihonBareApplication)getApplication()).getCommonService());
return
  ((NihonBareApplication)getApplication()).getCommonService();
}
  }
 
 
  But eventhough the bean injected into 'NihonbareApplication' object,
 the
  getCommonService() method of my page returns null for the bean.
 
  What could be the problem?
 
  Thanks in advance.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Wicket-1.4.5-%3A-Spring-integration-problem--tp27237445p27238481.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Ad augusta per angusta

Des résultats grandioses par des voies étroites


Re: Objects.cloneModel() on google app engine

2010-01-20 Thread Pedro Santos
Hi Lionel, I had the same issue, but calling the setDefaultModelObject, that
call methods on IPageVersionManager at some point. In my case, the solution
was simple change that call for comp.getDefaultModel().setObject()

On Tue, Jan 19, 2010 at 11:32 PM, Lionel Port lionel.p...@gmail.com wrote:

 Hi,

 I'm using wicket on google app engine and am having trouble with the
 sort link headers on data tables.

 It looks like when a sort link is clicked the method
 Objects.cloneModel() is called. This creates a
 ReplaceableObjectOutputStream wrapper around the ObjectOutputStream to
 do the copy using serialization/deserialization. Unfortunately this
 class tries to call enableReplace on the the underlying
 ObjectOutputStream so that it can replace component objects with just
 their name (to stop component hierachy being serialized).

 It seams the google app engine security permissions deny calling
 enableReplace on the ObjectOutputStream.

 Does any one know of a work around to get the sort links working?

 regards,
 Lionel

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Objects.cloneModel() on google app engine

2010-01-20 Thread Lionel Port
The gae security restriction looks pointless because
Objects.cloneModel is just using a ByteArrayOutputStream (why should
there be restrictions on that?) but because the Objects calls are all
static I can't override the method with a working clone method also
because the OrderByLink.sort method is final I can't fix there either.

As a workaround for any one who is interested, it looks like
cloneModel is only used in this case if the component is versioned so
I set called setVersion(false) on the orderByLink and it avoids this
problem area.

On Wed, Jan 20, 2010 at 12:32 PM, Lionel Port lionel.p...@gmail.com wrote:
 Hi,

 I'm using wicket on google app engine and am having trouble with the
 sort link headers on data tables.

 It looks like when a sort link is clicked the method
 Objects.cloneModel() is called. This creates a
 ReplaceableObjectOutputStream wrapper around the ObjectOutputStream to
 do the copy using serialization/deserialization. Unfortunately this
 class tries to call enableReplace on the the underlying
 ObjectOutputStream so that it can replace component objects with just
 their name (to stop component hierachy being serialized).

 It seams the google app engine security permissions deny calling
 enableReplace on the ObjectOutputStream.

 Does any one know of a work around to get the sort links working?

 regards,
 Lionel


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



Wicket mentioned in Maven book...

2010-01-20 Thread nino martinez wael
Hi Guys

Just wanted to tell that wicket are mentioned here as a noticeable
archetype ( the quickstart )

http://www.sonatype.com/books/mvnref-book/reference/archetype-sect-third-party.html


And good words from the book :

Apache Wicket is a component-oriented web framework which focused on
managing the server-side state of a number of components written in
Java and simple HTML. Where a framework like Spring MVC or Ruby on
Rails focuses on merging objects within a request with a series of
page templates, Wicket is very strongly focused on capturing
interactions and page structure in a series of POJO Java classes. In
an age where hype-driven tech media outlets are proclaiming the Death
of Java, Wicket is a contrarian approach to the design and assembly
of web applications.

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



Re: Objects.cloneModel() on google app engine

2010-01-20 Thread Pedro Santos
Thank u! that will work for me too

On Wed, Jan 20, 2010 at 8:21 AM, Lionel Port lionel.p...@gmail.com wrote:

 The gae security restriction looks pointless because
 Objects.cloneModel is just using a ByteArrayOutputStream (why should
 there be restrictions on that?) but because the Objects calls are all
 static I can't override the method with a working clone method also
 because the OrderByLink.sort method is final I can't fix there either.

 As a workaround for any one who is interested, it looks like
 cloneModel is only used in this case if the component is versioned so
 I set called setVersion(false) on the orderByLink and it avoids this
 problem area.

 On Wed, Jan 20, 2010 at 12:32 PM, Lionel Port lionel.p...@gmail.com
 wrote:
  Hi,
 
  I'm using wicket on google app engine and am having trouble with the
  sort link headers on data tables.
 
  It looks like when a sort link is clicked the method
  Objects.cloneModel() is called. This creates a
  ReplaceableObjectOutputStream wrapper around the ObjectOutputStream to
  do the copy using serialization/deserialization. Unfortunately this
  class tries to call enableReplace on the the underlying
  ObjectOutputStream so that it can replace component objects with just
  their name (to stop component hierachy being serialized).
 
  It seams the google app engine security permissions deny calling
  enableReplace on the ObjectOutputStream.
 
  Does any one know of a work around to get the sort links working?
 
  regards,
  Lionel
 

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




-- 
Pedro Henrique Oliveira dos Santos


Re: DataTable : Link with dynamically chaning label

2010-01-20 Thread Ernesto Reinaldo Barreiro
Did you search the list? A very similar question was asked just a few days
ago...

http://old.nabble.com/How-to-get-a-cell-work-as-a-link-in-AjaxFallbackDefaultDataTable-td27161378.html

Regards,

Ernesto

On Wed, Jan 20, 2010 at 10:10 AM, Ashika Umanga Umagiliya 
auma...@biggjapan.com wrote:

 Greetings ,

 I have implemented  'AbstractColumn' to display list of 'id's and when user
 click on a 'id',it should take to the Page relevant to that 'id'.

 But in the application, the tablecells just display [Cell] and I want to
 display an anchor (a) with the dynamically changing label .
 How can i archive this?

 Thanks in advance.

 populateItem() method of AbstractColumn :

 public void populateItem(ItemICellPopulatorFamily cellitem,String
 cellid, IModelFamily model){

  final Family f = model.getObject();
  String id=f.getFamilyId(); //what to display this is an anchor

 Link alink = new Link(cellid) {
  @Override
   public void onClick() {
   setResponsePage(new SubFamiliesPage(f));
   }
 };
 cellitem.add(alink);
 }

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




JBoss 5, JaaS, Wicket and ThreadLocal

2010-01-20 Thread Alexander Elsholz
Hi,

im confused;-)

With jboss 5 the security-client interceptor uses the SecurityAssociation
Thread-Local variables to get the principal and credentials and put them into
the rmi-call. the set will perform in login. 

hmm, thread local, multi-user-plattform, webcontainer - how should this work?

ok, there is a possibility to use an inheritance-thread-local - but that doesnt
help. the wicket-parent-thread isn't the thread who performs the login.

so how could that work?

now we set the thread-local-variable in overridden newrequest-opertaion of
webapplication. after login we save principal and credentials in session. when a
new wicket request will created (i think wicket creates a new thread per
request) we push the session-variables into the thread-local.

that works now - but has anybody a better idea?

alex


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



Re: Adding a form field at run time... is it possible?

2010-01-20 Thread Alexander Elsholz
hi,

use a listview. the model contains wicket-components that you put on listview.
if you have different html-elements introduce a wrapper: TextfieldWrapper,
SpanWrapper etc what are panels that wrapps the component.

alex






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



Custom DropDownChoice with css style

2010-01-20 Thread Alexander Monakhov
Hi, guys.

I'm trying to implement DropDownChoice that could render select tag with
possiblity to add style with css.
What do I mean:
select tag rendering is OS dependent. So, plain select element is always
ugly. There is no possibility to change arrow, or border of drop down list
only with css.
One of the ways to resolve this problem is to add span tag before select
tag to show currently selected value, then apply to it desired background
and any desired styles and give select tag's opacity zero value. So, drop
down menu would appear any time user clicks on span element. To push
selected value to span onChange method for select tag is appropriated.

So, I've created this class:
code
public class StyledDropDownChoiceT extends DropDownChoiceT {


/*Here goes constructors and StyleDropDownSpan is added as behavior. */


@Override
protected void onComponentTag( ComponentTag tag ) {
tag.put( onChange, var span = document.getElementById(' +
getMarkupId()
+ -span'); var select = document.getElementById(' +
getMarkupId()
+  '); span.innerHTML = select.options[
select.selectedIndex ].innerHTML; );
//todo move javascript output to renderJavascript( CharSequence,
String )

super.onComponentTag( tag );
}

private class StyledDropDownSpan extends AbstractBehavior {

@Override
public void onComponentTag( Component component, ComponentTag tag )
{
replaceComponentTagBody( getMarkupStream(), tag,
span class=\combobox\ id=\ +
component.getMarkupId()
+ -span\ + component.getDefaultModelObjectAsString()

+ /span );
super.onComponentTag( component, tag );
}

}

}
/code

So, this code works fine with usual drop down choices. But, when I'm trying
to update list of choice via AJAX call, another span element appear on the
page. So, I get that span tag is added any time dropdownchoice is
rendered. Could you help me to resolve this issue?

Best regards, Alexander.


Re: Image name changing in dev server

2010-01-20 Thread VGoel
It is capital jpg. But I also think it might be in the same line. Its not 
finding it and hence may be changing to non-localized.

Thanks for the tips.

Thanks and Regards,
Vandana Goel



Edward Zarecor edw...@indeterminate.org 
01/19/2010 08:21 PM
Please respond to
users@wicket.apache.org


To
users@wicket.apache.org
cc

Subject
Re: Image name changing in dev server






I notice that you are using capitalized extensions.  Are local and dev
instances on different operating systems?  Is the extension of the
file jpg or JPG?

My stab in the dark is that in dev you get a broken image because
neither the localized or non-localized images are found.  You are
seeing that the name has been changed and are mis-diagnosing the root
cause.  This is just a stab in the dark

Ed.

On Tue, Jan 19, 2010 at 2:07 PM,  vg...@osc.state.ny.us wrote:
 We do not need any naming rules. Thats why I am confused.

 My code is this inside a reating view.

 Image image = new Image(circle+i, /images/circlegray.JPG)

 In local enviornment it works fine but in Dev Server image name is 
changed
 with us local appended.

 Thanks and Regards,
 Vandana Goel



 Pedro Santos pedros...@gmail.com
 01/19/2010 01:58 PM
 Please respond to
 users@wicket.apache.org


 To
 users@wicket.apache.org
 cc

 Subject
 Re: Image name changing in dev server






 You can use an ResourceReference to implement any naming rule you need.

 On Tue, Jan 19, 2010 at 4:51 PM, vg...@osc.state.ny.us wrote:

 Is it expected behaviour in wicket. Why wicket is changing the name of
 the
 image ?

 Thanks and Regards,
 Vandana Goel



 Igor Vaynberg igor.vaynb...@gmail.com
 01/19/2010 01:31 PM
 Please respond to
 users@wicket.apache.org


 To
 users@wicket.apache.org
 cc

 Subject
 Re: Image name changing in dev server






 even though the name of the image is changed to _en_US the original
 image should still be tried if wicket cannot find the more specific
 one. please debug and see where it goes wrong.

 -igor

 On Tue, Jan 19, 2010 at 9:49 AM,  vg...@osc.state.ny.us wrote:
  All our other images works fine in dev server. In local environment
 image
  in wizard also works but not in dev.
 
  The name of image is change from circlegray.JPG to
 circlegray_en_US.JPG.
  Its happening in wizard component only.
 
  Our environment is Websphere 6.1 and we are using Wicket Servlet.
 
  Any help will be appreciated.
 
  Thanks and Regards,
  Vandana Goel
 
 
 
  Notice: This communication, including any attachments, is intended
 solely
  for the use of the individual or entity to which it is addressed. 
This
  communication may contain information that is protected from
 disclosure
  under State and/or Federal law. Please notify the sender immediately
 if
  you have received this communication in error and delete this email
 from
  your system. If you are not the intended recipient, you are requested
 not
  to disclose, copy, distribute or take any action in reliance on the
  contents of this information.

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






 Notice: This communication, including any attachments, is intended
 solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email 
from
 your system. If you are not the intended recipient, you are requested
 not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.




 --
 Pedro Henrique Oliveira dos Santos





 Notice: This communication, including any attachments, is intended 
solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested 
not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.

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






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, 

Re: Wicket mentioned in Maven book...

2010-01-20 Thread nmelen...@getsense.com.ar
cool!

On Wed, Jan 20, 2010 at 7:22 AM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Hi Guys

 Just wanted to tell that wicket are mentioned here as a noticeable
 archetype ( the quickstart )


 http://www.sonatype.com/books/mvnref-book/reference/archetype-sect-third-party.html


 And good words from the book :

 Apache Wicket is a component-oriented web framework which focused on
 managing the server-side state of a number of components written in
 Java and simple HTML. Where a framework like Spring MVC or Ruby on
 Rails focuses on merging objects within a request with a series of
 page templates, Wicket is very strongly focused on capturing
 interactions and page structure in a series of POJO Java classes. In
 an age where hype-driven tech media outlets are proclaiming the Death
 of Java, Wicket is a contrarian approach to the design and assembly
 of web applications.

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




javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Steve Whitson

Hi,

I'm new to wicket, and am working on my first app.  Great alternative to 
other WebUI frameworks!


I've added a link to my panel using this code:

   Link deleteReportLink = new Link( deletereport ) {
   @Override
   public void onClick() {
   System.out.println(deleting report );
   service.deleteReport( selectedReport );
   }
   };
  
   add( deleteReportLink );


   // add a confirmation to the Delete Report operation
   deleteReportLink.add(
   new SimpleAttributeModifier( onclick, return confirm( 
'Are you sure?'); )

   );

Here's the markup:

   a href=# wicket:id=deletereportDelete Report/a
   !--  input type=button wicket:id=deletereport value=Delete 
Report / --
   !-- button type=button wicket:id=deletereportDelete 
Report/button  --


In the markup, when I use an 'a' tag the javascript confirmation dialog 
works fine along with the onClick() override.  When I use it with either 
of the (commented out) button inputs, the dialog appears, but the 
'onClick()' override is never executed.


I'd much rather this work with a button and not a hyperlink.

Any ideas or help is greatly appreciated.
   -Steve



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



Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Fatih Mehmet Ucar
AttributeAppender should solve your problem.

fmu

2010/1/20 Steve Whitson steven.whit...@gmail.com:
 Hi,

 I'm new to wicket, and am working on my first app.  Great alternative to
 other WebUI frameworks!

 I've added a link to my panel using this code:

       Link deleteReportLink = new Link( deletereport ) {
           @Override
           public void onClick() {
               System.out.println(deleting report );
               service.deleteReport( selectedReport );
           }
       };
         add( deleteReportLink );

   // add a confirmation to the Delete Report operation
   deleteReportLink.add(
           new SimpleAttributeModifier( onclick, return confirm( 'Are you
 sure?'); )
       );

 Here's the markup:

   a href=# wicket:id=deletereportDelete Report/a
   !--  input type=button wicket:id=deletereport value=Delete Report
 / --
   !-- button type=button wicket:id=deletereportDelete Report/button
  --

 In the markup, when I use an 'a' tag the javascript confirmation dialog
 works fine along with the onClick() override.  When I use it with either of
 the (commented out) button inputs, the dialog appears, but the 'onClick()'
 override is never executed.

 I'd much rather this work with a button and not a hyperlink.

 Any ideas or help is greatly appreciated.
   -Steve



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



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



dropdown issue

2010-01-20 Thread chinedu efoagui
Hello , I have a class PersonnelrecordsDepartment
 with the following fields with corresponding getters and setters
   private java.lang.Integer id;
   private java.lang.String departmentname;
   private java.lang.Integer parentid;

I left out the getters and setters . Any the field parentid can refer
to an existing department like a recursive stuff like having a self
foreign key
Anyway the problem is that i have a dropdownlchoice for the form
code
public class DepartmentDropDownChoice extends DropDownChoice {

@SpringBean(name=IHRService)
private  IHRService dao;

*//**
 *
 * @param id
 * @param model
 */
public DepartmentDropDownChoice(String id,final IModel model){

super(id,model);
final ChoiceRenderer renderer = new
ChoiceRenderer(departmentname, id);

setChoiceRenderer(renderer);
ListPersonnelrecordsDepartment departments=Collections.EMPTY_LIST;
try {
   departments = dao.getPersonnelrecordsDepartmentList();
} catch (GenericBusinessException ex) {

Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE,
null, ex);
}
setChoices(titles);
}
/code

and it gives this error anytime i try to save the personneldepartment object
code
2010-01-20 16:12:07,745 ERROR [org.apache.wicket.RequestCycle] -
Cannot format given Object as a Number
java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.text.DecimalFormat.format(DecimalFormat.java:487)
at java.text.Format.format(Format.java:140)
at 
org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111)
at 
org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85)
at 
org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1107)
at 
org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:588)
at 
org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136)
at 
org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169)
at 
org.apache.wicket.Component.setDefaultModelObject(Component.java:3052)
at 
org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168)
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.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 
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
at 
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)

/code

i think it has something to do with the conversion. but how do i
convert it again??
How can i solve this problem???

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



Re: dropdown issue

2010-01-20 Thread Jonas
not sure if that's the problem, but shouldn't

setChoices(titles);

be

setChoices(departments);




On Wed, Jan 20, 2010 at 4:14 PM, chinedu efoagui chinedub...@gmail.com wrote:
 Hello , I have a class PersonnelrecordsDepartment
  with the following fields with corresponding getters and setters
   private java.lang.Integer id;
   private java.lang.String departmentname;
   private java.lang.Integer parentid;

 I left out the getters and setters . Any the field parentid can refer
 to an existing department like a recursive stuff like having a self
 foreign key
 Anyway the problem is that i have a dropdownlchoice for the form
 code
 public class DepartmentDropDownChoice extends DropDownChoice {

   �...@springbean(name=IHRService)
    private  IHRService dao;

 */    /**
     *
     * @param id
     * @param model
     */
    public DepartmentDropDownChoice(String id,final IModel model){

        super(id,model);
        final ChoiceRenderer renderer = new
 ChoiceRenderer(departmentname, id);

        setChoiceRenderer(renderer);
        ListPersonnelrecordsDepartment departments=Collections.EMPTY_LIST;
        try {
           departments = dao.getPersonnelrecordsDepartmentList();
        } catch (GenericBusinessException ex) {
            
 Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE,
 null, ex);
        }
        setChoices(titles);
    }
 /code

 and it gives this error anytime i try to save the personneldepartment object
 code
 2010-01-20 16:12:07,745 ERROR [org.apache.wicket.RequestCycle] -
 Cannot format given Object as a Number
 java.lang.IllegalArgumentException: Cannot format given Object as a Number
        at java.text.DecimalFormat.format(DecimalFormat.java:487)
        at java.text.Format.format(Format.java:140)
        at 
 org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111)
        at 
 org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85)
        at 
 org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1107)
        at 
 org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:588)
        at 
 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136)
        at 
 org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169)
        at 
 org.apache.wicket.Component.setDefaultModelObject(Component.java:3052)
        at 
 org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168)
        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.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 
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
        at 
 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
        at 
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)

 /code

 i think it has something to do with the conversion. but how do i
 convert it again??
 How can i solve this problem???

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



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



Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Steve Whitson

Thanks for the suggestion...

It appears as though I need to insert the attribute before the existing 
onclick attribute.  How do I retrieve the existing onclick attribute?  
My hope is to retrieve the existing onclick attribute so I can prepend 
my onclick action and use AttributeModifier to replace the existing with 
the newly prepended content.


Thanks much,
   -Steve


Fatih Mehmet Ucar wrote:

AttributeAppender should solve your problem.

fmu

2010/1/20 Steve Whitson steven.whit...@gmail.com:
  

Hi,

I'm new to wicket, and am working on my first app.  Great alternative to
other WebUI frameworks!

I've added a link to my panel using this code:

  Link deleteReportLink = new Link( deletereport ) {
  @Override
  public void onClick() {
  System.out.println(deleting report );
  service.deleteReport( selectedReport );
  }
  };
add( deleteReportLink );

  // add a confirmation to the Delete Report operation
  deleteReportLink.add(
  new SimpleAttributeModifier( onclick, return confirm( 'Are you
sure?'); )
  );

Here's the markup:

  a href=# wicket:id=deletereportDelete Report/a
  !--  input type=button wicket:id=deletereport value=Delete Report
/ --
  !-- button type=button wicket:id=deletereportDelete Report/button
 --

In the markup, when I use an 'a' tag the javascript confirmation dialog
works fine along with the onClick() override.  When I use it with either of
the (commented out) button inputs, the dialog appears, but the 'onClick()'
override is never executed.

I'd much rather this work with a button and not a hyperlink.

Any ideas or help is greatly appreciated.
  -Steve



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





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




Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Fatih Mehmet Ucar
onClick code is created in onComponentTag(), and replaced by getOnClickScript()
you can override the getOnClickScript() to prepend custom js code.

fmu

2010/1/20 Steve Whitson steven.whit...@gmail.com:
 Thanks for the suggestion...

 It appears as though I need to insert the attribute before the existing
 onclick attribute.  How do I retrieve the existing onclick attribute?  My
 hope is to retrieve the existing onclick attribute so I can prepend my
 onclick action and use AttributeModifier to replace the existing with the
 newly prepended content.

 Thanks much,
   -Steve


 Fatih Mehmet Ucar wrote:

 AttributeAppender should solve your problem.

 fmu

 2010/1/20 Steve Whitson steven.whit...@gmail.com:


 Hi,

 I'm new to wicket, and am working on my first app.  Great alternative to
 other WebUI frameworks!

 I've added a link to my panel using this code:

      Link deleteReportLink = new Link( deletereport ) {
         �...@override
          public void onClick() {
              System.out.println(deleting report );
              service.deleteReport( selectedReport );
          }
      };
        add( deleteReportLink );

  // add a confirmation to the Delete Report operation
  deleteReportLink.add(
          new SimpleAttributeModifier( onclick, return confirm( 'Are
 you
 sure?'); )
      );

 Here's the markup:

  a href=# wicket:id=deletereportDelete Report/a
  !--  input type=button wicket:id=deletereport value=Delete
 Report
 / --
  !-- button type=button wicket:id=deletereportDelete
 Report/button
  --

 In the markup, when I use an 'a' tag the javascript confirmation dialog
 works fine along with the onClick() override.  When I use it with either
 of
 the (commented out) button inputs, the dialog appears, but the
 'onClick()'
 override is never executed.

 I'd much rather this work with a button and not a hyperlink.

 Any ideas or help is greatly appreciated.
  -Steve



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




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




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



Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Ernesto Reinaldo Barreiro
I remember Martijn advising to copy/paste AttributeAppender and transforming
it to AttributePrepender for such a use case...

Best,

Ernesto

On Wed, Jan 20, 2010 at 4:26 PM, Steve Whitson steven.whit...@gmail.comwrote:

 Thanks for the suggestion...

 It appears as though I need to insert the attribute before the existing
 onclick attribute.  How do I retrieve the existing onclick attribute?  My
 hope is to retrieve the existing onclick attribute so I can prepend my
 onclick action and use AttributeModifier to replace the existing with the
 newly prepended content.

 Thanks much,
   -Steve



 Fatih Mehmet Ucar wrote:

 AttributeAppender should solve your problem.

 fmu

 2010/1/20 Steve Whitson steven.whit...@gmail.com:


 Hi,

 I'm new to wicket, and am working on my first app.  Great alternative to
 other WebUI frameworks!

 I've added a link to my panel using this code:

  Link deleteReportLink = new Link( deletereport ) {
  @Override
  public void onClick() {
  System.out.println(deleting report );
  service.deleteReport( selectedReport );
  }
  };
add( deleteReportLink );

  // add a confirmation to the Delete Report operation
  deleteReportLink.add(
  new SimpleAttributeModifier( onclick, return confirm( 'Are
 you
 sure?'); )
  );

 Here's the markup:

  a href=# wicket:id=deletereportDelete Report/a
  !--  input type=button wicket:id=deletereport value=Delete
 Report
 / --
  !-- button type=button wicket:id=deletereportDelete
 Report/button
  --

 In the markup, when I use an 'a' tag the javascript confirmation dialog
 works fine along with the onClick() override.  When I use it with either
 of
 the (commented out) button inputs, the dialog appears, but the
 'onClick()'
 override is never executed.

 I'd much rather this work with a button and not a hyperlink.

 Any ideas or help is greatly appreciated.
  -Steve



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





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






Re: dropdown issue

2010-01-20 Thread chinedu efoagui
@jonas ingore that i was just refactoring the code for the email.
the error is runtime not compile time.
I think it is a conversion problem
please help

On 1/20/10, Jonas barney...@gmail.com wrote:
 not sure if that's the problem, but shouldn't

 setChoices(titles);

 be

 setChoices(departments);




 On Wed, Jan 20, 2010 at 4:14 PM, chinedu efoagui chinedub...@gmail.com
 wrote:
 Hello , I have a class PersonnelrecordsDepartment
  with the following fields with corresponding getters and setters
   private java.lang.Integer id;
   private java.lang.String departmentname;
   private java.lang.Integer parentid;

 I left out the getters and setters . Any the field parentid can refer
 to an existing department like a recursive stuff like having a self
 foreign key
 Anyway the problem is that i have a dropdownlchoice for the form
 code
 public class DepartmentDropDownChoice extends DropDownChoice {

   �...@springbean(name=IHRService)
    private  IHRService dao;

 */    /**
     *
     * @param id
     * @param model
     */
    public DepartmentDropDownChoice(String id,final IModel model){

        super(id,model);
        final ChoiceRenderer renderer = new
 ChoiceRenderer(departmentname, id);

        setChoiceRenderer(renderer);
        ListPersonnelrecordsDepartment
 departments=Collections.EMPTY_LIST;
        try {
           departments = dao.getPersonnelrecordsDepartmentList();
        } catch (GenericBusinessException ex) {

  Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE,
 null, ex);
        }
        setChoices(titles);
    }
 /code

 and it gives this error anytime i try to save the personneldepartment
 object
 code
 2010-01-20 16:12:07,745 ERROR [org.apache.wicket.RequestCycle] -
 Cannot format given Object as a Number
 java.lang.IllegalArgumentException: Cannot format given Object as a Number
        at java.text.DecimalFormat.format(DecimalFormat.java:487)
        at java.text.Format.format(Format.java:140)
        at
 org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111)
        at
 org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85)
        at
 org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1107)
        at
 org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:588)
        at
 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136)
        at
 org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169)
        at
 org.apache.wicket.Component.setDefaultModelObject(Component.java:3052)
        at
 org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168)
        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.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
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
        at
 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
        at
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)

 /code

 i think it has something to do with the conversion. but how do i
 convert it again??
 How can i solve this problem???

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



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



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



Re: dropdown issue

2010-01-20 Thread chinedu efoagui
@jonas ignore that. i was just refactoring the code for the email.
the error is runtime not compile time.
I think it is a conversion problem
please help
The field parentid is integer but the dropdown is expecting object
the form
code
IModel zaModel=new CompoundPropertyModel(selected);
departmentform.setModel(zaModel);
RequiredTextField  departmentname=new
RequiredTextField(departmentname);
departmentname.setOutputMarkupId(true);
departmentform.add(departmentname);

DepartmentDropDownChoice title=new
DepartmentDropDownChoice(parentid,zaModel);
departmentform.add(title);

departmentform.add(new AjaxFallbackLink(canceldepartmentformbutton){

@Override
public void onClick(AjaxRequestTarget target) {
   closeModalWindow(target);

}


});
feedback = new FeedbackPanel(feedback);
  feedback.setOutputMarkupId(true);
  int[] filteredErrorLevels = new int[]{FeedbackMessage.ERROR};
  feedback.setFilter(new
ErrorLevelsFeedbackMessageFilter(filteredErrorLevels));
 departmentform.add(feedback);


FeedbackLabel departmentFeedbackLabel = new
FeedbackLabel(departmentfeedback, departmentname,new
Model(Department is required));
departmentFeedbackLabel.setOutputMarkupId(true);
departmentname.add(new ComponentVisualErrorBehavior(onblur,
departmentFeedbackLabel));
departmentform.add(departmentFeedbackLabel);


  departmentform.add(new
AjaxFallbackButton(savedepartmentbutton, departmentform) {

   @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form) {

   PersonnelrecordsDepartment
pr=(PersonnelrecordsDepartment)form.getDefaultModel().getObject();

try {
if(isNew){
dao.addPersonnelrecordsDepartment(pr);
}
else{

dao.savePersonnelrecordsDepartment(pr);
}
} catch (GenericBusinessException ex) {
Logger.getLogger(DepartmentPanel.class.getName()).log(Level.SEVERE,
null, ex);
}
//target.addComponent(form);
setFormReponse(target);

}

 @Override
protected void onError(AjaxRequestTarget target, 
Form? form)
{
// repaint the feedback panel so errors are shown

   target.addComponent(feedback);
}

});

add(departmentform);
}
private void setFormReponse(AjaxRequestTarget target){


info(Save Operation was Successful);

target.addComponent(feedback);

  }
FeedbackPanel feedback;


}


/code

On 1/20/10, Jonas barney...@gmail.com wrote:
 not sure if that's the problem, but shouldn't

 setChoices(titles);

 be

 setChoices(departments);




 On Wed, Jan 20, 2010 at 4:14 PM, chinedu efoagui chinedub...@gmail.com
 wrote:
 Hello , I have a class PersonnelrecordsDepartment
  with the following fields with corresponding getters and setters
   private java.lang.Integer id;
   private java.lang.String departmentname;
   private java.lang.Integer parentid;

 I left out the getters and setters . Any the field parentid can refer
 to an existing department like a recursive stuff like having a self
 foreign key
 Anyway the problem is that i have a dropdownlchoice for the form
 code
 public class DepartmentDropDownChoice extends DropDownChoice {

   �...@springbean(name=IHRService)
    private  IHRService dao;

 */    /**
     *
     * @param id
     * @param model
     */
    public DepartmentDropDownChoice(String id,final IModel model){

        super(id,model);
        final ChoiceRenderer renderer = new
 ChoiceRenderer(departmentname, id);

        setChoiceRenderer(renderer);
        ListPersonnelrecordsDepartment
 departments=Collections.EMPTY_LIST;
        try {
           departments = dao.getPersonnelrecordsDepartmentList();
        } catch (GenericBusinessException ex) {

  Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE,
 null, ex);
        }
        setChoices(titles);
    }
 /code

 and it gives this error anytime i try to save the personneldepartment
 object
 code
 2010-01-20 16:12:07,745 ERROR [org.apache.wicket.RequestCycle] -
 Cannot format given Object as a Number
 java.lang.IllegalArgumentException: Cannot format given Object as a Number
        at java.text.DecimalFormat.format(DecimalFormat.java:487)
        at java.text.Format.format(Format.java:140)
        at
 org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111)
        at
 org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85)
        at
 org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1107)
        at
 

Wicket URL Encryption Key

2010-01-20 Thread MZemeck
On page 331 of Wicket In Action is the following excerpt, Note that you 
should modify the default encryption key that is stored in 
ISecuritySettings to prevent malicious hackers from using the default 
publicly available key as an attack vector.  Does this only pertain to 
when Sun JCE is not available and Wicket defaults to no encryption? From 
what I can gather, the key should be generated by...

KeyInSessionSunJceCryptFactory.java
if (key == null)
{
 // generate new key
 key = session.getId() + . + UUID.randomUUID().toString
();
 session.setAttribute(keyAttr, key);
}



Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Fatih Mehmet Ucar
yes, if you are gonna use this in several places, creating a class
like AttributePrepender may be a better idea.

2010/1/20 Ernesto Reinaldo Barreiro reier...@gmail.com:
 I remember Martijn advising to copy/paste AttributeAppender and transforming
 it to AttributePrepender for such a use case...

 Best,

 Ernesto

 On Wed, Jan 20, 2010 at 4:26 PM, Steve Whitson 
 steven.whit...@gmail.comwrote:

 Thanks for the suggestion...

 It appears as though I need to insert the attribute before the existing
 onclick attribute.  How do I retrieve the existing onclick attribute?  My
 hope is to retrieve the existing onclick attribute so I can prepend my
 onclick action and use AttributeModifier to replace the existing with the
 newly prepended content.

 Thanks much,
   -Steve



 Fatih Mehmet Ucar wrote:

 AttributeAppender should solve your problem.

 fmu

 2010/1/20 Steve Whitson steven.whit...@gmail.com:


 Hi,

 I'm new to wicket, and am working on my first app.  Great alternative to
 other WebUI frameworks!

 I've added a link to my panel using this code:

      Link deleteReportLink = new Link( deletereport ) {
         �...@override
          public void onClick() {
              System.out.println(deleting report );
              service.deleteReport( selectedReport );
          }
      };
        add( deleteReportLink );

  // add a confirmation to the Delete Report operation
  deleteReportLink.add(
          new SimpleAttributeModifier( onclick, return confirm( 'Are
 you
 sure?'); )
      );

 Here's the markup:

  a href=# wicket:id=deletereportDelete Report/a
  !--  input type=button wicket:id=deletereport value=Delete
 Report
 / --
  !-- button type=button wicket:id=deletereportDelete
 Report/button
  --

 In the markup, when I use an 'a' tag the javascript confirmation dialog
 works fine along with the onClick() override.  When I use it with either
 of
 the (commented out) button inputs, the dialog appears, but the
 'onClick()'
 override is never executed.

 I'd much rather this work with a button and not a hyperlink.

 Any ideas or help is greatly appreciated.
  -Steve



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





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






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



Re: dropdown issue

2010-01-20 Thread Jonas
with this code, you're trying to set a PersonnelrecordsDepartment Object
into the field called parentId of the object referred to by the
'selected' variable
that you're passing to the CompoundPropertyModel. The data types don't
match, that's why wicket trys to safe the day using conversion (which obviously
cannot succeed in this case...).
You can either:
a) change the data type of the parentId field of your 'selected' object
or
b) change your dropdown choice so only the id is propagated instead of the
whole PersonnelrecordsDepartment Object. you could do that e.g. by
setting the ids
as choices, and use a custom choicerenderer which retrieves and
renders the PersonnelrecordsDepartment Objects

I hope that helps...

On Wed, Jan 20, 2010 at 4:54 PM, chinedu efoagui chinedub...@gmail.com wrote:
 @jonas ignore that. i was just refactoring the code for the email.
 the error is runtime not compile time.
 I think it is a conversion problem
 please help
 The field parentid is integer but the dropdown is expecting object
 the form
 code
 IModel zaModel=new CompoundPropertyModel(selected);
        departmentform.setModel(zaModel);
        RequiredTextField  departmentname=new
 RequiredTextField(departmentname);
        departmentname.setOutputMarkupId(true);
        departmentform.add(departmentname);

        DepartmentDropDownChoice title=new
 DepartmentDropDownChoice(parentid,zaModel);
        departmentform.add(title);

        departmentform.add(new AjaxFallbackLink(canceldepartmentformbutton){

               �...@override
                public void onClick(AjaxRequestTarget target) {
                   closeModalWindow(target);

                }


        });
        feedback = new FeedbackPanel(feedback);
      feedback.setOutputMarkupId(true);
      int[] filteredErrorLevels = new int[]{FeedbackMessage.ERROR};
      feedback.setFilter(new
 ErrorLevelsFeedbackMessageFilter(filteredErrorLevels));
     departmentform.add(feedback);


        FeedbackLabel departmentFeedbackLabel = new
 FeedbackLabel(departmentfeedback, departmentname,new
 Model(Department is required));
        departmentFeedbackLabel.setOutputMarkupId(true);
        departmentname.add(new ComponentVisualErrorBehavior(onblur,
 departmentFeedbackLabel));
        departmentform.add(departmentFeedbackLabel);


      departmentform.add(new
 AjaxFallbackButton(savedepartmentbutton, departmentform) {

           @Override
      protected void onSubmit(AjaxRequestTarget target, Form? form) {

       PersonnelrecordsDepartment
 pr=(PersonnelrecordsDepartment)form.getDefaultModel().getObject();

        try {
            if(isNew){
            dao.addPersonnelrecordsDepartment(pr);
            }
            else{

            dao.savePersonnelrecordsDepartment(pr);
            }
        } catch (GenericBusinessException ex) {
            Logger.getLogger(DepartmentPanel.class.getName()).log(Level.SEVERE,
 null, ex);
        }
        //target.addComponent(form);
        setFormReponse(target);

    }

         @Override
                        protected void onError(AjaxRequestTarget target, 
 Form? form)
                        {
                        // repaint the feedback panel so errors are shown

                           target.addComponent(feedback);
                        }

            });

        add(departmentform);
    }
        private void setFormReponse(AjaxRequestTarget target){


            info(Save Operation was Successful);

            target.addComponent(feedback);

  }
    FeedbackPanel feedback;


    }


 /code

 On 1/20/10, Jonas barney...@gmail.com wrote:
 not sure if that's the problem, but shouldn't

 setChoices(titles);

 be

 setChoices(departments);




 On Wed, Jan 20, 2010 at 4:14 PM, chinedu efoagui chinedub...@gmail.com
 wrote:
 Hello , I have a class PersonnelrecordsDepartment
  with the following fields with corresponding getters and setters
   private java.lang.Integer id;
   private java.lang.String departmentname;
   private java.lang.Integer parentid;

 I left out the getters and setters . Any the field parentid can refer
 to an existing department like a recursive stuff like having a self
 foreign key
 Anyway the problem is that i have a dropdownlchoice for the form
 code
 public class DepartmentDropDownChoice extends DropDownChoice {

   �...@springbean(name=IHRService)
    private  IHRService dao;

 */    /**
     *
     * @param id
     * @param model
     */
    public DepartmentDropDownChoice(String id,final IModel model){

        super(id,model);
        final ChoiceRenderer renderer = new
 ChoiceRenderer(departmentname, id);

        setChoiceRenderer(renderer);
        ListPersonnelrecordsDepartment
 departments=Collections.EMPTY_LIST;
        try {
           departments = dao.getPersonnelrecordsDepartmentList();
        } catch (GenericBusinessException ex) {

  Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE,
 null, ex);
        }
        setChoices(titles);
    

Re: javascript confirm - seems to work fine with link markup but not with button markup

2010-01-20 Thread Ernesto Reinaldo Barreiro
and maybe donating it back to the community;-)

Ernesto

On Wed, Jan 20, 2010 at 5:01 PM, Fatih Mehmet Ucar fmu...@gmail.com wrote:

 yes, if you are gonna use this in several places, creating a class
 like AttributePrepender may be a better idea.

 2010/1/20 Ernesto Reinaldo Barreiro reier...@gmail.com:
  I remember Martijn advising to copy/paste AttributeAppender and
 transforming
  it to AttributePrepender for such a use case...
 
  Best,
 
  Ernesto
 
  On Wed, Jan 20, 2010 at 4:26 PM, Steve Whitson steven.whit...@gmail.com
 wrote:
 
  Thanks for the suggestion...
 
  It appears as though I need to insert the attribute before the existing
  onclick attribute.  How do I retrieve the existing onclick attribute?
  My
  hope is to retrieve the existing onclick attribute so I can prepend my
  onclick action and use AttributeModifier to replace the existing with
 the
  newly prepended content.
 
  Thanks much,
-Steve
 
 
 
  Fatih Mehmet Ucar wrote:
 
  AttributeAppender should solve your problem.
 
  fmu
 
  2010/1/20 Steve Whitson steven.whit...@gmail.com:
 
 
  Hi,
 
  I'm new to wicket, and am working on my first app.  Great alternative
 to
  other WebUI frameworks!
 
  I've added a link to my panel using this code:
 
   Link deleteReportLink = new Link( deletereport ) {
   @Override
   public void onClick() {
   System.out.println(deleting report );
   service.deleteReport( selectedReport );
   }
   };
 add( deleteReportLink );
 
   // add a confirmation to the Delete Report operation
   deleteReportLink.add(
   new SimpleAttributeModifier( onclick, return confirm( 'Are
  you
  sure?'); )
   );
 
  Here's the markup:
 
   a href=# wicket:id=deletereportDelete Report/a
   !--  input type=button wicket:id=deletereport value=Delete
  Report
  / --
   !-- button type=button wicket:id=deletereportDelete
  Report/button
   --
 
  In the markup, when I use an 'a' tag the javascript confirmation
 dialog
  works fine along with the onClick() override.  When I use it with
 either
  of
  the (commented out) button inputs, the dialog appears, but the
  'onClick()'
  override is never executed.
 
  I'd much rather this work with a button and not a hyperlink.
 
  Any ideas or help is greatly appreciated.
   -Steve
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

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




Re: Wicket URL Encryption Key

2010-01-20 Thread Jonas
I think the book refers to wicket 1.3. The default behaviour of
Settings#getCryptFactory has changed
in 1.4. I think in 1.3 the default was ClassCryptFactory with a default key
as still visible in ISecuritySettings#DEFAULT_ENCRYPTION_KEY. Now in 1.4,
the KeyInSessionSunJceCryptFactory with a generated key (as you mentioned)
is used.

On Wed, Jan 20, 2010 at 4:59 PM,  mzem...@osc.state.ny.us wrote:
 On page 331 of Wicket In Action is the following excerpt, Note that you
 should modify the default encryption key that is stored in
 ISecuritySettings to prevent malicious hackers from using the default
 publicly available key as an attack vector.  Does this only pertain to
 when Sun JCE is not available and Wicket defaults to no encryption? From
 what I can gather, the key should be generated by...

 KeyInSessionSunJceCryptFactory.java
 if (key == null)
 {
                 // generate new key
                 key = session.getId() + . + UUID.randomUUID().toString
 ();
                 session.setAttribute(keyAttr, key);
 }



 Notice: This communication, including any attachments, is intended solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.

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



Re: Wicket URL Encryption Key

2010-01-20 Thread Jonas
A quick search through wicket's fisheye [1] revealed the default was changed
in wicket 1.3.5 to fix [2]

[1] 
http://fisheye6.atlassian.com/browse/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java#r684127
[2] http://issues.apache.org/jira/browse/WICKET-1782

On Wed, Jan 20, 2010 at 5:13 PM, Jonas barney...@gmail.com wrote:
 I think the book refers to wicket 1.3. The default behaviour of
 Settings#getCryptFactory has changed
 in 1.4. I think in 1.3 the default was ClassCryptFactory with a default key
 as still visible in ISecuritySettings#DEFAULT_ENCRYPTION_KEY. Now in 1.4,
 the KeyInSessionSunJceCryptFactory with a generated key (as you mentioned)
 is used.

 On Wed, Jan 20, 2010 at 4:59 PM,  mzem...@osc.state.ny.us wrote:
 On page 331 of Wicket In Action is the following excerpt, Note that you
 should modify the default encryption key that is stored in
 ISecuritySettings to prevent malicious hackers from using the default
 publicly available key as an attack vector.  Does this only pertain to
 when Sun JCE is not available and Wicket defaults to no encryption? From
 what I can gather, the key should be generated by...

 KeyInSessionSunJceCryptFactory.java
 if (key == null)
 {
                 // generate new key
                 key = session.getId() + . + UUID.randomUUID().toString
 ();
                 session.setAttribute(keyAttr, key);
 }



 Notice: This communication, including any attachments, is intended solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.


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



Re: Objects.cloneModel() on google app engine

2010-01-20 Thread Lionel Port
Thanks Pedro,

Hope it helps. From your answer looks like we may have a slightly
different problem with the same cause. Looks like the cloneModel()
method is depended on from a couple of spots but it all related to
versioning of components. Ideally it would be good if we could just
replace the implementation of cloneModel with one that works on GAE.
Anyway I'll stick with this for now till it comes and bites me again.

regards,
Lionel

On Wed, Jan 20, 2010 at 9:26 PM, Pedro Santos pedros...@gmail.com wrote:
 Thank u! that will work for me too

 On Wed, Jan 20, 2010 at 8:21 AM, Lionel Port lionel.p...@gmail.com wrote:

 The gae security restriction looks pointless because
 Objects.cloneModel is just using a ByteArrayOutputStream (why should
 there be restrictions on that?) but because the Objects calls are all
 static I can't override the method with a working clone method also
 because the OrderByLink.sort method is final I can't fix there either.

 As a workaround for any one who is interested, it looks like
 cloneModel is only used in this case if the component is versioned so
 I set called setVersion(false) on the orderByLink and it avoids this
 problem area.

 On Wed, Jan 20, 2010 at 12:32 PM, Lionel Port lionel.p...@gmail.com
 wrote:
  Hi,
 
  I'm using wicket on google app engine and am having trouble with the
  sort link headers on data tables.
 
  It looks like when a sort link is clicked the method
  Objects.cloneModel() is called. This creates a
  ReplaceableObjectOutputStream wrapper around the ObjectOutputStream to
  do the copy using serialization/deserialization. Unfortunately this
  class tries to call enableReplace on the the underlying
  ObjectOutputStream so that it can replace component objects with just
  their name (to stop component hierachy being serialized).
 
  It seams the google app engine security permissions deny calling
  enableReplace on the ObjectOutputStream.
 
  Does any one know of a work around to get the sort links working?
 
  regards,
  Lionel
 

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




 --
 Pedro Henrique Oliveira dos Santos


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



Re: Thanks for wicket: it is awesome and I'm just getting to know it

2010-01-20 Thread nmelen...@getsense.com.ar
yes, looks like real desktop application code but it is web :)

On Tue, Jan 19, 2010 at 6:23 PM, Chuck Brinkman chasb1...@gmail.com wrote:

 Just wanted to say thanks for wicket.

 I have a ListMultipleChoice and wanted to update the page based on at least
 one item selected or no items selected.  It took a while for me to locate

 lmc.add(new AjaxFormComponentUpdatingBehavior(onChange) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
  // do the right thing here!
}
});

 but once I did it just worked.  I like things that just work.  I don't know
 js very well so just java and just html if real attractive to me.

 Thanks again for wicket.

 Chuck



Re: Thanks for wicket: it is awesome and I'm just getting to know it

2010-01-20 Thread nino martinez wael
And it grows on you, the deeper you dig the more of these things you
discover :)

2010/1/19 Chuck Brinkman chasb1...@gmail.com

 Just wanted to say thanks for wicket.

 I have a ListMultipleChoice and wanted to update the page based on at least
 one item selected or no items selected.  It took a while for me to locate

 lmc.add(new AjaxFormComponentUpdatingBehavior(onChange) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
  // do the right thing here!
}
});

 but once I did it just worked.  I like things that just work.  I don't know
 js very well so just java and just html if real attractive to me.

 Thanks again for wicket.

 Chuck



moving to spring 3

2010-01-20 Thread tubin gen
I am using wicket 1.4.1  , can I move to spring 3  ?


Re: moving to spring 3

2010-01-20 Thread Scott Swank
Check out jWeekend's maven archetype generator: Leg Up.  Spring 3.0.0
is in there with jdbc  jpa, respectively.

   http://www.jweekend.com/dev/LegUp

Scott

On Wed, Jan 20, 2010 at 2:25 PM, tubin gen fachh...@gmail.com wrote:
 I am using wicket 1.4.1  , can I move to spring 3  ?


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



Re: Checkbox tree component

2010-01-20 Thread prati

Hi i also am having same kind of problem.
I got checkboxes in tree panel ,how to iterate over the selected nodes on
checkbox click.

Thanks
Partibha

Edi wrote:
 
 I am not able to configure the above example Doug.
 
 Could you give me .war file. please
 
 thanks and regards,
 edi
 
 
 Doug Leeper wrote:
 
 If the tree is pre-loaded, it is easier.  When the checkbox is selected,
 iterate through the children nodes and set its state to selected.
 
 The dynamically loaded is alot trickier...as you would have to load the
 tree from the selected node and then iterate and set the children notes
 to selected.
 
 Are you sure you want to select the children nodes or is it the parent
 nodes you want to select?
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Checkbox-tree-component-tp13433102p27250675.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket+Guice

2010-01-20 Thread Peter Karich

Hi,

now I blogged about this stuff recently:
http://karussell.wordpress.com/2010/01/18/crud-with-wicket-guice-db4o-neodatis/

Comments and requests of reformulations are welcome ;-) !

Question 1. is fixed ... maybe someone could point me to a solution of 2.?

Regards,
Peter.


Hi,

Thanks to Jeremy Thomerson who pointed me to jweekend [1] which helped me
a lot to get started with a simple CRUD webapp based on wicket and 
guice (+db4o)

see [2] for a screenshot.

I have now the following problems:

1. If I select an Event (row of DataView) and want to remove it 
directly after the selection
I lost the database connnection. It seems to me that something with 
guice and

session management is not properly handled of my app.

2. E.g. if I select event1 from the list and want to create a new 
event2 based on
the properties of event1. event2 is shown correctly where the row of 
event1 is
now identical to the one of event2, although this is fixed after 
refreshing the page via F5.


Do you have a feeling which could be wrong here?
I would simply attach two failing test cases but I didn't get the 
tests working.

I try to figure this out now...

The maven project is here:
https://timefinder.svn.sourceforge.net/svnroot/timefinder/branches/timefinderwicket/ 



After mvn install (it should compile without any set up)
run mvn jetty:run and go to
http://localhost:8080/timefinderwicket/event


Regards,
Peter.

[1]
http://www.jweekend.com/dev/LegUp

[2]
http://peat_hal.users.sourceforge.net/wicket-guice.png





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



Cannot get default invisible TextField's ModelObject ?

2010-01-20 Thread smallufo
I have a form , which contains a radio button.
When user clicks the radio button , a default-invisible textfield is set
visible.
But I cannot get the textfield's Model Object , it is null 

What's the problem ? Did I miss anything ?


Re: Cannot get default invisible TextField's ModelObject ?

2010-01-20 Thread smallufo
To make it more clear :
When the radio button is clicked , by implement AjaxEventBehavior(onClick)

, a default-invisible WebMarkupContainer is set visible ,
The WebMarkupContainer  contains other TextFields , which I cannot get their
values at all 
I've stuck with this problems for half day , searching but found no anwser
...
I need help

Wicket 1.4.5


2010/1/21 smallufo small...@gmail.com

 I have a form , which contains a radio button.
 When user clicks the radio button , a default-invisible textfield is set
 visible.
 But I cannot get the textfield's Model Object , it is null 

 What's the problem ? Did I miss anything ?



Re: Cannot get default invisible TextField's ModelObject ?

2010-01-20 Thread Jered Myers
What do you mean by cannot get their values?  I am wondering if the 
model's value is not showing in the TextField when it become visible or 
if the model's value is not getting set based on what you type into the 
TextField.  If your problem is that the value you type into the 
TextField is not getting to the model, check to make sure the Form that 
the TextField is in is reaching the Form's onSubmit method when you 
submit the form.  Wicket does not push the TextField value to the model 
until it has checked for required fields, converted the input, and 
validated the converted input.  If you can copy in the related code to 
this thread, that may help.


-Jered

On 1/20/2010 5:14 PM, smallufo wrote:

To make it more clear :
When the radio button is clicked , by implement AjaxEventBehavior(onClick)

, a default-invisible WebMarkupContainer is set visible ,
The WebMarkupContainer  contains other TextFields , which I cannot get their
values at all 
I've stuck with this problems for half day , searching but found no anwser
...
I need help

Wicket 1.4.5


2010/1/21 smallufosmall...@gmail.com

   

I have a form , which contains a radio button.
When user clicks the radio button , a default-invisible textfield is set
visible.
But I cannot get the textfield's Model Object , it is null 

What's the problem ? Did I miss anything ?

 
   


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



onAfterRender called twice in AjaxLazyLoadPanel

2010-01-20 Thread Steve Swinsburg
I have an AjaxLazyLoadPanel and want some javascript to fire after its loaded 
it's contents:

I assumed I could override onAfterRender and add my javascript like so:

add(new AjaxLazyLoadPanel(myPanel) {

@Override
public Component getLazyLoadComponent(String markupId) {
return new SomePamel(markupId);
}

@Override
protected void onAfterRender() {
JavascriptUtils.writeJavascript(getResponse(), 
alert('hello'););
super.onAfterRender();
}

});

Except it is called twice, it looks like once when the page is loading and then 
again when the actual panel has been loaded.

Is there another way to achieve what I want?

thanks,
Steve



Re: Cannot get default invisible TextField's ModelObject ?

2010-01-20 Thread smallufo
This is a full functional Page  :

I found this problem only occurs when the form is in the listView :
If I move the form out of the listView , it works like a charm.
Bug ? I am not sure...

The link is the screen capture :
http://xs.to/image-B859_4B57CDD0.gif


MyPage.html

table border=1
  tr
thname/th
thmore ?/th
  /tr
  span wicket:id=listView
form wicket:id=form
  tr
td wicket:id=name[name]/td
td
  span wicket:id=radioGroup
input type=radio wicket:id=yes/yes
input type=radio wicket:id=no/no
  /span
/td
  /tr
  tr wicket:id=more
td colspan=2
  input type=text size=40 value=Please leave comments
wicket:id=textfield/
  input type=submit value=Submit wicket:id=submit/
/td
  /tr
/form
  /span
/table


MyPage.java

package quickstart.ajax;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.ajax.AjaxEventBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.Radio;
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.Model;

public class MyPage extends WebPage
{
  private final static ListString names = new ArrayListString();
  static
  {
names.add(Andy);
names.add(Brian);
names.add(Carol);
  }

  public MyPage()
  {
ListViewString listView = new ListViewString(listView , names)
{
  @Override
  protected void populateItem(ListItemString item)
  {

FormVoid form = new FormVoid(form);
item.add(form);

String name = item.getModelObject();

form.add(new Label(name , name));

final WebMarkupContainer more = new WebMarkupContainer(more);
more.setVisible(false);
more.setOutputMarkupPlaceholderTag(true);
form.add(more);


final RadioGroupBoolean radioGroup = new
RadioGroupBoolean(radioGroup , Model.of(Boolean.FALSE));
form.add(radioGroup);

RadioBoolean yes = new RadioBoolean(yes ,
Model.of(Boolean.TRUE));
RadioBoolean no = new RadioBoolean(no ,
Model.of(Boolean.FALSE));
radioGroup.add(yes);
radioGroup.add(no);

yes.add(new AjaxEventBehavior(onClick)
{
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
more.setVisible(true);
target.addComponent(more);
  }
});

no.add(new AjaxEventBehavior(onClick)
{
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
more.setVisible(false);
target.addComponent(more);
  }
});

final TextFieldString textfield = new
TextFieldString(textfield , new ModelString());
more.add(textfield);
AjaxButton button = new AjaxButton(submit)
{
  @Override
  protected void onSubmit(AjaxRequestTarget arg0, Form? form)
  {
System.out.println(radioGroup =  + radioGroup.getModelObject()
+  , textfield.getModelObject() =  + textfield.getModelObject());
  }
};
more.add(button);
  }
};
add(listView);
  }
}


Re: onAfterRender called twice in AjaxLazyLoadPanel

2010-01-20 Thread Igor Vaynberg
you are writing out javascript after every component render...

perhaps you should keep a boolean flag that marks if you rendered the
js yet or not.

alternatively you can add a behavior to the panel with istemporary() {
return true; }

-igor

On Wed, Jan 20, 2010 at 7:24 PM, Steve Swinsburg
steve.swinsb...@gmail.com wrote:
 I have an AjaxLazyLoadPanel and want some javascript to fire after its loaded 
 it's contents:

 I assumed I could override onAfterRender and add my javascript like so:

 add(new AjaxLazyLoadPanel(myPanel) {

       �...@override
        public Component getLazyLoadComponent(String markupId) {
            return new SomePamel(markupId);
        }

       �...@override
        protected void onAfterRender() {
                JavascriptUtils.writeJavascript(getResponse(), 
 alert('hello'););
                super.onAfterRender();
        }

 });

 Except it is called twice, it looks like once when the page is loading and 
 then again when the actual panel has been loaded.

 Is there another way to achieve what I want?

 thanks,
 Steve



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



Re: onAfterRender called twice in AjaxLazyLoadPanel

2010-01-20 Thread Steve Swinsburg
So  overriding onAfterRender for a component doesn't just override it for that 
instance of the component? 

Also I can see the markup is being added to the end of the page after the 
closing HTML. However, the Javadocs say it is meant to be called after after 
the actual component is finished rendering. So it look s like onAfterRender is 
not what I need.

Can I attach to a different phase in the render lifecycle to call the 
javascript when that specific panel has just finished rendering?

thanks,
Steve




On 21/01/2010, at 2:52 PM, Igor Vaynberg wrote:

 you are writing out javascript after every component render...
 
 perhaps you should keep a boolean flag that marks if you rendered the
 js yet or not.
 
 alternatively you can add a behavior to the panel with istemporary() {
 return true; }
 
 -igor
 
 On Wed, Jan 20, 2010 at 7:24 PM, Steve Swinsburg
 steve.swinsb...@gmail.com wrote:
 I have an AjaxLazyLoadPanel and want some javascript to fire after its 
 loaded it's contents:
 
 I assumed I could override onAfterRender and add my javascript like so:
 
 add(new AjaxLazyLoadPanel(myPanel) {
 
@Override
public Component getLazyLoadComponent(String markupId) {
return new SomePamel(markupId);
}
 
@Override
protected void onAfterRender() {
JavascriptUtils.writeJavascript(getResponse(), 
 alert('hello'););
super.onAfterRender();
}
 
 });
 
 Except it is called twice, it looks like once when the page is loading and 
 then again when the actual panel has been loaded.
 
 Is there another way to achieve what I want?
 
 thanks,
 Steve
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


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



Re: onAfterRender called twice in AjaxLazyLoadPanel

2010-01-20 Thread Lionel Port
Hi Steve,

Are you trying to do this..

http://cwiki.apache.org/WICKET/adding-javascript-from-wicket.html

with an onload event instead of onblur, or do I misunderstand.

regards,
Lionel

On Thu, Jan 21, 2010 at 2:56 PM, Steve Swinsburg
steve.swinsb...@gmail.com wrote:
 So  overriding onAfterRender for a component doesn't just override it for 
 that instance of the component?

 Also I can see the markup is being added to the end of the page after the 
 closing HTML. However, the Javadocs say it is meant to be called after after 
 the actual component is finished rendering. So it look s like onAfterRender 
 is not what I need.

 Can I attach to a different phase in the render lifecycle to call the 
 javascript when that specific panel has just finished rendering?

 thanks,
 Steve




 On 21/01/2010, at 2:52 PM, Igor Vaynberg wrote:

 you are writing out javascript after every component render...

 perhaps you should keep a boolean flag that marks if you rendered the
 js yet or not.

 alternatively you can add a behavior to the panel with istemporary() {
 return true; }

 -igor

 On Wed, Jan 20, 2010 at 7:24 PM, Steve Swinsburg
 steve.swinsb...@gmail.com wrote:
 I have an AjaxLazyLoadPanel and want some javascript to fire after its 
 loaded it's contents:

 I assumed I could override onAfterRender and add my javascript like so:

 add(new AjaxLazyLoadPanel(myPanel) {

       �...@override
        public Component getLazyLoadComponent(String markupId) {
            return new SomePamel(markupId);
        }

       �...@override
        protected void onAfterRender() {
                JavascriptUtils.writeJavascript(getResponse(), 
 alert('hello'););
                super.onAfterRender();
        }

 });

 Except it is called twice, it looks like once when the page is loading and 
 then again when the actual panel has been loaded.

 Is there another way to achieve what I want?

 thanks,
 Steve



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



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



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