Wicket E-Commerce

2011-01-29 Thread msj121

I know that there were talks of a Wicket Cart on the forum that never
materialized. I looked at Apache OFBiz, BroadLeaf, Konakart etc... I ran
their examples. I was curious if anyone knew of a pure backend JEE solution
for e-commerce, so that integrating the business logic might be well
documented regardless of the front end. 

OfBiz has too much compared to what I need at the moment. 

BroadLeaf seems somewhat complicated as it is geared to JSP pages seemingly
and there is little documentation available (I have attempted to go through
source code, but I am not further then I was when I started). I like Wicket
not JSPs. Though it seems like it would be a fine solution otherwise, though
it extensively uses Spring and I don't, but probably not a big deal.

Konakart is simply not open Though there is a Ted who has commented
and put some insight into how to get the code running in Wicket. Have others
used this framework? Thoughts?


I guess I am a little bit lost with all the options and I am not having much
luck in regard to searches or understanding these other frameworks in regard
to getting them into Wicket.

Has anyone had insight into these frameworks and Wicket? Any advice? Better
frameworks to try?

Thank you in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-E-Commerce-tp3246883p3246883.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Adding attribute to selected menu item

2011-01-30 Thread msj121

Well there are a couple ways of doing this I recently dealt with this
same problem. You can in fact use some Javascript on the onClick of your
item (or onHover) to add to the affect, but either way you will want to have
your default menu item selected from the get go when they are on that page
(ie: they clicked on the blog section, that link in the menu should be
highlighted now without clicking). So unless its all one page and your using
ajax(I'll stop droning) The following should help:

Link link = new Link(menuLink) { 
@Override
protected void onComponentTag(ComponentTag tag) {
if()
 tag.put(id,curent_menu);
}
}

In Theory you can simply add the AttributeAppender from the get go depending
on which page you are on, so when it reloads, it will be reloaded with a
component.

Now I take it you are using onclick to keep track of your page. Either you
have to store a local variable that will record the page onClick, you have
to have a method that each page overrides telling you the current page, or
what I do is simply look at the PageParameters of my page.

So as follows: params.getString(key); //the key depends on how you build
your urls.
This only works if every time a link is clicked it actually goes to another
page with a different url.

So as of now, in your onclick record the name of the menu clicked, then in
the building section automaticlally add the appender This is what I mean
(notice the unqouted changes):


String selected = ;

 ListView lv = new ListView(mainMenu, menuList) {
@Override
protected void populateItem(final ListItem item) {
Menu menuItem = (Menu) item.getModelObject();
Link link = new Link(menuLink) {
@Override
public void onClick() {
  selected = item.getPath();
System.out.println(item was clicked  +
 item.getPath());
}

};
  if(item.getPath().equals(selected))
   item.add(new AttributeAppender(id, new
Model(current_menu), ;));
link.add(new Label(menuCaption,
 menuItem.getMenuNameDe()));
item.add(link);
}
};
add(lv);
 

Try the above. Notice the selected variable is now global and the if
statement can be used to whatever will stay constant. I have never used
getPath() before not sure what it returns, you might need the name of the
menu which doesn't change etc no idea.

Good Luck, 
   Matthew
 Hello to all,

 i am trying to build a dynamic menu based on data from a database. So i
 thought i could build it like my code shows it. To highlight the selected
 menu i try to dynamically add an attribute to the li tag in the onClick
 method. I would also want to load and repaint other panels (for example
 loading sub menus ), when the user clicks a menu link. But it is not
 working. What am i doing wrong?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-attribute-to-selected-menu-item-tp3244327p3247201.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Wicket Tutorial Videos

2011-01-30 Thread msj121

I was making some Wicket Tutorial Videos on youtube.com/programjava

Just curious if there are very common questions with Wicket that appear on
the boards a lot, maybe I should make some quick video tutorials for them to
make people's lives a little easier. You can check what I already have,
standard videos like getting started, it is all pretty much in Netbeans
though it is all standard. Using EJB3 with Wicket etc
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Tutorial-Videos-tp3247603p3247603.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: setResponsePage weirdness

2011-01-31 Thread msj121

You might want to use a Wizard for the record. Just curious does first page
add anything to the page, perhaps a new url and redirect is not necessary if
no Wicket Components were added, try adding some Wicket Label about a
redirect or something (just trying to narrow this down).

Just curious, the way you have it, in theory a user really could enter the
second or third page without the previous page(s), with the url, no? I
suggest look into making a wizard component
http://www.wicket-library.com/wicket-examples/wizard/ .

Matthew


syg6 wrote:
 
 I have a few mounts set up:
 
 mount(new QueryStringUrlCodingStrategy(/first, FirstPage.class));
 mount(new QueryStringUrlCodingStrategy(/second, SecondPage.class));
 mount(new QueryStringUrlCodingStrategy(/third, ThirdPage.class));
 
 And in HomePage I have a link to FirstPage:
 
 add(new BookmarkablePageLinkFirstPage(firstPageLink,
 FirstPage.class, parameters));
 
 All FirstPage does is verify some parameters sent to it and do a
 setResponse() to SecondPage.
 
 Why is it that when I click on the link in HomePage, to FirstPage, when
 setResponsePage(SecondPage.class) in FirstPage's constructor is called the
 url remains:
 
 http://localhost:8080/myapp/first
 
 when I am actually now on SecondPage? But when I call
 setResponsePage(ThirdPage.class) from SecondPageForm's onSubmit()
 (SecondPage contains SecondPageForm), the url is:
 
 http://localhost:8080/myapp/third
 
 I've tried sticking setRedirect(true) in a few places but that seems to
 mess up my custom session; my custom session is constantly reset, previous
 info stored in the session is wiped out.
 
 I've also tried using setResponsePage(new SecondPage()) but it doesn't
 seem to change the url and SecondPage.html breaks, it's telling me none of
 my form components are present!
 
 Both SecondPage and ThirdPage *can* (and should!) be tied to the session,
 the user must never be able to enter directly into either one, but rather
 first enter FirstPage.
 
 Can someone tell me what I am doing wrong?
 
 Thanks,
 Bob
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249002.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: setResponsePage weirdness

2011-01-31 Thread msj121

Okay,
  So don't use a link on the html page for FirstPage. Try redirecting when
there is an html page with some filler, try adding a wicket label if plain
html doesn't work. Although it's not the best solution it will narrow down
the problem!

   The Wizard is useful in the sense, you can go back and forth for the user
and it is all in one page etc There is nothing amazing about the
wizard, just that it seems your trying to do the same thing, and it would
handle making each step and not allowing one to skip to the second page
because they bookmarked the url

  No worries about the ranting, I do it all the time.

Matthew


syg6 wrote:
 
 Hi and thanks for the response.
 
 No, FirstPage doesn't add anything to the page. It checks a param passed
 to it and redirects to one page or the other. Just for a test, I made a
 FirstPage.html with a link to SecondPage and had FirstPage.java just bring
 me to FirstPage.html, instead of doing a redirect.  When I click on it the
 url changes correctly, unlike when I do a setResponsePage(SecondPage) from
 HomePage. But I don't need to 'stop' on FirstPage ... in fact I don't even
 have a FirstPage.html because I always redirect somewhere else.
 
 As for using a Wizard ... I thought about it and looked into it but it
 doesn't seem do too much. I only have 3 pages in my wizard and and
 controlling access to the 2nd and 3rd pages with a custom session object.
 ie, when you click on the link in the HomePage, if everything is correct
 (right parameters), I stick something in the session and redirect to
 page2. I do the same with page2. So access to the pages is controlled by
 my custom session object. Would it be that much easier with a wizard? I
 guess it would control the order of the pages but I would still need to
 stick my own logic in there because it's not just about the order of the
 pages, it also needs to validate other stuff.
 
 Anyway ...sorry to rant. Thanks for your help. Any other ideas much
 appreciated.
 
 Bob
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249263.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: correct way to get css classes of component

2011-01-31 Thread msj121

You can also use an AttributeModifier, which will give you the old value (as
I recall).

overriding the method onComponentTag(ComponentTag tag), will let you easily
put a new variable for your class etc... but you will need to use tag.get(),
and tag.put(tag.get()+...). Looks somewhat messy when you start using
StringBuffers, unless your doing a lot of tag modifications might as well
use AttributeModifier.

In fact use, SimpleAttributeModifier:

component.add(new SimpleAttributeModifier(class, my-css-class));


More methods can be seen here:
https://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/correct-way-to-get-css-classes-of-component-tp3248490p3249278.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: setResponsePage weirdness

2011-02-01 Thread msj121

Worse case scenario, though I understand not wanting to do it, is using a
javascript/html redirect and by passing Wicket, not the nicest scenario, I
wish I knew more about redirects, sorry.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3251802.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Mapping wicket:id to component without changing Java code

2011-02-01 Thread msj121

You can add an empty label to replace the content if not adding the
component. You can have a repeating list if you have lots of dynamic
content, this way whatever you add to the list is added or you can just add
an empty component.

It does seem odd to me that in your html you know whether to add the credit
card div, but in Wicket you do not... that is certainly unclear to me.

Btw, I am building an e-commerce solution myself, are you using an
opensource platform or building it yourself?

 Hello,

 I would like to add credit card processing form to many different pages in
 my application. However, I don't know which pages it will be added to and
 it
 is up to the web designer to decide.

 I would like to allow the web designer to be able to putdiv
 wicket:id=creditCardForm/  anywhere in HTML. This would typically cause
 Wicket to throw an error saying that a matching component was not added.

 Is there a way to configure Wicket to somehow add an instance of
 CreditCardForm class whenever it seesdiv wicket:id=creditCardForm/?

 Thanks,

 Alec
 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mapping-wicket-id-to-component-without-changing-Java-code-tp3250381p3251809.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Using non-Model fields in Form

2011-02-01 Thread msj121

As Nimmy said you should be able to supply your own model to the RadioChoice
which will override the CompoundPropertyModel Assuming NUMBERS is a
list...

RadioChoiceString rc = new RadioChoiceString(numberRadioChoice, new
Model(),NUMBERS); 

Look at https://cwiki.apache.org/WICKET/working-with-wicket-models.html for
more information.


nimmy wrote:
 
 I'm a newbie also but
 
 Can't you just create a new model specifically for the RadioChoice
 component? Each component can have its own model.
 
 
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251822.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Provide the user with immediate feedback

2011-02-01 Thread msj121

Interesting the Ajax call decorator mentioned above sounds like a good
choice, I don't know the transactional steps for each solution, but to have
the javascript written entirely in the page without requiring some sort of
connection to the wicket server, does sound like it will be more immediate
if your worried about that 1 or 2 seconds of idle time however you want to
accomplish that.
http://radio.javaranch.com/pascarello/2005/05/17/1116340367337.html If you
need a script: 
function DisableEnableForm(xForm,xHow){
  objElems = xForm.elements;
  for(i=0;iobjElems.length;i++){
objElems[i].disabled = xHow;
  }
}

Just my two cents,
Matthew




Patrick Petermair wrote:
 In our wicket application we are using a lot of Ajax links/forms. 
 Sometimes, those requests take a second or two. We now want to give the 
 user some feedback, that his request is being processed (to avoid double 
 clicking or the impression that the webapp is slow).

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Provide-the-user-with-immediate-feedback-tp3250978p3251879.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread msj121

I don't quite understand the problem... some code might help. But why can't
you do something like the following:

tabs.add(new AbstractTab(item.getModel()) {
 public Panel getPanel(String panelId) {
 return new AlbumPanel(panelId, );// can be item.getModelObject() or
something
 }
}); 

The above assumes your inside some sort of Wicket Repeater (I assumed this
as you mentioned it was dynamic). Like I said, some more code might help.

nimmy wrote:
 
 Hi all,
 
 I'm having a bit of confusion with dynamic tabs and would appreciate your
 help.
 
 My page has a LDM model. The model wraps an AlbumGroup object, which has a
 list of Album objects.
 
 I'm creating a tab for each Album object by extending AbstractTab. I'm
 passing in a ModelAlbum as a constructor to the tab. This model is used
 to set the title of the tab and should also be used to populate the
 contents of the tab panel.
 
 How can I pass the ModelAlbum to the tab Panel?
 
 I don't think I can hold the model as an instance variable in the Tab
 until the getPanel() method is called as detach will never be called on
 the LDM.
 
 I cannot simply implement the IDetachable interface because AbstractTab is
 not a component and detach will not be called on it.
 
 Am I overthinking the LDM?
 
 Cheers,
 Nim
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3251937.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread msj121

the method .detach() or some variation should be called on every Loadable
Detachable Model (LDM) if your model is being used as a default model to any
component in the page hierarchy. To make this LDM your page model, I think
there is a trick in the sense you should call super(model), and not just
set the page's default model. It should be detached automatically.

The best way is probably to test the code with a breakpoint or override the
method and print with log4j or something

Sorry I misunderstood the question.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3252947.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Using DataView newItem method to display a BreadCrumbPanel

2011-02-01 Thread msj121

not sure what activate does, I would hope though that it would add the object
to a panel on the page, and then you call target.addComponent(panel); As
this target (the AjaxRequestTarget) deals with actually updating the front
end of the page.

Also Data Repeaters are somewhat dubious in that they refresh their content
on each reload, so don't try to add the content to the DataView itself
(which I assume you are not). Similarly using the model and not the value of
the model might cause some issues, I am not sure. The stack error trace
after this first visual issue is fixed would be useful.

I do presume they are somewhat separate (ie: fixing one won't solve the
other).

Matthew


shetc wrote:
 
 Hi All,
 
 I am trying to add an onclick event to a table row -- each row is created
 using a DataView.
 To make an entire row clickable, I add an AjaxEventBehavior via the
 DataView's Item newItem method.
 This seems to work as far as an onEvent event being raised when I click on
 a table row.
 However, I am trying to activate a BreadCrumbPanel from within the onEvent
 event. Nothing seems
 to happen as far as showing the next panel (called JobDescPanel). If I
 click on the row again
 then a component not found on page exception is thrown. I have supplied a
 snippet of code below.
 Is it wrong to try and activate a breadcrumb from this Ajax event?
 
 Thanks,
 Steve
 
 P.S. Using Wicket 1.4.10
 
 
   private void buildDataView() 
   {
   final DataViewJobSearchResult dv = new
 DataViewJobSearchResult(dataView, jsdp) {
   private static final long serialVersionUID = 1L;
 
   @Override
   protected ItemJobSearchResult newItem(String id, int 
 index, final
 IModelJobSearchResult model) {
   ItemJobSearchResult item = super.newItem(id, 
 index, model);
   item.add(new AjaxEventBehavior(onclick) {
   private static final long 
 serialVersionUID = 1L;
   @Override
   protected void 
 onEvent(AjaxRequestTarget target) {
   activate(new 
 IBreadCrumbPanelFactory() {
   private static final 
 long serialVersionUID = 1L;
   public BreadCrumbPanel 
 create(String componentId, IBreadCrumbModel
 bcm) {
   JobSearchResult 
 jsr = model.getObject();
   return new 
 JobDescPanel(componentId, bcm, homePage,
 jsr.getOrderId());
   }
   });
   }
   });
   return item;
   }
 
   ...
   }
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-DataView-newItem-method-to-display-a-BreadCrumbPanel-tp3252215p3252973.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Multiple Button Problem in Wicket

2011-02-02 Thread msj121

To be honest, I decided to stick this code into my own web page (it has a
form), but I put it outside of it without a form, and it works fine

Shows up just dandy. I did of course change your retrieveButton code to add
an );. So I presume it is something else in your code stopping your code
from compiling or something Perhaps something wrong with UserVerifyForm,
not sure what this extends. I assume you edited a lot of your code which was
necessary when you put it up on the boards, which you may, but everything
works for me What version of Wicket are you using?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-Button-Problem-in-Wicket-tp3254779p3256935.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Mapping wicket:id to component without changing Java code

2011-02-02 Thread msj121

Not sure how to e-mail someone directly as e-mails are hidden But it's
okay, I will probably look to implement an existing open source system with
Wicket, I am just curious if anyone would want to work on building a
specific open source idea for wicket either from scratch or properly
building off a basic system

If I build an e-commerce system from scratch I certainly wouldn't want to do
it alone But I wish you luck with your system.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mapping-wicket-id-to-component-without-changing-Java-code-tp3250381p3256939.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Does Wicket 1.5 requires Wicket-auth-roles if I want to use Spring Security 3?

2011-02-03 Thread msj121

I have not used it, but doesn't it stand to reason that it is simpler to
decide whether a user can access a certain piece of code in Wicket. That
being, because I would presume you can apply the spring security to panels
or pages etc... based in wicket, and not spring filters etc Or perhaps I
misunderstand spring security method of checking user permissions on
content.

Just my guess, but like I said, I know close to nothing on the topic, I only
perused it once a while ago.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Does-Wicket-1-5-requires-Wicket-auth-roles-if-I-want-to-use-Spring-Security-3-tp3259415p3259440.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Using DataView newItem method to display a BreadCrumbPanel

2011-02-03 Thread msj121

Well if you have the Panel

Panel pnl = new Panel(breadcumbholder);
pnl.setOutputMarkupId(true);

and if this panel is made global, then you can add it inside other classes
if necessary target.addComponent(pnl);

This way you only update the panel and not the entire page



shetc wrote:
 
 I seemed to have resolved the issue by adding the page that owns the bread
 crumb panels as the
 Ajax target; I do this within the BreadCrumbPanel create method:
 
 
 getPage().setOutputMarkupId(true);
 target.addComponent(getPage());
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-DataView-newItem-method-to-display-a-BreadCrumbPanel-tp3252215p3259442.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: MarkupId generation

2011-02-03 Thread msj121

Well I think that all of the markup ids being output are based off of the
name in wicket:id=name. If memory serves correct so the easiest (ie:
less obtrusive) solution is to simply change your tags. Of course tedious if
you already had completed your project, so perhaps overriding the code that
generates the markup id. Not sure, but an interesting question.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3259445.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: MarkupId generation

2011-02-04 Thread msj121

True, perhaps using .setMarkupId(someid);. I had no idea about that in
production mode, I guess I never checked, I am still somewhat surprised that
is true.

You could have an automatic listener that takes the getMarkupId(...) and
preppend, or append to the id, or do it by hand (not my favourite choice).

Perhaps, you can change the non-wicket ids? would that help? I am not sure
why there would be collisions, could you explain more? Perhaps there is a
more elegant solution, without using wicket 

Matthew


Uwe Schäfer-2 wrote:
 
 On 02/04/2011 05:02 AM, msj121 wrote:
 Well I think that all of the markup ids being output are based off of the
 name  in wicket:id=name. If memory serves correct so the easiest
 (ie:
 less obtrusive) solution is to simply change your tags.
 
 this is only true for development mode. in deployment, id generation 
 differs (it generates id1,id2...)
 
 Of course tedious if
 you already had completed your project, so perhaps overriding the code
 that
 generates the markup id. Not sure, but an interesting question.
 
 overriding is not an option due to this method being on Component. i do 
 not want to use own components in my code. imagine smth like
 add(new TextField(...){
   public String getMarkupId(boolean create){
...
}
 });
 
 yuck ;)
 
 cu uwe
 
 -
 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://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3260937.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: MarkupId generation

2011-02-05 Thread msj121

I see, well I am happy I could help, and it sounds like you have quite an
interesting project.

Good Luck,
  Matthew

Uwe Schäfer-2 wrote:
 
 On 02/04/2011 09:07 PM, msj121 wrote:
 
 You could have an automatic listener that takes the getMarkupId(...)
 and
 preppend, or append to the id, or do it by hand (not my favourite
 choice).
 
 good idea. i´ll try just setMarkupId(prefix+getMarkupId()) with an 
 IComponentInstantiationListener.
 
 Perhaps, you can change the non-wicket ids? would that help? I am not
 sure
 why there would be collisions, could you explain more?
 
 the point is that the functional benefits of the wicket app are supposed 
 to be included in a third-party-web-page with only a script tag (just 
 like banners normally do).
 therefore i have no control over the ids already used in the page, that 
 the wicket app is supposed to be included in.
 
   Perhaps there is a
   more elegant solution, without using wicket
 
 believe me, i tried. what is to be included has quite some conversation 
  state, so that doing all this ajaxy stuff with just bare-knuckle 
 servlets  jQuery is so incredibly hard to do, that i came back to 
 wicket after almost 2 days, i now deeply regret ;)
 
 thanks, uwe
 
 
 -
 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://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3262558.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: TextField submit via Ajax

2011-02-07 Thread msj121

If you have multiple html text input elements you can insert the javascript
below in your document etc The only thing new in wicket is that you
simply need to add a callback to your java method, which you can learn about
here (I made a video for this type of issue): 
http://www.youtube.com/watch?v=aqNQShdSOvM
http://www.youtube.com/watch?v=aqNQShdSOvM 

left out of your code post, but you should need an
AjaxFormSubmitBehavior(onkeydown) as Martin pointed out, so for other
users you should post a more complete solution instead of simply script.
But everyone does appreciate you left something for the next person.

function cancelEvent(event){
  event.cancelBubble = true;
  if (event.stopPropagation) event.stopPropagation();
}
if (typeof window.event == 'undefined'){
   document.onkeypress = function(e){
var test_var=e.target.nodeName.toUpperCase();
if (e.target.type) var test_type=e.target.type.toUpperCase();
if ((test_var == 'INPUT'  test_type == 'TEXT') || test_var ==
'TEXTAREA'){
  return e.keyCode;
}else if (e.keyCode == 13){
submit form
  e.preventDefault();
}
   }
 }else{
   document.onkeydown = function(){
var test_var=event.srcElement.tagName.toUpperCase();
if (event.srcElement.type) var
test_type=event.srcElement.type.toUpperCase();
if ((test_var == 'INPUT'  test_type == 'TEXT') || test_var ==
'TEXTAREA'){
  return event.keyCode;
}else if (event.keyCode == 13){
submit value
  event.returnValue=false;
}
   }
 }

Matthew


Altuğ Bilgin Altıntaş wrote:
 
 Hi Martin;
 
 It works thanks; but my condition needs onkeydown anyway  now i am
 posting
 the complete solution for others
 
 Code goal : user enters some char in textfield and press enter, and data
 comes via ajax.
 
 final TextFieldString txtMy= new TextFieldString(txtMy, new
 Model())
 ;
 txtMy.add(new AjaxFormComponentUpdatingBehavior(onkeydown) {
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 //...
 }
 
 @Override
 protected IAjaxCallDecorator getAjaxCallDecorator() {
 return new AjaxCallDecorator() {
 private static final long serialVersionUID = 1L;
 
 @Override
 public CharSequence decorateScript(CharSequence
 script)
 {
 return if(wicketKeyCode(event) == 13){ + script
 +
  return false;};
 }
 };
 }
 ;
 });
 
 Altug.
 
 2010/10/19 Martin Grigorov mgrigo...@apache.org
 
 1. you need AjaxFormSubmitBehavior(onkeyup)
 2. you'll have to add AjaxCallDecorator to it do fire only when the key
 is
 ENTER, i.e. event.keyCode === 13

 2010/10/19 Altuğ Bilgin Altıntaş alt...@gmail.com

  Hi;
 
  How can i submit a form via Ajax when user hit the enter key on a
 TextField
  ?
 
  I did below but it doesn't work.
 
  myTextField.add(new AjaxFormComponentUpdatingBehavior(onsubmit) {
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
//...
 
 }
 
   });
 
  Thanks.
 

 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-submit-via-Ajax-tp3002094p3264785.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Upload/Download FormComponent

2011-02-18 Thread msj121

Not exactly sure what the issue is. You can simply put the components into
panels (or other objects). Meaning make a Download Component, then an Upload
Component separate classes so they can be re-used in the future if you only
want to allow a download form... then put them in one form and decide which
panel to show (each panel holding 2 components). Then the onsubmit method
knows which is showing (since its the same component that decides which to
show) and in theory that is the least amount of code as far as I can
tell

More then that I am not sure what you are asking for I don't consider
myself a seasoned wicketeer though.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upload-Download-FormComponent-tp3310023p3313094.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Storing and retrieving user uploaded images

2011-02-18 Thread msj121

You can see how this works for you:

String path =  WebApplication.get().getServletContext().getRealPath();
Folder uploadFolder = new Folder(path+/uploads);

public String getURLFolder(){
return
getServletContext().getContextPath()+uploadFolder.getPath().replace(path,
);
}


I remember writing this a long time ago, looking at it now, not sure why or
what the difference is getRealPath() and getContextPath(), and not
sure if Wicket 1.5 changed this code, but this worked for me, though I hope
to migrate to a database that way there should be much much less issue in
regard to scaling to 20 servers... where sharing a database and backing up
is readily done and improved whereas sharing files probably not

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Storing-and-retrieving-user-uploaded-images-tp3312735p3313112.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket tree

2011-02-18 Thread msj121

Interestingly if the tree component has its own style unique to the component
I think it will or could override a css style applied for the page even
matching classes.

Perhaps you can also try on the component:

@Override
public void onComponentTag(ComponentTag tag){
   super.onComponentTag();
   tag.put(style, white-space: nowrap;width: 60em;overflow: auto;margin:
10px;line-height: 1.5em; );
}


The above is from memory but it should work... just put it inside the tree
component ie:
Tree tree = new Tree(...){
@Override public void onComponentTag(...){...}
};

I hope this helps, it will certainly narrow down the problem I think

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313613.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket tree

2011-02-19 Thread msj121

Just out of curiosity, are you using a theme with your wicket-tree? Meaning
new WicketTree(...,new WindowsTheme());... Pretty sure this is the
wicket-tree from wicket-stuff project.

You can just look at their css and write your own, I am not sure why this is
not working at all... have you tried using firefox debug to see if the css
changes you want will have the component look the way you want. Maybe they
are being applied but due to css there is a bug with your browser or css
code in the bigger scheme of things?

I am just curious so we can narrow down the issue. Btw, with the wicket-tree
code being open source you can always add a method to tack on to its
onComponentTag of the WicketTree component itself

just write:
   String addition = ;
   public void addToComponentTag(String...){addition = ...;}
   @Override
   public void onComponentTag(ComponentTag tag){...}

Personally not the way I would want to do it, but if your getting fed up it
is feasible, at least as a way to check if the css would work etc

msj121


mlabs wrote:
 
 well i'm beginning to get the impression that this particular tree isn't
 intended for re-use .. and grepping around here I see that others have run
 into this little chestnut too.. and that there is a better tree to use now
 .. the LinkTree ? Ok so I tried that and no problems with sizing .. much
 better.. so I guess the wicket examples are just out of date with respect
 to trees..?
 
 just noticed that link selection highlight doesn't work properly with this
 tree  
 *sigh*
 
 are there any working tree examples out there?
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3314799.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: [Vote] New Wicket Version Numbering

2011-04-01 Thread msj121
I mean XP is letters... That is pretty amazing, there isn't even a number,
and even roman numerals, is there a 'P' in roman numerals?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Vote-New-Wicket-Version-Numbering-tp3420887p3421249.html
Sent from the Users forum mailing list archive at Nabble.com.

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



JavaEEComponentInjector in Wicket 1.5

2011-04-04 Thread msj121
I am not sure if this is a bug or intentional. 

But seemingly
getComponentInstantiationListeners().add((IComponentInstantiationListener)
new JavaEEComponentInjector(this)); No longer works in Wicket 1.5 (any
version I tried), but perfectly works in Wicket 1.4.5.

In Wicket 1.5 it states: cannot access
org.apache.wicket.injection.ComponentInjector I only changed the
version of wicket in my pom file


I will open a bug, but I have a feeling others ran into this, and I googled
for a solution (mostly people without wicket-ioc), but nothing yet, anyone
have any help or advice?

Matthew

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaEEComponentInjector-in-Wicket-1-5-tp3426937p3426937.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: JavaEEComponentInjector in Wicket 1.5

2011-04-05 Thread msj121
Haza! I had switched back to 1.4 momentarily after almost giving up hope.
Didn't realize there was a package on github, my mistake. And great wiki
available on using it in maven, was a quick solution.

Thank you so much!

Matthew

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaEEComponentInjector-in-Wicket-1-5-tp3426937p3429587.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket For Mobile

2011-04-05 Thread msj121

shetc wrote:
 
 This is slightly off-topic but I have found one JavaScript issue with the
 latest BlackBerry called the Torch.
 The Torch has a bug in which a POST is not handled correctly but a GET is
 okay. This is specifically for
 form submits handled via JavaScript, which is typical for Wicket.
 
 See 
 http://supportforums.blackberry.com/t5/Web-Development/Insufficient-Network-Coverage-error-on-form-submit/td-p/941679
 Insufficient Network Coverage error on form submit 
 

 I wonder if Blackberry is changing their operating system anyways, as they
bought a company for the tablet to move to a better operating system. Just
making a note that this may not be a long term issue. But still worth
looking into.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-For-Mobile-tp3423644p3429591.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wiquery experiences

2011-04-06 Thread msj121
I both agree and disagree with the aforementioned comments.

I don't think anyone would disagree that writing javascript from wicket or
using a decorator to write javascript is wrong. In fact quite often I may
not know the id of an object until run-time and I may want the javascript to
run on a specific textfield with no extra class names or additional tags
marking it. To say that you need an extra .js file for a one-line or even 20
line simple js command is arguable I think.



That being said, if you know javascript or jquery, probably WiQuery is not
the most necessary, it is really an object oriented interface to jquery, not
much more as I recall.


The best advantage to wiquery I find is that JQuery at page ready can run
numerous sets of commands All you need to do with WiQuery is add these
commands and they are all grouped together and run in a single document
ready function. Similarly WiQuery will take care of keeping track of what
object id to run the script against, javascript files to import etc It
does simplify things, but do you NEED another library, some people want to
keep as few dependencies as possible, some don't care.


Remember the real engine is JQuery, WiQuery is just an interface to
simplify. But look at writing javascript plainly in Wicket. If it is easy
for you, probably don't bother, but if your getting a headache you might
want to use WiQuery.

My main fear is how often it may be updated and how long will it be around.
I have WiQuery in a current project I may take it out, I notice I mostly
have been writing my own jquery anyway.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wiquery-experiences-tp3430320p3432209.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Wiquery experiences

2011-04-07 Thread msj121
Keep in mind I do use WiQuery myself primarily for the Resource Manager, my
main point was that this is the main reason to use WiQuery, like you
mentioned, and that it should only be viewed as an interface was in my
opinion more of a compliment to well written code. And of course people who
don't know jquery or javascript will gain a lot from WiQuery bypassing much
of that knowledge.

I do admit that there are regular updates to WiQuery, but there was some
time where it did not convert its source jquery files to the newer versions
of JQuery (which I understand requires testing etc... and cannot be done
quickly), which I think now can be overriden more easily by the user.

My other main fear is that with a couple of JQuery Wicket modules, which
will stay and be adopted and which will go. I personally hope that WiQuery
will continue to be updated and grow, but with only a couple of people as
maintainers, I thought it could become extinct all of a sudden at any time.
Though it is good to know that it is being used by an organization, which
means there is monetary incentive for them to keep it afloat.

But yes, I do think that WiQuery is a great project! Though I do need to one
day solve issue 77, I am hoping with the new versions of wicket/wiquery it
will have been  somehow solved though I may have solved it by working around
the problem which is probably better code.


Hielke Hoeve-2 wrote:
 
 
-Original Message-
From: msj121 [mailto:msj...@gmail.com] 
Sent: donderdag 7 april 2011 2:13
To: users@wicket.apache.org
Subject: Re: Wiquery experiences

I both agree and disagree with the aforementioned comments.

I don't think anyone would disagree that writing JavaScript from wicket
 or using a decorator to write JavaScript is wrong. In fact quite often I
 may not know the id of an object until run-time and I may want the
 javascript to run on a specific textfield with no extra class names or
 additional tags marking it. To say that you need an extra .js file for a
 one-line or even 20 line simple js command is arguable I think.
 
 Hence we created the JsScope.quickScope(). However others, like Maarten,
 do not like this function as it allows people to write js code in a java
 class. There are more than 1 way to use WiQuery and everyone can use
 their favorite one.
 
That being said, if you know JavaScript or jQuery, probably WiQuery is
 not the most necessary, it is really an object oriented interface to
 jQuery, not much more as I recall.
 
 That and resource manager. That is all it needs to be, because otherwise
 it would be slow, large in jar size and unmaintainable. 
 
The best advantage to WiQuery I find is that JQuery at page ready can
 run numerous sets of commands All you need to do with WiQuery is add
 these commands and they are all grouped together and run in a single
 document ready function. Similarly WiQuery will take care of keeping
 track of what object id to run the script against, JavaScript files to
 import etc It does simplify things, but do you NEED another library,
 some people want to keep as few dependencies as possible, some don't
 care.
Remember the real engine is JQuery, WiQuery is just an interface to
 simplify. But look at writing javascript plainly in Wicket. If it is
 easy for you, probably don't bother, but if your getting a headache you
 might want to use WiQuery.
 
 Hooray for freedom of choice! :-)
 
My main fear is how often it may be updated and how long will it be
 around.
I have WiQuery in a current project I may take it out, I notice I
 mostly have been writing my own jQuery anyway.
 
 Since January we have released 4 new 1.2 versions in which we fixed a
 great deal of bugs and added new features, like the YUI compressor to
 compress resources when in production mode. We have started to work on a
 wicket 1.5 version and are nearing RC status.
 
 Hielke
 
 -
 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://apache-wicket.1842946.n4.nabble.com/Wiquery-experiences-tp3430320p3433900.html
Sent from the Users forum mailing list archive at Nabble.com.

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



wicket 1.5 AbstractDefaultAjaxBehavior bad url

2011-04-29 Thread msj121
I have noticed calling getCallbackUrl() on an AbstractDefaultAjaxBehavior
results in a url sometimes in:

./wicket/page?0-1.IBehaviorListener

and other parts of the same page have:

./wicket/page?1-2.IBehaviorListener


I think that the bad urls cause the page to reload when the attempt to call:

wicketAjaxGet('+click.getCallbackUrl()+x='+...+'y='+...+'');



For some reason having these ajax calls reloads the page in Wicket 1.5 but
not wicket 1.4. I am of course calling getCallbackUrl() after the behavior
is added to the page not sure what is wrong.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-AbstractDefaultAjaxBehavior-bad-url-tp3484600p3484600.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket 1.5 AbstractDefaultAjaxBehavior bad url

2011-05-01 Thread msj121
SOLVED:

After some debugging I noticed the following:

In the constructor the url generated is:
./wicket/page?54-0.IBehaviorListener.0

In onBeforeRender and onAfterRender the url is
./wicket/page?54-1.IBehaviorListener.0

I was pretty much getting the url as a string and passing it to WiQuery (ie:
another object). When the url is finally updated after the constructor (ie:
later in the request cycle) the string was obviously not altered though the
url was no longer good.

Furthermore, reloading the page doesn't always seem to call the constructor
leaving a further off url. Meaning the string stored was for a previous
version number so it might be 52-0 instead of the intended 53-1 etc


This may be obvious to someone who understood the url changes even after the
constructor of the page was called. I suppose it boggled me as this is only
an issue now in Wicket 1.5 somehow.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-AbstractDefaultAjaxBehavior-bad-url-tp3484600p3489362.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Loading wicket components from javascript

2011-07-17 Thread msj121
I am not sure if it is still true, but if you have the label added, just the
visibility is false from the beginning, then in older versions of wicket it
would not actually put the component, even the placeholder. I dealt with
this before, but I think in newer versions presumably this was changed
In theory a good way to check if this is an issue is to setvisible to true
in the beginning and alternate.


If your trying to add a new markup that never existed in html to the page,
it should throw an error, and then you will need to use ListViews etc... as
described above.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loading-wicket-components-from-javascript-tp3673381p3674372.html
Sent from the Users forum mailing list archive at Nabble.com.

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



wicket, hibernate, spring setup

2011-08-08 Thread msj121
I noticed there was a github setup here:
https://github.com/pflanzenmoerder/wicket-hibernate-archetype

And I added the repository and imported the project into my eclipse helios.
I can't seem to get the project to run, not sure how to finish setting up
the project.

Can anyone help?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-hibernate-spring-setup-tp3728444p3728444.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket, hibernate, spring setup

2011-08-09 Thread msj121
jWeekend no longer seems to have a wicket/hibernate/spring archetype.

SOLVED:
I had a lot of trouble using eclipse, but simply I did the following from
the command line:
mvn archertype:generate
and then went through the steps of choosing groupid etc


after all my attempts the archetype was in this list but not eclipse no
matter what I was doing. You may need to switch to the directory and run
mvn package install if you don't see it populated in the list.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-hibernate-spring-setup-tp3728444p3729072.html
Sent from the Users forum mailing list archive at Nabble.com.

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