Multiple submit buttons - CompoundPropertyModel not updated

2010-11-03 Thread Benjamin Lorenz
Hello,

I have a problem with a form that shall have two submit buttons. One finally 
submits the form with all plausibility checks, etc... the other just opens up a 
search form, to lookup some data for inclusion in the form. This submit shall 
NOT do all the checks on e.g. .setRequired(true), etc..., but it DOES HAVE to 
update my CompoundPropertyModel values, to deal with the user's (partially) 
entered values so far.

I cannot get this together: setDefaultFormProcessing(false) will not update my 
models, setDefaultFormProcessing(true) will finally submit my form, also 
calling the form's onSubmit, which is not what I want. 

I am using an anonymous form class with the default onSubmit(), and an 
additionally attached Button, which has its own onSubmit().

Do you understand what I mean, and can anybody point me to the right direction? 
It seems to me like a very basic, fundamental thing to do, two form buttons, 
that deal - independently from each other - with the entered data, but it seems 
to be tricky nevertheless...

Thanks,
Benjamin



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



Re: wicket-ajax header from url?

2010-11-03 Thread Frank van Lankvelt
I think it would make sense to have any requests targeting an
abstract-ajax-behavior be marked as 'ajax', without requiring client-side
logic.  This makes client-side integration quite straightforward.  One then
only needs to implement the server side of the protocol, without having to
intercept the request creation process.  It also makes request handling more
robust in the face of concurrent requests, as I experienced.

Implementing this behavior with the wicket:ajax parameter in the url does
require support when rendering urls; should be easy in 1.5, is currently not
possible in 1.4 since the webrequestcodingstrategy does not render
user-defined request parameters.  I'm now doing it by simply appending
'wicket:ajax=true' in the getCallbackUrl method.

There are probably alternative solutions that do not require a parameter in
the url; I haven't looked into those yet.

thanks for clarifying, Frank


On Tue, Nov 2, 2010 at 7:03 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 the url parameter is there only as a workaround for when we cannot set
 the header. i think the only usecase is for fileuploads where we have
 to set an ajax url on iframe's src attribute. the header is the
 preferred way to do this and you can set it yourself i you need or use
 wicket's ajax js to perform the request - which will set it for you.

 -igor

 On Mon, Nov 1, 2010 at 11:59 PM, Frank van Lankvelt
 f.vanlankv...@onehippo.com wrote:
  well, the two kinds of ajax requests differ; the WebRequest#isAjax method
  returns true for wicket-ajax, but false for non-wicket-ajax requests.
  The
  'wicket-ajax' request has the Wicket-Ajax header, the other does not.  So
 I
  should have said that the first (locking) request was non-wicket-ajax;
 i.e.
  an ajax request but without the Wicket-Ajax header set.
 
  Some further digging turned up the wicket:ajax request parameter; I guess
 I
  should simply append it to the URL for the non-wicket-ajax behavior.
   Perhaps that could happen in the base class AbstractAjaxBehavior?
 
  cheers, Frank
 
  On Tue, Nov 2, 2010 at 1:14 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  so why is there the non-ajax request?
 
  once the page is loaded everything else - communication with ext -
  should be happening via ajax requests...
 
  -igor
 
  On Mon, Nov 1, 2010 at 1:20 PM, Frank van Lankvelt
  f.vanlankv...@onehippo.com wrote:
   it returned false because
   a) the locking request was not ajax
   b) the current request was ajax
   c) they shared the same page version
   Page versioning is disabled, though that shouldn't matter.  (that
 might
  be a
   worthwhile additional check before comparing versions; I'm not very
  familiar
   with versions)
  
   It's a concurrency issue for one page, with some non-wicket-ajax
  behaviors,
   so it might be pushing what people have seen?
  
   Both ext-js integration projects I've found have the same basic setup;
  use
   AbstractAjaxBehavior to provide data services, use
   AbstractDefaultAjaxBehavior subclasses for listening to Ext events.
  So
   that's also where my bug occurs; I'm switching between ext components
 on
  the
   client as the result of some action.  The action leads to a
 notification
  to
   wicket, the new component starts fetching data.
  
   thanks, Frank
  
   On Mon, Nov 1, 2010 at 5:28 PM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   did you check why it returns false? ajax requests should not
 increment
   the page version, so they should always be current. people have
   built extjs integrations before, you may look into one of those for
   hints.
  
   -igor
  
   On Mon, Nov 1, 2010 at 9:14 AM, Frank van Lankvelt
   f.vanlankv...@onehippo.com wrote:
In my attempts to integrate a javascript client-side framework
  (ext-js)
   to
wicket, I'm running into the problem that the client-side framework
   expects
URLs to send requests to, expecting a JSON/XML response.  This is
 of
   course
perfectly natural behavior for a js framework.
   
The documentation I could find suggested to use an
  AbstractAjaxBehavior.
 However, this doesn't quite work.  Concurrent proper wicket-ajax
   requests
(abstractdefaultajaxbehavior) are aborted due to
WebSession#isCurrentRequestValid returning false.
   
Am I doing something wrong here, or should I simply override the
isCurrentRequestValid method to always return true?
   
thanks, Frank
   
PS: I'm using wicket-1.4.9; but couldn't find relevant issues that
  have
   been
fixed since this release
   
--
Hippo
Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31
 (0)20
   522
4466
USA  • San Francisco  185 H Street Suite B  •  Petaluma CA
 94952-5100
  •
+1
(707) 773 4646
Canada•   Montréal  5369 Boulevard St-Laurent #430 •  Montréal
 QC
  H2T
1S5  •  +1 (514) 316 8966
www.onehippo.com  •  www.onehippo.org  •  i...@onehippo.com
   
  
   

How to get other page's localized messages ?

2010-11-03 Thread smallufo
If I have two WebPages :
Page1.java
Page1.properties , which stores default value
Page1_zh.properties , which stores Chinese translations

And Page2.java

How do I get Page1's specific localized message in Page2 ?

I noticed the StringResourceModel , but it seems not what I want.
StringResourceModel's constructor must pass a Component object , but I
cannot new Page1 in Page2

Is there anything like :
SomeModel(key , Page1.class) , so that I can get key bound to Page1 ?

Thanks.


SV: How to get other page's localized messages ?

2010-11-03 Thread Wilhelmsen Tor Iver
 How do I get Page1's specific localized message in Page2 ?

1) Make a superclass for the two pages and put the message in the superclass' 
property file

2) Put the property in the Application's property file

In both cases the mechanisms in Wicket will find the message.

- Tor I.

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



How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread tommy

I asked the following question on stack-overflow but was advised to ask here
instead.
http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc

I am using Wicket and would like to create a grid of radio buttons using
html as shown below (outer lists will be displayed vertically, inner lists
will be displayed horizontally).

I would like the radio buttons grouped vertically.

ul
  li
ul
   liinput type=radio name=A/li
   liinput type=radio name=B/li
   liinput type=radio name=C/li
/ul
  /li
  li
ul
   liinput type=radio name=A/li
   liinput type=radio name=B/li
   liinput type=radio name=C/li
/ul
  /li
  li
ul
   liinput type=radio name=A/li
   liinput type=radio name=B/li
   liinput type=radio name=C/li
/ul
  /li
/ul

Unfortunately it seems that RadioGroup only allow one to group radio buttons
according to the grouping defined by their layout.

eg RadioGroup group = new RadioGroup(radioGroupA);

group.add( new Radio(myradio, new Model(1)) ;

Problem with this is that I cannot then layout the way I want.

Is there another way? Manually specifying the name and gather results?

UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one can
do something like:

// create some groups
for (0..n) {
  RadioGroup group = new RadioGroup(myRadioGroup, new Model { .. } );
  groupArray.add(group)
}

//create a ListView for the RadioGroups so we can attach them to page
ListView radioListView = ListView(radioGroupList) { populate from
groupArray }
add(radioListView);

// create our grid of radio buttons
// outer - rows
for (0..x) {
  // inner - columns
  for (0..n)
// supply group from our groupArray
add( new Radio(myradio, new Model(1), groupArray.get(n) ));
  }
}

I can then add the Radios and RadioGroups to the form independently of
layout and this has the desired effect in terms of the grouping.

form
   span wicket:id=radioGroupList
  span wicket:id=radioGroup/
   /span
  ul
liradio wicket:id=myradio//li

But now, when I submit I am getting the following error:

WicketMessage: submitted http post value [radio33] for RadioGroup component
[2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
is illegal because it does not contain relative path to a Radio componnet.
Due to this the RadioGroup component cannot resolve the selected Radio
component pointed to by the illegal value. A possible reason is that
componment hierarchy changed between rendering and form submission.

Any idea what this means?

The spelling mistake 'componment' suggests it's not seen too often.

I am using wicket 1.4.12.

I found this ticket that looks related too :
https://issues.apache.org/jira/browse/WICKET-1055

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.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



GMap2 off center

2010-11-03 Thread Peter Miklosko
In our application we are using Wicket GMap2 in some cases successfully in
other case with problems. The map is being off center, having about 10-15px
grey border on the left and bottom of the map and in case of multiple
markers on the map being zoomed out to 0.0 in Firefox. The map is showing
fine in Chromium and to big surprise in IE6.

I'm trying to determinate what is problem here and bellow is just
short comparison of differences.
Page A with working map does quick search for geographical location to be
presented to user, pin these locations to map and show descriptions
retrieved from DB.
Page B with not working map first runs flash animation while does the search
for flights, once flights found it will redirect results to next page and
pin locations to map plus plus populate table with search results.

Anyone had similar problem? Can you give some pointers to solve this?

If more info need it please just let me know

Peter


Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Michael O'Cleirigh

Hi,

The RadioGroup just needs to wrap the radio's in your markup.  Typically 
it does not even render markup in the resultant page.


Instead of this:

form
 span wicket:id=radioGroupList
span wicket:id=radioGroup/
 /span
   ul
 liradio wicket:id=myradio//li


do this:

form
span wicket:id=radioGroup
ul wicket:id=listview
li radio wicket:id=myradio//li
 /span
/form

add (rg = new RadioGroup(radioGroup));

rd.add (new ListView(listView) {...});

This way the radio group will contain the Model Object of the Radio that 
was selected by the user when the form submits.


Regards,

Mike

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



Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread tommy

Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
maybe didnt make this point clear enough). How can you nest them when you
dont know how many there will be?

On Wed, Nov 3, 2010 at 1:46 PM, Tom Howe tomh...@artcore.com wrote:

 Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
 maybe didnt make this point clear enough). How can you nest them when you
 dont know how many there will be?



 On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket] 
 ml-node+3025272-1259231181-201...@n4.nabble.comml-node%2b3025272-1259231181-201...@n4.nabble.com
  wrote:

 Hi,

 The RadioGroup just needs to wrap the radio's in your markup.  Typically
 it does not even render markup in the resultant page.

 Instead of this:
  form
   span wicket:id=radioGroupList
  span wicket:id=radioGroup/
   /span
 ul
   liradio wicket:id=myradio//li

 do this:

 form
 span wicket:id=radioGroup
 ul wicket:id=listview
 li radio wicket:id=myradio//li
  /span
 /form

 add (rg = new RadioGroup(radioGroup));

 rd.add (new ListView(listView) {...});

 This way the radio group will contain the Model Object of the Radio that
 was selected by the user when the form submits.

 Regards,

 Mike

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025272i=0
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025272i=1



 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html
 To unsubscribe from How can I create RadioGroups that are not defined by
 component hierarchy/layout ?, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3025204code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==.





-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025394.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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Michael O'Cleirigh
If you only need to select one Radio then one RadioGroup will work no 
matter how many nested radio's there are (the model object of the 
selected radio is assigned to the model object of the radio when the 
form submits)


If you actually have different radio's (i.e. multiple selections are 
allowed) then using RadioChoice may make more sense.


add (new ListView(listview) {

   protected void populateItem(final ListItemT item);

item.add (rc = new RadioChoice(choice, new ModelT(), 
choiceList));


rc.setPrefix(li);
rc.setSuffix(/li);

}
}

ul wicket:id=listview
span wicket:id=choice
/ul

Not tested but it should work close to this way and cause each select 
type=radio.../select to be wrapped in a li/li like you want.


Mike


Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
maybe didnt make this point clear enough). How can you nest them when you
dont know how many there will be?

On Wed, Nov 3, 2010 at 1:46 PM, Tom Howetomh...@artcore.com  wrote:


Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
maybe didnt make this point clear enough). How can you nest them when you
dont know how many there will be?



On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket]
ml-node+3025272-1259231181-201...@n4.nabble.comml-node%2b3025272-1259231181-201...@n4.nabble.com

wrote:
Hi,

The RadioGroup just needs to wrap the radio's in your markup.  Typically
it does not even render markup in the resultant page.

Instead of this:

form
   span wicket:id=radioGroupList
  span wicket:id=radioGroup/
   /span
ul
  liradio wicket:id=myradio//li

do this:

form
span wicket:id=radioGroup
ul wicket:id=listview
li  radio wicket:id=myradio//li
  /span
/form

add (rg = new RadioGroup(radioGroup));

rd.add (new ListView(listView) {...});

This way the radio group will contain the Model Object of the Radio that
was selected by the user when the form submits.

Regards,

Mike

-
To unsubscribe, e-mail: [hidden 
email]http://user/SendEmail.jtp?type=nodenode=3025272i=0
For additional commands, e-mail: [hidden 
email]http://user/SendEmail.jtp?type=nodenode=3025272i=1



--
  View message @
http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html
To unsubscribe from How can I create RadioGroups that are not defined by
component hierarchy/layout ?, click 
herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3025204code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==.






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



Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread tommy

If you look at the original html I showed you can see 3 groups called A, B,
C (I've included again below with values to make it clearer).

I want to be able to select one item from group A, one item from group B and
one item from group C. The number of groups will vary, eg sometimes it will
go to D or E or F etc.

Each group of radio buttons with the same name will be shown vertically, ie
All group A will be shown one on top of the other.

Each group has radios with the same set of values that (1..n).

The rows will show a slice across the groups where the values are the same
and some text at the end. a bit like this.

 A1  B1  C1   some text about 1
 A2  B2  C2   some text about 2
 A3  B3  C3   some text about 3

Your suggestion requires adding the radioButtons of the same group to a
parent object that represents the radio grouping. I dont see how you can do
this and at the same time, also have them as part of a ListView that groups
them by their value so I can display them as shown.

ul
  li
ul
   liinput type=radio name=A value=1/li
   liinput type=radio name=B value=1/li
   liinput type=radio name=C value=1/li
/ul
some text
  /li
  li
ul
   liinput type=radio name=A value=2 /li
   liinput type=radio name=B value=2/li
   liinput type=radio name=C value=2/li
  some text
/ul
  /li
  li
ul
   liinput type=radio name=A value=3/li
   liinput type=radio name=B value=3/li
   liinput type=radio name=C value=3/li
 some text
/ul
  /li
/ul



On Wed, Nov 3, 2010 at 2:35 PM, Michael O'Cleirigh [via Apache Wicket] 
ml-node+3025457-596905818-201...@n4.nabble.comml-node%2b3025457-596905818-201...@n4.nabble.com
 wrote:

 If you only need to select one Radio then one RadioGroup will work no
 matter how many nested radio's there are (the model object of the
 selected radio is assigned to the model object of the radio when the
 form submits)

 If you actually have different radio's (i.e. multiple selections are
 allowed) then using RadioChoice may make more sense.

 add (new ListView(listview) {

 protected void populateItem(final ListItemT item);

  item.add (rc = new RadioChoice(choice, new ModelT(),
 choiceList));

  rc.setPrefix(li);
  rc.setSuffix(/li);

  }
 }

 ul wicket:id=listview
 span wicket:id=choice
 /ul

 Not tested but it should work close to this way and cause each select
 type=radio.../select to be wrapped in a li/li like you want.

 Mike

  Ah but I have varying number of groups, hence the radioGroupList ( Sorry
 I
  maybe didnt make this point clear enough). How can you nest them when you

  dont know how many there will be?
 
  On Wed, Nov 3, 2010 at 1:46 PM, Tom Howe[hidden 
  email]http://user/SendEmail.jtp?type=nodenode=3025457i=0
  wrote:
 
  Ah but I have varying number of groups, hence the radioGroupList ( Sorry
 I
  maybe didnt make this point clear enough). How can you nest them when
 you
  dont know how many there will be?
 
 
 
  On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket]

  [hidden email] 
  http://user/SendEmail.jtp?type=nodenode=3025457i=1[hidden
 email] http://user/SendEmail.jtp?type=nodenode=3025457i=2
  wrote:
  Hi,
 
  The RadioGroup just needs to wrap the radio's in your markup.
  Typically
  it does not even render markup in the resultant page.
 
  Instead of this:
  form
 span wicket:id=radioGroupList
span wicket:id=radioGroup/
 /span
  ul
liradio wicket:id=myradio//li
  do this:
 
  form
  span wicket:id=radioGroup
  ul wicket:id=listview
  li  radio wicket:id=myradio//li
/span
  /form
 
  add (rg = new RadioGroup(radioGroup));
 
  rd.add (new ListView(listView) {...});
 
  This way the radio group will contain the Model Object of the Radio
 that
  was selected by the user when the form submits.
 
  Regards,
 
  Mike
 
  -
  To unsubscribe, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3025272i=0
  For additional commands, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3025272i=1
 
 
 
  --
View message @
 
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.htmlhttp://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html?by-user=t
  To unsubscribe from How can I create RadioGroups that are not defined
 by
  component hierarchy/layout ?, click here
 http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3025204code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3025204code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==by-user=t.

 

Re: set focus in Modal Window

2010-11-03 Thread Eric Hamel
Thanks for posting this.

I'm having a similar issue. I updated my behavior with your changes, but
still doesn't seem to work on the component in the modal window.

I have a Panel with the FormComponents that is being used on a page and on a
modal window. The Focus Behavior works on the Page, but not the modal
window.

Eric

On Fri, Oct 29, 2010 at 2:17 PM, Stefan Lindner lind...@visionet.de wrote:

 Try this:


 public class FocusBehavior extends AbstractBehavior {

private static final long serialVersionUID = 1L;

private Component component;

@Override
public void bind(final Component component) {
this.component = component;
component.setOutputMarkupId(true);
}

@Override
public void renderHead(final IHeaderResponse response) {

  response.renderOnDomReadyJavascript(document.getElementById(' +
 component.getMarkupId() + ').focus(););
}

 }



 And do

TextField bla = new Textfield();
Bla.add(new FocusBeahvior());

 Stefan

 -Ursprüngliche Nachricht-
 Von: Henry, Mike [GCG-PFS] [mailto:mike.he...@primerica.com]
 Gesendet: Freitag, 29. Oktober 2010 19:58
 An: users@wicket.apache.org
 Betreff: set focus in Modal Window

 I have successfully set the focus on a text field in a Modal window but
 after it is closed and re-opened it no longer sets the focus to that field.
 If I reload the whole parent page it will work once but again If the modal
 window is closed and re-opened same problem. I have tried all of these with
 the same result:
 target.appendJavascript(document.findRepform.searchString.focus(););

 target.focusComponent(((FindRepDetailsPanel)selectModalWindow.get(conte
 nt)).get(findRepform:searchString));

 ((FindRepDetailsPanel)selectModalWindow.get(content)).get(findRepform
 :searchString).add(new DefaultFocusBehavior())



 Any ideas?

 Thanks
 Mike

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




-- 
Sent by Eric Hamel


Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Igor Vaynberg
best way for us to help you is for you to create a quickstart and
attach it to your email or a jira issue.

-igor

On Wed, Nov 3, 2010 at 4:40 AM, tommy tommytas...@gmail.com wrote:

 I asked the following question on stack-overflow but was advised to ask here
 instead.
 http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc

 I am using Wicket and would like to create a grid of radio buttons using
 html as shown below (outer lists will be displayed vertically, inner lists
 will be displayed horizontally).

 I would like the radio buttons grouped vertically.

 ul
  li
    ul
       liinput type=radio name=A/li
       liinput type=radio name=B/li
       liinput type=radio name=C/li
    /ul
  /li
  li
    ul
       liinput type=radio name=A/li
       liinput type=radio name=B/li
       liinput type=radio name=C/li
    /ul
  /li
  li
    ul
       liinput type=radio name=A/li
       liinput type=radio name=B/li
       liinput type=radio name=C/li
    /ul
  /li
 /ul

 Unfortunately it seems that RadioGroup only allow one to group radio buttons
 according to the grouping defined by their layout.

 eg RadioGroup group = new RadioGroup(radioGroupA);

 group.add( new Radio(myradio, new Model(1)) ;

 Problem with this is that I cannot then layout the way I want.

 Is there another way? Manually specifying the name and gather results?

 UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one can
 do something like:

 // create some groups
 for (0..n) {
  RadioGroup group = new RadioGroup(myRadioGroup, new Model { .. } );
  groupArray.add(group)
 }

 //create a ListView for the RadioGroups so we can attach them to page
 ListView radioListView = ListView(radioGroupList) { populate from
 groupArray }
 add(radioListView);

 // create our grid of radio buttons
 // outer - rows
 for (0..x) {
  // inner - columns
  for (0..n)
    // supply group from our groupArray
    add( new Radio(myradio, new Model(1), groupArray.get(n) ));
  }
 }

 I can then add the Radios and RadioGroups to the form independently of
 layout and this has the desired effect in terms of the grouping.

 form
   span wicket:id=radioGroupList
      span wicket:id=radioGroup/
   /span
  ul
    liradio wicket:id=myradio//li

 But now, when I submit I am getting the following error:

 WicketMessage: submitted http post value [radio33] for RadioGroup component
 [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
 is illegal because it does not contain relative path to a Radio componnet.
 Due to this the RadioGroup component cannot resolve the selected Radio
 component pointed to by the illegal value. A possible reason is that
 componment hierarchy changed between rendering and form submission.

 Any idea what this means?

 The spelling mistake 'componment' suggests it's not seen too often.

 I am using wicket 1.4.12.

 I found this ticket that looks related too :
 https://issues.apache.org/jira/browse/WICKET-1055

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.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



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



Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread tommy

Hi
Can you point me to a link that explains what a quickstart is and how I
create one?

Also maybe you consider these questions

1. If I can pass in a RadioGroup object to a Radio() constructor does the
RadioGroup also need to be added to the page and if so, does it matter where
on the page the RadioGroup is rendered, and in both cases: why the need?
given that the Radio objects are now bound to the RadioGroup object
directly.

2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
passed in to the Radio() constructor?

Thanks, Tom

On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] 
ml-node+3025609-175919079-201...@n4.nabble.comml-node%2b3025609-175919079-201...@n4.nabble.com
 wrote:

 best way for us to help you is for you to create a quickstart and
 attach it to your email or a jira issue.

 -igor

 On Wed, Nov 3, 2010 at 4:40 AM, tommy [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=0
 wrote:

 
  I asked the following question on stack-overflow but was advised to ask
 here
  instead.
 
 http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
 
  I am using Wicket and would like to create a grid of radio buttons using
  html as shown below (outer lists will be displayed vertically, inner
 lists
  will be displayed horizontally).
 
  I would like the radio buttons grouped vertically.
 
  ul
   li
 ul
liinput type=radio name=A/li
liinput type=radio name=B/li
liinput type=radio name=C/li
 /ul
   /li
   li
 ul
liinput type=radio name=A/li
liinput type=radio name=B/li
liinput type=radio name=C/li
 /ul
   /li
   li
 ul
liinput type=radio name=A/li
liinput type=radio name=B/li
liinput type=radio name=C/li
 /ul
   /li
  /ul
 
  Unfortunately it seems that RadioGroup only allow one to group radio
 buttons
  according to the grouping defined by their layout.
 
  eg RadioGroup group = new RadioGroup(radioGroupA);
 
  group.add( new Radio(myradio, new Model(1)) ;
 
  Problem with this is that I cannot then layout the way I want.
 
  Is there another way? Manually specifying the name and gather results?
 
  UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one
 can
  do something like:
 
  // create some groups
  for (0..n) {
   RadioGroup group = new RadioGroup(myRadioGroup, new Model { .. } );
   groupArray.add(group)
  }
 
  //create a ListView for the RadioGroups so we can attach them to page
  ListView radioListView = ListView(radioGroupList) { populate from
  groupArray }
  add(radioListView);
 
  // create our grid of radio buttons
  // outer - rows
  for (0..x) {
   // inner - columns
   for (0..n)
 // supply group from our groupArray
 add( new Radio(myradio, new Model(1), groupArray.get(n) ));
   }
  }
 
  I can then add the Radios and RadioGroups to the form independently of
  layout and this has the desired effect in terms of the grouping.
 
  form
span wicket:id=radioGroupList
   span wicket:id=radioGroup/
/span
   ul
 liradio wicket:id=myradio//li
 
  But now, when I submit I am getting the following error:
 
  WicketMessage: submitted http post value [radio33] for RadioGroup
 component
 
 [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]

  is illegal because it does not contain relative path to a Radio
 componnet.
  Due to this the RadioGroup component cannot resolve the selected Radio
  component pointed to by the illegal value. A possible reason is that
  componment hierarchy changed between rendering and form submission.
 
  Any idea what this means?
 
  The spelling mistake 'componment' suggests it's not seen too often.
 
  I am using wicket 1.4.12.
 
  I found this ticket that looks related too :
  https://issues.apache.org/jira/browse/WICKET-1055
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.htmlhttp://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=3025609i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=3025609i=2
 
 

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=3
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=4



 --
  View message @
 

Re: Wicket-auth annotations to hide a link problem

2010-11-03 Thread Ivana

I just found this works - but has other problems:

I have a page with a menu made of links. The links replace the main panel
the user is looking at. Depending on user role, some panels are not
available and the corresponding links are not shown.

I have implemented this like this:
@AuthorizeAction(action = Action.RENDER, roles = { Roles.internal })
class InternalAjaxReplacementLink extends AjaxFallbackLink{
... replace panel, change/append css styles
}

@AuthorizeAction(action = Action.RENDER, roles = {Roles.public,
Roles.internal })
class PublicAjaxReplacementLink extends AjaxFallbackLink{
... replace panel, change/append css styles
}On my page i add the links, according to which users should have access to
which resources - and this works.
A user that has only the 'public' role sees only the links leading to public
resources, internal users see more resources. 


Except: the welcome panel is accesible to both 'internal' and 'public'
user-roles. When 'internal' users click an InternalAjaxReplacementLink, the
container asks them to authenticate again before they can continue. Nothing
happens with this new login: i have tried loggin in as a different
authorized user and the original credentials are not overwritten.  What is
going on?

I'm using tomcat form based security while developing. I intend to replace
this in the near future with spring security.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-auth-annotations-to-hide-a-link-problem-tp2542360p3025671.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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Igor Vaynberg
http://wicket.apache.org/start/quickstart.html

-igor

On Wed, Nov 3, 2010 at 9:03 AM, tommy tommytas...@gmail.com wrote:

 Hi
 Can you point me to a link that explains what a quickstart is and how I
 create one?

 Also maybe you consider these questions

 1. If I can pass in a RadioGroup object to a Radio() constructor does the
 RadioGroup also need to be added to the page and if so, does it matter where
 on the page the RadioGroup is rendered, and in both cases: why the need?
 given that the Radio objects are now bound to the RadioGroup object
 directly.

 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
 passed in to the Radio() constructor?

 Thanks, Tom

 On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] 
 ml-node+3025609-175919079-201...@n4.nabble.comml-node%2b3025609-175919079-201...@n4.nabble.com
 wrote:

 best way for us to help you is for you to create a quickstart and
 attach it to your email or a jira issue.

 -igor

 On Wed, Nov 3, 2010 at 4:40 AM, tommy [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=0
 wrote:

 
  I asked the following question on stack-overflow but was advised to ask
 here
  instead.
 
 http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
 
  I am using Wicket and would like to create a grid of radio buttons using
  html as shown below (outer lists will be displayed vertically, inner
 lists
  will be displayed horizontally).
 
  I would like the radio buttons grouped vertically.
 
  ul
   li
     ul
        liinput type=radio name=A/li
        liinput type=radio name=B/li
        liinput type=radio name=C/li
     /ul
   /li
   li
     ul
        liinput type=radio name=A/li
        liinput type=radio name=B/li
        liinput type=radio name=C/li
     /ul
   /li
   li
     ul
        liinput type=radio name=A/li
        liinput type=radio name=B/li
        liinput type=radio name=C/li
     /ul
   /li
  /ul
 
  Unfortunately it seems that RadioGroup only allow one to group radio
 buttons
  according to the grouping defined by their layout.
 
  eg RadioGroup group = new RadioGroup(radioGroupA);
 
  group.add( new Radio(myradio, new Model(1)) ;
 
  Problem with this is that I cannot then layout the way I want.
 
  Is there another way? Manually specifying the name and gather results?
 
  UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one
 can
  do something like:
 
  // create some groups
  for (0..n) {
   RadioGroup group = new RadioGroup(myRadioGroup, new Model { .. } );
   groupArray.add(group)
  }
 
  //create a ListView for the RadioGroups so we can attach them to page
  ListView radioListView = ListView(radioGroupList) { populate from
  groupArray }
  add(radioListView);
 
  // create our grid of radio buttons
  // outer - rows
  for (0..x) {
   // inner - columns
   for (0..n)
     // supply group from our groupArray
     add( new Radio(myradio, new Model(1), groupArray.get(n) ));
   }
  }
 
  I can then add the Radios and RadioGroups to the form independently of
  layout and this has the desired effect in terms of the grouping.
 
  form
    span wicket:id=radioGroupList
       span wicket:id=radioGroup/
    /span
   ul
     liradio wicket:id=myradio//li
 
  But now, when I submit I am getting the following error:
 
  WicketMessage: submitted http post value [radio33] for RadioGroup
 component
 
 [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]

  is illegal because it does not contain relative path to a Radio
 componnet.
  Due to this the RadioGroup component cannot resolve the selected Radio
  component pointed to by the illegal value. A possible reason is that
  componment hierarchy changed between rendering and form submission.
 
  Any idea what this means?
 
  The spelling mistake 'componment' suggests it's not seen too often.
 
  I am using wicket 1.4.12.
 
  I found this ticket that looks related too :
  https://issues.apache.org/jira/browse/WICKET-1055
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.htmlhttp://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=3025609i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=3025609i=2
 
 

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=3
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025609i=4



 

Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread tommy

ok thanks, I'll try and put something together tonight. Are you able to
answer either of those questions?

On Wed, Nov 3, 2010 at 5:56 PM, Igor Vaynberg-2 [via Apache Wicket] 
ml-node+3025865-1659550532-201...@n4.nabble.comml-node%2b3025865-1659550532-201...@n4.nabble.com
 wrote:

 http://wicket.apache.org/start/quickstart.html

 -igor

 On Wed, Nov 3, 2010 at 9:03 AM, tommy [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3025865i=0
 wrote:

 
  Hi
  Can you point me to a link that explains what a quickstart is and how I
  create one?
 
  Also maybe you consider these questions
 
  1. If I can pass in a RadioGroup object to a Radio() constructor does the

  RadioGroup also need to be added to the page and if so, does it matter
 where
  on the page the RadioGroup is rendered, and in both cases: why the need?
  given that the Radio objects are now bound to the RadioGroup object
  directly.
 
  2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
  passed in to the Radio() constructor?
 
  Thanks, Tom
 
  On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] 
  [hidden email] 
  http://user/SendEmail.jtp?type=nodenode=3025865i=1[hidden
 email] http://user/SendEmail.jtp?type=nodenode=3025865i=2
  wrote:
 
  best way for us to help you is for you to create a quickstart and
  attach it to your email or a jira issue.
 
  -igor
 
  On Wed, Nov 3, 2010 at 4:40 AM, tommy [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3025609i=0
  wrote:
 
  
   I asked the following question on stack-overflow but was advised to
 ask
  here
   instead.
  
 
 http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
  
   I am using Wicket and would like to create a grid of radio buttons
 using
   html as shown below (outer lists will be displayed vertically, inner
  lists
   will be displayed horizontally).
  
   I would like the radio buttons grouped vertically.
  
   ul
li
  ul
 liinput type=radio name=A/li
 liinput type=radio name=B/li
 liinput type=radio name=C/li
  /ul
/li
li
  ul
 liinput type=radio name=A/li
 liinput type=radio name=B/li
 liinput type=radio name=C/li
  /ul
/li
li
  ul
 liinput type=radio name=A/li
 liinput type=radio name=B/li
 liinput type=radio name=C/li
  /ul
/li
   /ul
  
   Unfortunately it seems that RadioGroup only allow one to group radio
  buttons
   according to the grouping defined by their layout.
  
   eg RadioGroup group = new RadioGroup(radioGroupA);
  
   group.add( new Radio(myradio, new Model(1)) ;
  
   Problem with this is that I cannot then layout the way I want.
  
   Is there another way? Manually specifying the name and gather results?

  
   UPDATE: I notice that Radio can take a RadioGroup as a parameter. So
 one
  can
   do something like:
  
   // create some groups
   for (0..n) {
RadioGroup group = new RadioGroup(myRadioGroup, new Model { .. } );

groupArray.add(group)
   }
  
   //create a ListView for the RadioGroups so we can attach them to page
   ListView radioListView = ListView(radioGroupList) { populate from
   groupArray }
   add(radioListView);
  
   // create our grid of radio buttons
   // outer - rows
   for (0..x) {
// inner - columns
for (0..n)
  // supply group from our groupArray
  add( new Radio(myradio, new Model(1), groupArray.get(n) ));
}
   }
  
   I can then add the Radios and RadioGroups to the form independently of

   layout and this has the desired effect in terms of the grouping.
  
   form
 span wicket:id=radioGroupList
span wicket:id=radioGroup/
 /span
ul
  liradio wicket:id=myradio//li
  
   But now, when I submit I am getting the following error:
  
   WicketMessage: submitted http post value [radio33] for RadioGroup
  component
  
 
 [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]

 
   is illegal because it does not contain relative path to a Radio
  componnet.
   Due to this the RadioGroup component cannot resolve the selected Radio

   component pointed to by the illegal value. A possible reason is that
   componment hierarchy changed between rendering and form submission.
  
   Any idea what this means?
  
   The spelling mistake 'componment' suggests it's not seen too often.
  
   I am using wicket 1.4.12.
  
   I found this ticket that looks related too :
   https://issues.apache.org/jira/browse/WICKET-1055
  
   --
   View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.htmlhttp://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t
 
 

Re: GMap2 off center

2010-11-03 Thread Sven Meier

Hi Peter,

I have no idea what's going wrong on your page B.
Try removing features (e.g. the flash animation) to make B more like A, 
repeat until it works then build up again.


Regards

Sven

On 11/03/2010 01:15 PM, Peter Miklosko wrote:

In our application we are using Wicket GMap2 in some cases successfully in
other case with problems. The map is being off center, having about 10-15px
grey border on the left and bottom of the map and in case of multiple
markers on the map being zoomed out to 0.0 in Firefox. The map is showing
fine in Chromium and to big surprise in IE6.

I'm trying to determinate what is problem here and bellow is just
short comparison of differences.
Page A with working map does quick search for geographical location to be
presented to user, pin these locations to map and show descriptions
retrieved from DB.
Page B with not working map first runs flash animation while does the search
for flights, once flights found it will redirect results to next page and
pin locations to map plus plus populate table with search results.

Anyone had similar problem? Can you give some pointers to solve this?

If more info need it please just let me know

Peter

   



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



Re: GMap2 off center

2010-11-03 Thread Peter Miklosko
Yeap, that is my battle plan for tomorrow.



On 3 November 2010 19:12, Sven Meier s...@meiers.net wrote:

 Hi Peter,

 I have no idea what's going wrong on your page B.
 Try removing features (e.g. the flash animation) to make B more like A,
 repeat until it works then build up again.

 Regards

 Sven


 On 11/03/2010 01:15 PM, Peter Miklosko wrote:

 In our application we are using Wicket GMap2 in some cases successfully in
 other case with problems. The map is being off center, having about
 10-15px
 grey border on the left and bottom of the map and in case of multiple
 markers on the map being zoomed out to 0.0 in Firefox. The map is showing
 fine in Chromium and to big surprise in IE6.

 I'm trying to determinate what is problem here and bellow is just
 short comparison of differences.
 Page A with working map does quick search for geographical location to be
 presented to user, pin these locations to map and show descriptions
 retrieved from DB.
 Page B with not working map first runs flash animation while does the
 search
 for flights, once flights found it will redirect results to next page and
 pin locations to map plus plus populate table with search results.

 Anyone had similar problem? Can you give some pointers to solve this?

 If more info need it please just let me know

 Peter





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




Lazy Load Panel at runtime from another jar

2010-11-03 Thread cole

I have simple plugin frame work for my app. I load plug-in's at startup. What
I would like is to have the plug-in supply a panel for exposing the plugin's
functionality. So a wicket page loads, the app determines if pluginA is
available and calls, pluginA.getPanel(). pluginA is in a separate jar, the
class and html file. When the application runs I get :
(UrlResourceStream.java:108) - cannot convert url:
jar:file://localhostc:/foo/extenders/pluginA.jar!/pluginA.html to file (URI
is not hierarchical), falling back to the inputstream for polling

I'm not sure if the resource loader is finding the html file or it simply
cannot load the html file. Is this a classpath issue or do I need to do
something special to allow loading panels from jar's at runtime.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Lazy-Load-Panel-at-runtime-from-another-jar-tp3026325p3026325.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: Send an object to page

2010-11-03 Thread Peter Ertl
 That's one more reason why I use UUID's for my object ids.  They're
 harder to spoof.


Security by obscurity :-) 

Checking the URL is not an option ... any web app claiming to be secure must do 
that no what what the surrogate database key looks like *imho*

Also, if the userID is the id of the currently logged in user why not just 
store it in your wicket session when logging on to make it inaccessible for the 
client and prevent spoof altogether?

Am 02.11.2010 um 05:29 schrieb James Carman:

 On Mon, Nov 1, 2010 at 11:30 PM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 
 And, of course, it opens you up to doing more security checks i.e., you
 have editUserProfile.html?userID=123 - now you have to check that the signed
 in person is allowed to edit whatever user they are trying to edit (since
 they can twiddle the URL).
 
 
 That's one more reason why I use UUID's for my object ids.  They're
 harder to spoof.
 
 -
 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: If-Modified-Since header

2010-11-03 Thread Mauro Ciancio
Sorry for bringing up this thread, but I'm still looking for advices.
Should I implement this or Wicket can do it for me?

Regards.

On Sun, Oct 31, 2010 at 2:11 PM, Mauro Ciancio maurocian...@gmail.com wrote:
 Hi Martin,

 I didn't explain myself very well. I'm using wicket resources, I
 inherited from WebResource and implemented the abstract methods.

 Also, I mounted the resources using the following code:

 String resourceKey = photos;
 String alias = photos

 SharedResources sharedResources = application.getSharedResources();
 sharedResources.putClassAlias(MyWebResource.class, alias);
 sharedResources.add(MyWebResource.class, resourceKey, null, null, new
 MyWebResource());
 webApplication.mount(new
 IndexedSharedResourceCodingStrategy(/photos, alias + / +
 resourceKey));

 So, I get the pretty urls I wanted. My resources gets mounted at
 domain.com/photos/my/parameters and according to the parameters I
 serve differents photos.

 Once the photos are uploaded they never change, so I'd like the photos
 be cached. I'm expecting to get a 304 not modified, but the
 If-Modified-Since header is ignored because of the mount path is not
 under '/resources'.

 Is this clearer?
 Should I implement the checking for the header or it's supposed that
 wicket could do that for me?

 Thanks in advance.
 Regards.

 On Sun, Oct 31, 2010 at 6:15 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi Mauro,

 /resources is a special path managed by Wicket, e.g.
 ResourceReference(MyComponent.class, myImage.gif) will be reachable at
 /resources/com.mypackage.MyComponent/myImage.gif

 Resources which are put in next to WEB-INF folder are not managed by WIcket
 and they are served directly by the web container
 Take a look at http://code.google.com/p/wro4j/

 On Sun, Oct 31, 2010 at 1:11 AM, Mauro Ciancio maurocian...@gmail.comwrote:

 Hello everyone:

 I've been trying to get properly working the caching in my site's
 resources using the if-modified-since header. I've noticed that the
 check for the header is only done if the resource is mounted under the
 '/resources' url (wicket filter @ line 1130, Wicket 1.4).

 My resources are mounted under another url ('/photos'). I was
 wondering why the check is restricted to that url. Also, I've tried to
 mount my resources under /resources/photos but I get an exception that
 says 'cannot be mounted under /resources'.

 Any advices?
 Thanks in advance.
 --
 Mauro Ciancio

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






 --
 Mauro Ciancio




-- 
Mauro Ciancio

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



generated form and form IDs vs model confusion

2010-11-03 Thread Troy Cauble
Typically, one sets a FormComponent's ID to match the data model.
My form is generated from data, so the IDs are a recursive set of fieldFrag,
list, blockFrag, label, value and RepeatingView#newChildID().

My data on the other hand is represented by HashMapString,String
and CompoundPropertyModel.  The keys are generated.

This works fine when my form has a Model before I construct it.
Where each FormComponent is constructed I do this.

   new PropertyModelString(getDefaultModel(), key);

Anyway, PM doesn't like it when the first arg is null.  So I can't support
using setDefaultModel() after the form components are instantiated.

How can I support setDefaultModel() ?  ComponentPropertyModel looks
like it might work if it wasn't read only.

Thanks,
-troy

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



Re: Lazy Load Panel at runtime from another jar

2010-11-03 Thread Jeremy Thomerson
On Wed, Nov 3, 2010 at 6:22 PM, cole cmilli...@comcast.net wrote:


 I have simple plugin frame work for my app. I load plug-in's at startup.
 What
 I would like is to have the plug-in supply a panel for exposing the
 plugin's
 functionality. So a wicket page loads, the app determines if pluginA is
 available and calls, pluginA.getPanel(). pluginA is in a separate jar, the
 class and html file. When the application runs I get :
 (UrlResourceStream.java:108) - cannot convert url:
 jar:file://localhostc:/foo/extenders/pluginA.jar!/pluginA.html to file (URI
 is not hierarchical), falling back to the inputstream for polling

 I'm not sure if the resource loader is finding the html file or it simply
 cannot load the html file. Is this a classpath issue or do I need to do
 something special to allow loading panels from jar's at runtime.


It must be classpath / classloader related, although I haven't seen that
error and don't know what it means without digging in more.

HTML panels are loaded from jars all the time.  Every time you use a
DataTable or a FeedbackPanel or dozens of other Wicket components, you're
loading HTML from a (wicket) jar.

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


Re: Send an object to page

2010-11-03 Thread Jeremy Thomerson
On Wed, Nov 3, 2010 at 7:39 PM, Peter Ertl pe...@gmx.org wrote:

 Also, if the userID is the id of the currently logged in user why not just
 store it in your wicket session when logging on to make it inaccessible for
 the client and prevent spoof altogether?


Obviously this is more secure.  And also not even necessary - the ID can be
directly in the link's model, so you can have dozens of links on the page,
all to edit different users, rather than having a single ID in the session.
 That's the whole premise Wicket is built around.

But, you missed this part of the thread apparently:

On Mon, Nov 1, 2010 at 5:09 PM, James Carman ja...@carmanconsulting.com
 wrote:

 You could pass the id of the object (if possible) as a
 PageParameter.  You can then use a bookmarkable URL for your page.
 You'll have to lookup the object from the db, though.  Again, this is
 only possible if the object is an entity.


That part of the thread is what I was replying to - that it was then
insecure because the DB ID is in the URL.  This is not a standard way of
doing most links in Wicket - because of the security leak

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


Re: SV: How to get other page's localized messages ?

2010-11-03 Thread Igor Vaynberg
Later versions of wicket also support package level bundles stored in
package.properties files

-igor

On Nov 3, 2010 3:43 AM, Wilhelmsen Tor Iver toriv...@arrive.no wrote:

 How do I get Page1's specific localized message in Page2 ?
1) Make a superclass for the two pages and put the message in the
superclass' property file

2) Put the property in the Application's property file

In both cases the mechanisms in Wicket will find the message.

- Tor I.

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


Re: generated form and form IDs vs model confusion

2010-11-03 Thread Jeremy Thomerson
On Wed, Nov 3, 2010 at 10:34 PM, Troy Cauble troycau...@gmail.com wrote:

 Typically, one sets a FormComponent's ID to match the data model.
 My form is generated from data, so the IDs are a recursive set of
 fieldFrag,
 list, blockFrag, label, value and RepeatingView#newChildID().

 My data on the other hand is represented by HashMapString,String
 and CompoundPropertyModel.  The keys are generated.

 This works fine when my form has a Model before I construct it.
 Where each FormComponent is constructed I do this.

   new PropertyModelString(getDefaultModel(), key);

 Anyway, PM doesn't like it when the first arg is null.  So I can't support
 using setDefaultModel() after the form components are instantiated.

 How can I support setDefaultModel() ?  ComponentPropertyModel looks
 like it might work if it wasn't read only.

 Thanks,
 -troy

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


If your form is using a compoundpropertymodel, your form components don't
need an explicit property model.

class YourForm extends Form {
setModel(IModel model) {
// ensure that you always get a compoundpropertymodel:
super.setModel(new CompoundPropertyModel(model));
}
}

Form form = new YourForm();
form.setModel(new LoadableDetachableFooBarSomethingOrOtherModel());

form.add(new
TextField(someKeyThatRepresentsAPropertyOnTheThingReturnedByAboveModel));

That should work.

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


Re: Multiple submit buttons - CompoundPropertyModel not updated

2010-11-03 Thread Igor Vaynberg
You cannot update models without default processing, what If the user typed
abcinto a text field backed by an integer model? What you can do, however,
is accesses the raw value of the component via getvalue method.

-igor

On Nov 3, 2010 2:37 AM, Benjamin Lorenz benjamin.lor...@kapowtech.com
wrote:

Hello,

I have a problem with a form that shall have two submit buttons. One finally
submits the form with all plausibility checks, etc... the other just opens
up a search form, to lookup some data for inclusion in the form. This submit
shall NOT do all the checks on e.g. .setRequired(true), etc..., but it DOES
HAVE to update my CompoundPropertyModel values, to deal with the user's
(partially) entered values so far.

I cannot get this together: setDefaultFormProcessing(false) will not update
my models, setDefaultFormProcessing(true) will finally submit my form, also
calling the form's onSubmit, which is not what I want.

I am using an anonymous form class with the default onSubmit(), and an
additionally attached Button, which has its own onSubmit().

Do you understand what I mean, and can anybody point me to the right
direction? It seems to me like a very basic, fundamental thing to do, two
form buttons, that deal - independently from each other - with the entered
data, but it seems to be tricky nevertheless...

Thanks,
Benjamin



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