Re: Absolute urls in forms

2009-08-25 Thread Steen Larsen
Thanks

2009/8/25 Erik van Oosten :
>
> I added a patch in Jira.
>
> Regards,
>    Erik.
>
>
>
> Erik van Oosten wrote:
>>
>> Anyways, you can make all URLs absolute by following the hints in
>> https://issues.apache.org/jira/browse/WICKET-1974.
>>
>> You'll need to patch Wicket as the issue is not yet solved. (I really
>> should make the patch, its soo easy, just have to find time.)
>>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
> --
> View this message in context: 
> http://www.nabble.com/Absolute-urls-in-forms-tp25075543p25132710.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Absolute urls in forms

2009-08-22 Thread Steen Larsen
Haha, Its not me doing the proxy work. Don't know why they consider it
a problem, but they would really like absolute urls.

/Steen

2009/8/21 Igor Vaynberg :
> thats funny, we worked really had to make all urls relative because it
> would make it a lot easier to work with proxies... :)
>
> -igor
>
> On Fri, Aug 21, 2009 at 12:43 AM, Steen Larsen wrote:
>> Hi,
>>
>> Just a quick question. Is it somehow possible to make Wicket generate
>> absolute urls in the forms action attribute. The reason I ask is
>> because my Wicket application is going to be embedded in a CMS through
>> a proxy, and apparently the dude writing the proxy would prefer the
>> urls to be absolute.
>>
>> /Steen
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Absolute urls in forms

2009-08-21 Thread Steen Larsen
Hm, didn't know about that one. I suppose you could rewrite the url
through this, but maybe there was some setting you could change in the
init phase, that already did this. But the AttributeModifier looks
like a workaround so thanks for the hint.

/Steen

2009/8/21 copenhag copenhagen :
> Hi,
>
> Why can't you just add a AttributeModifier to the Form and then modify it as
> you wish ?
>
> Best Regards
> Cemil
>
> On Fri, Aug 21, 2009 at 9:43 AM, Steen Larsen  wrote:
>
>> Hi,
>>
>> Just a quick question. Is it somehow possible to make Wicket generate
>> absolute urls in the forms action attribute. The reason I ask is
>> because my Wicket application is going to be embedded in a CMS through
>> a proxy, and apparently the dude writing the proxy would prefer the
>> urls to be absolute.
>>
>> /Steen
>>
>> -
>> 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



Absolute urls in forms

2009-08-21 Thread Steen Larsen
Hi,

Just a quick question. Is it somehow possible to make Wicket generate
absolute urls in the forms action attribute. The reason I ask is
because my Wicket application is going to be embedded in a CMS through
a proxy, and apparently the dude writing the proxy would prefer the
urls to be absolute.

/Steen

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



Re: absolute urls in form action

2009-04-27 Thread Steen Larsen
Hi Eric,

Thank you for the answer. Unfortunately we are still on 1.3.5, but good to
know there is a future solution.

/Steen

2009/4/27 Erik van Oosten 

> Hi Steen,
>
> Starting Wicket 1.4-rc1 plus a patch you can let Wicket make all URLs
> absolute.
> See http://issues.apache.org/jira/browse/WICKET-1974 for more details.
>
> With some tweaks you can make the shown code work for any context (not just
> the root context).
>
> Regards,
>   Erik.
>
>
>
> Steen Larsen wrote:
>
>> Hi,
>>
>> Does anybody know if it's possible to get Wicket to use absolute urls in a
>> forms action attribute, and how to accomplish this if possible. We're
>> trying
>> to get a Wicket application integrated into a CMS system, through some
>> proxying and need the full urls since the CMS is on a different server
>> from
>> the Wicket application. I realise we probably could do some url rewriting
>> on
>> the CMS side, but it would be nice if there was a simple way to get
>> absolute
>> urls directly in Wicket.
>>
>> /Steen
>>
>>
>>
>
> --
> Erik van Oosten
> http://day-to-day-stuff.blogspot.com/
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


absolute urls in form action

2009-04-27 Thread Steen Larsen
Hi,

Does anybody know if it's possible to get Wicket to use absolute urls in a
forms action attribute, and how to accomplish this if possible. We're trying
to get a Wicket application integrated into a CMS system, through some
proxying and need the full urls since the CMS is on a different server from
the Wicket application. I realise we probably could do some url rewriting on
the CMS side, but it would be nice if there was a simple way to get absolute
urls directly in Wicket.

/Steen


Re: CheckGroup and back Button problem

2008-05-08 Thread Steen Larsen
If I instead of item.getModel() for the Check, uses some PropertyModel that
evaluates to a String identifier it works fine, but then only the identifier
is saved, and not the object, which as I understand it should be the
purpose. I haven't looked at the code, but I wander what uuid is exactly as
the equals apparently fail on non basic types. Will have a look when I get
the time. Thanks for the hint.

/Steen

2008/5/8 Thomas Mäder <[EMAIL PROTECTED]>:

> We seem to have a similar problem with a wizard page. We came across the
> following code in Check.onComponentTag(..)
>
>if (group.hasRawInput())
>{
>final String[] input = group.getInputAsArray();
>
>if (input != null)
>{
>for (int i = 0; i < input.length; i++)
>{
>if (uuid.equals(input[i]))
>{
>tag.put("checked", "checked");
>
>
> It looks like the Check component is checking for the existence of raw
> input, but then using the input from the current request (via
> getInputAsArray()) to render. Sounds fishy! I figure this could be related?
>
> Thomas
>
> On Wed, May 7, 2008 at 5:27 PM, Steen Larsen <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I have made a CheckGroup vith a ListView of Check's than works fine,
> except
> > that when it is submitted and I'm on the next page and want to go back
> > through a Wicket Button (not the browsers back button), all the checks
> are
> > empty even thouch the model behind still contains the selected obejcts.
> > Here
> > is the example code of the first page:
> >
> > public HomePage() {
> >Order order = ((WicketSession) (Session.get())).getOrder();
> >if (order.getDigitalPackets() == null)
> >order.setDigitalPackets(new ArrayList());
> >System.err.println("LIST1 = " + order.getDigitalPackets());
> >Form form = new DigitalOrderForm("digitalOrderForm");
> >form.setModel(new CompoundPropertyModel(order));
> >add(form);
> >List allProducts = new ArrayList();
> >for (int i = 0; i < 10; i++) {
> >Product p = new Product();
> >p.setProductKey(i + "");
> >p.setTotalPrice(new BigDecimal(100 + i));
> >p.setProductName("Product" + i);
> >allProducts.add(p);
> >}
> >CheckGroup group = new CheckGroup("digitalPackets");
> >form.add(group);
> >ListView products = new ListView("products", allProducts) {
> >protected void populateItem(ListItem item) {
> >  item.add(new Check("check",
> > item.getModel()).setEscapeModelStrings(false));
> >  item.add(new Label("productName", new
> > PropertyModel(item.getModel(), "productName")));
> >  item.add(new Label("totalPrice", new
> > PropertyModel(item.getModel(), "totalPrice")));
> >}
> >};
> >group.add(products.setReuseItems(true));
> >}
> >
> >class DigitalOrderForm extends Form {
> >DigitalOrderForm(String s) {
> >super(s);
> >}
> >
> >protected void onSubmit() {
> >Order order = (Order) getModelObject();
> >System.err.println("LIST2 = " +
> > order.getDigitalPackets());
> >setResponsePage(PageTwo.class);
> >}
> >}
> >
> > The second page is just a back button like this:
> >
> > public PageTwo() {
> >add(new Button("back") {
> >public void onSubmit() {
> >setResponsePage(HomePage.class);
> >}
> >});
> >}
> >
> > Anybody knows how to get the selected objects shown when you go back like
> > that ?
> >
> > /Steen
> >
>


CheckGroup and back Button problem

2008-05-07 Thread Steen Larsen
Hi,

I have made a CheckGroup vith a ListView of Check's than works fine, except
that when it is submitted and I'm on the next page and want to go back
through a Wicket Button (not the browsers back button), all the checks are
empty even thouch the model behind still contains the selected obejcts. Here
is the example code of the first page:

public HomePage() {
Order order = ((WicketSession) (Session.get())).getOrder();
if (order.getDigitalPackets() == null)
order.setDigitalPackets(new ArrayList());
System.err.println("LIST1 = " + order.getDigitalPackets());
Form form = new DigitalOrderForm("digitalOrderForm");
form.setModel(new CompoundPropertyModel(order));
add(form);
List allProducts = new ArrayList();
for (int i = 0; i < 10; i++) {
Product p = new Product();
p.setProductKey(i + "");
p.setTotalPrice(new BigDecimal(100 + i));
p.setProductName("Product" + i);
allProducts.add(p);
}
CheckGroup group = new CheckGroup("digitalPackets");
form.add(group);
ListView products = new ListView("products", allProducts) {
protected void populateItem(ListItem item) {
  item.add(new Check("check",
item.getModel()).setEscapeModelStrings(false));
  item.add(new Label("productName", new
PropertyModel(item.getModel(), "productName")));
  item.add(new Label("totalPrice", new
PropertyModel(item.getModel(), "totalPrice")));
}
};
group.add(products.setReuseItems(true));
}

class DigitalOrderForm extends Form {
DigitalOrderForm(String s) {
super(s);
}

protected void onSubmit() {
Order order = (Order) getModelObject();
System.err.println("LIST2 = " +
order.getDigitalPackets());
setResponsePage(PageTwo.class);
}
}

The second page is just a back button like this:

public PageTwo() {
add(new Button("back") {
public void onSubmit() {
setResponsePage(HomePage.class);
}
});
}

Anybody knows how to get the selected objects shown when you go back like
that ?

/Steen


Re: Changing Wickets default styles

2008-04-03 Thread Steen Larsen
More or less. Rearranging the order of the styles, seems to have an
influence. No idea why but it looks ok now. Firebug only showed the first
style (background-image), but changing the order made more show up (not
all). Go figure. But thanks for the input all.

/Steen

2008/4/2, Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>:
>
> so you got this sorted out right?
>
> Steen Larsen wrote:
>
> > I'm also developing mainly on firefox, and have tried clearing the cache
> > an
> > all, but no luck. My colleague tried it out with the same result and he
> > had
> > never downloaded the new stylesheet before.
> >
> > The html is the standard feedback panel:
> >
> > 
> >  
> >
> >  Feltet
> > postnummer skal udfyldes.
> >
> >  
> > 
> >
> > and the css reference adds the following line to head, which should be
> > ok:
> >
> >  > href="resources/dk.yousee.order.css.Style/yousee.css" media="screen"
> > />
> >
> > /Steen
> >
> > 2008/4/1, Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]
> > >:
> >
> >
> > > Eeek TDC(yousee), which robs me of a montly fee for television!
> > >
> > > This might not be the rigth forum to ask CSS questions and is sort of
> > > offtopic. But usually when something works in IE and doesnt in firefox
> > > it means that IE breaks standard compability, and due to some bug in
> > > IE
> > > works anyway. My prefered way of working are using firefox to develop,
> > > checking in IE and then fix so it works in IE too..
> > >
> > > Could you show the corresponding html?
> > >
> > > regards Nino
> > >
> > >
> > > Steen Larsen wrote:
> > >
> > >
> > > > Hi,
> > > >
> > > > I have made a stylesheet to change the default look of the
> > > >
> > > >
> > > FeedbackPanel,
> > >
> > >
> > > > and loaded it with response.renderCSSReference(new
> > > > ResourceReference(
> > > > Style.class,"yousee.css"), "screen"), where the class Style and the
> > > > css
> > > >
> > > >
> > > is
> > >
> > >
> > > > in the same package. The css looks like this:
> > > >
> > > > li.feedbackPanelERROR {
> > > >background-image: none;
> > > >color: red;
> > > >padding-left: 0px;
> > > >background-repeat: no-repeat;
> > > >background-position: 0px;
> > > >list-style-type: none;
> > > > }
> > > >
> > > > li.feedbackPanelINFO {
> > > >background-image: none;
> > > >color: red;
> > > >padding-left: 0px;
> > > >background-repeat: no-repeat;
> > > >background-position: 0px;
> > > >list-style-type: none;
> > > > }
> > > >
> > > > This works fine in IE7, but for some reason only works partly in
> > > >
> > > >
> > > Firefox.
> > >
> > >
> > > > The green background-image is removed but the text is not red, and
> > > > is
> > > > indented as in the original. Looking at the styles with Firefoxs
> > > > WebDeveloper shows the correct styles. Anybody experienced this and
> > > >
> > > >
> > > found a
> > >
> > >
> > > > solution ?.
> > > >
> > > > /Steen
> > > >
> > > >
> > > >
> > > >
> > > --
> > > -Wicket for love
> > >
> > > Nino Martinez Wael
> > > Java Specialist @ Jayway DK
> > > http://www.jayway.dk
> > > +45 2936 7684
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> >
> >
> >
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Changing Wickets default styles

2008-04-01 Thread Steen Larsen
I'm also developing mainly on firefox, and have tried clearing the cache an
all, but no luck. My colleague tried it out with the same result and he had
never downloaded the new stylesheet before.

The html is the standard feedback panel:


  

  Feltet
postnummer skal udfyldes.

  


and the css reference adds the following line to head, which should be ok:



/Steen

2008/4/1, Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>:
>
> Eeek TDC(yousee), which robs me of a montly fee for television!
>
> This might not be the rigth forum to ask CSS questions and is sort of
> offtopic. But usually when something works in IE and doesnt in firefox
> it means that IE breaks standard compability, and due to some bug in IE
> works anyway. My prefered way of working are using firefox to develop,
> checking in IE and then fix so it works in IE too..
>
> Could you show the corresponding html?
>
> regards Nino
>
>
> Steen Larsen wrote:
> > Hi,
> >
> > I have made a stylesheet to change the default look of the
> FeedbackPanel,
> > and loaded it with response.renderCSSReference(new ResourceReference(
> > Style.class,"yousee.css"), "screen"), where the class Style and the css
> is
> > in the same package. The css looks like this:
> >
> > li.feedbackPanelERROR {
> > background-image: none;
> > color: red;
> > padding-left: 0px;
> > background-repeat: no-repeat;
> > background-position: 0px;
> > list-style-type: none;
> > }
> >
> > li.feedbackPanelINFO {
> > background-image: none;
> > color: red;
> > padding-left: 0px;
> > background-repeat: no-repeat;
> > background-position: 0px;
> > list-style-type: none;
> > }
> >
> > This works fine in IE7, but for some reason only works partly in
> Firefox.
> > The green background-image is removed but the text is not red, and is
> > indented as in the original. Looking at the styles with Firefoxs
> > WebDeveloper shows the correct styles. Anybody experienced this and
> found a
> > solution ?.
> >
> > /Steen
> >
> >
>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Changing Wickets default styles

2008-04-01 Thread Steen Larsen
Hi,

I have made a stylesheet to change the default look of the FeedbackPanel,
and loaded it with response.renderCSSReference(new ResourceReference(
Style.class,"yousee.css"), "screen"), where the class Style and the css is
in the same package. The css looks like this:

li.feedbackPanelERROR {
background-image: none;
color: red;
padding-left: 0px;
background-repeat: no-repeat;
background-position: 0px;
list-style-type: none;
}

li.feedbackPanelINFO {
background-image: none;
color: red;
padding-left: 0px;
background-repeat: no-repeat;
background-position: 0px;
list-style-type: none;
}

This works fine in IE7, but for some reason only works partly in Firefox.
The green background-image is removed but the text is not red, and is
indented as in the original. Looking at the styles with Firefoxs
WebDeveloper shows the correct styles. Anybody experienced this and found a
solution ?.

/Steen


Re: Nested forms problem

2008-01-24 Thread Steen Larsen
Hm, it seems like i can get the behaviour I expect by overiding the inner
form button's onSubmit method and setting  setDefaultFormProcessing(false)
on it as in this code.

public class Test extends WebPage {
public Test() {
MandatoryProductsForm outer = new
MandatoryProductsForm("outerForm");
NewPhoneForm inner =  new NewPhoneForm("innerForm");
Button innerButton = new Button("innerButton") {
public void onSubmit() {
((NewPhoneForm)getForm()).onSubmit();
}
};
innerButton.setDefaultFormProcessing(false);
inner.add(innerButton);
outer.add(new Button("outerButton"));
outer.add(inner);
add(outer);
}

class MandatoryProductsForm  extends Form {
MandatoryProductsForm(String s) {
super(s);
}

protected void onSubmit() {
System.err.println("Submit outer form");
}
}

class NewPhoneForm  extends Form {
NewPhoneForm(String s) {
super(s);
}

protected void onSubmit() {
System.err.println("Submit inner form");
}
}
}

and this html



TEST









Is this the way it's supposed to be done ?. My understanding was that this
should happen automatically, and i suppose i will have to do my own
validation on the inner form now (haven't tested that part).

/Steen

2008/1/23, James Carman <[EMAIL PROTECTED]>:
>
> Okay, I stand corrected.  We had this question come up on the Tapestry
> users group and I don't believe Tapestry supports it (at least it
> didn't).  I guess I just assumed Wicket didn't either.  There's
> another reason for me to make the switch! :)  I'm going to have to go
> look into this.  Sounds like an interesting feature and I want to see
> how they do it.
>
> On 1/23/08, Steen Larsen <[EMAIL PROTECTED]> wrote:
> > According to the javadoc for Form it is possible because the inner form
> gets
> > substituted with span tags. It says:
> >
> > 
> > Forms can be nested. You can put a form in another form. Since HTML
> doesn't
> > allow nested  tags, the inner forms will be rendered using the
> 
> > tag. You have to submit the inner forms using explicit components (like
> > Button or SubmitLink), you can't rely on implicit submit behavior (by
> using
> > just  that is not attached to a component).
> > 
> >
> > It is mentioned in other threads, I just don't know what I do wrong.
> >
> > /Steen
> >
> > 2008/1/23, James Carman <[EMAIL PROTECTED]>:
> > >
> > > http://www.thescripts.com/forum/thread95602.html
> > >
> > >
> > > On 1/23/08, Steen Larsen <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have seen that nested forms should be possible in Wicket 1.3, so i
> > > have
> > > > tried to use it in one of my projects, but for some reason when
> > > submitting
> > > > the inner form, only the outer form submit method is run. The code
> looks
> > > > something like this:
> > > >
> > > > In a WebPage class
> > > >
> > > > MandatoryProductsForm form = new
> > > > MandatoryProductsForm("mandatoryProductsForm");
> > > > add(form);
> > > > Order order = getOrder();
> > > > form.setModel(new CompoundPropertyModel(order));
> > > > NewPhoneForm pForm = new NewPhoneForm("phoneForm");
> > > > pForm.add(new Button("searchPhone"));
> > > > form.add(pForm);
> > > >
> > > > where the forms are
> > > >
> > > > class MandatoryProductsForm  extends Form {
> > > > MandatoryProductsForm(String s) {
> > > > super(s);
> > > > }
> > > >
> > > > protected void onSubmit() {
> > > > Order order = (Order) getModelObject();
> > > > System.err.println("pn = " + order.getNewPhoneNumber());
> > > > setOrder(order);
> > > > setResponsePage(AdditionalProducts.class);
> > > > }
> > > > }
> > > >
> > > > class NewPhoneForm  extends Form {
> > > > NewPhoneForm(String s) {
> > > > super(s);
> > > > }
> > > >
> > > > protected void onSubmit() {
> > > > System.err.println("Submit inner form");
> > > > }
> > > > }
> > > >
> > > > and the html is
> > > >
> > > > 
> > > >
> > > >> > > value="Søg"/>
> > > >
> > > >
> > > > 
> > > >
> > > > when pressing the searchPhone button I would expect the
> NewPhoneForm's
> > > > onSubmit method to be run but that doesn't happen. Anyone know why ?
> > > >
> > > > /Steen
> > > >
> > >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Nested forms problem

2008-01-23 Thread Steen Larsen
The button's onSubmit gets called, but not the form's onSubmit that the
button is a part of. That's what i can't figure out as the javadoc says it
should only submit the inner form.

/Steen

2008/1/23, Matej Knopp <[EMAIL PROTECTED]>:
>
> You seem to have a button in your search phone. type="submit" wicket:id="searchPhone"/
>
> The button's onSubmit method should be called.
>
> -Matej
>
> On Jan 23, 2008 3:38 PM, Steen Larsen <[EMAIL PROTECTED]> wrote:
> > According to the javadoc for Form it is possible because the inner form
> gets
> > substituted with span tags. It says:
> >
> > 
> > Forms can be nested. You can put a form in another form. Since HTML
> doesn't
> > allow nested  tags, the inner forms will be rendered using the
> 
> > tag. You have to submit the inner forms using explicit components (like
> > Button or SubmitLink), you can't rely on implicit submit behavior (by
> using
> > just  that is not attached to a component).
> > 
> >
> > It is mentioned in other threads, I just don't know what I do wrong.
> >
> > /Steen
> >
> > 2008/1/23, James Carman <[EMAIL PROTECTED]>:
> >
> > >
> > > http://www.thescripts.com/forum/thread95602.html
> > >
> > >
> > > On 1/23/08, Steen Larsen <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have seen that nested forms should be possible in Wicket 1.3, so i
> > > have
> > > > tried to use it in one of my projects, but for some reason when
> > > submitting
> > > > the inner form, only the outer form submit method is run. The code
> looks
> > > > something like this:
> > > >
> > > > In a WebPage class
> > > >
> > > > MandatoryProductsForm form = new
> > > > MandatoryProductsForm("mandatoryProductsForm");
> > > > add(form);
> > > > Order order = getOrder();
> > > > form.setModel(new CompoundPropertyModel(order));
> > > > NewPhoneForm pForm = new NewPhoneForm("phoneForm");
> > > > pForm.add(new Button("searchPhone"));
> > > > form.add(pForm);
> > > >
> > > > where the forms are
> > > >
> > > > class MandatoryProductsForm  extends Form {
> > > > MandatoryProductsForm(String s) {
> > > > super(s);
> > > > }
> > > >
> > > > protected void onSubmit() {
> > > > Order order = (Order) getModelObject();
> > > > System.err.println("pn = " + order.getNewPhoneNumber());
> > > > setOrder(order);
> > > > setResponsePage(AdditionalProducts.class);
> > > > }
> > > > }
> > > >
> > > > class NewPhoneForm  extends Form {
> > > > NewPhoneForm(String s) {
> > > > super(s);
> > > > }
> > > >
> > > > protected void onSubmit() {
> > > > System.err.println("Submit inner form");
> > > > }
> > > > }
> > > >
> > > > and the html is
> > > >
> > > > 
> > > >
> > > >> > > value="Søg"/>
> > > >
> > > >
> > > > 
> > > >
> > > > when pressing the searchPhone button I would expect the
> NewPhoneForm's
> > > > onSubmit method to be run but that doesn't happen. Anyone know why ?
> > > >
> > > > /Steen
> > > >
> > >
> >
>
>
>
> --
> Resizable and reorderable grid components.
> http://www.inmethod.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Nested forms problem

2008-01-23 Thread Steen Larsen
According to the javadoc for Form it is possible because the inner form gets
substituted with span tags. It says:


Forms can be nested. You can put a form in another form. Since HTML doesn't
allow nested  tags, the inner forms will be rendered using the 
tag. You have to submit the inner forms using explicit components (like
Button or SubmitLink), you can't rely on implicit submit behavior (by using
just  that is not attached to a component).


It is mentioned in other threads, I just don't know what I do wrong.

/Steen

2008/1/23, James Carman <[EMAIL PROTECTED]>:
>
> http://www.thescripts.com/forum/thread95602.html
>
>
> On 1/23/08, Steen Larsen <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I have seen that nested forms should be possible in Wicket 1.3, so i
> have
> > tried to use it in one of my projects, but for some reason when
> submitting
> > the inner form, only the outer form submit method is run. The code looks
> > something like this:
> >
> > In a WebPage class
> >
> > MandatoryProductsForm form = new
> > MandatoryProductsForm("mandatoryProductsForm");
> > add(form);
> > Order order = getOrder();
> > form.setModel(new CompoundPropertyModel(order));
> > NewPhoneForm pForm = new NewPhoneForm("phoneForm");
> > pForm.add(new Button("searchPhone"));
> > form.add(pForm);
> >
> > where the forms are
> >
> > class MandatoryProductsForm  extends Form {
> > MandatoryProductsForm(String s) {
> > super(s);
> > }
> >
> > protected void onSubmit() {
> > Order order = (Order) getModelObject();
> > System.err.println("pn = " + order.getNewPhoneNumber());
> > setOrder(order);
> > setResponsePage(AdditionalProducts.class);
> > }
> > }
> >
> > class NewPhoneForm  extends Form {
> > NewPhoneForm(String s) {
> > super(s);
> > }
> >
> > protected void onSubmit() {
> > System.err.println("Submit inner form");
> > }
> > }
> >
> > and the html is
> >
> > 
> >
> >> value="Søg"/>
> >
> >
> > 
> >
> > when pressing the searchPhone button I would expect the NewPhoneForm's
> > onSubmit method to be run but that doesn't happen. Anyone know why ?
> >
> > /Steen
> >
>


Nested forms problem

2008-01-23 Thread Steen Larsen
Hi,

I have seen that nested forms should be possible in Wicket 1.3, so i have
tried to use it in one of my projects, but for some reason when submitting
the inner form, only the outer form submit method is run. The code looks
something like this:

In a WebPage class

MandatoryProductsForm form = new
MandatoryProductsForm("mandatoryProductsForm");
add(form);
Order order = getOrder();
form.setModel(new CompoundPropertyModel(order));
NewPhoneForm pForm = new NewPhoneForm("phoneForm");
pForm.add(new Button("searchPhone"));
form.add(pForm);

where the forms are

class MandatoryProductsForm  extends Form {
MandatoryProductsForm(String s) {
super(s);
}

protected void onSubmit() {
Order order = (Order) getModelObject();
System.err.println("pn = " + order.getNewPhoneNumber());
setOrder(order);
setResponsePage(AdditionalProducts.class);
}
}

class NewPhoneForm  extends Form {
NewPhoneForm(String s) {
super(s);
}

protected void onSubmit() {
System.err.println("Submit inner form");
}
}

and the html is


   
  
   
   


when pressing the searchPhone button I would expect the NewPhoneForm's
onSubmit method to be run but that doesn't happen. Anyone know why ?

/Steen


Panels in forms problem

2008-01-09 Thread Steen Larsen
I have a form with a RadioGroup containing a ListView much like the example
from WicketStuff, which works fine.

Now I would like to get the radiogroup part out into a panel that I could
then add to the form multiple times with different models (products),
however I can't figure out where the chosen radiobuttons backing model gets
set as it isn't on the model object I used. Anyone got  an example of
submitting a form containing panels (tat is panels not containing forms
themselves)?

In the normal case the resulting object gets set on the property specified
in the radiogroup, and I suspect the problem has something to do with the
added markup identifier from adding a panel to the form instead of the
radiogroup but haven't been able to figure it out.

/Steen


keyboard shortcuts in wicket ?

2007-08-21 Thread Steen Larsen
Hi,

I am doing an evaluation of wicket and would like to know if there is any
support for keyboard shortcuts besides the standard html accesskey. Is it
for instance possible to define a key kombination for an AJAX component ?

/Steen