Re: DropDownChoice with Java Enum
If understand correctly, the value displayed in as value in the html options will not be used to set my requestStatus property in the model class "RequestFormModel" but use by the DropDownchoice to find the value to be setted (like key for hashmap, index for array, ...). In consequenc,e I have to change the code of my property setter inside my model to set the value (coming from the ENUM) : public void setRequestType(String requestType) { // Set requestType field with the value (and not the description) of the enum this.requestType = ProcessingStatusType.valueOf( requestType ).getValue(); } Pedro Santos-6 wrote: > > The value on model are on ProcessingStatusType instance. Use > ((ProcessingStatusType)model.getObject()).getValue() to access the value > REJEC > > > On Thu, Sep 10, 2009 at 12:39 PM, cmoulliard wrote: > >> >> Thks for all. >> >> With the following syntax : >> >>add(new DropDownChoice("requestStatus", >> Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { >> >> public Object getDisplayValue(Object status) { >>return ((ProcessingStatusType) >> status).getDescription(); >>} >> >>public String getIdValue(Object status, int index) >> { >>return ((ProcessingStatusType) >> status).getValue(); >>}})); >> >> html generated : >> >> >> Choose One >> New >> Accepted >> >> Validated >> Transformed >> Transferred >> Rejected >> Failed >> >> >> Everything is ok except that the value receives by my RequestFormModel >> after >> the post is equal to the description (e.g : REJECTED instead of REJEC) >> and >> not the value >> >> >> >> >> >> >> Here is what I have in html : >> >> >> >> Matthias Keller wrote: >> > >> > Hi >> > >> > Close but not quite. getDisplayValue gets the catual ELEMENT of the >> list >> > - so objDispl is of type ProcessingStatusType already. >> > So in your case it would be something like: >> > >> >> public Object getDisplayValue(Object objDispl) { >> >> return ((ProcessingStatusType) objDispl).getDescription(); >> >> } >> >> >> >> public String getIdValue(Object obj, int index) { >> >> return obj.toString(); >> >> // or if you prefer to have the value of your enum in the HTML >> code: >> >> // return ((ProcessingStatusType) objDispl).getValue() >> >> } >> > Which one of the getIdValue implementations you chose doesn't matter >> for >> > wicket, it just needs an ID for every entry which is unique. >> > In your case you could even return String.valueOf(index) as your >> > backing List of the Enums will not ever change while deployed. >> > >> > Be careful though with using index, there are circumstances where no >> > useful index will be provided (always -1) - That happens when you >> > externally change the selected value of the DropDownChoice. >> > >> > you could also just use or extend ChoiceRenderer which might already do >> > what you want... >> > For example >> > new ChoiceRenderer("description", "value") >> > >> > Matt >> > >> > cmoulliard wrote: >> >> You mean create something like this : >> >> >> >> add(new DropDownChoice("requestStatus", >> >> Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { >> >> >> >> public Object getDisplayValue(Object objDispl) { >> >> return >> ProcessingStatusType.valueOf((String) >> >> objDispl).getDescription(); >> >> } >> >> >> >> public String getIdValue(Object obj, int index) { >> >> return obj.toString(); >> >> }})); >> >> >> >> I have an error during initialisation : >> >> >> >> WicketMessage: Exception in rendering component: [MarkupContainer >> >> [Component >> >> id = requestStatus]] >> >> >> >> Root cause: >> >> >> >> java.lang.ClassCastException: >> >> com.xpectis.x3s.model.usertype.ProcessingStatusType >> >> at >> >> >> com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) >> >> >> >> I suppose that what I defined in getDisplayValue is not correct ? >> >> >> >> Matthias Keller wrote: >> >> >> >>> Hi Charles >> >>> >> >>> No problem. Just make an IChoiceRenderer which calls getDescription >> for >> >>> the display value and getValue for the id. >> >>> >> >>> Matt >> >>> >> >>> Charles Moulliard wrote: >> >>> >> Hi, >> >> I would like to know if I can create a DropDownChoice where the >> value >> to >> be >> displayed in the drop down list corresponds to the description of my >> enumeration (e.g. Accepted) while the value to be returned is the >> value >> defined in the enumeration (e.g: ACCPT) ? >> >> public enum ProcessingStatusType { >> NEW ("NEW", "New"), >> ACCEPTED ("ACCPT", "Accepted"), >> VALIDATED ("VALID", "Valid
Re: Ajax Redirect with Busy Indicator
> Why not include a script containing hideBusysign() On the page you are > navigating to? Y If it is external page you cannot... say a link to outlook or hiihuu.. ** Martin > > On Fri, Sep 11, 2009 at 7:50 AM, Robert McGuinness < > robert.mcguinness@gmail.com> wrote: > >> I applied the busy indicator techniques found here: >> >> http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.htmlas >> a site wide implementation. >> >> I am using an ajax to submit the form, and do to some condition, I redirect >> to the user to another page. My problem seems to be the >> Wicket.Ajax.invokePreCallHandlers() gets called on the doPost() method in >> the wicket-ajax.js and the busy indicator continuously shows on the next >> page. >> >> Any ideas how to resolve this issue? >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RefreshingView not Refreshing
Hi, > I'm wondering why the small change (see comments) > to my RV causes it to not refresh automatically. > A browser refresh shows the changes. The Form submit does not call the page constructor, but a browser refresh does. mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to redirect from a ModalWindow
Hi Matthias, Try to navigate to another page from WindowClosedCallback window.close(target); window.setWindowClosedCallback(new WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { setResponsePage(OtherPage.class); } } But remember to remove WindowClosedCallback before you open your window next time Michal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Stuff Core 1.4.1 Release[ing]
Let me see if I could do that in the coming weeks. However we could have a red zone for projects that are becoming outdated.. If of course there are any? Just to tell the authors that they are in danger of being removed -> attic. 2009/9/10 Jeremy Thomerson : > In the time it would take to generate the list, you could fix the problems. > I wrote detailed instructions for adding projects to WS-core, so someone > should be able to take those and fix the projects that are not meeting those > standards. > > You want to do it? > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Thu, Sep 10, 2009 at 1:11 PM, nino martinez wael < > nino.martinez.w...@gmail.com> wrote: > >> Hi Jeremy >> >> Should we have a list of offendending project? >> >> 2009/9/6 Jeremy Thomerson : >> > First, jquery was built. They don't follow the naming conventions like >> they >> > should, so you have to look into the pom to realize that it's actually >> > wicketstuff-jquery [1]. >> > >> > Second, regarding merged resources - there's a link on the wiki [2] that >> > explains how. Please make sure to follow all conventions and run "mvn >> clean >> > install" as well as "mvn site:site" on all of wicketstuff-core when you >> are >> > done. If you can't build everything or you can't generate sites, please >> > don't commit. I just comment out projects that can't easily be fixed and >> > built when building releases. >> > >> > [1] >> > >> http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-jquery/1.4.1/ >> > [2] >> > >> http://wicketstuff.org/confluence/display/STUFFWIKI/WicketStuff+Core+-+Migration+Guide >> > >> > Best regards, >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Sun, Sep 6, 2009 at 11:22 AM, Jörn Zaefferer < >> > joern.zaeffe...@googlemail.com> wrote: >> > >> >> So jquery-parent was build, which just references jquery and >> >> jquery-examples - neither of which were build. Whats the point of >> >> that? >> >> >> >> Also, how can we get wicketstuff-merged-resources included in the next >> >> release? >> >> >> >> Jörn >> >> >> >> On Mon, Aug 31, 2009 at 10:20 PM, Jeremy >> >> Thomerson wrote: >> >> > I have the credentials and think that I will definitely be trying this >> on >> >> > the next release :) >> >> > >> >> > -- >> >> > Jeremy Thomerson >> >> > http://www.wickettraining.com >> >> > >> >> > >> >> > >> >> > On Mon, Aug 31, 2009 at 3:16 PM, Martijn Dashorst < >> >> > martijn.dasho...@gmail.com> wrote: >> >> > >> >> >> Perhaps it's more beneficial to do the actual release local on the >> >> >> machine? I'm sure Johan can provide you with the credentials to do >> so. >> >> >> >> >> >> Martijn >> >> >> >> >> >> On Mon, Aug 31, 2009 at 9:27 PM, Jeremy >> >> >> Thomerson wrote: >> >> >> > It's mostly uploading and then merging the POMs on the remote >> server. >> >> >> The >> >> >> > build isn't actually that bad (maybe 15 or 20 minutes for the >> release >> >> >> > procedure, including tagging, etc). >> >> >> > >> >> >> > -- >> >> >> > Jeremy Thomerson >> >> >> > http://www.wickettraining.com >> >> >> > >> >> >> > >> >> >> > >> >> >> > On Mon, Aug 31, 2009 at 2:14 PM, Nicolas Melendez < >> >> >> nmelen...@getsense.com.ar >> >> >> >> wrote: >> >> >> > >> >> >> >> very slow build :) >> >> >> >> >> >> >> >> On Mon, Aug 31, 2009 at 9:07 PM, Jeremy >> >> >> >> Thomerson wrote: >> >> >> >> > Wicket Stuff Core 1.4.1 is now released: >> >> >> >> > >> >> >> >> > [INFO] BUILD SUCCESSFUL >> >> >> >> > [INFO] >> >> >> >> > >> >> >> >> >> >> >> >> > [INFO] Total time: 204 minutes 20 seconds >> >> >> >> > [INFO] Finished at: Mon Aug 31 14:04:09 CDT 2009 >> >> >> >> > [INFO] Final Memory: 218M/929M >> >> >> >> > [INFO] >> >> >> >> > >> >> >> >> >> >> >> >> > >> >> >> >> > >> >> >> >> > -- >> >> >> >> > Jeremy Thomerson >> >> >> >> > http://www.wickettraining.com >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > On Mon, Aug 31, 2009 at 10:38 AM, Jeremy Thomerson < >> >> >> >> > jer...@wickettraining.com> wrote: >> >> >> >> > >> >> >> >> >> That was only in the event that we really needed an interim >> >> release. >> >> >> >> The >> >> >> >> >> plan still is that we will release to match Wicket releases. >> >> >> >> >> >> >> >> >> >> PS - I have to try to start the deploy over again: >> >> >> >> >> >> >> >> >> >> [INFO] Retrieving previous metadata from >> wicketstuff-org-maven >> >> >> >> >> [INFO] Uploading repository metadata for: 'artifact >> >> >> >> >> org.wicketstuff:sitemap-xml' >> >> >> >> >> [INFO] Uploading project information for sitemap-xml >> 1.4.1 >> >> >> >> >> Uploading: scpexe:// >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> wicketstuff.org/home/wicket/tomcat/webapps/maven/repository/org/wicketstuff/sitemap-xml/1.4.1/sitemap-xml-1.4.1-sources.jar >> >> >> >> >> [INFO]
Re: history.go(-1) in wickets?
"page parameters retained"? The parameters of which page? The one you are going back to? "browser back button is not to be used"? The browser has a back button whether you like it or not. Users may not see if you hide it but still press "ALT-LEFT" while cursing over you. The back button can be available through link: ExternalLink backLink = new ExternalLink("backLink", "javascript:history.go(-1)"); add(backLink); The semantics of the back button is like "undo". This is not always exactly what you want, e.g. a webshop where the shopping cart must be kept in the session so that when you go back the things in your cart does not disappear. /Per On Fri, Sep 11, 2009 at 5:45 AM, Jade wrote: > Hi people, > > I want to have a hyperlink or button on click of which does a > history.go(-1) similar to javascript.(browser back button is not be used in > our application) with page parameters retained. > > I did see couple of posts on this, like the isVersioned of the page is to > be set to true and do some manipulations with PageReference. However, it > was > not so clear to me. > > Could any one please explain how to do this? Does making isVersioned true > cause any performance issues? > > Thanks, > J >
Re: Ajax Redirect with Busy Indicator
Why not include a script containing hideBusysign() On the page you are navigating to? Y Best, Ernesto On Fri, Sep 11, 2009 at 7:50 AM, Robert McGuinness < robert.mcguinness@gmail.com> wrote: > I applied the busy indicator techniques found here: > > http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.htmlas > a site wide implementation. > > I am using an ajax to submit the form, and do to some condition, I redirect > to the user to another page. My problem seems to be the > Wicket.Ajax.invokePreCallHandlers() gets called on the doPost() method in > the wicket-ajax.js and the busy indicator continuously shows on the next > page. > > Any ideas how to resolve this issue? >
Re: Ajax Redirect with Busy Indicator
Hi! Well.. you need to find out what is the cause. For example, if you redirect to external pages, you must skip the busy indicator. This means that you might have to use some clue in your button or link to omit the busy indicator. Here is some example code that we use: if ((clickedElement.tagName.toUpperCase() == 'A' && ((clickedElement.target == null) || (clickedElement.target.length <= 0)) && (clickedElement.href.lastIndexOf('#') != (clickedElement.href.length-1)) && (!('nobusy' in clickedElement)) && (clickedElement.href.indexOf('skype') < 0) && (clickedElement.href.indexOf('mailto') < 0) && (clickedElement.href.indexOf('WicketAjaxDebug') < 0) && (clickedElement.href.lastIndexOf('.doc') != (clickedElement.href.length-4)) && (clickedElement.href.lastIndexOf('.csv') != (clickedElement.href.length-4)) && (clickedElement.href.lastIndexOf('.xls') != (clickedElement.href.length-4)) && ((clickedElement.onclick == null) || (clickedElement.onclick.toString().indexOf('window.open') <= 0)) ) || (clickedElement.parentNode.tagName.toUpperCase() == 'A' && ((clickedElement.parentNode.target == null) || (clickedElement.parentNode.target.length <= 0)) && (clickedElement.parentNode.href.indexOf('skype') < 0) && (clickedElement.parentNode.href.indexOf('mailto') < 0) && (clickedElement.parentNode.href.lastIndexOf('#') != (clickedElement.parentNode.href.length-1)) && (clickedElement.parentNode.href.lastIndexOf('.doc') != (clickedElement.parentNode.href.length-4)) && (clickedElement.parentNode.href.lastIndexOf('.csv') != (clickedElement.parentNode.href.length-4)) && (clickedElement.parentNode.href.lastIndexOf('.xls') != (clickedElement.parentNode.href.length-4)) && ((clickedElement.parentNode.onclick == null) || (clickedElement.parentNode.onclick.toString().indexOf('window.open') <= 0)) ) || ( ((clickedElement.onclick == null) || ((clickedElement.onclick.toString().indexOf('confirm') <= 0) && (clickedElement.onclick.toString().indexOf('alert') <= 0) && (clickedElement.onclick.toString().indexOf('Wicket.Palette') <= 0))) && (clickedElement.tagName.toUpperCase() == 'INPUT' && (clickedElement.type.toUpperCase() == 'BUTTON' || clickedElement.type.toUpperCase() == 'SUBMIT' || clickedElement.type.toUpperCase() == 'IMAGE')) ) ) { showBusysign(); } ** Martin 2009/9/11 Robert McGuinness : > I applied the busy indicator techniques found here: > http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.htmlas > a site wide implementation. > > I am using an ajax to submit the form, and do to some condition, I redirect > to the user to another page. My problem seems to be the > Wicket.Ajax.invokePreCallHandlers() gets called on the doPost() method in > the wicket-ajax.js and the busy indicator continuously shows on the next > page. > > Any ideas how to resolve this issue? > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajax Redirect with Busy Indicator
I applied the busy indicator techniques found here: http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.htmlas a site wide implementation. I am using an ajax to submit the form, and do to some condition, I redirect to the user to another page. My problem seems to be the Wicket.Ajax.invokePreCallHandlers() gets called on the doPost() method in the wicket-ajax.js and the busy indicator continuously shows on the next page. Any ideas how to resolve this issue?
history.go(-1) in wickets?
Hi people, I want to have a hyperlink or button on click of which does a history.go(-1) similar to javascript.(browser back button is not be used in our application) with page parameters retained. I did see couple of posts on this, like the isVersioned of the page is to be set to true and do some manipulations with PageReference. However, it was not so clear to me. Could any one please explain how to do this? Does making isVersioned true cause any performance issues? Thanks, J
Re: Serialization on objects inherited from a container
wicket serializes the page which contains all the components - so everything your components hold on to is also serialized. this is why we have models that can detach - so you can release the heavy state before the page is serialized, and reacquire it again when needed. -igor On Thu, Sep 10, 2009 at 7:59 PM, kingcode wrote: > > Thanks Igor for the quick response - I guess this is stating the obvious, but > I conclude that this is just part of the page/component serialization? > > Correct me if I am wrong, but from what I understand the reference to an > outer scope obj. is a 'field' of the inner class and therefore required to > be serializable by wicket. > > JF > > > > igor.vaynberg wrote: >> >>> add new Link( "addToCart") { >>> public void onClick() { >>> getSession().getCart().add( p.getId()); >>> //..etc >>> >> >> your anonymous class keeps a reference to p because inside you >> reference p via p.getId(). >> >> -igor >> >> On Thu, Sep 10, 2009 at 12:00 PM, J.-F. Rompre wrote: >>> Hello, >>> >>> I would like to know where I could find documentation on the issue of >>> serializing objects inherited from a component's container as in the >>> example >>> below. I tried looking at the wicket source code to see when this occurs >>> but >>> still don't understand when/how it is done. >>> >>> //... >>> >>> final Product p = //get non-serializable Product object >>> >>> add new Link( "addToCart") { >>> public void onClick() { >>> getSession().getCart().add( p.getId()); >>> //..etc >>> >>> The above throws a NotSerializableException. However, no problem occurs >>> after the code is changed to: >>> >>> //... >>> >>> //Product p already assigned >>> final String pId = p.getId() //serializable >>> >>> add new Link( "addToCart") { >>> public void onClick() { >>> getSession().getCart().add( pId); >>> //..etc >>> >>> (Also, building the Link with a wrapping Model object also works, >>> obviously) >>> >>> However I am curious to know why a non-model object is serialized when >>> inherited from the container even though within the same request? >>> >>> Thanks for any comment, >>> >>> JF >>> >> >> - >> 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/Serialization-on-objects-inherited-from-a-container-tp25389127p25394299.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: Serialization on objects inherited from a container
Thanks Igor for the quick response - I guess this is stating the obvious, but I conclude that this is just part of the page/component serialization? Correct me if I am wrong, but from what I understand the reference to an outer scope obj. is a 'field' of the inner class and therefore required to be serializable by wicket. JF igor.vaynberg wrote: > >> add new Link( "addToCart") { >>public void onClick() { >>getSession().getCart().add( p.getId()); >>//..etc >> > > your anonymous class keeps a reference to p because inside you > reference p via p.getId(). > > -igor > > On Thu, Sep 10, 2009 at 12:00 PM, J.-F. Rompre wrote: >> Hello, >> >> I would like to know where I could find documentation on the issue of >> serializing objects inherited from a component's container as in the >> example >> below. I tried looking at the wicket source code to see when this occurs >> but >> still don't understand when/how it is done. >> >> //... >> >> final Product p = //get non-serializable Product object >> >> add new Link( "addToCart") { >> public void onClick() { >> getSession().getCart().add( p.getId()); >> //..etc >> >> The above throws a NotSerializableException. However, no problem occurs >> after the code is changed to: >> >> //... >> >> //Product p already assigned >> final String pId = p.getId() //serializable >> >> add new Link( "addToCart") { >> public void onClick() { >> getSession().getCart().add( pId); >> //..etc >> >> (Also, building the Link with a wrapping Model object also works, >> obviously) >> >> However I am curious to know why a non-model object is serialized when >> inherited from the container even though within the same request? >> >> Thanks for any comment, >> >> JF >> > > - > 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/Serialization-on-objects-inherited-from-a-container-tp25389127p25394299.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
RefreshingView not Refreshing
I have a RefreshingView followed by (not in) a Form. On form submit, an object is added to the db list associated with the RefreshingView. I'm wondering why the small change (see comments) to my RV causes it to not refresh automatically. A browser refresh shows the changes. Thanks, -troy private class FooRV extends RefreshingView { public FooRV(String id, IModel listModel) { super(id, listModel); } @Override protected Iterator getItemModels() { return new ModelIteratorAdapter( // THIS LINE WORKS Hibby.getAllFoo().iterator() // THIS LINE DOESN'T -- My model is an LDM calling Hibby.getAllFoo() // ((List)getModelObject()).iterator() ) { private static final long serialVersionUID = 1L; @Override protected IModel model(Object o) { Foo r = (Foo)o; return new CompoundPropertyModel( new EntityModel(Foo.class, r.getId())); } }; } // ... } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Extract method suggestion in MultipartServletWebRequest class
Hi there: In MultipartServletWebRequest constructor we have: ... (line 93) DiskFileItemFactory factory = new DiskFileItemFactory(); ... which inhibits anyone from reusing MultipartServletWebRequest with a different factory. The only solution is generate a new class that is a copy of this one, with that line changed. Would it be possible to extract this code in a method like: /** Creates and returns a new file item factory. Subclasses can override this method to use a different factory * @returns a recently created FileItemFactory object */ protected FileItemFactory getNewFileItemFactory() { return new DiskFileItemFactory(); } This way, we could just extend this class when there's a need to use a different factory (as in GAE applications) Thanks in advance, Esteban - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
back button using HistoryAjaxBehavior
I want to disable back and forward button for which I followed HistoryAjaxBehavior example final AjaxLink linkTwo = new AjaxLink("linkTwo") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { info("Link two has been clicked"); target.addChildren(getPage(), FeedbackPanel.class); historyAjaxBehavior.registerAjaxEvent(target, this); } }; here one component is registered to historyAjaxBehavior , on click of back button, onAjaxHistoryEvent from HistoryAjaxBehavior gets called , but my case I donot have any link component , I have a page with a datatable and when user navigates away from this page and clicks back button to return to this page, in this case because I did not register any component, so the method onAjaxHistoryEvent will not be called so please tell me how to have historyAjaxBehavior to a page ?
Re: Wicket Stuff Core 1.4.1 Release[ing]
In the time it would take to generate the list, you could fix the problems. I wrote detailed instructions for adding projects to WS-core, so someone should be able to take those and fix the projects that are not meeting those standards. You want to do it? -- Jeremy Thomerson http://www.wickettraining.com On Thu, Sep 10, 2009 at 1:11 PM, nino martinez wael < nino.martinez.w...@gmail.com> wrote: > Hi Jeremy > > Should we have a list of offendending project? > > 2009/9/6 Jeremy Thomerson : > > First, jquery was built. They don't follow the naming conventions like > they > > should, so you have to look into the pom to realize that it's actually > > wicketstuff-jquery [1]. > > > > Second, regarding merged resources - there's a link on the wiki [2] that > > explains how. Please make sure to follow all conventions and run "mvn > clean > > install" as well as "mvn site:site" on all of wicketstuff-core when you > are > > done. If you can't build everything or you can't generate sites, please > > don't commit. I just comment out projects that can't easily be fixed and > > built when building releases. > > > > [1] > > > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-jquery/1.4.1/ > > [2] > > > http://wicketstuff.org/confluence/display/STUFFWIKI/WicketStuff+Core+-+Migration+Guide > > > > Best regards, > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > > > On Sun, Sep 6, 2009 at 11:22 AM, Jörn Zaefferer < > > joern.zaeffe...@googlemail.com> wrote: > > > >> So jquery-parent was build, which just references jquery and > >> jquery-examples - neither of which were build. Whats the point of > >> that? > >> > >> Also, how can we get wicketstuff-merged-resources included in the next > >> release? > >> > >> Jörn > >> > >> On Mon, Aug 31, 2009 at 10:20 PM, Jeremy > >> Thomerson wrote: > >> > I have the credentials and think that I will definitely be trying this > on > >> > the next release :) > >> > > >> > -- > >> > Jeremy Thomerson > >> > http://www.wickettraining.com > >> > > >> > > >> > > >> > On Mon, Aug 31, 2009 at 3:16 PM, Martijn Dashorst < > >> > martijn.dasho...@gmail.com> wrote: > >> > > >> >> Perhaps it's more beneficial to do the actual release local on the > >> >> machine? I'm sure Johan can provide you with the credentials to do > so. > >> >> > >> >> Martijn > >> >> > >> >> On Mon, Aug 31, 2009 at 9:27 PM, Jeremy > >> >> Thomerson wrote: > >> >> > It's mostly uploading and then merging the POMs on the remote > server. > >> >> The > >> >> > build isn't actually that bad (maybe 15 or 20 minutes for the > release > >> >> > procedure, including tagging, etc). > >> >> > > >> >> > -- > >> >> > Jeremy Thomerson > >> >> > http://www.wickettraining.com > >> >> > > >> >> > > >> >> > > >> >> > On Mon, Aug 31, 2009 at 2:14 PM, Nicolas Melendez < > >> >> nmelen...@getsense.com.ar > >> >> >> wrote: > >> >> > > >> >> >> very slow build :) > >> >> >> > >> >> >> On Mon, Aug 31, 2009 at 9:07 PM, Jeremy > >> >> >> Thomerson wrote: > >> >> >> > Wicket Stuff Core 1.4.1 is now released: > >> >> >> > > >> >> >> > [INFO] BUILD SUCCESSFUL > >> >> >> > [INFO] > >> >> >> > > >> >> > > >> >> >> > [INFO] Total time: 204 minutes 20 seconds > >> >> >> > [INFO] Finished at: Mon Aug 31 14:04:09 CDT 2009 > >> >> >> > [INFO] Final Memory: 218M/929M > >> >> >> > [INFO] > >> >> >> > > >> >> > > >> >> >> > > >> >> >> > > >> >> >> > -- > >> >> >> > Jeremy Thomerson > >> >> >> > http://www.wickettraining.com > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > On Mon, Aug 31, 2009 at 10:38 AM, Jeremy Thomerson < > >> >> >> > jer...@wickettraining.com> wrote: > >> >> >> > > >> >> >> >> That was only in the event that we really needed an interim > >> release. > >> >> >> The > >> >> >> >> plan still is that we will release to match Wicket releases. > >> >> >> >> > >> >> >> >> PS - I have to try to start the deploy over again: > >> >> >> >> > >> >> >> >> [INFO] Retrieving previous metadata from > wicketstuff-org-maven > >> >> >> >>[INFO] Uploading repository metadata for: 'artifact > >> >> >> >> org.wicketstuff:sitemap-xml' > >> >> >> >> [INFO] Uploading project information for sitemap-xml > 1.4.1 > >> >> >> >>Uploading: scpexe:// > >> >> >> >> > >> >> >> > >> >> > >> > wicketstuff.org/home/wicket/tomcat/webapps/maven/repository/org/wicketstuff/sitemap-xml/1.4.1/sitemap-xml-1.4.1-sources.jar > >> >> >> >> [INFO] > >> >> >> >> > >> >> > > >> >> >> >>[ERROR] BUILD ERROR > >> >> >> >> [INFO] > >> >> >> >> > >> >> > > >> >> >> >>[INFO] Error deploying artifact: Error executing command > >> for > >> >> >> >> transfer > >> >> >> >> > >> >> >> >>Exit code 255 -
Re: Serialization on objects inherited from a container
> add new Link( "addToCart") { >public void onClick() { >getSession().getCart().add( p.getId()); >//..etc > your anonymous class keeps a reference to p because inside you reference p via p.getId(). -igor On Thu, Sep 10, 2009 at 12:00 PM, J.-F. Rompre wrote: > Hello, > > I would like to know where I could find documentation on the issue of > serializing objects inherited from a component's container as in the example > below. I tried looking at the wicket source code to see when this occurs but > still don't understand when/how it is done. > > //... > > final Product p = //get non-serializable Product object > > add new Link( "addToCart") { > public void onClick() { > getSession().getCart().add( p.getId()); > //..etc > > The above throws a NotSerializableException. However, no problem occurs > after the code is changed to: > > //... > > //Product p already assigned > final String pId = p.getId() //serializable > > add new Link( "addToCart") { > public void onClick() { > getSession().getCart().add( pId); > //..etc > > (Also, building the Link with a wrapping Model object also works, obviously) > > However I am curious to know why a non-model object is serialized when > inherited from the container even though within the same request? > > Thanks for any comment, > > JF > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Variation algorithm
IStringResourceLoader is what you want most likely. -igor On Thu, Sep 10, 2009 at 11:37 AM, Chris Colman wrote: > Hi Igor, > > Is there any interface available that we can override to implement that > kind of behavior? > > Wicket's usually pretty good like that - there's usually some interface > available that allows us to put in our own home grown implementation of > something. > > I don't know if IResourceLocator is the one maybe it is. > > Regards, > Chris > >> -Original Message- >> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] >> Sent: Friday, 11 September 2009 12:56 AM >> To: users@wicket.apache.org >> Subject: Re: Variation algorithm >> >> wicket will not iterate over '_' delimiters that you supply in the >> return value of getVariation(). >> >> -igor >> >> On Thu, Sep 10, 2009 at 1:21 AM, Chris Colman >> wrote: >> > With using the getVariation() method is the 'fallback' process for > when >> > a particular variant isn't found like this: >> > >> > (a) Incremental removal of variant suffixes using '_' as the > delimeter: >> > >> > i.e. Wicket looks for files in the following order until one is > found: >> > >> > HeaderPanel_Var1_Var2_Var3.html >> > HeaderPanel_Var1_Var2.html >> > HeaderPanel_Var1.html >> > HeaderPanel.html >> > >> > OR this: >> > >> > (b) Total removal of entire variant suffix if no variant markup file > is >> > found: >> > >> > i.e. Wicket looks for files in the following order until one is > found: >> > >> > HeaderPanel_Var1_Var2_Var3.html >> > HeaderPanel.html >> > >> > >> > > - >> > 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 >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com >> Version: 8.5.409 / Virus Database: 270.13.89/2359 - Release Date: > 09/10/09 >> 05:50:00 > > - > 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 to embed one wicket app into another
This was my point, many times people 'assume' they are individual apps when they are not. I just wanted to highlight that this should be investigated before the assumption was made. For example, I just completed an intranet project where it was 'assumed' that there were 3 different systems. WebHelpDesk, FileMaker Pro and the Wicket based portal. Truly, 3 disparate systems and technology platforms. Everyone assumed this but it turns out that WHD can run on top of mysql and FMP can access mysql via ODBC and Wicket, well, its wicket. Result of challenging this assumption is that this client has a single-sign-on across all apps for their users with shared account, user and support ticket info. So I was just challenging the assumption. I think its healthy. John- On Thu, Sep 10, 2009 at 11:52 AM, Martin Makundi wrote: >> Databases have this cool feature called 'access control' ;) Its fairly >> trivial to set up the db to take connections from both apps and share >> the live data. > > Yes but if we assume that the applications are separate, i.e., they > cannot be merged. > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Serialization on objects inherited from a container
Hello, I would like to know where I could find documentation on the issue of serializing objects inherited from a component's container as in the example below. I tried looking at the wicket source code to see when this occurs but still don't understand when/how it is done. //... final Product p = //get non-serializable Product object add new Link( "addToCart") { public void onClick() { getSession().getCart().add( p.getId()); //..etc The above throws a NotSerializableException. However, no problem occurs after the code is changed to: //... //Product p already assigned final String pId = p.getId() //serializable add new Link( "addToCart") { public void onClick() { getSession().getCart().add( pId); //..etc (Also, building the Link with a wrapping Model object also works, obviously) However I am curious to know why a non-model object is serialized when inherited from the container even though within the same request? Thanks for any comment, JF
Re: how to embed one wicket app into another
> Databases have this cool feature called 'access control' ;) Its fairly > trivial to set up the db to take connections from both apps and share > the live data. Yes but if we assume that the applications are separate, i.e., they cannot be merged. If they can be merged it turns into developing a single application. Whole another ballpark, eh. > But every app and environment is different and this may not be > possible, I just proposed this as its a method that people miss > oftentimes. You are right. The right answer is to forget about the 'constraint' that you are running two applications. If you are coding application A and application B just make an application C that is modular. Especially if both are wicket. We have run into the iframe situation when the other application is for example JSF and there is no money to rewrite it completely. Furthermore, we have tweaked Wicket application views into CMS systems using iframe... .. but when you have all the code in wicket .. don't go there, just refactor and make a modular wicket app on a "single server" ;) ** Martin > > John- > > On Thu, Sep 10, 2009 at 11:37 AM, Martin Makundi > wrote: >> Well.. that doesn't help if the other app is on other server and other >> db and live data should be viewed from the other app.. in that sad >> case you do need iframe. >> >> ** >> Martin >> >> 2009/9/10 John Armstrong : >>> My vote would be to create a common jar package that contains the >>> relevant panels along with their associated business logic, DAO/ORM >>> etc. >>> >>> Then you can use that jar package in both of your apps seamlessly >>> assuming there are not more complex interactions going on. We use this >>> paradigm on our apps and it works very nicely. >>> >>> John- >>> >>> On Thu, Sep 10, 2009 at 12 >> >> - >> 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: how to embed one wicket app into another
Databases have this cool feature called 'access control' ;) Its fairly trivial to set up the db to take connections from both apps and share the live data. The only time this hurts is if you need to share non-wicket content (image galleries or pdfs that users upload or something) since NFS is not quite as easy to manage as mysql perms etc. But every app and environment is different and this may not be possible, I just proposed this as its a method that people miss oftentimes. John- On Thu, Sep 10, 2009 at 11:37 AM, Martin Makundi wrote: > Well.. that doesn't help if the other app is on other server and other > db and live data should be viewed from the other app.. in that sad > case you do need iframe. > > ** > Martin > > 2009/9/10 John Armstrong : >> My vote would be to create a common jar package that contains the >> relevant panels along with their associated business logic, DAO/ORM >> etc. >> >> Then you can use that jar package in both of your apps seamlessly >> assuming there are not more complex interactions going on. We use this >> paradigm on our apps and it works very nicely. >> >> John- >> >> On Thu, Sep 10, 2009 at 12 > > - > 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 to embed one wicket app into another
Well.. that doesn't help if the other app is on other server and other db and live data should be viewed from the other app.. in that sad case you do need iframe. ** Martin 2009/9/10 John Armstrong : > My vote would be to create a common jar package that contains the > relevant panels along with their associated business logic, DAO/ORM > etc. > > Then you can use that jar package in both of your apps seamlessly > assuming there are not more complex interactions going on. We use this > paradigm on our apps and it works very nicely. > > John- > > On Thu, Sep 10, 2009 at 12 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Variation algorithm
Hi Igor, Is there any interface available that we can override to implement that kind of behavior? Wicket's usually pretty good like that - there's usually some interface available that allows us to put in our own home grown implementation of something. I don't know if IResourceLocator is the one maybe it is. Regards, Chris > -Original Message- > From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > Sent: Friday, 11 September 2009 12:56 AM > To: users@wicket.apache.org > Subject: Re: Variation algorithm > > wicket will not iterate over '_' delimiters that you supply in the > return value of getVariation(). > > -igor > > On Thu, Sep 10, 2009 at 1:21 AM, Chris Colman > wrote: > > With using the getVariation() method is the 'fallback' process for when > > a particular variant isn't found like this: > > > > (a) Incremental removal of variant suffixes using '_' as the delimeter: > > > > i.e. Wicket looks for files in the following order until one is found: > > > > HeaderPanel_Var1_Var2_Var3.html > > HeaderPanel_Var1_Var2.html > > HeaderPanel_Var1.html > > HeaderPanel.html > > > > OR this: > > > > (b) Total removal of entire variant suffix if no variant markup file is > > found: > > > > i.e. Wicket looks for files in the following order until one is found: > > > > HeaderPanel_Var1_Var2_Var3.html > > HeaderPanel.html > > > > > > - > > 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 > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.409 / Virus Database: 270.13.89/2359 - Release Date: 09/10/09 > 05:50:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to embed one wicket app into another
My vote would be to create a common jar package that contains the relevant panels along with their associated business logic, DAO/ORM etc. Then you can use that jar package in both of your apps seamlessly assuming there are not more complex interactions going on. We use this paradigm on our apps and it works very nicely. John- On Thu, Sep 10, 2009 at 12:38 AM, Eyal Golan wrote: > I go with Martin, use iFrame. > This is what we do. > We have two Wicket apps, running on the same machine, the web.xml triggers > two different Wicket apps. Why you ask? an old and a VERY BAD decision. > In order to navigate from one app to the other we actually use URLs. In > order to show page from app B in the A app (the main), we show it in iframe > and calling URLs. > We had to implement a very bad security patch. > > One of my main assignments currently, is to merge the two applications back > to one. > > Eyal Golan > egola...@gmail.com > > Visit: http://jvdrums.sourceforge.net/ > LinkedIn: http://www.linkedin.com/in/egolan74 > > P Save a tree. Please don't print this e-mail unless it's really necessary > > > On Thu, Sep 10, 2009 at 7:33 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Use Iframe >> >> ** >> Martin >> >> 2009/9/10 Quan Zhou : >> > sorry, i forget to say this two apps are installed in different >> servers.each >> > is a single standalone app. >> > so i think i can't embed panelB into PageA. >> > >> > On Thu, Sep 10, 2009 at 11:58 AM, Jeremy Thomerson < >> > jer...@wickettraining.com> wrote: >> > >> >> If you have created good self-contained components, you should be able >> to >> >> just embed into >> >> >> >> -- >> >> Jeremy Thomerson >> >> http://www.wickettraining.com >> >> >> >> >> >> >> >> On Wed, Sep 9, 2009 at 10:54 PM, Quan Zhou >> wrote: >> >> >> >> > Hi.I've developed my simple forum with Wicket(we call it A), and I >> want >> >> to >> >> > embed it into another website (B) developed by Wicket. >> >> > like, the left panel and the navigator panel are both from B, and the >> >> right >> >> > panel is from A, >> >> > I dont want to use Frame because my page will be complicated. >> >> > >> >> > Does anyone have this kind of experience? >> >> > >> >> > Thanks in advance and I hope you understand my question. >> >> > >> >> >> > >> >> - >> 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: Wicket Stuff Core 1.4.1 Release[ing]
Hi Jeremy Should we have a list of offendending project? 2009/9/6 Jeremy Thomerson : > First, jquery was built. They don't follow the naming conventions like they > should, so you have to look into the pom to realize that it's actually > wicketstuff-jquery [1]. > > Second, regarding merged resources - there's a link on the wiki [2] that > explains how. Please make sure to follow all conventions and run "mvn clean > install" as well as "mvn site:site" on all of wicketstuff-core when you are > done. If you can't build everything or you can't generate sites, please > don't commit. I just comment out projects that can't easily be fixed and > built when building releases. > > [1] > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-jquery/1.4.1/ > [2] > http://wicketstuff.org/confluence/display/STUFFWIKI/WicketStuff+Core+-+Migration+Guide > > Best regards, > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Sun, Sep 6, 2009 at 11:22 AM, Jörn Zaefferer < > joern.zaeffe...@googlemail.com> wrote: > >> So jquery-parent was build, which just references jquery and >> jquery-examples - neither of which were build. Whats the point of >> that? >> >> Also, how can we get wicketstuff-merged-resources included in the next >> release? >> >> Jörn >> >> On Mon, Aug 31, 2009 at 10:20 PM, Jeremy >> Thomerson wrote: >> > I have the credentials and think that I will definitely be trying this on >> > the next release :) >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Mon, Aug 31, 2009 at 3:16 PM, Martijn Dashorst < >> > martijn.dasho...@gmail.com> wrote: >> > >> >> Perhaps it's more beneficial to do the actual release local on the >> >> machine? I'm sure Johan can provide you with the credentials to do so. >> >> >> >> Martijn >> >> >> >> On Mon, Aug 31, 2009 at 9:27 PM, Jeremy >> >> Thomerson wrote: >> >> > It's mostly uploading and then merging the POMs on the remote server. >> >> The >> >> > build isn't actually that bad (maybe 15 or 20 minutes for the release >> >> > procedure, including tagging, etc). >> >> > >> >> > -- >> >> > Jeremy Thomerson >> >> > http://www.wickettraining.com >> >> > >> >> > >> >> > >> >> > On Mon, Aug 31, 2009 at 2:14 PM, Nicolas Melendez < >> >> nmelen...@getsense.com.ar >> >> >> wrote: >> >> > >> >> >> very slow build :) >> >> >> >> >> >> On Mon, Aug 31, 2009 at 9:07 PM, Jeremy >> >> >> Thomerson wrote: >> >> >> > Wicket Stuff Core 1.4.1 is now released: >> >> >> > >> >> >> > [INFO] BUILD SUCCESSFUL >> >> >> > [INFO] >> >> >> > >> >> >> >> >> > [INFO] Total time: 204 minutes 20 seconds >> >> >> > [INFO] Finished at: Mon Aug 31 14:04:09 CDT 2009 >> >> >> > [INFO] Final Memory: 218M/929M >> >> >> > [INFO] >> >> >> > >> >> >> >> >> > >> >> >> > >> >> >> > -- >> >> >> > Jeremy Thomerson >> >> >> > http://www.wickettraining.com >> >> >> > >> >> >> > >> >> >> > >> >> >> > On Mon, Aug 31, 2009 at 10:38 AM, Jeremy Thomerson < >> >> >> > jer...@wickettraining.com> wrote: >> >> >> > >> >> >> >> That was only in the event that we really needed an interim >> release. >> >> >> The >> >> >> >> plan still is that we will release to match Wicket releases. >> >> >> >> >> >> >> >> PS - I have to try to start the deploy over again: >> >> >> >> >> >> >> >> [INFO] Retrieving previous metadata from wicketstuff-org-maven >> >> >> >> [INFO] Uploading repository metadata for: 'artifact >> >> >> >> org.wicketstuff:sitemap-xml' >> >> >> >> [INFO] Uploading project information for sitemap-xml 1.4.1 >> >> >> >> Uploading: scpexe:// >> >> >> >> >> >> >> >> >> >> wicketstuff.org/home/wicket/tomcat/webapps/maven/repository/org/wicketstuff/sitemap-xml/1.4.1/sitemap-xml-1.4.1-sources.jar >> >> >> >> [INFO] >> >> >> >> >> >> >> >> >> >> [ERROR] BUILD ERROR >> >> >> >> [INFO] >> >> >> >> >> >> >> >> >> >> [INFO] Error deploying artifact: Error executing command >> for >> >> >> >> transfer >> >> >> >> >> >> >> >> Exit code 255 - Write failed: Connection timed out >> >> >> >> >> >> >> >> [INFO] >> >> >> >> >> >> >> >> >> >> [INFO] For more information, run Maven with the -e switch >> >> >> >> [INFO] >> >> >> >> >> >> >> >> >> >> [INFO] Total time: 601 minutes 35 seconds >> >> >> >> [INFO] Finished at: Mon Aug 31 10:33:31 CDT 2009 >> >> >> >> [INFO] Final Memory: 221M/902M >> >> >> >> [INFO] >> >> >> >> >> >> >> >> >> >> [INFO] >> >> >> >>
Re: CheckBoxMultipleChoice Component
The component let all options enabled or disabled. I wondering 3 options: 1- you can implement an AbstractReadOnlyModel that returns only the avaliable options to your CheckboxMultipleChoice 2 - open an JIRA asking to CheckboxMultipleChoice use an isEnabled(choice, index, selected) method to resolve option enable. 3- make your own CheckboxMultipleChoice On Thu, Sep 10, 2009 at 2:37 PM, wrote: > Wondering if there is a way in Wicket to conditionally disable a > particular element from a list of choices in a CheckboxMultipleChoice > component? Anyone know if this is possible? >
Re: CheckBoxMultipleChoice Component
You'd probably have to roll your own copy of CheckboxMultipleChoice because its method onComponentTagBody is final. There it would be pretty easy to individually make a checkbox enabled/disabled: // Add checkbox element buffer.append(""); Just add your own operation together with isEnabled in the above code. Ofcourse you are left with handling the server-side enable/disable of your option. ** Martin 2009/9/10 : > Wondering if there is a way in Wicket to conditionally disable a particular > element from a list of choices in a CheckboxMultipleChoice component? Anyone > know if this is possible? > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
CheckBoxMultipleChoice Component
Wondering if there is a way in Wicket to conditionally disable a particular element from a list of choices in a CheckboxMultipleChoice component? Anyone know if this is possible?
Re: prevent browser from cahing my pages
I restarted firefox and then it works.Thanks mbrictson wrote: > > I am not sure, but you may want to double-check where the caching is > actually happening, and whether setHeaders() is working. > > For example, using Firebug or something simliar you should be able to > check if the browser cache is being used or if it is actually making an > HTTP roundtrip. You should also double-check that the cache-control header > is being sent as you expect. > > If the browser isn't caching (i.e. it is getting stale data from the > server), or if the expected cache-control header is not being sent, the > problem might be in your Wicket code or something in between. Some logging > statements or debugging could help narrow down that problem. > > > > fachhoch wrote: >> >> i tried this it did not work , does it have anything to do with >> urlencodingstrategy ? >> >> mbrictson wrote: >>> >>> This works for me: >>> >>> @Override >>> protected void setHeaders(WebResponse response) >>> { >>> response.setHeader("Pragma", "no-cache"); >>> response.setHeader( >>> "Cache-Control", >>> "no-cache, max-age=0, must-revalidate, no-store" >>> ); >>> } >>> >>> "no-store" is needed to prevent Firefox from caching the back-button. >>> >>> >>> >>> fachhoch wrote: I want to add nocache header to my pages , code from WebPage response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate"); // no-store and I also added response.setHeader("Cache-Control","no-cache"); response.setDateHeader ("Expires", -1); by overriding @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setHeader("Cache-Control","no-cache"); response.setDateHeader ("Expires", -1); } but the browser is still caching the pages , I hit the back button or forward button the page is not refreshed , please tell me how to prevent browser from chaching my pages. >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/prevent-browser-from-cahing-my-pages-tp25385725p25387730.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
Re: Password Field Question
Thanks. Worked great! Pedro Santos-6 wrote: > > PasswordTextField passwordField1 = new PasswordTextField("password"); > PasswordTextField passwordField2 = new > PasswordTextField("controlPassword"); > on these lines you are creating components with null model, and on wicket > models can be inherited from components higher in the hierarchy. I think > in > your case, these components have an parent component with an > IComponentInheritedModel, probably an CompoundPropertyModel. You can't > pass > an new Model() to these PasswordTextField and will not get this > exception... > > > > On Thu, Sep 10, 2009 at 1:21 PM, wrote: > >> I have the below snippet of code used to allow the user to change their >> password by typing their old password and then typing in their new >> password >> twice. Not sure why but I'm getting the following exception when the code >> is >> executed: >> >> WicketMessage: No get method defined for class: class >> org.cityofchicago.dor.ezdec.domain.security.EzdecUser expression: >> controlPassword >> >> Things were working fine until I moved the password stuff to the >> WebMarkupContainer. >> >> Any suggestions would be greatly appreciated. >> >> PasswordTextField oldPasswordField = new PasswordTextField("oldPassword", >> new Model()) { >> @Override >> public void validate() { >> if >> (!MD5Helper.toMD5(getInput()).equals(EzdecSession.getCurrentUser().getPassword())) >> { >> error(new IValidationError() { >> @Override >> public String getErrorMessage(IErrorMessageSource >> arg0) { >> return "Old password does not match password >> on >> file. Please ensure caps lock is not on and try again."; >> } >> }); >> } >> } >> }; >> //form.add(oldPasswordField); >> >> PasswordTextField passwordField1 = new >> PasswordTextField("password"); >> passwordField1.add(StringValidator.lengthBetween(6, 50)); >> //form.add(passwordField1); >> >> PasswordTextField passwordField2 = new >> PasswordTextField("controlPassword"); >> passwordField2.setModel(passwordField1.getModel()); >> passwordField2.setResetPassword(false); >> //form.add(passwordField2); >> >> form.add(new EqualPasswordInputValidator(passwordField1, >> passwordField2)); >> >> WebMarkupContainer passwordWmc = new >> WebMarkupContainer("passwordWmc") { >> >> @Override >> public boolean isVisible() { >> if ((!EzdecSession.getCurrentUser().equals(user)) && >> (EzdecSession.getCurrentUser().isAnyAdministratorUser())) { >> return false; >> } else { >> return true; >> } >> } >> >> }; >> >> passwordWmc.add(oldPasswordField); >> passwordWmc.add(passwordField1); >> passwordWmc.add(passwordField2); >> >> form.add(passwordWmc); >> > > -- View this message in context: http://www.nabble.com/Password-Field-Question-tp25386498p25387687.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
Re: prevent browser from cahing my pages
I am not sure, but you may want to double-check where the caching is actually happening, and whether setHeaders() is working. For example, using Firebug or something simliar you should be able to check if the browser cache is being used or if it is actually making an HTTP roundtrip. You should also double-check that the cache-control header is being sent as you expect. If the browser isn't caching (i.e. it is getting stale data from the server), or if the expected cache-control header is not being sent, the problem might be in your Wicket code or something in between. Some logging statements or debugging could help narrow down that problem. fachhoch wrote: > > i tried this it did not work , does it have anything to do with > urlencodingstrategy ? > > mbrictson wrote: >> >> This works for me: >> >> @Override >> protected void setHeaders(WebResponse response) >> { >> response.setHeader("Pragma", "no-cache"); >> response.setHeader( >> "Cache-Control", >> "no-cache, max-age=0, must-revalidate, no-store" >> ); >> } >> >> "no-store" is needed to prevent Firefox from caching the back-button. >> >> >> >> fachhoch wrote: >>> >>> I want to add nocache header to my pages , >>> >>> code from WebPage >>> >>> response.setHeader("Pragma", "no-cache"); >>> response.setHeader("Cache-Control", "no-cache, max-age=0, >>> must-revalidate"); // no-store >>> >>> >>> and I also added >>> >>> response.setHeader("Cache-Control","no-cache"); >>> response.setDateHeader ("Expires", -1); >>> by overriding >>>@Override >>> protected void setHeaders(WebResponse response) { >>> super.setHeaders(response); >>> response.setHeader("Cache-Control","no-cache"); >>> response.setDateHeader ("Expires", -1); >>> } >>> >>> >>> but the browser is still caching the pages , I hit the back button or >>> forward button the page is not refreshed , please tell me how to >>> prevent >>> browser from chaching my pages. >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/prevent-browser-from-cahing-my-pages-tp25385725p25387499.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
Re: prevent browser from cahing my pages
> but the browser is still caching the pages , I hit the back button or > forward button the page is not refreshed , please tell me how to prevent > browser from chaching my pages. This has got nothing to do with CACHE. It is Wicket's pagemap. If you hit BACK it loadas the OLD page from PAGEMAP / Page History. If you want to disable back button there are posts about that... ** Martin > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: prevent browser from cahing my pages
i tried this it did not work , does it have anything to do with urlencodingstrategy ? mbrictson wrote: > > This works for me: > > @Override > protected void setHeaders(WebResponse response) > { > response.setHeader("Pragma", "no-cache"); > response.setHeader( > "Cache-Control", > "no-cache, max-age=0, must-revalidate, no-store" > ); > } > > "no-store" is needed to prevent Firefox from caching the back-button. > > > > fachhoch wrote: >> >> I want to add nocache header to my pages , >> >> code from WebPage >> >> response.setHeader("Pragma", "no-cache"); >> response.setHeader("Cache-Control", "no-cache, max-age=0, >> must-revalidate"); // no-store >> >> >> and I also added >> >> response.setHeader("Cache-Control","no-cache"); >> response.setDateHeader ("Expires", -1); >> by overriding >>@Override >> protected void setHeaders(WebResponse response) { >> super.setHeaders(response); >> response.setHeader("Cache-Control","no-cache"); >> response.setDateHeader ("Expires", -1); >> } >> >> >> but the browser is still caching the pages , I hit the back button or >> forward button the page is not refreshed , please tell me how to >> prevent >> browser from chaching my pages. >> >> > > -- View this message in context: http://www.nabble.com/prevent-browser-from-cahing-my-pages-tp25385725p25387264.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
Re: prevent browser from cahing my pages
This works for me: @Override protected void setHeaders(WebResponse response) { response.setHeader("Pragma", "no-cache"); response.setHeader( "Cache-Control", "no-cache, max-age=0, must-revalidate, no-store" ); } "no-store" is needed to prevent Firefox from caching the back-button. fachhoch wrote: > > I want to add nocache header to my pages , > > code from WebPage > > response.setHeader("Pragma", "no-cache"); > response.setHeader("Cache-Control", "no-cache, max-age=0, > must-revalidate"); // no-store > > > and I also added > > response.setHeader("Cache-Control","no-cache"); > response.setDateHeader ("Expires", -1); > by overriding >@Override > protected void setHeaders(WebResponse response) { > super.setHeaders(response); > response.setHeader("Cache-Control","no-cache"); > response.setDateHeader ("Expires", -1); > } > > > but the browser is still caching the pages , I hit the back button or > forward button the page is not refreshed , please tell me how to prevent > browser from chaching my pages. > > -- View this message in context: http://www.nabble.com/prevent-browser-from-cahing-my-pages-tp25385725p25386585.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
Re: Password Field Question
PasswordTextField passwordField1 = new PasswordTextField("password"); PasswordTextField passwordField2 = new PasswordTextField("controlPassword"); on these lines you are creating components with null model, and on wicket models can be inherited from components higher in the hierarchy. I think in your case, these components have an parent component with an IComponentInheritedModel, probably an CompoundPropertyModel. You can't pass an new Model() to these PasswordTextField and will not get this exception... On Thu, Sep 10, 2009 at 1:21 PM, wrote: > I have the below snippet of code used to allow the user to change their > password by typing their old password and then typing in their new password > twice. Not sure why but I'm getting the following exception when the code is > executed: > > WicketMessage: No get method defined for class: class > org.cityofchicago.dor.ezdec.domain.security.EzdecUser expression: > controlPassword > > Things were working fine until I moved the password stuff to the > WebMarkupContainer. > > Any suggestions would be greatly appreciated. > > PasswordTextField oldPasswordField = new PasswordTextField("oldPassword", > new Model()) { > @Override > public void validate() { > if > (!MD5Helper.toMD5(getInput()).equals(EzdecSession.getCurrentUser().getPassword())) > { > error(new IValidationError() { > @Override > public String getErrorMessage(IErrorMessageSource > arg0) { > return "Old password does not match password on > file. Please ensure caps lock is not on and try again."; > } > }); > } > } > }; > //form.add(oldPasswordField); > > PasswordTextField passwordField1 = new > PasswordTextField("password"); > passwordField1.add(StringValidator.lengthBetween(6, 50)); > //form.add(passwordField1); > > PasswordTextField passwordField2 = new > PasswordTextField("controlPassword"); > passwordField2.setModel(passwordField1.getModel()); > passwordField2.setResetPassword(false); > //form.add(passwordField2); > > form.add(new EqualPasswordInputValidator(passwordField1, > passwordField2)); > > WebMarkupContainer passwordWmc = new > WebMarkupContainer("passwordWmc") { > > @Override > public boolean isVisible() { > if ((!EzdecSession.getCurrentUser().equals(user)) && > (EzdecSession.getCurrentUser().isAnyAdministratorUser())) { > return false; > } else { > return true; > } > } > > }; > > passwordWmc.add(oldPasswordField); > passwordWmc.add(passwordField1); > passwordWmc.add(passwordField2); > > form.add(passwordWmc); >
Password Field Question
I have the below snippet of code used to allow the user to change their password by typing their old password and then typing in their new password twice. Not sure why but I'm getting the following exception when the code is executed:WicketMessage: No get method defined for class: class org.cityofchicago.dor.ezdec.domain.security.EzdecUser _expression_: controlPasswordThings were working fine until I moved the password stuff to the WebMarkupContainer.Any suggestions would be greatly appreciated.PasswordTextField oldPasswordField = new PasswordTextField("oldPassword", new Model()) { @Override public void validate() { if (!MD5Helper.toMD5(getInput()).equals(EzdecSession.getCurrentUser().getPassword())) { error(new IValidationError() { @Override public String getErrorMessage(IErrorMessageSource arg0) { return "Old password does not match password on file. Please ensure caps lock is not on and try again."; } }); } } };// form.add(oldPasswordField); PasswordTextField passwordField1 = new PasswordTextField("password"); passwordField1.add(StringValidator.lengthBetween(6, 50));// form.add(passwordField1); PasswordTextField passwordField2 = new PasswordTextField("controlPassword"); passwordField2.setModel(passwordField1.getModel()); passwordField2.setResetPassword(false);// form.add(passwordField2); form.add(new EqualPasswordInputValidator(passwordField1, passwordField2)); WebMarkupContainer passwordWmc = new WebMarkupContainer("passwordWmc") { @Override public boolean isVisible() { if ((!EzdecSession.getCurrentUser().equals(user)) && (EzdecSession.getCurrentUser().isAnyAdministratorUser())) { return false; } else { return true; } } }; passwordWmc.add(oldPasswordField); passwordWmc.add(passwordField1); passwordWmc.add(passwordField2); form.add(passwordWmc);
Re: DropDownChoice with Java Enum
The value on model are on ProcessingStatusType instance. Use ((ProcessingStatusType)model.getObject()).getValue() to access the value REJEC On Thu, Sep 10, 2009 at 12:39 PM, cmoulliard wrote: > > Thks for all. > > With the following syntax : > >add(new DropDownChoice("requestStatus", > Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > > public Object getDisplayValue(Object status) { >return ((ProcessingStatusType) > status).getDescription(); >} > >public String getIdValue(Object status, int index) { >return ((ProcessingStatusType) > status).getValue(); >}})); > > html generated : > > > Choose One > New > Accepted > > Validated > Transformed > Transferred > Rejected > Failed > > > Everything is ok except that the value receives by my RequestFormModel > after > the post is equal to the description (e.g : REJECTED instead of REJEC) and > not the value > > > > > > > Here is what I have in html : > > > > Matthias Keller wrote: > > > > Hi > > > > Close but not quite. getDisplayValue gets the catual ELEMENT of the list > > - so objDispl is of type ProcessingStatusType already. > > So in your case it would be something like: > > > >> public Object getDisplayValue(Object objDispl) { > >> return ((ProcessingStatusType) objDispl).getDescription(); > >> } > >> > >> public String getIdValue(Object obj, int index) { > >> return obj.toString(); > >> // or if you prefer to have the value of your enum in the HTML > code: > >> // return ((ProcessingStatusType) objDispl).getValue() > >> } > > Which one of the getIdValue implementations you chose doesn't matter for > > wicket, it just needs an ID for every entry which is unique. > > In your case you could even return String.valueOf(index) as your > > backing List of the Enums will not ever change while deployed. > > > > Be careful though with using index, there are circumstances where no > > useful index will be provided (always -1) - That happens when you > > externally change the selected value of the DropDownChoice. > > > > you could also just use or extend ChoiceRenderer which might already do > > what you want... > > For example > > new ChoiceRenderer("description", "value") > > > > Matt > > > > cmoulliard wrote: > >> You mean create something like this : > >> > >> add(new DropDownChoice("requestStatus", > >> Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > >> > >> public Object getDisplayValue(Object objDispl) { > >> return > ProcessingStatusType.valueOf((String) > >> objDispl).getDescription(); > >> } > >> > >> public String getIdValue(Object obj, int index) { > >> return obj.toString(); > >> }})); > >> > >> I have an error during initialisation : > >> > >> WicketMessage: Exception in rendering component: [MarkupContainer > >> [Component > >> id = requestStatus]] > >> > >> Root cause: > >> > >> java.lang.ClassCastException: > >> com.xpectis.x3s.model.usertype.ProcessingStatusType > >> at > >> > com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) > >> > >> I suppose that what I defined in getDisplayValue is not correct ? > >> > >> Matthias Keller wrote: > >> > >>> Hi Charles > >>> > >>> No problem. Just make an IChoiceRenderer which calls getDescription for > >>> the display value and getValue for the id. > >>> > >>> Matt > >>> > >>> Charles Moulliard wrote: > >>> > Hi, > > I would like to know if I can create a DropDownChoice where the value > to > be > displayed in the drop down list corresponds to the description of my > enumeration (e.g. Accepted) while the value to be returned is the > value > defined in the enumeration (e.g: ACCPT) ? > > public enum ProcessingStatusType { > NEW ("NEW", "New"), > ACCEPTED ("ACCPT", "Accepted"), > VALIDATED ("VALID", "Validated"), > TRANSFORMED("TRFRM", "Transformed"), > TRANSFERRED("TRFRD", "Transferred"), > REJECTED("REJEC", "Rejected"), > FAILED("FAIL", "Failed"); > > private final String value; > private final String description; > > ProcessingStatusType( String value, String description ) { > this.value = value; > this.description = description; > } > > > > > > > > > > > > - > Charles Moulliard > SOA Architect > > My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ > -- > View this message in context: > http://www.nabble.com/DropDownChoice-with-Java-Enum-tp25382303p25385339.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --
Re: DropDownChoice with Java Enum
Thks for all. With the following syntax : add(new DropDownChoice("requestStatus", Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { public Object getDisplayValue(Object status) { return ((ProcessingStatusType) status).getDescription(); } public String getIdValue(Object status, int index) { return ((ProcessingStatusType) status).getValue(); }})); html generated : Choose One New Accepted Validated Transformed Transferred Rejected Failed Everything is ok except that the value receives by my RequestFormModel after the post is equal to the description (e.g : REJECTED instead of REJEC) and not the value Here is what I have in html : Matthias Keller wrote: > > Hi > > Close but not quite. getDisplayValue gets the catual ELEMENT of the list > - so objDispl is of type ProcessingStatusType already. > So in your case it would be something like: > >> public Object getDisplayValue(Object objDispl) { >> return ((ProcessingStatusType) objDispl).getDescription(); >> } >> >> public String getIdValue(Object obj, int index) { >> return obj.toString(); >> // or if you prefer to have the value of your enum in the HTML code: >> // return ((ProcessingStatusType) objDispl).getValue() >> } > Which one of the getIdValue implementations you chose doesn't matter for > wicket, it just needs an ID for every entry which is unique. > In your case you could even return String.valueOf(index) as your > backing List of the Enums will not ever change while deployed. > > Be careful though with using index, there are circumstances where no > useful index will be provided (always -1) - That happens when you > externally change the selected value of the DropDownChoice. > > you could also just use or extend ChoiceRenderer which might already do > what you want... > For example > new ChoiceRenderer("description", "value") > > Matt > > cmoulliard wrote: >> You mean create something like this : >> >> add(new DropDownChoice("requestStatus", >> Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { >> >> public Object getDisplayValue(Object objDispl) { >> return ProcessingStatusType.valueOf((String) >> objDispl).getDescription(); >> } >> >> public String getIdValue(Object obj, int index) { >> return obj.toString(); >> }})); >> >> I have an error during initialisation : >> >> WicketMessage: Exception in rendering component: [MarkupContainer >> [Component >> id = requestStatus]] >> >> Root cause: >> >> java.lang.ClassCastException: >> com.xpectis.x3s.model.usertype.ProcessingStatusType >> at >> com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) >> >> I suppose that what I defined in getDisplayValue is not correct ? >> >> Matthias Keller wrote: >> >>> Hi Charles >>> >>> No problem. Just make an IChoiceRenderer which calls getDescription for >>> the display value and getValue for the id. >>> >>> Matt >>> >>> Charles Moulliard wrote: >>> Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType { NEW ("NEW", "New"), ACCEPTED ("ACCPT", "Accepted"), VALIDATED ("VALID", "Validated"), TRANSFORMED("TRFRM", "Transformed"), TRANSFERRED("TRFRD", "Transferred"), REJECTED("REJEC", "Rejected"), FAILED("FAIL", "Failed"); private final String value; private final String description; ProcessingStatusType( String value, String description ) { this.value = value; this.description = description; } > > > - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- View this message in context: http://www.nabble.com/DropDownChoice-with-Java-Enum-tp25382303p25385339.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
prevent browser from cahing my pages
I want to add nocache header to my pages , code from WebPage response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate"); // no-store and I also added response.setHeader("Cache-Control","no-cache"); response.setDateHeader ("Expires", -1); by overriding @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setHeader("Cache-Control","no-cache"); response.setDateHeader ("Expires", -1); } but the browser is still caching the pages , I hit the back button or forward button the page is not refreshed , please tell me how to prevent browser from chaching my pages.
Re: Variation algorithm
wicket will not iterate over '_' delimiters that you supply in the return value of getVariation(). -igor On Thu, Sep 10, 2009 at 1:21 AM, Chris Colman wrote: > With using the getVariation() method is the 'fallback' process for when > a particular variant isn't found like this: > > (a) Incremental removal of variant suffixes using '_' as the delimeter: > > i.e. Wicket looks for files in the following order until one is found: > > HeaderPanel_Var1_Var2_Var3.html > HeaderPanel_Var1_Var2.html > HeaderPanel_Var1.html > HeaderPanel.html > > OR this: > > (b) Total removal of entire variant suffix if no variant markup file is > found: > > i.e. Wicket looks for files in the following order until one is found: > > HeaderPanel_Var1_Var2_Var3.html > HeaderPanel.html > > > - > 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 to redirect from a ModalWindow
Hi Peter You would be right as long as it wasn't for a ModalWindow. When having an open ModalWindow, wicket seems to register an unload javascript event which - when trying to navigate away from the page (be it by following a link, closing the window etc), displays a confirmation message which you have to accept. I need to avoid that message, but the only way to do that probably is by closing that window first so that the javascript event gets unloaded. Matt Peter Ertl wrote: throw new RestartResponseException(OtherPage.class) window.close() is not needed! Am 10.09.2009 um 12:50 schrieb Matthias Keller: OtherPage.class - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME Cryptographic Signature
Re: How to use AjaxPagingNavigationIncrementLink without Navigator...
Ok, I will choose option 2 because then it is consistent with the non Ajax variant PagingNavigationIncrementLink. Thanks for your help, best regards, Andrej - Original Message - From: "Pedro Santos" To: users@wicket.apache.org Sent: Donnerstag, 10. September 2009 14.58 Uhr (GMT+0100) Europe/Berlin Subject: Re: How to use AjaxPagingNavigationIncrementLink without Navigator... Yes, I take a second read and got the same impression than you. You can extends AjaxPagingNavigationIncrementLink and open a JIRA 1 - to change the doc: "pageable and itself or the navigator the link is part" to "pageable, itself and the navigator the link is part" since the AjaxPagingNavigationBehavior do the test: if (navigator == null) { throw new WicketRuntimeException( "Unable to find AjaxPagingNavigator component in hierarchy starting from " + owner); } 2 - or change the behavior... On Thu, Sep 10, 2009 at 9:26 AM, Andrej Thiele wrote: > Perhaps you have missunderstand me. > > I want to present only a PageableListview with '<' and '>' under it. If I > use Ajax free variant PagingNavigationIncrementLink this is no problem but > using the Ajax there is an Exception that the navigator is missing. > > The javadoc says: ...it will update the pageable and itself or the > navigator component which it is part of. > > But it cannot be used without that component. I have understood the text > that the navigator should be optional and is not a must have. > > Best regards, > Andrej > > > - Original Message - > From: "Pedro Santos" > To: users@wicket.apache.org > Sent: Donnerstag, 10. September 2009 14.02 Uhr (GMT+0100) Europe/Berlin > Subject: Re: How to use AjaxPagingNavigationIncrementLink without > Navigator... > > Hi, > > I din't find were javadoc says that AjaxPagingNavigationIncrementLink can > to > be used as standalone component > > *AjaxPagingNavigationIncrementLink *javadoc: > > An incremental Ajaxian link to a page of a PageableListView. Assuming your > list view navigation looks like > > [first / << / <] 1 | 2 | 3 [> / >> /last] > > and "<" meaning the previous and "<<" goto the "current page - 5", than it > is this kind of incremental page links which can easily be created. This > link will update the pageable and itself or the navigator the link is part > of using Ajax techniques, or perform a full refresh when ajax is not > available. > > > nor were the navigator is just optional to AjaxPagingNavigationBehavior > *AjaxPagingNavigationBehavior * only contructor javadoc: > > Attaches the navigation behavior to the owner link and drives the pageable > component. The behavior is attached to the markup event. > Parameters: *owner* the owner ajax link *pageable* the pageable to update * > event* the javascript event to bind to (e.g. onclick) > > On Thu, Sep 10, 2009 at 5:11 AM, Andrej Thiele >wrote: > > > Hi, > > I tried to use the AjaxPagingNavigationIncrementLink as standalone > > component. As javadoc describes this should be possible like using the > > PagingNavigationIncrementLink. But if I click on this link an exception > is > > the result. > > > > After diving into the code I have seen that the > > AjaxPagingNavigationBehavior searches for a AjaxPagingNavigator component > > which is not present in my code. The javadoc to this behavior says that > the > > navigator is just optional. > > > > Is this a problem in the wicket code or is there another possibility to > use > > an incremental link together with ajax? > > > > Best regards, > > > > Andrej > > > > > > > > - > > 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: How to redirect from a ModalWindow
throw new RestartResponseException(OtherPage.class) window.close() is not needed! Am 10.09.2009 um 12:50 schrieb Matthias Keller: OtherPage.class - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with Java Enum
You cast objDispl to String which is obviously(?) a ProcessingStatusType cmoulliard wrote: > You mean create something like this : > > add(new DropDownChoice("requestStatus", > Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > > public Object getDisplayValue(Object objDispl) { > return ProcessingStatusType.valueOf((String) > objDispl).getDescription(); > } > > public String getIdValue(Object obj, int index) { > return obj.toString(); > }})); > > I have an error during initialisation : > > WicketMessage: Exception in rendering component: [MarkupContainer [Component > id = requestStatus]] > > Root cause: > > java.lang.ClassCastException: > com.xpectis.x3s.model.usertype.ProcessingStatusType > at > com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) > > I suppose that what I defined in getDisplayValue is not correct ? > > Matthias Keller wrote: >> Hi Charles >> >> No problem. Just make an IChoiceRenderer which calls getDescription for >> the display value and getValue for the id. >> >> Matt >> >> Charles Moulliard wrote: >>> Hi, >>> >>> I would like to know if I can create a DropDownChoice where the value to >>> be >>> displayed in the drop down list corresponds to the description of my >>> enumeration (e.g. Accepted) while the value to be returned is the value >>> defined in the enumeration (e.g: ACCPT) ? >>> >>> public enum ProcessingStatusType { >>> NEW ("NEW", "New"), >>> ACCEPTED ("ACCPT", "Accepted"), >>> VALIDATED ("VALID", "Validated"), >>> TRANSFORMED("TRFRM", "Transformed"), >>> TRANSFERRED("TRFRD", "Transferred"), >>> REJECTED("REJEC", "Rejected"), >>> FAILED("FAIL", "Failed"); >>> >>> private final String value; >>> private final String description; >>> >>> ProcessingStatusType( String value, String description ) { >>> this.value = value; >>> this.description = description; >>> } >>> >>> >> >> >> > > > - > Charles Moulliard > SOA Architect > > My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with Java Enum
Hi Close but not quite. getDisplayValue gets the catual ELEMENT of the list - so objDispl is of type ProcessingStatusType already. So in your case it would be something like: public Object getDisplayValue(Object objDispl) { return ((ProcessingStatusType) objDispl).getDescription(); } public String getIdValue(Object obj, int index) { return obj.toString(); // or if you prefer to have the value of your enum in the HTML code: // return ((ProcessingStatusType) objDispl).getValue() } Which one of the getIdValue implementations you chose doesn't matter for wicket, it just needs an ID for every entry which is unique. In your case you could even return String.valueOf(index) as your backing List of the Enums will not ever change while deployed. Be careful though with using index, there are circumstances where no useful index will be provided (always -1) - That happens when you externally change the selected value of the DropDownChoice. you could also just use or extend ChoiceRenderer which might already do what you want... For example new ChoiceRenderer("description", "value") Matt cmoulliard wrote: You mean create something like this : add(new DropDownChoice("requestStatus", Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { public Object getDisplayValue(Object objDispl) { return ProcessingStatusType.valueOf((String) objDispl).getDescription(); } public String getIdValue(Object obj, int index) { return obj.toString(); }})); I have an error during initialisation : WicketMessage: Exception in rendering component: [MarkupContainer [Component id = requestStatus]] Root cause: java.lang.ClassCastException: com.xpectis.x3s.model.usertype.ProcessingStatusType at com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) I suppose that what I defined in getDisplayValue is not correct ? Matthias Keller wrote: Hi Charles No problem. Just make an IChoiceRenderer which calls getDescription for the display value and getValue for the id. Matt Charles Moulliard wrote: Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType { NEW ("NEW", "New"), ACCEPTED ("ACCPT", "Accepted"), VALIDATED ("VALID", "Validated"), TRANSFORMED("TRFRM", "Transformed"), TRANSFERRED("TRFRD", "Transferred"), REJECTED("REJEC", "Rejected"), FAILED("FAIL", "Failed"); private final String value; private final String description; ProcessingStatusType( String value, String description ) { this.value = value; this.description = description; } smime.p7s Description: S/MIME Cryptographic Signature
Re: DropDownChoice with Java Enum
@Override public String getDisplayValue(Object status) { return ((ProcessingStatusType) status).getDescription(); } On Thu, Sep 10, 2009 at 9:46 AM, cmoulliard wrote: > > You mean create something like this : > > add(new DropDownChoice("requestStatus", > Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > >public Object getDisplayValue(Object objDispl) { >return ProcessingStatusType.valueOf((String) > objDispl).getDescription(); >} > >public String getIdValue(Object obj, int index) { >return obj.toString(); >}})); > > I have an error during initialisation : > > WicketMessage: Exception in rendering component: [MarkupContainer > [Component > id = requestStatus]] > > Root cause: > > java.lang.ClassCastException: > com.xpectis.x3s.model.usertype.ProcessingStatusType > at > > com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) > > I suppose that what I defined in getDisplayValue is not correct ? > > Matthias Keller wrote: > > > > Hi Charles > > > > No problem. Just make an IChoiceRenderer which calls getDescription for > > the display value and getValue for the id. > > > > Matt > > > > Charles Moulliard wrote: > >> Hi, > >> > >> I would like to know if I can create a DropDownChoice where the value to > >> be > >> displayed in the drop down list corresponds to the description of my > >> enumeration (e.g. Accepted) while the value to be returned is the value > >> defined in the enumeration (e.g: ACCPT) ? > >> > >> public enum ProcessingStatusType { > >> NEW ("NEW", "New"), > >> ACCEPTED ("ACCPT", "Accepted"), > >> VALIDATED ("VALID", "Validated"), > >> TRANSFORMED("TRFRM", "Transformed"), > >> TRANSFERRED("TRFRD", "Transferred"), > >> REJECTED("REJEC", "Rejected"), > >> FAILED("FAIL", "Failed"); > >> > >> private final String value; > >> private final String description; > >> > >> ProcessingStatusType( String value, String description ) { > >> this.value = value; > >> this.description = description; > >> } > >> > >> > > > > > > > > > > > - > Charles Moulliard > SOA Architect > > My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ > -- > View this message in context: > http://www.nabble.com/DropDownChoice-with-Java-Enum-tp25382303p25382688.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 > >
Re: How to use AjaxPagingNavigationIncrementLink without Navigator...
Yes, I take a second read and got the same impression than you. You can extends AjaxPagingNavigationIncrementLink and open a JIRA 1 - to change the doc: "pageable and itself or the navigator the link is part" to "pageable, itself and the navigator the link is part" since the AjaxPagingNavigationBehavior do the test: if (navigator == null) { throw new WicketRuntimeException( "Unable to find AjaxPagingNavigator component in hierarchy starting from " + owner); } 2 - or change the behavior... On Thu, Sep 10, 2009 at 9:26 AM, Andrej Thiele wrote: > Perhaps you have missunderstand me. > > I want to present only a PageableListview with '<' and '>' under it. If I > use Ajax free variant PagingNavigationIncrementLink this is no problem but > using the Ajax there is an Exception that the navigator is missing. > > The javadoc says: ...it will update the pageable and itself or the > navigator component which it is part of. > > But it cannot be used without that component. I have understood the text > that the navigator should be optional and is not a must have. > > Best regards, > Andrej > > > - Original Message - > From: "Pedro Santos" > To: users@wicket.apache.org > Sent: Donnerstag, 10. September 2009 14.02 Uhr (GMT+0100) Europe/Berlin > Subject: Re: How to use AjaxPagingNavigationIncrementLink without > Navigator... > > Hi, > > I din't find were javadoc says that AjaxPagingNavigationIncrementLink can > to > be used as standalone component > > *AjaxPagingNavigationIncrementLink *javadoc: > > An incremental Ajaxian link to a page of a PageableListView. Assuming your > list view navigation looks like > > [first / << / <] 1 | 2 | 3 [> / >> /last] > > and "<" meaning the previous and "<<" goto the "current page - 5", than it > is this kind of incremental page links which can easily be created. This > link will update the pageable and itself or the navigator the link is part > of using Ajax techniques, or perform a full refresh when ajax is not > available. > > > nor were the navigator is just optional to AjaxPagingNavigationBehavior > *AjaxPagingNavigationBehavior * only contructor javadoc: > > Attaches the navigation behavior to the owner link and drives the pageable > component. The behavior is attached to the markup event. > Parameters: *owner* the owner ajax link *pageable* the pageable to update * > event* the javascript event to bind to (e.g. onclick) > > On Thu, Sep 10, 2009 at 5:11 AM, Andrej Thiele >wrote: > > > Hi, > > I tried to use the AjaxPagingNavigationIncrementLink as standalone > > component. As javadoc describes this should be possible like using the > > PagingNavigationIncrementLink. But if I click on this link an exception > is > > the result. > > > > After diving into the code I have seen that the > > AjaxPagingNavigationBehavior searches for a AjaxPagingNavigator component > > which is not present in my code. The javadoc to this behavior says that > the > > navigator is just optional. > > > > Is this a problem in the wicket code or is there another possibility to > use > > an incremental link together with ajax? > > > > Best regards, > > > > Andrej > > > > > > > > - > > 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: DropDownChoice with Java Enum
Please use debugger to find out.. 2009/9/10 cmoulliard : > > You mean create something like this : > > add(new DropDownChoice("requestStatus", > Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > > public Object getDisplayValue(Object objDispl) { > return ProcessingStatusType.valueOf((String) > objDispl).getDescription(); > } > > public String getIdValue(Object obj, int index) { > return obj.toString(); > }})); > > I have an error during initialisation : > > WicketMessage: Exception in rendering component: [MarkupContainer [Component > id = requestStatus]] > > Root cause: > > java.lang.ClassCastException: > com.xpectis.x3s.model.usertype.ProcessingStatusType > at > com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) > > I suppose that what I defined in getDisplayValue is not correct ? > > Matthias Keller wrote: >> >> Hi Charles >> >> No problem. Just make an IChoiceRenderer which calls getDescription for >> the display value and getValue for the id. >> >> Matt >> >> Charles Moulliard wrote: >>> Hi, >>> >>> I would like to know if I can create a DropDownChoice where the value to >>> be >>> displayed in the drop down list corresponds to the description of my >>> enumeration (e.g. Accepted) while the value to be returned is the value >>> defined in the enumeration (e.g: ACCPT) ? >>> >>> public enum ProcessingStatusType { >>> NEW ("NEW", "New"), >>> ACCEPTED ("ACCPT", "Accepted"), >>> VALIDATED ("VALID", "Validated"), >>> TRANSFORMED("TRFRM", "Transformed"), >>> TRANSFERRED("TRFRD", "Transferred"), >>> REJECTED("REJEC", "Rejected"), >>> FAILED("FAIL", "Failed"); >>> >>> private final String value; >>> private final String description; >>> >>> ProcessingStatusType( String value, String description ) { >>> this.value = value; >>> this.description = description; >>> } >>> >>> >> >> >> >> > > > - > Charles Moulliard > SOA Architect > > My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ > -- > View this message in context: > http://www.nabble.com/DropDownChoice-with-Java-Enum-tp25382303p25382688.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: DropDownChoice with Java Enum
You mean create something like this : add(new DropDownChoice("requestStatus", Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { public Object getDisplayValue(Object objDispl) { return ProcessingStatusType.valueOf((String) objDispl).getDescription(); } public String getIdValue(Object obj, int index) { return obj.toString(); }})); I have an error during initialisation : WicketMessage: Exception in rendering component: [MarkupContainer [Component id = requestStatus]] Root cause: java.lang.ClassCastException: com.xpectis.x3s.model.usertype.ProcessingStatusType at com.xpectis.x3s.fundbox.web.form.RequestForm$1.getDisplayValue(RequestForm.java:38) I suppose that what I defined in getDisplayValue is not correct ? Matthias Keller wrote: > > Hi Charles > > No problem. Just make an IChoiceRenderer which calls getDescription for > the display value and getValue for the id. > > Matt > > Charles Moulliard wrote: >> Hi, >> >> I would like to know if I can create a DropDownChoice where the value to >> be >> displayed in the drop down list corresponds to the description of my >> enumeration (e.g. Accepted) while the value to be returned is the value >> defined in the enumeration (e.g: ACCPT) ? >> >> public enum ProcessingStatusType { >> NEW ("NEW", "New"), >> ACCEPTED ("ACCPT", "Accepted"), >> VALIDATED ("VALID", "Validated"), >> TRANSFORMED("TRFRM", "Transformed"), >> TRANSFERRED("TRFRD", "Transferred"), >> REJECTED("REJEC", "Rejected"), >> FAILED("FAIL", "Failed"); >> >> private final String value; >> private final String description; >> >> ProcessingStatusType( String value, String description ) { >> this.value = value; >> this.description = description; >> } >> >> > > > > - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- View this message in context: http://www.nabble.com/DropDownChoice-with-Java-Enum-tp25382303p25382688.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
Re: How to use AjaxPagingNavigationIncrementLink without Navigator...
Perhaps you have missunderstand me. I want to present only a PageableListview with '<' and '>' under it. If I use Ajax free variant PagingNavigationIncrementLink this is no problem but using the Ajax there is an Exception that the navigator is missing. The javadoc says: ...it will update the pageable and itself or the navigator component which it is part of. But it cannot be used without that component. I have understood the text that the navigator should be optional and is not a must have. Best regards, Andrej - Original Message - From: "Pedro Santos" To: users@wicket.apache.org Sent: Donnerstag, 10. September 2009 14.02 Uhr (GMT+0100) Europe/Berlin Subject: Re: How to use AjaxPagingNavigationIncrementLink without Navigator... Hi, I din't find were javadoc says that AjaxPagingNavigationIncrementLink can to be used as standalone component *AjaxPagingNavigationIncrementLink *javadoc: An incremental Ajaxian link to a page of a PageableListView. Assuming your list view navigation looks like [first / << / <] 1 | 2 | 3 [> / >> /last] and "<" meaning the previous and "<<" goto the "current page - 5", than it is this kind of incremental page links which can easily be created. This link will update the pageable and itself or the navigator the link is part of using Ajax techniques, or perform a full refresh when ajax is not available. nor were the navigator is just optional to AjaxPagingNavigationBehavior *AjaxPagingNavigationBehavior * only contructor javadoc: Attaches the navigation behavior to the owner link and drives the pageable component. The behavior is attached to the markup event. Parameters: *owner* the owner ajax link *pageable* the pageable to update * event* the javascript event to bind to (e.g. onclick) On Thu, Sep 10, 2009 at 5:11 AM, Andrej Thiele wrote: > Hi, > I tried to use the AjaxPagingNavigationIncrementLink as standalone > component. As javadoc describes this should be possible like using the > PagingNavigationIncrementLink. But if I click on this link an exception is > the result. > > After diving into the code I have seen that the > AjaxPagingNavigationBehavior searches for a AjaxPagingNavigator component > which is not present in my code. The javadoc to this behavior says that the > navigator is just optional. > > Is this a problem in the wicket code or is there another possibility to use > an incremental link together with ajax? > > Best regards, > > Andrej > > > > - > 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: DropDownChoice with Java Enum
Hi Charles No problem. Just make an IChoiceRenderer which calls getDescription for the display value and getValue for the id. Matt Charles Moulliard wrote: Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType { NEW ("NEW", "New"), ACCEPTED ("ACCPT", "Accepted"), VALIDATED ("VALID", "Validated"), TRANSFORMED("TRFRM", "Transformed"), TRANSFERRED("TRFRD", "Transferred"), REJECTED("REJEC", "Rejected"), FAILED("FAIL", "Failed"); private final String value; private final String description; ProcessingStatusType( String value, String description ) { this.value = value; this.description = description; } smime.p7s Description: S/MIME Cryptographic Signature
Re: How to hide html sections
Or with attribute: add(new Button("red_or_green")add(new AttributeModifier("class", new AbstractReadOnlyModel() { getObject() { return condition ? "red" : "green"; }}); ** Martin 2009/9/10 Pedro Santos : > With OO you can teach you objects to behave, rater the set then every time: > String property; > add(new Button("red"){ > @Override > public boolean isVisible() { > return property == red condition > } > }); > add(new Button("green"){ > @Override > public boolean isVisible() { > return property == green contition > } > }); > > On Thu, Sep 10, 2009 at 7:38 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> > How is it possible to do this in Wicket ? Is there a wicket tag that we >> can >> > use for that ? >> >> If you want to hide a component just say component.setVisible(false); >> >> If you wnat to hide component and surrounding html markup, do the >> following: >> >> >> >> td>Here you can have any arbitrary html >> Let's assume >> this is your component then >> >> >> >> >> >> In the above example you could hide the component with its surrounding >> markup using >> add(new >> Label("this_component_will_determine_visibility").setVisible(false)); >> >> Is this what you were looking for? >> >> > E.g. Depending of the value returned by a property, I would like to >> display >> > in a table a red button instead of a green >> >> Well.. CSS should be used for that and AttributeModifier. >> >> ** >> Martin >> >> > >> > Regards, >> > >> > Charles Moulliard >> > Senior Enterprise Architect >> > Apache Camel Committer >> > >> > * >> > blog : http://cmoulliard.blogspot.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
DropDownChoice with Java Enum
Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType { NEW ("NEW", "New"), ACCEPTED ("ACCPT", "Accepted"), VALIDATED ("VALID", "Validated"), TRANSFORMED("TRFRM", "Transformed"), TRANSFERRED("TRFRD", "Transferred"), REJECTED("REJEC", "Rejected"), FAILED("FAIL", "Failed"); private final String value; private final String description; ProcessingStatusType( String value, String description ) { this.value = value; this.description = description; } Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
Re: How to hide html sections
With OO you can teach you objects to behave, rater the set then every time: String property; add(new Button("red"){ @Override public boolean isVisible() { return property == red condition } }); add(new Button("green"){ @Override public boolean isVisible() { return property == green contition } }); On Thu, Sep 10, 2009 at 7:38 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > > How is it possible to do this in Wicket ? Is there a wicket tag that we > can > > use for that ? > > If you want to hide a component just say component.setVisible(false); > > If you wnat to hide component and surrounding html markup, do the > following: > > > > td>Here you can have any arbitrary html > Let's assume > this is your component then > > > > > > In the above example you could hide the component with its surrounding > markup using > add(new > Label("this_component_will_determine_visibility").setVisible(false)); > > Is this what you were looking for? > > > E.g. Depending of the value returned by a property, I would like to > display > > in a table a red button instead of a green > > Well.. CSS should be used for that and AttributeModifier. > > ** > Martin > > > > > Regards, > > > > Charles Moulliard > > Senior Enterprise Architect > > Apache Camel Committer > > > > * > > blog : http://cmoulliard.blogspot.com > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: How to use AjaxPagingNavigationIncrementLink without Navigator...
Hi, I din't find were javadoc says that AjaxPagingNavigationIncrementLink can to be used as standalone component *AjaxPagingNavigationIncrementLink *javadoc: An incremental Ajaxian link to a page of a PageableListView. Assuming your list view navigation looks like [first / << / <] 1 | 2 | 3 [> / >> /last] and "<" meaning the previous and "<<" goto the "current page - 5", than it is this kind of incremental page links which can easily be created. This link will update the pageable and itself or the navigator the link is part of using Ajax techniques, or perform a full refresh when ajax is not available. nor were the navigator is just optional to AjaxPagingNavigationBehavior *AjaxPagingNavigationBehavior * only contructor javadoc: Attaches the navigation behavior to the owner link and drives the pageable component. The behavior is attached to the markup event. Parameters: *owner* the owner ajax link *pageable* the pageable to update * event* the javascript event to bind to (e.g. onclick) On Thu, Sep 10, 2009 at 5:11 AM, Andrej Thiele wrote: > Hi, > I tried to use the AjaxPagingNavigationIncrementLink as standalone > component. As javadoc describes this should be possible like using the > PagingNavigationIncrementLink. But if I click on this link an exception is > the result. > > After diving into the code I have seen that the > AjaxPagingNavigationBehavior searches for a AjaxPagingNavigator component > which is not present in my code. The javadoc to this behavior says that the > navigator is just optional. > > Is this a problem in the wicket code or is there another possibility to use > an incremental link together with ajax? > > Best regards, > > Andrej > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
How to redirect from a ModalWindow
Hi I've got a ModalWindow which lets the user select some choices. Now I need a button in that ModalWindow allowing the user to enter some new choices. I don't want that target to be another ModalWindow (as it's referenced from other places too), so I need to redirect the user to that new page if he wishes to add a new choice. Basically that works, using a Button or an AjaxButton both works, but since the ModalWindow is still open, I get the ugly browser warning about navigating away from the current page. What can I do to solve that? I tried an AjaxButton using window.close(target); setResponsePage(OtherPage.class); But that doesn't work. Any ideas? Thanks Matt smime.p7s Description: S/MIME Cryptographic Signature
Re: How to hide html sections
> How is it possible to do this in Wicket ? Is there a wicket tag that we can > use for that ? If you want to hide a component just say component.setVisible(false); If you wnat to hide component and surrounding html markup, do the following: td>Here you can have any arbitrary html Let's assume this is your component then In the above example you could hide the component with its surrounding markup using add(new Label("this_component_will_determine_visibility").setVisible(false)); Is this what you were looking for? > E.g. Depending of the value returned by a property, I would like to display > in a table a red button instead of a green Well.. CSS should be used for that and AttributeModifier. ** Martin > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > * > blog : http://cmoulliard.blogspot.com > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How test modal windows with wicket tester?
Yes.. you need to check the panel INSIDE the modal panel. And a hint: avoid using string paths to the maximum... you'll have more flexibility in refactoring. Just do like this: MessageTabs tabs = (MessageTabs) tester.getLastRenderedPage(); Panel panel = tabs.getPanel(); Company company = panel.getCompany(); CommentForm form = company.getForm(); ModalWindow modalWindow = form.getCommentCreateModal(); // Assert visibility tester.assertInvisible(modalWindow.getPageRelativePath() + ":" + modalWindow.getContentId()); ** Martin 2009/9/10 Denis Kandrov : > Hi, Martin! > I try use > tester.assertVisible("messageTabs:panel:company:commentForm:commentCreateModal") > where > messageTabs:panel:company:commentForm:commentCreateModal is > my.app.class.NotificationModalWindow > where > NotificationModalWindow extends ModalWindow. > > But it not work, "messageTabs:panel:company:commentForm:commentCreateModal" > is always visible.. > > Denis. > > Martin Makundi пишет: >> >> Hi! >> >> There is nothing special in testing modal windows. It is just a panel >> with a panel inside. You can use tester.assertVisible... >> >> THe only trick is if you have windowCloseCallbacks.. you need to >> invoke those manually using tester.executeBehavior... >> >> ** >> Martin >> >> 2009/9/8 Denis Kandrov : >> >>> >>> I have dashboard, that have modal windows for adding comments and view >>> dashboard message. >>> >>> How can I get this modal window for testing with wicket tester? >>> And how to check that modal window is opened? >>> >>> Denis. >>> >>> >>> - >>> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How test modal windows with wicket tester?
Hi, Martin! I try use tester.assertVisible("messageTabs:panel:company:commentForm:commentCreateModal") where messageTabs:panel:company:commentForm:commentCreateModal is my.app.class.NotificationModalWindow where NotificationModalWindow extends ModalWindow. But it not work, "messageTabs:panel:company:commentForm:commentCreateModal" is always visible.. Denis. Martin Makundi пишет: Hi! There is nothing special in testing modal windows. It is just a panel with a panel inside. You can use tester.assertVisible... THe only trick is if you have windowCloseCallbacks.. you need to invoke those manually using tester.executeBehavior... ** Martin 2009/9/8 Denis Kandrov : I have dashboard, that have modal windows for adding comments and view dashboard message. How can I get this modal window for testing with wicket tester? And how to check that modal window is opened? Denis. - 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
How to hide html sections
Hi, In JSP pages, it is quite simple to change HTML rendering as it is possible to test java properties and depending on the value we can display or hide html code. How is it possible to do this in Wicket ? Is there a wicket tag that we can use for that ? E.g. Depending of the value returned by a property, I would like to display in a table a red button instead of a green Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
Re: placing multiple gmap markers
Thanks for the reply. What I am looking for, is shown under: http://esa.ilmari.googlepages.com/ZMarker2.htm (placing markers which are too close together) Shiraz On Wed, Sep 9, 2009 at 9:34 PM, Pedro Santos wrote: > See if it occurs on http://maps.google.com/ too. You can put markers on > this > map too. If the problem remains, you can disable the zoom out. > > On Wed, Sep 9, 2009 at 11:35 AM, shiraz memon > wrote: > > > Hi, > > > > I am trying to put multiple markers at the same position. It looks fine > if > > I > > magnifies it but as soon as I zoom out it shows only one marker (which > > becomes ambiguous while clicking at the info window). I came to know that > > it > > might be solved by setting the z-Index of every marker (if they are > > located > > on the same position). Is it possible to solve this using apache Wicket's > > GMap2 api? > > > > Thanks in advance, > > Shiraz > > >
RE: Passing parameters from markup to panels
Thanks for those suggestions. I've actually got it kind of working *with* an IComponentResolver and that seems to be working fine for now. > -Original Message- > From: Michael Mosmann [mailto:mich...@mosmann.de] > Sent: Thursday, 10 September 2009 6:24 PM > To: users@wicket.apache.org > Subject: RE: Passing parameters from markup to panels > > Am Donnerstag, den 10.09.2009, 14:03 +1000 schrieb Chris Colman: > > > why? what is different between a 10 or a 50 item song panel? the > > number > > > of items? you should anyhow use a ListView which repeats the "her is > > the > > > song"-block as many times as you want to.. > > > > It is using a ListView - the desire was to provide an easy way for the > > UI guy to specify a row count in the markup. > > ok.. i got this.. i would put it into an property file of the component > where the SongPanel is used and put a ResourceModel as parameter to > SongPanel > > > > > Let's say we make > > > > > > > > SongChartTop10Panel and SongChartTop50Panel > > > > > > > > (with .java and .html markup for each) > > > > > > > > Now he says he wants to make a top 20 list for one page and a top 40 > > > > list for another page... the inefficiency and non OO nature of this > > > > approach becomes apparent. > > > > > > why do you make this? > > > > They each derive from SongChartTopPanel and invoke the constructor with > > a different row count - but without parameterization and using standard > > simple wicket devices (i.e. not component resolvers) then we need a > > separate markup and separate .java class for each panel that has a > > different number of songs displayed. > > you can override getVariation to switch between markup.. so if you use > the ResourceModel for this, this should be easy.. > > > > > If a simple parameter were able to be passed to the panel we could > > reuse > > > > that panel code to show anywhere from 1 to n songs. > > > > Yes but you'd still require a separate markup for each one I would think > > - without going the with component resolver approach. > > i am not sure, that i understand this problem as it is.. so excuse, if > my solutions does not fit.. > > > The web designer will have a nice 'Top 10' image above the panel so I > > didn't want to put it in the hands of the user who might change the > > rowcount to 13 or something. 'Top 13 songs around the country this week' > > doesn't sound right - especially if the image above it says 'Top 10'. > > ok.. > some code to show you my view of this problem and the solution (may not > fit).. > > > class SongPanel .. > { > SongPanel(String id,ResourceModel topCountAsStringModel) > { > final int count=getCountAsInt(topCountAsStringModel,10); > IModel model=new LoadabledDetachModel() > { > load() { ... getSongs(count) } > } > add(new ListView("songs",model) {..} > add(new Image("topImg",new ResourceReference(getClass(), "topImage", > getLocale(), "top"+count))) > } > > getVariation() > { > return "top"+count; > } > } > > > SongPanel.html > > Top 10 (default) > > ... > > > > > SongPanel_top50.html > > Top 50 > > ... > > > > > ComponentA(String id) > { > add(new SongPanel("songs",new ResourceModel("songsInList","")); > } > > > > ComponentA.properties: > songsInList=10; > > > > ComponentB(String id) > { > add(new SongPanel("songs",new ResourceModel("songsInList","")); > } > > > > ComponentB.properties: > songsInList=50; > > > > .. > if you enable autolink, then this image-stuff could be much easier, so > the web design guy have much control and you have much OO as you can.. > > .. hope this will help a little > > mm:) > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.409 / Virus Database: 270.13.86/2355 - Release Date: 09/10/09 > 05:50:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Passing parameters from markup to panels
Am Donnerstag, den 10.09.2009, 14:03 +1000 schrieb Chris Colman: > > why? what is different between a 10 or a 50 item song panel? the > number > > of items? you should anyhow use a ListView which repeats the "her is > the > > song"-block as many times as you want to.. > > It is using a ListView - the desire was to provide an easy way for the > UI guy to specify a row count in the markup. ok.. i got this.. i would put it into an property file of the component where the SongPanel is used and put a ResourceModel as parameter to SongPanel > > > Let's say we make > > > > > > SongChartTop10Panel and SongChartTop50Panel > > > > > > (with .java and .html markup for each) > > > > > > Now he says he wants to make a top 20 list for one page and a top 40 > > > list for another page... the inefficiency and non OO nature of this > > > approach becomes apparent. > > > > why do you make this? > > They each derive from SongChartTopPanel and invoke the constructor with > a different row count - but without parameterization and using standard > simple wicket devices (i.e. not component resolvers) then we need a > separate markup and separate .java class for each panel that has a > different number of songs displayed. you can override getVariation to switch between markup.. so if you use the ResourceModel for this, this should be easy.. > > > If a simple parameter were able to be passed to the panel we could > reuse > > > that panel code to show anywhere from 1 to n songs. > > Yes but you'd still require a separate markup for each one I would think > - without going the with component resolver approach. i am not sure, that i understand this problem as it is.. so excuse, if my solutions does not fit.. > The web designer will have a nice 'Top 10' image above the panel so I > didn't want to put it in the hands of the user who might change the > rowcount to 13 or something. 'Top 13 songs around the country this week' > doesn't sound right - especially if the image above it says 'Top 10'. ok.. some code to show you my view of this problem and the solution (may not fit).. class SongPanel .. { SongPanel(String id,ResourceModel topCountAsStringModel) { final int count=getCountAsInt(topCountAsStringModel,10); IModel model=new LoadabledDetachModel() { load() { ... getSongs(count) } } add(new ListView("songs",model) {..} add(new Image("topImg",new ResourceReference(getClass(), "topImage", getLocale(), "top"+count))) } getVariation() { return "top"+count; } } SongPanel.html Top 10 (default) ... SongPanel_top50.html Top 50 ... ComponentA(String id) { add(new SongPanel("songs",new ResourceModel("songsInList","")); } ComponentA.properties: songsInList=10; ComponentB(String id) { add(new SongPanel("songs",new ResourceModel("songsInList","")); } ComponentB.properties: songsInList=50; .. if you enable autolink, then this image-stuff could be much easier, so the web design guy have much control and you have much OO as you can.. .. hope this will help a little mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Variation algorithm
With using the getVariation() method is the 'fallback' process for when a particular variant isn't found like this: (a) Incremental removal of variant suffixes using '_' as the delimeter: i.e. Wicket looks for files in the following order until one is found: HeaderPanel_Var1_Var2_Var3.html HeaderPanel_Var1_Var2.html HeaderPanel_Var1.html HeaderPanel.html OR this: (b) Total removal of entire variant suffix if no variant markup file is found: i.e. Wicket looks for files in the following order until one is found: HeaderPanel_Var1_Var2_Var3.html HeaderPanel.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to use AjaxPagingNavigationIncrementLink without Navigator...
Hi, I tried to use the AjaxPagingNavigationIncrementLink as standalone component. As javadoc describes this should be possible like using the PagingNavigationIncrementLink. But if I click on this link an exception is the result. After diving into the code I have seen that the AjaxPagingNavigationBehavior searches for a AjaxPagingNavigator component which is not present in my code. The javadoc to this behavior says that the navigator is just optional. Is this a problem in the wicket code or is there another possibility to use an incremental link together with ajax? Best regards, Andrej - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to embed one wicket app into another
I go with Martin, use iFrame. This is what we do. We have two Wicket apps, running on the same machine, the web.xml triggers two different Wicket apps. Why you ask? an old and a VERY BAD decision. In order to navigate from one app to the other we actually use URLs. In order to show page from app B in the A app (the main), we show it in iframe and calling URLs. We had to implement a very bad security patch. One of my main assignments currently, is to merge the two applications back to one. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Thu, Sep 10, 2009 at 7:33 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Use Iframe > > ** > Martin > > 2009/9/10 Quan Zhou : > > sorry, i forget to say this two apps are installed in different > servers.each > > is a single standalone app. > > so i think i can't embed panelB into PageA. > > > > On Thu, Sep 10, 2009 at 11:58 AM, Jeremy Thomerson < > > jer...@wickettraining.com> wrote: > > > >> If you have created good self-contained components, you should be able > to > >> just embed into > >> > >> -- > >> Jeremy Thomerson > >> http://www.wickettraining.com > >> > >> > >> > >> On Wed, Sep 9, 2009 at 10:54 PM, Quan Zhou > wrote: > >> > >> > Hi.I've developed my simple forum with Wicket(we call it A), and I > want > >> to > >> > embed it into another website (B) developed by Wicket. > >> > like, the left panel and the navigator panel are both from B, and the > >> right > >> > panel is from A, > >> > I dont want to use Frame because my page will be complicated. > >> > > >> > Does anyone have this kind of experience? > >> > > >> > Thanks in advance and I hope you understand my question. > >> > > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: CSS and Javascript in Modal Panel
we used Page in the modal instead of Panel. In the page we added all header contributers. I'm not sure, but what if you add these contributers to the page that the modal window is in? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Thu, Sep 10, 2009 at 9:28 AM, Oliver-Sven Fritsch wrote: > Hi everybody! > > I want to use modal panels for forms which seems to be a good choice. Some > of my forms need to have multiple pages which I would like to display on > tabs. Tabbing work fine in "normal" wicket panels and pages when I provide > the necessary CSS and Javascript. But somehow the modal panel is completly > imune to it. First I tried to include the formatting and script directly in > the markup for my modal panel which doesn't work. Then I tried to do this > using the JavascriptPackageResource (nad css) in the class which wont work > too. > > Is there a way to add css formating and javascript functionallity to modal > panels beyond the default one? > Using my scripts and css on ordinary pages works perfectly well. > > Regards Oliver > > -- > Oliver-Sven Fritsch > > 3B LOGOS Logik+Logistik GmbH > Kaiserdamm 32, D-14057 Berlin, Tel.: 30 61 47 42 > Geschäftsführer: Dr. Friedrich Barounig > Sitz: Berlin, Amtsgericht Charlottenburg, HRB 69523 > UID: DE 198252668, SteuerNummer: 27/004/04695 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Announcing: Scala-Wicket Extensions Project
Antony Stubbs wrote: > > > Yes, the ⇒ is actually what the "=>" is supposed to be in Scala, and is a > UTF8 character, which I'm sure would be supported by all modern editors. > I'm surprised you can't see it properly. What OS and version of Eclipse > are you viewing them with? I am toying around with ⇒ atm and haven't > really reached a decision on which I prefer. But if it causes trouble for > people, and it's an open library, then causing _less_ trouble for people > is preferable :) > > I'm having the same problems, in any text editor. -- View this message in context: http://www.nabble.com/Announcing%3A-Scala-Wicket-Extensions-Project-tp24975011p25378371.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