Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2009-02-18 Thread Sean Brookes

Thank you for posting your code on this.  It is exactly the same issue I am
working on.  A problem I am experiencing is with adding the wizard to the
target in the addOrReplace method of AjaxWizardButtonBar:

target.addComponent(wizard);

That is causing the init method of the Wizard class to be called.  The last
line of that method calls:

   wizardModel.reset();

The reset method resets the whole wizard back to it's initial state so when
I click 'next' the navigation happens and the wizard advances to the next
'step' but then the wizard is reinitialized back to the original state.

What is the best way to avoid the reset method being called?

thanks in advance,
Sean




fstof wrote:
 
 Incredible!
 My next and previous works perfectly, I am liking wicket more and more...
 its all so simple
 I use the same AjaxWizardButon posted above 
 
 Here is my AjaxButtonBar
 
 public class AjaxWizardButtonBar extends WizardButtonBar {
 
   private static final long serialVersionUID = 1L;
 
   public AjaxWizardButtonBar(String id, final Wizard wizard) {
   super(id, wizard);
 
   addOrReplace(new AjaxWizardButton(next, wizard, next) {
   @Override
   protected void onClick(AjaxRequestTarget target, Form 
 form) {
   IWizardModel wizardModel = getWizardModel();
   IWizardStep step = wizardModel.getActiveStep();
 
   // let the step apply any state
   step.applyState();
 
   // if the step completed after applying the 
 state, move the model
 onward
   if (step.isComplete()) {
   wizardModel.next();
   } else {
   
 error(getLocalizer().getString(org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete,
 this));
   }
 
   target.addComponent(wizard);
   }
 
   public final boolean isEnabled() {
   return getWizardModel().isNextAvailable();
   }
   });
 
   addOrReplace(new AjaxWizardButton(previous, wizard, prev) {
   @Override
   protected void onClick(AjaxRequestTarget target, Form 
 form) {
   getWizardModel().previous();
   target.addComponent(wizard);
   }
 
   public final boolean isEnabled() {
   return getWizardModel().isPreviousAvailable();
   }
   });
   }
 
 }
 
 
 
 Nino.Martinez wrote:
 
 I would go checkout the source of wizardbuttonbar, find the appropriate 
 buttons and see how they either canceled or went to next step. And just 
 reimplement it with ajaxbuttons instead. It should be really trivial as 
 long as you remember target.addComponent as you mention..
 
 I guess there could be room for a Ajax wizard in extensions..
 
 fstof wrote:
 Oops... I see you are only concerned with the cancel and finish
 buttons...
 I'm looking to make everything, including the next and previous buttons
 to
 use ajax... 
 I'm asuming I'll have to have something like this in there someware,
 yes?
 target.addComponent(wizard);



 fstof wrote:
   
 Ahaa... I see...
 Can you maybe post your implementation of the onclick method of the
 AjaxNextButton?

 sorry, but I'm a bit new with the wicket thing

 Thanks a lot for the help


 AshleyAbraham wrote:
 
 Yes, I did make it to work by creating those two Ajax buttons and
 putting
 them in a class which extends WizardButtonBar class and overrided the
 newButtonBar() in the Wizard class to pass that. Its been a while
 since I
 did it, so I dont have the exact details on the tip of my finger.

 Hope it helps,
 Ashley




   
 

   
 
 -- 
 -Wicket for love
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p22088388.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



set mountPath for BookmarkablePageLink

2009-01-27 Thread Sean Brookes

I am working on some RESTful navigation and have run across an issue with ver
1.3.x.

I would like to specify multiple mountPath names to the same Page class eg:

mount(new IndexedParamUrlCodingStrategy(
internal,Class.forName(com.xyz.unittest.framework.layout.LandingPage)));
mount(new IndexedParamUrlCodingStrategy(
external,Class.forName(com.xyz.unittest.framework.layout.LandingPage)));
mount(new IndexedParamUrlCodingStrategy(
custom,Class.forName(com.xyz.unittest.framework.layout.LandingPage)));

So that in addition to the indexed set of parameters I can also use the
mountPath name to configure the page response.

So far so good but the problem is how to specify a particular mountPath when
creating the BookmarkablePageLink.  Is there there a straightforward way to
specify the mount path?

I have searched the forum and google and would have thought this would have
come up as an issue for someone else so maybe I am approaching this the
wrong way.

I realize I can do this with just the parameters passed to the page but we
have a diverse set of 'page views' and I would like to minimize the number
of page classes we have to 'mount'

I have also played around with using the ExternalLink and managing the URL
construction manually but it feels clunky.

Regards,
Sean

-- 
View this message in context: 
http://www.nabble.com/set-mountPath-for-BookmarkablePageLink-tp21700838p21700838.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



Absolute URL problem with HeaderContributor (1.3.4)

2008-11-06 Thread Sean Brookes

I know the recommeded approach is to use relative context URLs for CSS and
Javascript but our application places static assets on a separate server for
performance reasons so relative paths are not an option.  From what I
understand if my path starts with http://; or https://; wicket should
respect that but it doesn't seem to be working that way for me.

My code:

String fullyQualifiedPath = getAssetHost() +
/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js;
add(HeaderContributor.forJavaScript(fullyQualifiedPath));

Where 'getAssetHost()'  returns http://asset server host/assets  so
fullyQalifiedPath = http://asset server
host/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js 

The problem is that Wicket seems to be prepending the application context to
that value so on the client I get:
http://web app server host/web/app/http://asset server
host/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js

Can someone shed some light on this for me?

cheers,
Sean
-- 
View this message in context: 
http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Absolute URL problem with HeaderContributor (1.3.4)

2008-11-06 Thread Sean Brookes

Thank you for your quick response igor but I don't think I understand your
response.  We are currently using version 1.3.4, although we are assessing
the impact of moving to 1.3.5 and I will certainly test it there when we do.

I'm afraid I don't know what you mean when you suggest I 'create a
quckstart'

While looking into this a little further I discovered that this seems to
work in a file that extends WebPage but the file I am working on extends
Panel. I don't know if this should affect how HeaderContributor generates
it's path value or not but thought I would mention it.

Sean





igor.vaynberg wrote:
 
 can you make sure its still broken in 1.3.x branch and if it is create
 a quickstart.
 
 -igor
 
 On Thu, Nov 6, 2008 at 3:25 PM, Sean Brookes [EMAIL PROTECTED] wrote:

 I know the recommeded approach is to use relative context URLs for CSS
 and
 Javascript but our application places static assets on a separate server
 for
 performance reasons so relative paths are not an option.  From what I
 understand if my path starts with http://; or https://; wicket should
 respect that but it doesn't seem to be working that way for me.

 My code:

String fullyQualifiedPath = getAssetHost() +
 /tinymce-3-2/jscripts/tiny_mce/tiny_mce.js;
add(HeaderContributor.forJavaScript(fullyQualifiedPath));

 Where 'getAssetHost()'  returns http://asset server host/assets  so
 fullyQalifiedPath = http://asset server
 host/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js

 The problem is that Wicket seems to be prepending the application context
 to
 that value so on the client I get:
 http://web app server host/web/app/http://asset server
 host/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js

 Can someone shed some light on this for me?

 cheers,
 Sean
 --
 View this message in context:
 http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20372681.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]