Re: GIcon URL

2010-12-20 Thread Jeremy Thomerson
Have you tried

new GIcon(urlFor(new ResourceReference(SomeClass.class,
path-to-img-relative-to-class.jpg)));

On Sun, Dec 19, 2010 at 4:41 AM, Igor Racic igor.ra...@gmail.com wrote:
 Hi,

 That must be something simple.
 GIcon (from GMap2) have constructor GIcon (String) which works OK when I put
 URL of some external icon.
 How to do it when Icon is inside wicket ?
 I thought about resources but didn't come with something that works.


 Thank you and regards,
 Igor




-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: Spring Security 3 and Wicket

2010-12-20 Thread Dmytro Seredenko
It's still unclear to me: can I use SS 3 as a authorization tool with config
like:

   security:http create-session=never auto-config=true
security:intercept-url pattern=/admin access=ROLE_ADMIN/
security:intercept-url pattern=/**/
/security:http

or I there is no way to omit wicket-auth-roles?

Thanks,
Dmytro.

On Sun, Dec 19, 2010 at 10:44 PM, Dmytro Seredenko d.serede...@gmail.comwrote:

 I've tried proposed approach. In that case I have AuthenticationManager,
 however (for some reason) it doesn't store previously authenticated user and
 asks me for login every time. Still looking into this issue.

 P.S. I'm using SS 3 with a set of intercept-urls to allow access to certain
 URLs based on user roles.

 Thanks,
 Dmytro.

 On Sun, Dec 19, 2010 at 4:26 PM, James Carman 
 ja...@carmanconsulting.comwrote:

 I was using the AspectJ stuff and the @Configurable annotations to
 inject the session.  You can/should use @SpringBean and
 InjectorHolder.getInjector().inject(this) in the constructor of your
 web session class if you don't want to use AspectJ.  That should be a
 quick fix.

 On Sun, Dec 19, 2010 at 7:17 PM, Dmytro Seredenko d.serede...@gmail.com
 wrote:
  Thanks James for links. I didn't know about Wicketopia and it will
  definitely take my evening time :)
 
  I've got your Wicket-advanced project couple days before and it helped a
 lot
  to understand how Wicket stuff works. However, when I've moved to SS 3
 it
  didn't work. I've spent some time to figure out what is going on, but
 didn't
  find the solution. The problem with it: AuthenticationManager in
  SpringSecuritySession is not injected by Spring and, of course,
  authentication can't go through.
 
  Dmytro.
 
  On Sun, Dec 19, 2010 at 4:09 PM, James Carman 
 ja...@carmanconsulting.comwrote:
 
  The new Wicketopia project at github has a spring-security module.
  You can probably get some code from there.
 
  https://github.com/jwcarman/wicketopia
 
  Also, you can try to get stuff from my wicket-advanced project:
 
  http://svn.carmanconsulting.com/public/wicket-advanced/trunk/
 
  It's got spring-security integrated, too, but I don't think it's 3.
 
  On Sun, Dec 19, 2010 at 7:01 PM, Dmytro Seredenko 
 d.serede...@gmail.com
  wrote:
   Hi guys,
   I've spent last week in reading this mailing list (Wicket community
 is
  doing
   great job, by the way) to find the simple solution for Spring
 Security 3
  and
   Wicket 1.4.14 integration.
  
   I've tried several approaches mentioned in the list (many thanks to
 James
   Carman) and Wicket Wiki (an article, who everyone here has read,
 about
   wicket-auth-roles + SS), however they're not working as expected.
  
   So, my question is simple: is there any way to integrate SS 3 and
 Wicket
  1.4
   without:
  
 - wicket-auth-roles (I don't see a point in using it when SS 3
 offers
 this functionality)
 - integration with Swarm (like wicketstuff.org/wicket-securitydid)
  
   My point is to use authentication and authorization provided by SS 3
 and
   Wicket as a great component framework.
  
   P.S. I'm not going to use Apache Shiro, because it doesn't suite my
  needs.
  
   Thanks to everyone.
  
   --
   Best regards,
   Dmytro
  
 
  -
 
  --
  Best regards,
  Dmytro




-- 
Best regards,
Dmytro Seredenko


Re: [1,5]Error msg from Model?

2010-12-20 Thread nino martinez wael
Havent got time working on a release that has to come out before new year :(

Will replicate in quickstart next year :)

2010/12/17 Jeremy Thomerson jer...@wickettraining.com

 Show some code (quickstart).

 On Fri, Dec 17, 2010 at 9:23 AM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

  Hmm then there might be a problem, I have a model used for a dropdown,
  inside that I do mentioned earlier in the thread, no message on the page
  and
  no message in the log about unrendered messages...
 
  2010/12/17 Martin Grigorov mgrigo...@apache.org
 
   It should. There are no changes in that area, except that now all
 'debug
   methods accept Serializable instead of String, but this is backward
   compatible
  
   On Fri, Dec 17, 2010 at 4:15 PM, nino martinez wael 
   nino.martinez.w...@gmail.com wrote:
  
Should the below add an error message to the stack, it does not:
Session.get().error(Queue not found please select another);
   
Are here a better way?
   
regards Nino
   
  
 



 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*



CheckboxMultipleChoice doesn't support Ajax Behavior?

2010-12-20 Thread eugenebalt

I have a CheckBoxMultipleChoice which doesn't seem to support Ajax onChange. 

My code: 


CheckBoxMultipleChoice group = new CheckBoxMultipleChoice(CheckboxGroup1,
valueList);

group.add(new AjaxFormComponentUpdatingBehavior(onchange)
{

protected void onUpdate(AjaxRequestTarget target) 
{
 System.out.println(Updated Checkboxes);
}
});

add(group);





The checkboxes appear on the page as expected, but when I select or
de-select any of them, the debug println statement above is not printed. Any
ideas why? 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckboxMultipleChoice-doesn-t-support-Ajax-Behavior-tp3095768p3095768.html
Sent from the Users forum 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: CheckboxMultipleChoice doesn't support Ajax Behavior?

2010-12-20 Thread Martin Grigorov
try with onclick

On Mon, Dec 20, 2010 at 5:20 PM, eugenebalt eugeneb...@yahoo.com wrote:


 I have a CheckBoxMultipleChoice which doesn't seem to support Ajax
 onChange.

 My code:


 CheckBoxMultipleChoice group = new CheckBoxMultipleChoice(CheckboxGroup1,
 valueList);

 group.add(new AjaxFormComponentUpdatingBehavior(onchange)
 {

protected void onUpdate(AjaxRequestTarget target)
{
 System.out.println(Updated Checkboxes);
}
 });

 add(group);





 The checkboxes appear on the page as expected, but when I select or
 de-select any of them, the debug println statement above is not printed.
 Any
 ideas why?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/CheckboxMultipleChoice-doesn-t-support-Ajax-Behavior-tp3095768p3095768.html
 Sent from the Users forum 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: CheckboxMultipleChoice doesn't support Ajax Behavior?

2010-12-20 Thread Pedro Santos
use AjaxFormChoiceComponentUpdatingBehavior istead of
AjaxFormComponentUpdatingBehavior


On Mon, Dec 20, 2010 at 2:22 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 try with onclick

 On Mon, Dec 20, 2010 at 5:20 PM, eugenebalt eugeneb...@yahoo.com wrote:

 
  I have a CheckBoxMultipleChoice which doesn't seem to support Ajax
  onChange.
 
  My code:
 
 
  CheckBoxMultipleChoice group = new
 CheckBoxMultipleChoice(CheckboxGroup1,
  valueList);
 
  group.add(new AjaxFormComponentUpdatingBehavior(onchange)
  {
 
 protected void onUpdate(AjaxRequestTarget target)
 {
  System.out.println(Updated Checkboxes);
 }
  });
 
  add(group);
 
 
 
 
 
  The checkboxes appear on the page as expected, but when I select or
  de-select any of them, the debug println statement above is not printed.
  Any
  ideas why?
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/CheckboxMultipleChoice-doesn-t-support-Ajax-Behavior-tp3095768p3095768.html
  Sent from the Users forum 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
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: CheckboxMultipleChoice doesn't support Ajax Behavior?

2010-12-20 Thread eugenebalt

Thank you, the onClick() works, but I have another question:

As I select/de-select checkboxes, I need to check what's currently selected.
Example: If Checkbox X is selected by itself (as a result of my
selections/de-selections), then I need to do some Ajax action.

The problem is, I don't have the values of the CheckBoxMultipleChoice
available until after I submit the form. If, in the Ajax code, I do


protected void onUpdate(AjaxRequestTarget target) 
{
System.out.println(Updated. New value:  + group.getValue() +  New 
Input:
 + group.getInput());
}


I get this output for all actions on the checkboxes

Updated. New value:  New Input: null


How do I dynamically see which checkboxes are selected?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckboxMultipleChoice-doesn-t-support-Ajax-Behavior-tp3095768p3095803.html
Sent from the Users forum 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: CheckboxMultipleChoice doesn't support Ajax Behavior?

2010-12-20 Thread eugenebalt

Pedro's reply did it. I'm getting the Values correctly if I use the
AjaxFormChoiceComponentUpdatingBehavior() (as opposed to the
AjaxFormComponentUpdatingBehavior).

Thanks all, problem resolved!!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckboxMultipleChoice-doesn-t-support-Ajax-Behavior-tp3095768p3095810.html
Sent from the Users forum 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



Converting Wicket Application to fat client (Swing/WebStart)

2010-12-20 Thread Frank Silbermann

I have a Wicket application at work that has been well-received by its internal 
users.  Because I am not much of a web programmer, and because it is for 
internal use only, I built a bunch of general-purpose panels and base pages 
which I use to assemble the application-oriented pages using no additional 
HTML.  Many of the general-purpose panels simply provide the HTML for general 
purpose Wicket components (e.g. sets of radio-buttons and sets of checkboxes) 
with a simplified API façade that provides only the flexibility needed in my 
application.

My application-oriented pages therefore emphasize the business logic, with very 
little code whatsoever dealing with display logic.  Yes, the resulting pages 
are ugly, but they are functional and reliable so my users don't care.

Now I have a new requirement.  A group would like to use this application with 
the proviso that no open-source software be used!  (They have a short list of 
permitted exceptions containing standard stuff such as Struts.)  Since I chose 
Wicket so that I could use more-or-less a Swing style of programming, I figured 
it would be easier to translate my application into a fat-client application 
using Swing and deliver it via WebStart -- rather than, say, re-implementing it 
in JSP or JFS. :-(

There will only be a few users, and they work for the company; I'm not terribly 
concerned about maximizing performance.

Do you have any suggestions about the most straight-forward way of translating 
a Wicket application to Swing?  I suppose that I would represent each page as a 
JFrame, and each panel as a JPanel.

In my panels I have a number of components (buttons, checkboxes, radio 
buttons...), many (but not all) of which post back immediately on change, and a 
very few AJAX components that redraw only a bit of the page.  What would be the 
most direct method of modeling page post-back (and partial post-back, for the 
AJAX components) in Swing?

This question is kind of ironic, since Wicket was created to provide a more 
Swing-like approach to web programming, and now I'm wondering about Wicket-like 
approach to Swing programming!  :-)

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



Initial DropDown Blank Choice (Choose One) Disappearing

2010-12-20 Thread eugenebalt

In my DropDown, the initial choice is blank (Choose One), which I want to
keep. My selections allow N/A which means nothing is selected.

Initially on my form, the Choose One blank option is available, but after
I make a selection, it goes away. Do I need to manually add a blank option
to my dropdown so it doesn't go away? Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Initial-DropDown-Blank-Choice-Choose-One-Disappearing-tp3095904p3095904.html
Sent from the Users forum 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: Initial DropDown Blank Choice (Choose One) Disappearing

2010-12-20 Thread Matthias Keller

Hi eugene

See DropDownChoice#setNullValid(boolean)

Matt

On 2010-12-20 18:57, eugenebalt wrote:

In my DropDown, the initial choice is blank (Choose One), which I want to
keep. My selections allow N/A which means nothing is selected.

Initially on my form, the Choose One blank option is available, but after
I make a selection, it goes away. Do I need to manually add a blank option
to my dropdown so it doesn't go away? Thanks





smime.p7s
Description: S/MIME Cryptographic Signature


Re: adding sub rows to AjaxFallbackDefaultDataTable

2010-12-20 Thread Alexander Morozov

Suggest another approach:

class MasterTableT extends DefaultDataTableT {

public MasterTable(...) {
  setItemReuseStrategy(new MasterTableReuseStrategy(this));
}

protected ItemT newDetailsRow(...) {
  /* create row here */
}

protected void populateDetailsRow(...) {
  /* populate details (cells) here by means of Panel of Fragment */
}

}

class MasterTableReuseStrategy implements IItemReuseStrategy {
  @Override
  public T IteratorItemT getItems(final IItemFactoryT factory, final
IteratorIModelT newModels,
  final IteratorItemT existingItems) {
return new IteratorItemT() {

  private int index = 0;
  private IModelT currentMasterRowModel = null;

  public boolean hasNext() {
return currentMasterRowModel != null || newModels.hasNext();
  }

  public ItemT next() {
if (currentMasterRowModel != null) {
  ItemT row = table.newDetailsRow(..., index++,
currentMasterRowModel);
  table.populateDetailsRow(row, ...);
  currentMasterRowModel = null;
  return row;
}
currentMasterRowModel = newModels.next();
return factory.newItem(index++, model);
  }

};
  }
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/adding-sub-rows-to-AjaxFallbackDefaultDataTable-tp3095096p3095919.html
Sent from the Users forum 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: Initial DropDown Blank Choice (

2010-12-20 Thread eugenebalt

Great. Thanks Matt
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Initial-DropDown-Blank-Choice-Choose-One-Disappearing-tp3095904p3095931.html
Sent from the Users forum 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: Converting Wicket Application to fat client (Swing/WebStart)

2010-12-20 Thread Jeremy Thomerson
On Mon, Dec 20, 2010 at 10:45 AM, Frank Silbermann
frank.silberm...@fedex.com wrote:

 I have a Wicket application at work that has been well-received by its 
 internal users.  Because I am not much of a web programmer, and because it is 
 for internal use only, I built a bunch of general-purpose panels and base 
 pages which I use to assemble the application-oriented pages using no 
 additional HTML.  Many of the general-purpose panels simply provide the HTML 
 for general purpose Wicket components (e.g. sets of radio-buttons and sets of 
 checkboxes) with a simplified API façade that provides only the flexibility 
 needed in my application.

 My application-oriented pages therefore emphasize the business logic, with 
 very little code whatsoever dealing with display logic.  Yes, the resulting 
 pages are ugly, but they are functional and reliable so my users don't care.

 Now I have a new requirement.  A group would like to use this application 
 with the proviso that no open-source software be used!  (They have a short 
 list of permitted exceptions containing standard stuff such as Struts.)  
 Since I chose Wicket so that I could use more-or-less a Swing style of 
 programming, I figured it would be easier to translate my application into a 
 fat-client application using Swing and deliver it via WebStart -- rather 
 than, say, re-implementing it in JSP or JFS. :-(

Then they don't want to use this application.  They want a new
application.  And the real problem is why do they say no open-source
software?  What I would do in this case is counter with a budget
proposal for the project.  Start off with implement web framework
that works with this application from scratch since we can't use
open source software == $8,428,748
(http://www.ohloh.net/p/wicket#cocomo).  Then add the other pieces
that you'll be replacing.

 There will only be a few users, and they work for the company; I'm not 
 terribly concerned about maximizing performance.

 Do you have any suggestions about the most straight-forward way of 
 translating a Wicket application to Swing?  I suppose that I would represent 
 each page as a JFrame, and each panel as a JPanel.

 In my panels I have a number of components (buttons, checkboxes, radio 
 buttons...), many (but not all) of which post back immediately on change, and 
 a very few AJAX components that redraw only a bit of the page.  What would be 
 the most direct method of modeling page post-back (and partial post-back, for 
 the AJAX components) in Swing?

 This question is kind of ironic, since Wicket was created to provide a more 
 Swing-like approach to web programming, and now I'm wondering about 
 Wicket-like approach to Swing programming!  :-)

Sorry, I don't have any actual technical advice for you here.  It just
seems like the kind of project that shouldn't happen.  Your department
manager should be fighting back against arbitrarily bad requirements.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: Converting Wicket Application to fat client (Swing/WebStart)

2010-12-20 Thread Peter Karich
 Am 20.12.2010 19:36, schrieb Jeremy Thomerson:
 On Mon, Dec 20, 2010 at 10:45 AM, Frank Silbermann
 frank.silberm...@fedex.com wrote:
 I have a Wicket application at work that has been well-received by its 
 internal users.  Because I am not much of a web programmer, and because it 
 is for internal use only, I built a bunch of general-purpose panels and base 
 pages which I use to assemble the application-oriented pages using no 
 additional HTML.  Many of the general-purpose panels simply provide the HTML 
 for general purpose Wicket components (e.g. sets of radio-buttons and sets 
 of checkboxes) with a simplified API façade that provides only the 
 flexibility needed in my application.

 My application-oriented pages therefore emphasize the business logic, with 
 very little code whatsoever dealing with display logic.  Yes, the resulting 
 pages are ugly, but they are functional and reliable so my users don't care.

 Now I have a new requirement.  A group would like to use this application 
 with the proviso that no open-source software be used!  (They have a short 
 list of permitted exceptions containing standard stuff such as Struts.)  
 Since I chose Wicket so that I could use more-or-less a Swing style of 
 programming, I figured it would be easier to translate my application into a 
 fat-client application using Swing and deliver it via WebStart -- rather 
 than, say, re-implementing it in JSP or JFS. :-(
 Then they don't want to use this application.  They want a new
 application.  And the real problem is why do they say no open-source
 software?  What I would do in this case is counter with a budget
 proposal for the project.  Start off with implement web framework
 that works with this application from scratch since we can't use
 open source software == $8,428,748
 (http://www.ohloh.net/p/wicket#cocomo).  Then add the other pieces
 that you'll be replacing.


BTW: the JSF implementation myfaces and ... aehm the whole jdk is open
source ...


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



Re: GIcon URL

2010-12-20 Thread Igor Racic
Hi,

Thank you Jeremy, urlFor was missing ingredient.

Regards,
Igor


2010/12/20 Jeremy Thomerson jer...@wickettraining.com

 Have you tried

 new GIcon(urlFor(new ResourceReference(SomeClass.class,
 path-to-img-relative-to-class.jpg)));

 On Sun, Dec 19, 2010 at 4:41 AM, Igor Racic igor.ra...@gmail.com wrote:
  Hi,
 
  That must be something simple.
  GIcon (from GMap2) have constructor GIcon (String) which works OK when I
 put
  URL of some external icon.
  How to do it when Icon is inside wicket ?
  I thought about resources but didn't come with something that works.
 
 
  Thank you and regards,
  Igor
 



 --
 Jeremy Thomerson
 http://wickettraining.com
 Need a CMS for Wicket?  Use Brix! http://brixcms.org

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




RE: Converting Wicket Application to fat client (Swing/WebStart)

2010-12-20 Thread Frank Silbermann
Well, I started it 5 years ago when the policy on open source had not yet been 
nailed down. As I've been improving it since then and the production 
infrastructure group did not have servers to run it on, we been running it on 
dev/test machines, and production managers have nonetheless been making good 
use of it.

Since then, the architecture group has tightened their standards with two 
purposes in mind:
(1) Standardize the tool sets so that developers become a more easily 
replaceable commodity, and
(2) Satisfy the lawyers, who fear the implications of a rogue open-source 
license whose terms might put the company in legal trouble.

New government regulations are also forcing upper management to monitor 
software installations much more closely.  Therefore, any use of open source 
software must be approved by the architecture board, a board which is NOT 
responsible for our department's budget or convenience.  I have to consider the 
possibility that they will take a tough line.


Therefore, I'm trying to think of a back-up strategy in case they refuse to 
approve Wicket, which they might well do for the sake of reason (1), even if 
Apache's role in Wicket relieves concern (2).

I chose Wicket because the standard Java web frameworks then in existence 
horrified me (and still do).  Perhaps I should have used Java Swing with 
WebStart from the beginning, but I'd heard that 
WebStart still had problems.  (I expect it has been improved since then, but at 
this point I no longer care.)  I don't want a difficult rewrite, especially not 
one that forces me to give up the DRY (don't repeat yourself) principle.

Yeah, it might cost $8 million to re-implement Wicket in-house :-), but I was 
hoping that maybe it would be much cheaper to re-implement my base components 
in a fat-client technology -- since that would eliminate most of the problems 
Wicket was created to solve.
 
-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Monday, December 20, 2010 12:36 PM
To: users@wicket.apache.org
Subject: Re: Converting Wicket Application to fat client (Swing/WebStart)

On Mon, Dec 20, 2010 at 10:45 AM, Frank Silbermann
frank.silberm...@fedex.com wrote:

 I have a Wicket application at work that has been well-received by its 
 internal users.  Because I am not much of a web programmer, and because it is 
 for internal use only, I built a bunch of general-purpose panels and base 
 pages which I use to assemble the application-oriented pages using no 
 additional HTML.  Many of the general-purpose panels simply provide the HTML 
 for general purpose Wicket components (e.g. sets of radio-buttons and sets of 
 checkboxes) with a simplified API façade that provides only the flexibility 
 needed in my application.

 My application-oriented pages therefore emphasize the business logic, with 
 very little code whatsoever dealing with display logic.  Yes, the resulting 
 pages are ugly, but they are functional and reliable so my users don't care.

 Now I have a new requirement.  A group would like to use this application 
 with the proviso that no open-source software be used!  (They have a short 
 list of permitted exceptions containing standard stuff such as Struts.)  
 Since I chose Wicket so that I could use more-or-less a Swing style of 
 programming, I figured it would be easier to translate my application into a 
 fat-client application using Swing and deliver it via WebStart -- rather 
 than, say, re-implementing it in JSP or JFS. :-(

Then they don't want to use this application.  They want a new
application.  And the real problem is why do they say no open-source
software?  What I would do in this case is counter with a budget
proposal for the project.  Start off with implement web framework
that works with this application from scratch since we can't use
open source software == $8,428,748
(http://www.ohloh.net/p/wicket#cocomo).  Then add the other pieces
that you'll be replacing.

 There will only be a few users, and they work for the company; I'm not 
 terribly concerned about maximizing performance.

 Do you have any suggestions about the most straight-forward way of 
 translating a Wicket application to Swing?  I suppose that I would represent 
 each page as a JFrame, and each panel as a JPanel.

 In my panels I have a number of components (buttons, checkboxes, radio 
 buttons...), many (but not all) of which post back immediately on change, and 
 a very few AJAX components that redraw only a bit of the page.  What would be 
 the most direct method of modeling page post-back (and partial post-back, for 
 the AJAX components) in Swing?

 This question is kind of ironic, since Wicket was created to provide a more 
 Swing-like approach to web programming, and now I'm wondering about 
 Wicket-like approach to Swing programming!  :-)

Sorry, I don't have any actual technical advice for you here.  It just
seems like the kind of project that shouldn't happen.  Your department

Re: Converting Wicket Application to fat client (Swing/WebStart)

2010-12-20 Thread Martin Makundi
 Therefore, I'm trying to think of a back-up strategy in case they refuse to 
 approve Wicket

We are hiring ;))

**
Martin


which they might well do for the sake of reason (1), even if Apache's
role in Wicket relieves concern (2).

 I chose Wicket because the standard Java web frameworks then in existence 
 horrified me (and still do).  Perhaps I should have used Java Swing with 
 WebStart from the beginning, but I'd heard that
 WebStart still had problems.  (I expect it has been improved since then, but 
 at this point I no longer care.)  I don't want a difficult rewrite, 
 especially not one that forces me to give up the DRY (don't repeat yourself) 
 principle.

 Yeah, it might cost $8 million to re-implement Wicket in-house :-), but I was 
 hoping that maybe it would be much cheaper to re-implement my base components 
 in a fat-client technology -- since that would eliminate most of the problems 
 Wicket was created to solve.

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Monday, December 20, 2010 12:36 PM
 To: users@wicket.apache.org
 Subject: Re: Converting Wicket Application to fat client (Swing/WebStart)

 On Mon, Dec 20, 2010 at 10:45 AM, Frank Silbermann
 frank.silberm...@fedex.com wrote:

 I have a Wicket application at work that has been well-received by its 
 internal users.  Because I am not much of a web programmer, and because it 
 is for internal use only, I built a bunch of general-purpose panels and base 
 pages which I use to assemble the application-oriented pages using no 
 additional HTML.  Many of the general-purpose panels simply provide the HTML 
 for general purpose Wicket components (e.g. sets of radio-buttons and sets 
 of checkboxes) with a simplified API façade that provides only the 
 flexibility needed in my application.

 My application-oriented pages therefore emphasize the business logic, with 
 very little code whatsoever dealing with display logic.  Yes, the resulting 
 pages are ugly, but they are functional and reliable so my users don't care.


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



RadioGroup / Radio with text fields.

2010-12-20 Thread Ioannis Canellos
Hi,

I have an issue with the RadioGroup component.
I want a RadioGroup that will have a couple of radio items, which will
contain text fields. I want the model of the radio group to contain the
value that is typed in the selected textfield.

RadioGroupString radioGroup = new RadioGroup(radioGroup,new
PropertyModelString(this,value);

RadioString radio1 = new RadioString(radio1,
textfield1Model,radioGroup);
RadioString radio2 = new RadioString(radio2,
textfield2Model,radioGroup);

TextFieldString textField1 = new
TextFieldString(textField1,textField1Model);
TextFieldString textField2 = new
TextFieldString(textField2,textField1Model);

radioGroup.add(radio1);
radioGroup.add(radio2);
radio1.add(textField1)
radio2.add(textField2);


If the radio1 is select it works ok.
If the radio2 is selected it breaks.

Any idea is more than welcome.

*Ioannis Canellos*
http://iocanel.blogspot.com
Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com


AjaxFormComponentUpdatingBehaviour on CheckBoxMultipleChoice component

2010-12-20 Thread Josh Kamau
Hi guys;

I have a CheckboxMultipleChoice component. I want whenever a choice is
changed, a label lists a comma separated list of the selected items.
However, the CheckBoxMultipleChoice component seems to have an empty list
whenever a choice is changed.

Here is how i have created the component ;

lstMaterial = new CheckBoxMultipleChoiceMaterial(materials, new
LoadableDetachableModelListMaterial() {

@Override
protected ListMaterial load() {
return dao.getAllItems(Material.class);
}
});


Here is how i have added the change behaviour:

lstMaterial.add(new AjaxFormComponentUpdatingBehavior(onchange){

@Override
protected void onUpdate(AjaxRequestTarget target) {
materialDescription =
getStringFromList(lstMaterial.getModelValue());
target.addComponent(txtMaterialDescription);
}

});

I have even tried printing the size of the List in the component's model and
its 0. The component is a part of form that use CompoundPropertyModel with a
list property named materials.

Any help will be appreciated.

Josh


Re: AjaxFormComponentUpdatingBehaviour on CheckBoxMultipleChoice component

2010-12-20 Thread Jeremy Thomerson
On Mon, Dec 20, 2010 at 3:49 PM, Josh Kamau joshnet2...@gmail.com wrote:
 Hi guys;

 I have a CheckboxMultipleChoice component. I want whenever a choice is
 changed, a label lists a comma separated list of the selected items.
 However, the CheckBoxMultipleChoice component seems to have an empty list
 whenever a choice is changed.

 Here is how i have created the component ;

 lstMaterial = new CheckBoxMultipleChoiceMaterial(materials, new
 LoadableDetachableModelListMaterial() {

           �...@override
            protected ListMaterial load() {
                return dao.getAllItems(Material.class);
            }
        });


 Here is how i have added the change behaviour:

 lstMaterial.add(new AjaxFormComponentUpdatingBehavior(onchange){

           �...@override
            protected void onUpdate(AjaxRequestTarget target) {
                materialDescription =
 getStringFromList(lstMaterial.getModelValue());
                target.addComponent(txtMaterialDescription);
            }

        });

 I have even tried printing the size of the List in the component's model and
 its 0. The component is a part of form that use CompoundPropertyModel with a
 list property named materials.

 Any help will be appreciated.

 Josh


Less than five hours ago, Pedro Santos added a helpful warning message
that will tell you how to fix such a problem :)

http://svn.apache.org/viewvc?view=revisionrevision=1051222
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java?r1=806204r2=1051222pathrev=1051222diff_format=h

log.warn(String.format(
93  
AjaxFormComponentUpdatingBehavior is not suposed to be added in the
form component at path: \%s\. 
94   + Use the
AjaxFormChoiceComponentUpdatingBehavior instead, that is meant for
choices/groups that are not one component in the html but many,
95   
getComponent().getPageRelativePath()));

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: AjaxFormComponentUpdatingBehaviour on CheckBoxMultipleChoice component

2010-12-20 Thread Josh Kamau
Thanks alot Jeremy.

I have it working now.

That was a really quick response.

Josh.

On Tue, Dec 21, 2010 at 12:53 AM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 On Mon, Dec 20, 2010 at 3:49 PM, Josh Kamau joshnet2...@gmail.com wrote:
  Hi guys;
 
  I have a CheckboxMultipleChoice component. I want whenever a choice is
  changed, a label lists a comma separated list of the selected items.
  However, the CheckBoxMultipleChoice component seems to have an empty list
  whenever a choice is changed.
 
  Here is how i have created the component ;
 
  lstMaterial = new CheckBoxMultipleChoiceMaterial(materials, new
  LoadableDetachableModelListMaterial() {
 
 @Override
 protected ListMaterial load() {
 return dao.getAllItems(Material.class);
 }
 });
 
 
  Here is how i have added the change behaviour:
 
  lstMaterial.add(new AjaxFormComponentUpdatingBehavior(onchange){
 
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 materialDescription =
  getStringFromList(lstMaterial.getModelValue());
 target.addComponent(txtMaterialDescription);
 }
 
 });
 
  I have even tried printing the size of the List in the component's model
 and
  its 0. The component is a part of form that use CompoundPropertyModel
 with a
  list property named materials.
 
  Any help will be appreciated.
 
  Josh
 

 Less than five hours ago, Pedro Santos added a helpful warning message
 that will tell you how to fix such a problem :)

 http://svn.apache.org/viewvc?view=revisionrevision=1051222

 http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java?r1=806204r2=1051222pathrev=1051222diff_format=h

 log.warn(String.format(
 93
 AjaxFormComponentUpdatingBehavior is not suposed to be added in the
 form component at path: \%s\. 
 94   + Use the
 AjaxFormChoiceComponentUpdatingBehavior instead, that is meant for
 choices/groups that are not one component in the html but many,
 95
 getComponent().getPageRelativePath()));

 --
 Jeremy Thomerson
 http://wickettraining.com
 Need a CMS for Wicket?  Use Brix! http://brixcms.org

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




Re: adding sub rows to AjaxFallbackDefaultDataTable

2010-12-20 Thread Benedikt Schlegel
Hi Alexander,
would you mind to give a short explanation of the logic in
MasterTableReuseStrategy?

Thanks

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



Submit Form from AjaxFormChoiceComponentUpdatingBehavior

2010-12-20 Thread Jered Myers
Does anybody know a good way to trigger a form submit from inside the 
onUpdate method of an AjaxFormChoiceComponentUpdatingBehavior?


Here is an example:
int i = 0;
int mode = 0;
...
RadioGroupInteger group = new RadioGroupInteger(group, new 
PropertyModelInteger(this, mode));

group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
protected void onUpdate(AjaxRequestTarget target) {
if(mode == 3  i ==0) {
// submit my form ==
}
}
});

RadioInteger mode1 = new RatioInteger(one, new ModelInteger(1));
group.add(mode1);
RadioInteger mode2 = new RatioInteger(two, new ModelInteger(2));
group.add(mode2);
RadioInteger mode3 = new RatioInteger(three, new ModelInteger(3));
group.add(mode3);

Jered Myers



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



Re: Submit Form from AjaxFormChoiceComponentUpdatingBehavior

2010-12-20 Thread Jeremy Thomerson
Probably something like this should work:

target.appendJavascript(Wicket.$(' + getForm().getMarkupId() + ').submit());

On Mon, Dec 20, 2010 at 4:34 PM, Jered Myers
jer...@maplewoodsoftware.com wrote:
 Does anybody know a good way to trigger a form submit from inside the
 onUpdate method of an AjaxFormChoiceComponentUpdatingBehavior?

 Here is an example:
 int i = 0;
 int mode = 0;
 ...
 RadioGroupInteger group = new RadioGroupInteger(group, new
 PropertyModelInteger(this, mode));
 group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
    protected void onUpdate(AjaxRequestTarget target) {
        if(mode == 3  i ==0) {
            // submit my form ==
        }
    }
 });

 RadioInteger mode1 = new RatioInteger(one, new ModelInteger(1));
 group.add(mode1);
 RadioInteger mode2 = new RatioInteger(two, new ModelInteger(2));
 group.add(mode2);
 RadioInteger mode3 = new RatioInteger(three, new ModelInteger(3));
 group.add(mode3);

 Jered Myers



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





-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: DropDownChoice, AjaxFormComponentUpdatingBehavior and dijit.form.FilteringSelect

2010-12-20 Thread hok

Jeremy, thanks for the fast response. However my problem is not the same as
described in the other topic.
I'm using DropDownChoice, so I cannot use
AjaxFormChoiceComponentUpdatingBehavior (it throws an exception that it's
supposed to be used with RadioChoice/CheckboxChoice/RadioGroup/CheckGroup).
When I use the regular AjaxFormComponentUpdatingBehavior without dojo
FilteringSelect the behavior works normal and the value is transferred. The
problem occurs when I use FilteringSelect. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-AjaxFormComponentUpdatingBehavior-and-dijit-form-FilteringSelect-tp3102241p3104029.html
Sent from the Users forum 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: adding sub rows to AjaxFallbackDefaultDataTable

2010-12-20 Thread James Carman
Have you thought about using a tree table
On Dec 19, 2010 11:42 PM, fachhoch fachh...@gmail.com wrote:

 I want to insert row with column spanning

 My datatable lists master record in each row , I want to display detail
 record in the next row when user click on master record for which I tought
 of using expand table rows with jquery plugin

 I found this post which will help me here is the ocde form the post


 new AjaxFallbackDefaultDataTableMyCustomObject(
 id, columns, dataProvider, rowsPerPage){

 @Override
 protected ItemMyCustomObject newRowItem(String id,
 int index,
 final IModelMyCustomObject model){
 ItemMyCustomObject item = super.newRowItem(id, index, model);
 item.add(new AbstractBehavior(){

 private static final long serialVersionUID = 1L;

 /**
 * {...@inheritdoc}
 */
 @Override
 public void onRendered(Component component){
 if(model.getObject().isEpicFail()){
 component.getResponse().write(
 trtd colspan=\3\This is an epic fail/td/tr);
 }
 }

 });
 return item;
 }

 private static final long serialVersionUID = 1L;

 }

 in the above example I am writing some html to create the additional row ,
 I am wondering if I can get the generated markup of a panel and feed it to
 the write method ?

 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/adding-sub-rows-to-AjaxFallbackDefaultDataTable-tp3095096p3095096.html
 Sent from the Users forum 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: Submit Form from AjaxFormChoiceComponentUpdatingBehavior

2010-12-20 Thread Jered Myers

Thanks, that worked!

On 12/20/2010 2:36 PM, Jeremy Thomerson wrote:

Probably something like this should work:

target.appendJavascript(Wicket.$(' + getForm().getMarkupId() + ').submit());

On Mon, Dec 20, 2010 at 4:34 PM, Jered Myers
jer...@maplewoodsoftware.com  wrote:

Does anybody know a good way to trigger a form submit from inside the
onUpdate method of an AjaxFormChoiceComponentUpdatingBehavior?

Here is an example:
int i = 0;
int mode = 0;
...
RadioGroupInteger  group = new RadioGroupInteger(group, new
PropertyModelInteger(this, mode));
group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
protected void onUpdate(AjaxRequestTarget target) {
if(mode == 3  i ==0) {
// submit my form==
}
}
});

RadioInteger  mode1 = new RatioInteger(one, new ModelInteger(1));
group.add(mode1);
RadioInteger  mode2 = new RatioInteger(two, new ModelInteger(2));
group.add(mode2);
RadioInteger  mode3 = new RatioInteger(three, new ModelInteger(3));
group.add(mode3);

Jered Myers



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







--
Jered Myers
509-252-3550 x 109
Programmer/Analyst
Maplewood Software


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



Re: DropDownChoice, AjaxFormComponentUpdatingBehavior and dijit.form.FilteringSelect

2010-12-20 Thread Jeremy Thomerson
On Mon, Dec 20, 2010 at 4:41 PM, hok ivanvasi...@gmail.com wrote:

 Jeremy, thanks for the fast response. However my problem is not the same as
 described in the other topic.
 I'm using DropDownChoice, so I cannot use
 AjaxFormChoiceComponentUpdatingBehavior (it throws an exception that it's
 supposed to be used with RadioChoice/CheckboxChoice/RadioGroup/CheckGroup).
 When I use the regular AjaxFormComponentUpdatingBehavior without dojo
 FilteringSelect the behavior works normal and the value is transferred. The
 problem occurs when I use FilteringSelect.

Sorry, both Martin and I had our quick trigger fingers ready with the
(almost auto-) reply.  :)

Although I am not familiar with dojo, from your description of the
problem I would suspect that Dojo is modifying the this.value of the
select box.  Looking at the description that you linked to, this seems
correct.  It mentions immediately that it works with an input box and
a hidden text value.  I suspect that there is a hidden field that
contains the value of your select box.  The description of the
filtering select using a native select box confirms this: the
OPTION's child text node is used as the displayed value and the
OPTION's value attribute is used as *the hidden submit value*.

You'll need to write some custom JS (probably as an
IAjaxCallDecorator) that sets the value of the select input to the
value of the hidden field before Wicket does its thing, or else that
does custom submission altogether.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Ioannis Canellos
Hi,

I have an issue with the RadioGroup component.
I want a RadioGroup that will have a couple of radio items, which will
contain text fields. I want the model of the radio group to contain the
value that is typed in the selected textfield.

RadioGroupString radioGroup = new RadioGroup(radioGroup,new
PropertyModelString(this,value);

RadioString radio1 = new RadioString(radio1,
textfield1Model,radioGroup);
RadioString radio2 = new RadioString(radio2,
textfield2Model,radioGroup);

TextFieldString textField1 = new
TextFieldString(textField1,textField1Model);
TextFieldString textField2 = new
TextFieldString(textField2,textField1Model);

radioGroup.add(radio1);
radioGroup.add(radio2);
radio1.add(textField1)
radio2.add(textField2);


If the radio1 is select it works ok.
If the radio2 is selected it breaks.
-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com


Re: Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Jeremy Thomerson
On Mon, Dec 20, 2010 at 4:50 PM, Ioannis Canellos ioca...@gmail.com wrote:
 Hi,

 I have an issue with the RadioGroup component.
 I want a RadioGroup that will have a couple of radio items, which will
 contain text fields. I want the model of the radio group to contain the
 value that is typed in the selected textfield.

 RadioGroupString radioGroup = new RadioGroup(radioGroup,new
 PropertyModelString(this,value);

 RadioString radio1 = new RadioString(radio1,
 textfield1Model,radioGroup);
 RadioString radio2 = new RadioString(radio2,
 textfield2Model,radioGroup);

 TextFieldString textField1 = new
 TextFieldString(textField1,textField1Model);
 TextFieldString textField2 = new
 TextFieldString(textField2,textField1Model);

 radioGroup.add(radio1);
 radioGroup.add(radio2);
 radio1.add(textField1)
 radio2.add(textField2);


 If the radio1 is select it works ok.
 If the radio2 is selected it breaks.
 --
 *Ioannis Canellos*
 http://iocanel.blogspot.com

 Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com



Please don't double-post.  It won't help you get a quicker answer.  I
haven't really looked at your issue, but it might be good to provide
more example code.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: adding sub rows to AjaxFallbackDefaultDataTable

2010-12-20 Thread fachhoch

tree table will not work ,  I need a table in the sub row,if I use tree table
I cannot have header for the table.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/adding-sub-rows-to-AjaxFallbackDefaultDataTable-tp3095096p3112645.html
Sent from the Users forum 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



famous ajaxuploadpanel

2010-12-20 Thread fachhoch

I am using the famous ajaxupload panel which uses IFrame to simulate ajax
fileupload.

till this time I was saving the uploaded file to database and  in
onUploadFinished  method I used to update a refreshingview which gets these
files from database .
Now  I want to save them in memory till the user saves the form which has  
some more  filelds  .
what I did is I created a simple object to represent uploaded file , this
object contains filename and filebytes .
My case is Panel which has a form and and  ajaxuploadpanel,the panel has
fields represting formelements model and Myobject represeting uploaded file.
my panel

public abstract class AbstractBatchPanel extends Panel {


private BatchFileHelper  audBatchFileHelper;



private Date  batchReceivedDate; 



My uploaded file  representing object  is below

protected   class BatchFileHelper  implements  Serializable {
String filename;
byte[]  filedata;
FileType  fileType;

public BatchFileHelper(String filename, byte[]  
filedata,  FileType 
fileType ) {
this.filedata=filedata;
this.filename=filename;
this.fileType=fileType;
}

}



this is the simple class representing  uploaded file.

in the onFileUpload method of myUploadPanel  I create instance of  
BatchFileHelper   and set it to the field 
here is the code


add(new UploadPanel(auditBatchUploadPnel) {

@Override
public void onUploadFinished(AjaxRequestTarget target, 
String filename,
String newFileUrl) {


System.out.println(AbstractBatchPanel.this.audBatchFileHelper);

target.addComponent(AbstractBatchPanel.this.get(batchFilesContainer));
}
@Override
public String onFileUploaded(FileUpload upload) {
if(upload!=null){

AbstractBatchPanel.this.audBatchFileHelper= new
BatchFileHelper(FilenameUtils.getName(upload.getClientFileName()),upload.getBytes(),FileType.AUDIT);
}
return ;
}
});



I was assuming after onFileUploadedmethod  is called   the instance field   
audBatchFileHelper  will hold the uploaded file.but surprising once I
comeout of this method  in teh method onUploadFinished the   
audBatchFileHelper   remanins null.
Please help me, tell me why is the instance field remain null   even after 
instantiating   ?









-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/famous-ajaxuploadpanel-tp3113809p3113809.html
Sent from the Users forum 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: famous ajaxuploadpanel

2010-12-20 Thread Pedro Santos
please provide a quickstart

On Mon, Dec 20, 2010 at 11:19 PM, fachhoch fachh...@gmail.com wrote:


 I am using the famous ajaxupload panel which uses IFrame to simulate ajax
 fileupload.

 till this time I was saving the uploaded file to database and  in
 onUploadFinished  method I used to update a refreshingview which gets these
 files from database .
 Now  I want to save them in memory till the user saves the form which has
 some more  filelds  .
 what I did is I created a simple object to represent uploaded file , this
 object contains filename and filebytes .
 My case is Panel which has a form and and  ajaxuploadpanel,the panel has
 fields represting formelements model and Myobject represeting uploaded
 file.
 my panel

 public abstract class AbstractBatchPanel extends Panel {


private BatchFileHelper  audBatchFileHelper;



private Date  batchReceivedDate;



 My uploaded file  representing object  is below

protected   class BatchFileHelper  implements  Serializable {
String filename;
byte[]  filedata;
FileType  fileType;

public BatchFileHelper(String filename, byte[]
  filedata,  FileType
 fileType ) {
this.filedata=filedata;
this.filename=filename;
this.fileType=fileType;
}

}



 this is the simple class representing  uploaded file.

 in the onFileUpload method of myUploadPanel  I create instance of
 BatchFileHelper   and set it to the field
 here is the code


add(new UploadPanel(auditBatchUploadPnel) {

@Override
public void onUploadFinished(AjaxRequestTarget
 target, String filename,
String newFileUrl) {


  System.out.println(AbstractBatchPanel.this.audBatchFileHelper);

  target.addComponent(AbstractBatchPanel.this.get(batchFilesContainer));
}
@Override
public String onFileUploaded(FileUpload upload) {
if(upload!=null){

  AbstractBatchPanel.this.audBatchFileHelper= new

 BatchFileHelper(FilenameUtils.getName(upload.getClientFileName()),upload.getBytes(),FileType.AUDIT);
}
return ;
}
});



 I was assuming after onFileUploadedmethod  is called   the instance field
 audBatchFileHelper  will hold the uploaded file.but surprising once I
 comeout of this method  in teh method onUploadFinished the
 audBatchFileHelper   remanins null.
 Please help me, tell me why is the instance field remain null   even after
 instantiating   ?









 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/famous-ajaxuploadpanel-tp3113809p3113809.html
 Sent from the Users forum 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




-- 
Pedro Henrique Oliveira dos Santos


Re: Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Ioannis Canellos
Sorry but I received delivery failure both times I sent the email.

On Tuesday, December 21, 2010, Jeremy Thomerson
jer...@wickettraining.com wrote:
 On Mon, Dec 20, 2010 at 4:50 PM, Ioannis Canellos ioca...@gmail.com wrote:
 Hi,

 I have an issue with the RadioGroup component.
 I want a RadioGroup that will have a couple of radio items, which will
 contain text fields. I want the model of the radio group to contain the
 value that is typed in the selected textfield.

 RadioGroupString radioGroup = new RadioGroup(radioGroup,new
 PropertyModelString(this,value);

 RadioString radio1 = new RadioString(radio1,
 textfield1Model,radioGroup);
 RadioString radio2 = new RadioString(radio2,
 textfield2Model,radioGroup);

 TextFieldString textField1 = new
 TextFieldString(textField1,textField1Model);
 TextFieldString textField2 = new
 TextFieldString(textField2,textField1Model);

 radioGroup.add(radio1);
 radioGroup.add(radio2);
 radio1.add(textField1)
 radio2.add(textField2);


 If the radio1 is select it works ok.
 If the radio2 is selected it breaks.
 --
 *Ioannis Canellos*
 http://iocanel.blogspot.com

 Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com



 Please don't double-post.  It won't help you get a quicker answer.  I
 haven't really looked at your issue, but it might be good to provide
 more example code.

 --
 Jeremy Thomerson
 http://wickettraining.com
 Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com

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