Re: DDC and page reload
swf.setValue("flashvars", "somevar=" + "somevalue"+ "¤cy=" + curr); ^ that should instead take an IModel so that it renders a fresh value on each new request instead of always rendering the value you passed in at page construction. in fact, it should take the same model instance as is use by the ddc. -igor On Jan 30, 2008 5:10 AM, Sébastien Piller <[EMAIL PROTECTED]> wrote: > Yes, no problem, but it's really trivial... > > My Flash object is added here (I use the ShockWaveComponent, little > modified, from the wiki): > > ShockWaveComponent swf = new ShockWaveComponent("swf", > "ShirtDesignerV2.swf", "770", "480"); > swf.setValue("quality", "high"); > swf.setValue("bgcolor", "#869ca7"); > swf.setValue("id", "editor"); > swf.setValue("name", "editor"); > ... > String curr = getCurrentCurrency(); > swf.setValue("flashvars", "somevar=" + "somevalue"+ "¤cy=" > + curr); > swf.setValue("allowScriptAccess", "sameDomain"); > swf.setValue("type", "application/x-shockwave-flash"); > add(swf); > > And here I change the currency with the DDC: > DropDownChoice currencies = new > DropDownChoice("currencies", new PropertyModel(this, "currentCurrency"), > Arrays.asList(new String[] { "CHF", "EUR", "USD" })) { > @Override > protected boolean wantOnSelectionChangedNotifications() { > return true; > } > > @Override > protected void onSelectionChanged(Object newSelection) { > //System.out.println("SETTED: " + newSelection); > setCurrency(newSelection + ""); > } > }; > add(currencies); > > There is nothing special here > > But when the onSelectionChanged is fired, the flashvars doesn't change > > Thanks ;) > > > Edvin Syse a écrit : > > > I think it would be easier to help you if you supplied some code :) > > > > -- Edvin > > > - > 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]
Re: DDC and page reload
I found a patch (very ugly but works). On the onSelectionChange, I wrote this: if (MyAbstractPage.this instanceof MyPageWithTheRefreshIssue) { setResponsePage(new MyPageWithTheRefreshIssue()); } But I wonder: is this a normal behavior? I guessed I need not to refresh it manually, need I? Thanks! ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
Yes, no problem, but it's really trivial... My Flash object is added here (I use the ShockWaveComponent, little modified, from the wiki): ShockWaveComponent swf = new ShockWaveComponent("swf", "ShirtDesignerV2.swf", "770", "480"); swf.setValue("quality", "high"); swf.setValue("bgcolor", "#869ca7"); swf.setValue("id", "editor"); swf.setValue("name", "editor"); ... String curr = getCurrentCurrency(); swf.setValue("flashvars", "somevar=" + "somevalue"+ "¤cy=" + curr); swf.setValue("allowScriptAccess", "sameDomain"); swf.setValue("type", "application/x-shockwave-flash"); add(swf); And here I change the currency with the DDC: DropDownChoice currencies = new DropDownChoice("currencies", new PropertyModel(this, "currentCurrency"), Arrays.asList(new String[] { "CHF", "EUR", "USD" })) { @Override protected boolean wantOnSelectionChangedNotifications() { return true; } @Override protected void onSelectionChanged(Object newSelection) { //System.out.println("SETTED: " + newSelection); setCurrency(newSelection + ""); } }; add(currencies); There is nothing special here But when the onSelectionChanged is fired, the flashvars doesn't change Thanks ;) Edvin Syse a écrit : I think it would be easier to help you if you supplied some code :) -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
how are you listening to the change of the DDC? If through ajax then you have to set the response page again to get a real refresh of everything (or just refresh th flash markup part) if through normal submit (onSelection) then the page is completely refreshed anyway maybe you cache at some place to much johan On Jan 30, 2008 1:54 PM, Sébastien Piller <[EMAIL PROTECTED]> wrote: > Hello, > > I have a little problem with drop down choices. I have one on my page. > It stores some currencies. In the same page, I've got a Flash module, > who needs the actual currency to work. I pass it using the usual > "flashvars". > > But when I change a currency on the DDC (ie from USD to EUR), the actual > page is refreshed (or seems to), but the currency passed in the > flashvars is the old one (USD) although all of my models are properly > updated. So I think wicket hasn't recomputed some markup... > > Can I force him to fully reload (recreate) the current page when a > onSelectionChange event is fired? > > Thanks! > > ;) > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: DDC and page reload
I have a little problem with drop down choices. I have one on my page. It stores some currencies. In the same page, I've got a Flash module, who needs the actual currency to work. I pass it using the usual "flashvars". But when I change a currency on the DDC (ie from USD to EUR), the actual page is refreshed (or seems to), but the currency passed in the flashvars is the old one (USD) although all of my models are properly updated. So I think wicket hasn't recomputed some markup... Can I force him to fully reload (recreate) the current page when a onSelectionChange event is fired? I think it would be easier to help you if you supplied some code :) -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DDC and page reload
Hello, I have a little problem with drop down choices. I have one on my page. It stores some currencies. In the same page, I've got a Flash module, who needs the actual currency to work. I pass it using the usual "flashvars". But when I change a currency on the DDC (ie from USD to EUR), the actual page is refreshed (or seems to), but the currency passed in the flashvars is the old one (USD) although all of my models are properly updated. So I think wicket hasn't recomputed some markup... Can I force him to fully reload (recreate) the current page when a onSelectionChange event is fired? Thanks! ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]