ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael
Sure there a dozens of ways todo this, mine is just one of them. Im 
starting a new thread since it'll be more exposed then.


The idea is following:

Parent:

public class BasePage extends WebPage {

   protected final String LINK_LABEL_ID = linkText;
   protected final String LINK_ID = link;

   protected final String FOOTER_ID = item;
   protected final String HEADER_ID = item;

   protected ListWebMarkupContainer generalAccordionItem = new 
ArrayListWebMarkupContainer();


   protected ListWebMarkupContainer footer = new 
ArrayListWebMarkupContainer();
  
   protected ListWebMarkupContainer header = new 
ArrayListWebMarkupContainer();


   private AccordionPanel accordionPanel;

   /**
* Constructor that is invoked when page is invoked without a session.
*
* @param parameters
*Page parameters
*/
   public BasePage() {
   accordionPanel = new AccordionPanel(accordionMenu);
   add(accordionPanel);

   add(new ListView(footerContent, footer) {
   @Override
   protected void populateItem(ListItem item) {
   WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

   .getModelObject();
   item.add(webMarkupContainer);

   }
   });
   add(new ListView(headerContent, header) {
   @Override
   protected void populateItem(ListItem item) {
   WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

   .getModelObject();
   item.add(webMarkupContainer);

   }
   });

}
   protected void addMenu(AccordionPanelItem accordionPanelItem) {
   accordionPanel.addMenu(accordionPanelItem);
   };

   protected void addFooter(WebMarkupContainer webMarkupContainer) {
   footer.add(webMarkupContainer);
   };
   protected void addHeader(WebMarkupContainer webMarkupContainer) {
   header.add(webMarkupContainer);
   };

Subs/Children then calls the methods... Problem with this technique is 
that you need to use the right markup id's.. To make sure they are 
always set, and giving full control to the child/sub on what to add, I'd 
suggest that you create a BasePanel which encapsules the id, and then 
required that instead of a markupcontainer, that way subs/child only 
need to have panels that extend the basepanel...


But it depends on your needs, mine weren't that tricky..


regards Nino


Jonathan Locke wrote:

could you share this technique?  i think this might be a good idea.


Nino.Martinez wrote:
  
On the other hand, I've also done something with listviews.. Allowing 
sub pages adding markup items to menus etc Using the listviews as 
place holders...


Kaspar Fischer wrote:


Ah, 'course! Should have thought of it, that's an option they mention
in Wicket in Action.

However, Sebastiaan's solution can be reused in places where the markup
you have to change is not in head. -- Good to know.

On 04.03.2008, at 15:27, richardwilko wrote:

  
The way I do it is; dont specify a title in your base page then just 
add the

title in the subpage:

base page.html
html
!-- anything shared in all the pages eg a base.css file --
head
/head
body
   wicket:child/
/body
/html

subpage.html:

wicket:head
titlehard code or use wicket label to add this/title
/wicket:head
wicket:extend
  !-- anything ... --
/wicket:extend

subpage.java

Richard



hbf wrote:


I am using markup inheritance (wicket:child and wicket:extend)
and need to set the
page title from my subpage. I currently add a label in the base class
(BasePage.java)
and make it use an abstract method getTitle(), which is overridden in
the subclass
(SubPage.java). Has anybody found a better way?

Here's my solution:

!-- BasePage.html --
html
head
   title wicket:id=title[Page title]/title
/head
body
   wicket:child/
/body
/html

!-- SubPage.html --
wicket:extend
   !-- anything ... --
/wicket:extend


public abstract class BasePage extends WebPage
{
   // ...
   public BasePage(final PageParameters parameters)
   {
 add(new Label(title, new PropertyModel(this, title)));
   }
   public abstract String getTitle();
}

public class SubPage extends BasePage
{
   // ...
   public String getTitle()
   {
 return whatever title;
   }
}

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



  

--
View this message in context: 
http://www.nabble.com/Page-title-when-using-markup-inheritance-tp15827853p15828280.html 


Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: redirect to a new page on form error?

2008-03-05 Thread Maurice Marrink
You could add a Button to the form, use the button's onSubmit to do
the form processing instead of Form.onSubmit and tell the button to
turn of default form processing.
That way you can validate the form yourself in in case of a failure
set the response page.

Otoh you could also stay on the same page and use a feedbackpanel to
display the errors. Would be more user friendly imo since they
probably want to try again.

Maurice

On Wed, Mar 5, 2008 at 7:34 AM, Penn [EMAIL PROTECTED] wrote:


  Hello,

  i have use case, where on the home page i have login form, on form error
  like mismatched username or password, I need to redirect to new page and
  display the errors.

  Any thougths?

  'Penn
  --
  View this message in context: 
 http://www.nabble.com/redirect-to-a-new-page-on-form-error--tp15844162p15844162.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael

EEK!, I'll try once more to create a new thread!

Nino Saturnino Martinez Vazquez Wael wrote:
Sure there a dozens of ways todo this, mine is just one of them. Im 
starting a new thread since it'll be more exposed then.


The idea is following:

Parent:

public class BasePage extends WebPage {

   protected final String LINK_LABEL_ID = linkText;
   protected final String LINK_ID = link;

   protected final String FOOTER_ID = item;
   protected final String HEADER_ID = item;

   protected ListWebMarkupContainer generalAccordionItem = new 
ArrayListWebMarkupContainer();


   protected ListWebMarkupContainer footer = new 
ArrayListWebMarkupContainer();
 protected ListWebMarkupContainer header = new 
ArrayListWebMarkupContainer();


   private AccordionPanel accordionPanel;

   /**
* Constructor that is invoked when page is invoked without a session.
*
* @param parameters
*Page parameters
*/
   public BasePage() {
   accordionPanel = new AccordionPanel(accordionMenu);
   add(accordionPanel);

   add(new ListView(footerContent, footer) {
   @Override
   protected void populateItem(ListItem item) {
   WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

   .getModelObject();
   item.add(webMarkupContainer);

   }
   });
   add(new ListView(headerContent, header) {
   @Override
   protected void populateItem(ListItem item) {
   WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

   .getModelObject();
   item.add(webMarkupContainer);

   }
   });

}
   protected void addMenu(AccordionPanelItem accordionPanelItem) {
   accordionPanel.addMenu(accordionPanelItem);
   };

   protected void addFooter(WebMarkupContainer webMarkupContainer) {
   footer.add(webMarkupContainer);
   };
   protected void addHeader(WebMarkupContainer webMarkupContainer) {
   header.add(webMarkupContainer);
   };

Subs/Children then calls the methods... Problem with this technique is 
that you need to use the right markup id's.. To make sure they are 
always set, and giving full control to the child/sub on what to add, 
I'd suggest that you create a BasePanel which encapsules the id, and 
then required that instead of a markupcontainer, that way subs/child 
only need to have panels that extend the basepanel...


But it depends on your needs, mine weren't that tricky..


regards Nino


Jonathan Locke wrote:

could you share this technique?  i think this might be a good idea.


Nino.Martinez wrote:
 
On the other hand, I've also done something with listviews.. 
Allowing sub pages adding markup items to menus etc Using the 
listviews as place holders...


Kaspar Fischer wrote:
   

Ah, 'course! Should have thought of it, that's an option they mention
in Wicket in Action.

However, Sebastiaan's solution can be reused in places where the 
markup

you have to change is not in head. -- Good to know.

On 04.03.2008, at 15:27, richardwilko wrote:

 
The way I do it is; dont specify a title in your base page then 
just add the

title in the subpage:

base page.html
html
!-- anything shared in all the pages eg a base.css file --
head
/head
body
   wicket:child/
/body
/html

subpage.html:

wicket:head
titlehard code or use wicket label to add this/title
/wicket:head
wicket:extend
  !-- anything ... --
/wicket:extend

subpage.java

Richard



hbf wrote:
   

I am using markup inheritance (wicket:child and wicket:extend)
and need to set the
page title from my subpage. I currently add a label in the base 
class

(BasePage.java)
and make it use an abstract method getTitle(), which is 
overridden in

the subclass
(SubPage.java). Has anybody found a better way?

Here's my solution:

!-- BasePage.html --
html
head
   title wicket:id=title[Page title]/title
/head
body
   wicket:child/
/body
/html

!-- SubPage.html --
wicket:extend
   !-- anything ... --
/wicket:extend


public abstract class BasePage extends WebPage
{
   // ...
   public BasePage(final PageParameters parameters)
   {
 add(new Label(title, new PropertyModel(this, title)));
   }
   public abstract String getTitle();
}

public class SubPage extends BasePage
{
   // ...
   public String getTitle()
   {
 return whatever title;
   }
}

- 


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



  

--
View this message in context: 
http://www.nabble.com/Page-title-when-using-markup-inheritance-tp15827853p15828280.html 


Sent from the Wicket - User mailing list archive at Nabble.com.


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



-

ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael
Sure there a dozens of ways todo this, mine is just one of them. Im 
starting a new thread since it'll be more exposed then.


The idea is following:

Parent:

public class BasePage extends WebPage {

  protected final String LINK_LABEL_ID = linkText;
  protected final String LINK_ID = link;

  protected final String FOOTER_ID = item;
  protected final String HEADER_ID = item;

  protected ListWebMarkupContainer generalAccordionItem = new 
ArrayListWebMarkupContainer();


  protected ListWebMarkupContainer footer = new 
ArrayListWebMarkupContainer();
protected ListWebMarkupContainer header = new 
ArrayListWebMarkupContainer();


  private AccordionPanel accordionPanel;

  /**
   * Constructor that is invoked when page is invoked without a session.
   *
   * @param parameters
   *Page parameters
   */
  public BasePage() {
  accordionPanel = new AccordionPanel(accordionMenu);
  add(accordionPanel);

  add(new ListView(footerContent, footer) {
  @Override
  protected void populateItem(ListItem item) {
  WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

  .getModelObject();
  item.add(webMarkupContainer);

  }
  });
  add(new ListView(headerContent, header) {
  @Override
  protected void populateItem(ListItem item) {
  WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

  .getModelObject();
  item.add(webMarkupContainer);

  }
  });

}
  protected void addMenu(AccordionPanelItem accordionPanelItem) {
  accordionPanel.addMenu(accordionPanelItem);
  };

  protected void addFooter(WebMarkupContainer webMarkupContainer) {
  footer.add(webMarkupContainer);
  };
  protected void addHeader(WebMarkupContainer webMarkupContainer) {
  header.add(webMarkupContainer);
  };

Subs/Children then calls the methods... Problem with this technique is 
that you need to use the right markup id's.. To make sure they are 
always set, and giving full control to the child/sub on what to add, I'd 
suggest that you create a BasePanel which encapsules the id, and then 
required that instead of a markupcontainer, that way subs/child only 
need to have panels that extend the basepanel...


But it depends on your needs, mine weren't that tricky..


regards Nino

--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: captchas?

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael
Hmm, I actually also thought of doing clickable regions for images for 
wicket inputevents. I just might steal some of your stuff if it's okay, 
when you get around producing it..?


Jonathan Locke wrote:

i've been given permission to open source the kitten captcha i wrote for
thoof.  i don't have time right now, but hope to get to it before too long. 
to see it, you can submit a story on thoof.


   jon


Nino.Martinez wrote:
  

Hi

I know theres the captcha in wicket extensions.. But have anyone 
considered integrating something like this:


http://forge.octo.com/jcaptcha/confluence/display/general/Home

or

http://sourceforge.net/projects/simplecaptcha/

--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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






  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: captchas?

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael

Hehehe, very cool and different way of doing it:)

Jonathan Locke wrote:

i've been given permission to open source the kitten captcha i wrote for
thoof.  i don't have time right now, but hope to get to it before too long. 
to see it, you can submit a story on thoof.


   jon


Nino.Martinez wrote:
  

Hi

I know theres the captcha in wicket extensions.. But have anyone 
considered integrating something like this:


http://forge.octo.com/jcaptcha/confluence/display/general/Home

or

http://sourceforge.net/projects/simplecaptcha/

--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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






  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re:getPageParameters() NullPointer

2008-03-05 Thread zhangjunfeng21
 hello,i got the same problem.
 
   PageParameters params = new PageParameters();
   params.put(pid, pid);
   this.setResponsePage(FirstLogin.class,
 new PageParameters(params));
 
in FirstLogin.java ---
PageParameters params = new PageParameters();
System.out.print(pid= + params.getKey(pid));--the output is null;how to 
get the parameter?


在2008-01-22,Stephan Koch [EMAIL PROTECTED] 写道:

Hi all,

I'm experiencing a problem using getPageParameters().

The parameter id is passed to MyPage:
setResponsePage(MyPage.class, new PageParameters(id=+evalId));

In the constructor of MyPage I try to access the parameter id:
Integer evalId = Integer.parseInt(getPageParameters().getKey(id));

This fails with a NullPointerException. I thought the usage of
PageParameters was pretty straightforward- did I miss something here?

I'm using Wicket 1.3.

Regards,
Stephan




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



RE: getPageParameters() NullPointer

2008-03-05 Thread Maeder Thomas
Stephan, what you want is not PageParameters.getKey(id), but 
PageParameters.getInt(id);

@zhangjunfeng:

 PageParameters params = new PageParameters(); 
 System.out.print(pid= + params.getKey(pid));--the output is null

yes, the output is null, you just created a new, empty page parameters object. 
use Page.getPageParameters()

Thomas



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Mittwoch, 5. März 2008 10:31
 To: users@wicket.apache.org
 Subject: Re:getPageParameters() NullPointer
 
  hello,i got the same problem.
  
PageParameters params = new PageParameters();
params.put(pid, pid);
this.setResponsePage(FirstLogin.class,
  new PageParameters(params));
  
 in FirstLogin.java ---
 PageParameters params = new PageParameters(); 
 System.out.print(pid= + params.getKey(pid));--the 
 output is null;how to get the parameter?
 
 
 在2008-01-22,Stephan Koch [EMAIL PROTECTED] 写道:
 
 Hi all,
 
 I'm experiencing a problem using getPageParameters().
 
 The parameter id is passed to MyPage:
 setResponsePage(MyPage.class, new PageParameters(id=+evalId));
 
 In the constructor of MyPage I try to access the parameter id:
 Integer evalId = Integer.parseInt(getPageParameters().getKey(id));
 
 This fails with a NullPointerException. I thought the usage 
 of PageParameters was pretty straightforward- did I miss 
 something here?
 
 I'm using Wicket 1.3.
 
 Regards,
 Stephan
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread James Carman
On 3/5/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote:
 Sure there a dozens of ways todo this, mine is just one of them. Im
  starting a new thread since it'll be more exposed then.

  The idea is following:

  Parent:

  public class BasePage extends WebPage {

 protected final String LINK_LABEL_ID = linkText;
 protected final String LINK_ID = link;

 protected final String FOOTER_ID = item;
 protected final String HEADER_ID = item;

 protected ListWebMarkupContainer generalAccordionItem = new
  ArrayListWebMarkupContainer();

 protected ListWebMarkupContainer footer = new
  ArrayListWebMarkupContainer();

 protected ListWebMarkupContainer header = new
  ArrayListWebMarkupContainer();

 private AccordionPanel accordionPanel;

 /**
  * Constructor that is invoked when page is invoked without a session.
  *
  * @param parameters
  *Page parameters
  */
 public BasePage() {
 accordionPanel = new AccordionPanel(accordionMenu);
 add(accordionPanel);

 add(new ListView(footerContent, footer) {
 @Override
 protected void populateItem(ListItem item) {
 WebMarkupContainer webMarkupContainer =
  (WebMarkupContainer) item
 .getModelObject();
 item.add(webMarkupContainer);

 }
 });
 add(new ListView(headerContent, header) {
 @Override
 protected void populateItem(ListItem item) {
 WebMarkupContainer webMarkupContainer =
  (WebMarkupContainer) item
 .getModelObject();
 item.add(webMarkupContainer);

 }
 });

  }
 protected void addMenu(AccordionPanelItem accordionPanelItem) {
 accordionPanel.addMenu(accordionPanelItem);
 };

 protected void addFooter(WebMarkupContainer webMarkupContainer) {
 footer.add(webMarkupContainer);
 };
 protected void addHeader(WebMarkupContainer webMarkupContainer) {
 header.add(webMarkupContainer);
 };

  Subs/Children then calls the methods... Problem with this technique is
  that you need to use the right markup id's.. To make sure they are
  always set, and giving full control to the child/sub on what to add, I'd
  suggest that you create a BasePanel which encapsules the id, and then
  required that instead of a markupcontainer, that way subs/child only
  need to have panels that extend the basepanel...


Couldn't you use a VelocityPanel to generate your markup and have it
parse the markup after it's generated to avoid the whole need to use
the right markup ids part?  I was thinking about doing something like
this for generating dynamic editor forms (a la Trails) for objects,
since Wicket doesn't like you putting TextFields on spans (you must
use an input tag).  I was going to have a Velocity script that
decides what type of tag to spit out based on the type of component in
the list.

  But it depends on your needs, mine weren't that tricky..


  regards Nino


  Jonathan Locke wrote:
   could you share this technique?  i think this might be a good idea.
  
  
   Nino.Martinez wrote:
  
   On the other hand, I've also done something with listviews.. Allowing
   sub pages adding markup items to menus etc Using the listviews as
   place holders...
  
   Kaspar Fischer wrote:
  
   Ah, 'course! Should have thought of it, that's an option they mention
   in Wicket in Action.
  
   However, Sebastiaan's solution can be reused in places where the markup
   you have to change is not in head. -- Good to know.
  
   On 04.03.2008, at 15:27, richardwilko wrote:
  
  
   The way I do it is; dont specify a title in your base page then just
   add the
   title in the subpage:
  
   base page.html
   html
   !-- anything shared in all the pages eg a base.css file --
   head
   /head
   body
  wicket:child/
   /body
   /html
  
   subpage.html:
  
   wicket:head
   titlehard code or use wicket label to add this/title
   /wicket:head
   wicket:extend
 !-- anything ... --
   /wicket:extend
  
   subpage.java
  
   Richard
  
  
  
   hbf wrote:
  
   I am using markup inheritance (wicket:child and wicket:extend)
   and need to set the
   page title from my subpage. I currently add a label in the base class
   (BasePage.java)
   and make it use an abstract method getTitle(), which is overridden in
   the subclass
   (SubPage.java). Has anybody found a better way?
  
   Here's my solution:
  
   !-- BasePage.html --
   html
   head
  title wicket:id=title[Page title]/title
   /head
   body
  wicket:child/
   /body
   /html
  
   !-- SubPage.html --
   wicket:extend
  !-- anything ... --
   /wicket:extend
  
  
   public abstract class BasePage extends WebPage
   {
  // ...
  public BasePage(final PageParameters parameters)
  {
add(new Label(title, new PropertyModel(this, title)));
  }

to LoadDetach or not to LoadDetach?

2008-03-05 Thread Wojciech Biela
Hello

my next problem has to do with the LoadableDetachable models, do you
really use them for every object you get from Hibernate? My views will
be full of various informational panels, drop-downs and others that
are based on data from the DB (retrieved as objects by Hibernate).
So if I have to make every one of them LoadableDetachable that means
that every refresh will cause a whole series of new queries to the DB,
or do you rely on 2nd level cache here (like EHCache), but then if I
have an object that I do update (most of them I use read-only) then I
loose the changes between requests because it is being detached

I agree to use them when the objects are noticeably big or not
serializable for some reason, but what about all the other cases, is
the fact that they come from Hibernate enough to just make a rule -
all hibernate object must be served to components as
LoadableDetachable models?

one thing I thought of is for some cases just to evict the objects
from the Hibernate session (the Dao would do that if asked for)

how do you approach this subject?

-- 
Wojtek Biela

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



Re: to LoadDetach or not to LoadDetach?

2008-03-05 Thread James Carman
On 3/5/08, Wojciech Biela [EMAIL PROTECTED] wrote:
 Hello

  my next problem has to do with the LoadableDetachable models, do you
  really use them for every object you get from Hibernate? My views will
  be full of various informational panels, drop-downs and others that
  are based on data from the DB (retrieved as objects by Hibernate).
  So if I have to make every one of them LoadableDetachable that means
  that every refresh will cause a whole series of new queries to the DB,
  or do you rely on 2nd level cache here (like EHCache), but then if I
  have an object that I do update (most of them I use read-only) then I
  loose the changes between requests because it is being detached

  I agree to use them when the objects are noticeably big or not
  serializable for some reason, but what about all the other cases, is
  the fact that they come from Hibernate enough to just make a rule -
  all hibernate object must be served to components as
  LoadableDetachable models?

  one thing I thought of is for some cases just to evict the objects
  from the Hibernate session (the Dao would do that if asked for)

  how do you approach this subject?



You also have to consider what you want to do when you're using
versioned objects.  If you just go get the latest object from the
database every time, then you'll never run into the version mismatch
and you won't know if one user is blowing away edits done by another
user.  In this case, you need to keep the original object around
somewhere.

  --
  Wojtek Biela

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



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



Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael



James Carman wrote:

On 3/5/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote:
  

Sure there a dozens of ways todo this, mine is just one of them. Im
 starting a new thread since it'll be more exposed then.

 The idea is following:

 Parent:

 public class BasePage extends WebPage {

protected final String LINK_LABEL_ID = linkText;
protected final String LINK_ID = link;

protected final String FOOTER_ID = item;
protected final String HEADER_ID = item;

protected ListWebMarkupContainer generalAccordionItem = new
 ArrayListWebMarkupContainer();

protected ListWebMarkupContainer footer = new
 ArrayListWebMarkupContainer();

protected ListWebMarkupContainer header = new
 ArrayListWebMarkupContainer();

private AccordionPanel accordionPanel;

/**
 * Constructor that is invoked when page is invoked without a session.
 *
 * @param parameters
 *Page parameters
 */
public BasePage() {
accordionPanel = new AccordionPanel(accordionMenu);
add(accordionPanel);

add(new ListView(footerContent, footer) {
@Override
protected void populateItem(ListItem item) {
WebMarkupContainer webMarkupContainer =
 (WebMarkupContainer) item
.getModelObject();
item.add(webMarkupContainer);

}
});
add(new ListView(headerContent, header) {
@Override
protected void populateItem(ListItem item) {
WebMarkupContainer webMarkupContainer =
 (WebMarkupContainer) item
.getModelObject();
item.add(webMarkupContainer);

}
});

 }
protected void addMenu(AccordionPanelItem accordionPanelItem) {
accordionPanel.addMenu(accordionPanelItem);
};

protected void addFooter(WebMarkupContainer webMarkupContainer) {
footer.add(webMarkupContainer);
};
protected void addHeader(WebMarkupContainer webMarkupContainer) {
header.add(webMarkupContainer);
};

 Subs/Children then calls the methods... Problem with this technique is
 that you need to use the right markup id's.. To make sure they are
 always set, and giving full control to the child/sub on what to add, I'd
 suggest that you create a BasePanel which encapsules the id, and then
 required that instead of a markupcontainer, that way subs/child only
 need to have panels that extend the basepanel...




Couldn't you use a VelocityPanel to generate your markup and have it
parse the markup after it's generated to avoid the whole need to use
the right markup ids part?  I was thinking about doing something like
this for generating dynamic editor forms (a la Trails) for objects,
since Wicket doesn't like you putting TextFields on spans (you must
use an input tag).  I was going to have a Velocity script that
decides what type of tag to spit out based on the type of component in
the list.

  

i'll reply in the other thread...

 But it depends on your needs, mine weren't that tricky..


 regards Nino


 Jonathan Locke wrote:
  could you share this technique?  i think this might be a good idea.
 
 
  Nino.Martinez wrote:
 
  On the other hand, I've also done something with listviews.. Allowing
  sub pages adding markup items to menus etc Using the listviews as
  place holders...
 
  Kaspar Fischer wrote:
 
  Ah, 'course! Should have thought of it, that's an option they mention
  in Wicket in Action.
 
  However, Sebastiaan's solution can be reused in places where the markup
  you have to change is not in head. -- Good to know.
 
  On 04.03.2008, at 15:27, richardwilko wrote:
 
 
  The way I do it is; dont specify a title in your base page then just
  add the
  title in the subpage:
 
  base page.html
  html
  !-- anything shared in all the pages eg a base.css file --
  head
  /head
  body
 wicket:child/
  /body
  /html
 
  subpage.html:
 
  wicket:head
  titlehard code or use wicket label to add this/title
  /wicket:head
  wicket:extend
!-- anything ... --
  /wicket:extend
 
  subpage.java
 
  Richard
 
 
 
  hbf wrote:
 
  I am using markup inheritance (wicket:child and wicket:extend)
  and need to set the
  page title from my subpage. I currently add a label in the base class
  (BasePage.java)
  and make it use an abstract method getTitle(), which is overridden in
  the subclass
  (SubPage.java). Has anybody found a better way?
 
  Here's my solution:
 
  !-- BasePage.html --
  html
  head
 title wicket:id=title[Page title]/title
  /head
  body
 wicket:child/
  /body
  /html
 
  !-- SubPage.html --
  wicket:extend
 !-- anything ... --
  /wicket:extend
 
 
  public abstract class BasePage extends WebPage
  {
 // ...
 public BasePage(final PageParameters parameters)
 {
   add(new Label(title, new PropertyModel(this, title)));
 }
 public abstract String getTitle();
  }
 
  public class SubPage extends 

Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael

Answer below:

   James Carman Wrote:

   Couldn't you use a VelocityPanel to generate your markup and have it
   parse the markup after it's generated to avoid the whole need to use
   the right markup ids part? I was thinking about doing something like
   this for generating dynamic editor forms (a la Trails) for objects,
   since Wicket doesn't like you putting TextFields on spans (you must
   use an input tag). I was going to have a Velocity script that
   decides what type of tag to spit out based on the type of component in
   the list.

What I found simple, which I perhaps did not explain clearly.. Where to only 
accept basePanels in forexample addMenu method, that way a base panel would 
look something like this:



public class BasePanelItem extends Panel {

public final static String ITEM_ID = item;

public AccordionPanelItem() {
super(ITEM_ID);
}

Now we have the id fixed...

Then the user only need add what ever user wants when user extends 
basePanelItem.. So this solves that too... And the problem with 
attaching to wrong tags are solved too... There might be some overhead 
because each time you want todo something special you need to create a 
panel, but I think it's worth it..


PS, youve seen the web beans project right? 
http://wicketwebbeans.sourceforge.net/




regards Nino


Nino Saturnino Martinez Vazquez Wael wrote:
Sure there a dozens of ways todo this, mine is just one of them. Im 
starting a new thread since it'll be more exposed then.


The idea is following:

Parent:

public class BasePage extends WebPage {

  protected final String LINK_LABEL_ID = linkText;
  protected final String LINK_ID = link;

  protected final String FOOTER_ID = item;
  protected final String HEADER_ID = item;

  protected ListWebMarkupContainer generalAccordionItem = new 
ArrayListWebMarkupContainer();


  protected ListWebMarkupContainer footer = new 
ArrayListWebMarkupContainer();
protected ListWebMarkupContainer header = new 
ArrayListWebMarkupContainer();


  private AccordionPanel accordionPanel;

  /**
   * Constructor that is invoked when page is invoked without a session.
   *
   * @param parameters
   *Page parameters
   */
  public BasePage() {
  accordionPanel = new AccordionPanel(accordionMenu);
  add(accordionPanel);

  add(new ListView(footerContent, footer) {
  @Override
  protected void populateItem(ListItem item) {
  WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

  .getModelObject();
  item.add(webMarkupContainer);

  }
  });
  add(new ListView(headerContent, header) {
  @Override
  protected void populateItem(ListItem item) {
  WebMarkupContainer webMarkupContainer = 
(WebMarkupContainer) item

  .getModelObject();
  item.add(webMarkupContainer);

  }
  });

}
  protected void addMenu(AccordionPanelItem accordionPanelItem) {
  accordionPanel.addMenu(accordionPanelItem);
  };

  protected void addFooter(WebMarkupContainer webMarkupContainer) {
  footer.add(webMarkupContainer);
  };
  protected void addHeader(WebMarkupContainer webMarkupContainer) {
  header.add(webMarkupContainer);
  };

Subs/Children then calls the methods... Problem with this technique is 
that you need to use the right markup id's.. To make sure they are 
always set, and giving full control to the child/sub on what to add, 
I'd suggest that you create a BasePanel which encapsules the id, and 
then required that instead of a markupcontainer, that way subs/child 
only need to have panels that extend the basepanel...


But it depends on your needs, mine weren't that tricky..


regards Nino



--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread James Carman
On 3/5/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote:
 Answer below:


 James Carman Wrote:

 Couldn't you use a VelocityPanel to generate your markup and have it
 parse the markup after it's generated to avoid the whole need to use
 the right markup ids part? I was thinking about doing something like
 this for generating dynamic editor forms (a la Trails) for objects,
 since Wicket doesn't like you putting TextFields on spans (you must
 use an input tag). I was going to have a Velocity script that
 decides what type of tag to spit out based on the type of component in
 the list.


 What I found simple, which I perhaps did not explain clearly.. Where to only 
 accept basePanels in forexample addMenu method, that way a base panel would 
 look something like this:



  public class BasePanelItem extends Panel {

 public final static String ITEM_ID = item;

 public AccordionPanelItem() {
 super(ITEM_ID);
 }

  Now we have the id fixed...

  Then the user only need add what ever user wants when user extends
  basePanelItem.. So this solves that too... And the problem with
  attaching to wrong tags are solved too... There might be some overhead
  because each time you want todo something special you need to create a
  panel, but I think it's worth it..

  PS, youve seen the web beans project right?
  http://wicketwebbeans.sourceforge.net/


Yes, I've seen WWB.  But, I'm a roll your own kind of guy.
Actually, I'm going through this experiment to help me learn Wicket.
I was part of the Trails team and I was wondering how we'd do the same
thing in Wicket.



  regards Nino



  Nino Saturnino Martinez Vazquez Wael wrote:
   Sure there a dozens of ways todo this, mine is just one of them. Im
   starting a new thread since it'll be more exposed then.
  
   The idea is following:
  
   Parent:
  
   public class BasePage extends WebPage {
  
 protected final String LINK_LABEL_ID = linkText;
 protected final String LINK_ID = link;
  
 protected final String FOOTER_ID = item;
 protected final String HEADER_ID = item;
  
 protected ListWebMarkupContainer generalAccordionItem = new
   ArrayListWebMarkupContainer();
  
 protected ListWebMarkupContainer footer = new
   ArrayListWebMarkupContainer();
   protected ListWebMarkupContainer header = new
   ArrayListWebMarkupContainer();
  
 private AccordionPanel accordionPanel;
  
 /**
  * Constructor that is invoked when page is invoked without a session.
  *
  * @param parameters
  *Page parameters
  */
 public BasePage() {
 accordionPanel = new AccordionPanel(accordionMenu);
 add(accordionPanel);
  
 add(new ListView(footerContent, footer) {
 @Override
 protected void populateItem(ListItem item) {
 WebMarkupContainer webMarkupContainer =
   (WebMarkupContainer) item
 .getModelObject();
 item.add(webMarkupContainer);
  
 }
 });
 add(new ListView(headerContent, header) {
 @Override
 protected void populateItem(ListItem item) {
 WebMarkupContainer webMarkupContainer =
   (WebMarkupContainer) item
 .getModelObject();
 item.add(webMarkupContainer);
  
 }
 });
  
   }
 protected void addMenu(AccordionPanelItem accordionPanelItem) {
 accordionPanel.addMenu(accordionPanelItem);
 };
  
 protected void addFooter(WebMarkupContainer webMarkupContainer) {
 footer.add(webMarkupContainer);
 };
 protected void addHeader(WebMarkupContainer webMarkupContainer) {
 header.add(webMarkupContainer);
 };
  
   Subs/Children then calls the methods... Problem with this technique is
   that you need to use the right markup id's.. To make sure they are
   always set, and giving full control to the child/sub on what to add,
   I'd suggest that you create a BasePanel which encapsules the id, and
   then required that instead of a markupcontainer, that way subs/child
   only need to have panels that extend the basepanel...
  
   But it depends on your needs, mine weren't that tricky..
  
  
   regards Nino
  

  --
  -Wicket for love
  -Jme for fun

  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684


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



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



Re: Url Coding Strategy for choosing Locale by URL Sub Directory

2008-03-05 Thread Charlie Dobbie
Hi Wicket-User,

I have a similar situation - I'm tasked to build a site that appears
to have multiple directories but that actually use the same set of
pages.  So for example:

http://mysite.com/clientname/Login
http://mysite.com/clientname/Register
http://mysite.com/clientname/OtherBookmarkablePath

The first part of the path will be used to show a different
look-and-feel - depending on the clientname you'll get different
logos, text styles etc.  (I can't make these different sites with
alternative CSS or with variant pages, as they need to be created and
customized on the fly through an admin section.)

I'm not sure where to start looking, or what approach to take.  Should
that first path element be ultimately exposed on the Page as a
PageParameter?  Does this play havoc with getHomePage - how can I
return a particular user's home page?  Does the URL interpretation
occur in the WebRequestCodingStrategy?  (I'm stepping through a
request at the moment, but haven't located where this particular magic
happens yet!)

(It would be great to just store the look and feel on the user's
account, but I'm told that login and registration pages must also be
branded.)

Charlie.



On Mon, Mar 3, 2008 at 1:10 PM, oliverw [EMAIL PROTECTED] wrote:

  I would like to allow the users of my site to choose which language the site
  and the content is presented in by kind of prefixing the actual URL with a
  virtual subfolder specifying the language. Example:

  Let's mount a page:
  mount(new IndexedHybridUrlCodingStrategy(/foobar, FooPage.class));

  And assume the following user access urls:
  http://domain.com/foobar   - results in page foobar presented in english
  http://domain.com/de/foobar   - results in page foobar presented in german
  http://domain.com/fr/foobar   - results in page foobar presented in french

  What I would like to know if:

  a) It is possible to implement this without mounting /foobar multiple times
  for all possible location (I think in order to get this to work I would have
  to overrride WebRequestCodingStrategy.strategyForPath where simply all
  mountpoints get iterated and checked for the target URL with
  parth.startswith(key)

  b) Where to start? I debugged through most of the request cycle code but I'm
  still not sure what's the best place to hook into.

  Any hint would be appreciated.

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



Re: ways of doing markup Inheritance [WAS Re: Page title when using markup inheritance]

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael



James Carman wrote:

On 3/5/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote:
  

Answer below:


James Carman Wrote:

Couldn't you use a VelocityPanel to generate your markup and have it
parse the markup after it's generated to avoid the whole need to use
the right markup ids part? I was thinking about doing something like
this for generating dynamic editor forms (a la Trails) for objects,
since Wicket doesn't like you putting TextFields on spans (you must
use an input tag). I was going to have a Velocity script that
decides what type of tag to spit out based on the type of component in
the list.


What I found simple, which I perhaps did not explain clearly.. Where to only 
accept basePanels in forexample addMenu method, that way a base panel would 
look something like this:



 public class BasePanelItem extends Panel {

public final static String ITEM_ID = item;

public AccordionPanelItem() {
super(ITEM_ID);
}

 Now we have the id fixed...

 Then the user only need add what ever user wants when user extends
 basePanelItem.. So this solves that too... And the problem with
 attaching to wrong tags are solved too... There might be some overhead
 because each time you want todo something special you need to create a
 panel, but I think it's worth it..



What did you think of this approach?

 PS, youve seen the web beans project right?
 http://wicketwebbeans.sourceforge.net/




Yes, I've seen WWB.  But, I'm a roll your own kind of guy.
Actually, I'm going through this experiment to help me learn Wicket.
I was part of the Trails team and I was wondering how we'd do the same
thing in Wicket.

  

 regards Nino



 Nino Saturnino Martinez Vazquez Wael wrote:
  Sure there a dozens of ways todo this, mine is just one of them. Im
  starting a new thread since it'll be more exposed then.
 
  The idea is following:
 
  Parent:
 
  public class BasePage extends WebPage {
 
protected final String LINK_LABEL_ID = linkText;
protected final String LINK_ID = link;
 
protected final String FOOTER_ID = item;
protected final String HEADER_ID = item;
 
protected ListWebMarkupContainer generalAccordionItem = new
  ArrayListWebMarkupContainer();
 
protected ListWebMarkupContainer footer = new
  ArrayListWebMarkupContainer();
  protected ListWebMarkupContainer header = new
  ArrayListWebMarkupContainer();
 
private AccordionPanel accordionPanel;
 
/**
 * Constructor that is invoked when page is invoked without a session.
 *
 * @param parameters
 *Page parameters
 */
public BasePage() {
accordionPanel = new AccordionPanel(accordionMenu);
add(accordionPanel);
 
add(new ListView(footerContent, footer) {
@Override
protected void populateItem(ListItem item) {
WebMarkupContainer webMarkupContainer =
  (WebMarkupContainer) item
.getModelObject();
item.add(webMarkupContainer);
 
}
});
add(new ListView(headerContent, header) {
@Override
protected void populateItem(ListItem item) {
WebMarkupContainer webMarkupContainer =
  (WebMarkupContainer) item
.getModelObject();
item.add(webMarkupContainer);
 
}
});
 
  }
protected void addMenu(AccordionPanelItem accordionPanelItem) {
accordionPanel.addMenu(accordionPanelItem);
};
 
protected void addFooter(WebMarkupContainer webMarkupContainer) {
footer.add(webMarkupContainer);
};
protected void addHeader(WebMarkupContainer webMarkupContainer) {
header.add(webMarkupContainer);
};
 
  Subs/Children then calls the methods... Problem with this technique is
  that you need to use the right markup id's.. To make sure they are
  always set, and giving full control to the child/sub on what to add,
  I'd suggest that you create a BasePanel which encapsules the id, and
  then required that instead of a markupcontainer, that way subs/child
  only need to have panels that extend the basepanel...
 
  But it depends on your needs, mine weren't that tricky..
 
 
  regards Nino
 

 --
 -Wicket for love
 -Jme for fun

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


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





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


  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL 

Re: to LoadDetach or not to LoadDetach?

2008-03-05 Thread Maurice Marrink
  You also have to consider what you want to do when you're using
  versioned objects.  If you just go get the latest object from the
  database every time, then you'll never run into the version mismatch
  and you won't know if one user is blowing away edits done by another
  user.  In this case, you need to keep the original object around
  somewhere.
Or just the version,
You can easily modify Form to hold on to the version of the hibernate
object and compare that with the version of the object fresh from the
model.

Another problem with LDM is when you have a new object (not yet
persisted to the db) and you have to carry the changes across multiple
requests before you can persist it. if you attach persisted objects to
it you run the risk of lazyinit exceptions.

We hardly ever use LDM for lists of hibernate objects because of the
query overhead, instead we use an IDataProvider that will get
everything in 1 query.
For where we use one hibernate object we have or custom hibernate
model that detaches persisted objects to minimize session mem and
prevent lazyinit. Ofcourse this works best for simple read/write
operations for the more complex situations as described above we have
yet another model that tries to solve the problem of transient and
persisted objects mixed together, detaching as much as possible.

Maurice

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



Upload file

2008-03-05 Thread Pierre Gilquin
I try to modify the upload example 
(http://www.wicket-library.com/wicket-examples/upload/single)  for my own need.
I would like to be able to upload the file in a directory under my context (ie. 
tomcat_install/webapps/MyApp/DownloadedFiles) and generate the corresponding 
internet url for the files (ie. 
http://localhost:8080/MyApp/DownloadedFiles/file1)

How can I get the local and internet paths from my appli. ?

Thanks in advance


Pierre

Re: Upload file

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael
Theres file in utils package.. Producing a  url for that  could be  
mounting a  resource and  using the urlfor...


Pierre Gilquin wrote:

I try to modify the upload example 
(http://www.wicket-library.com/wicket-examples/upload/single)  for my own need.
I would like to be able to upload the file in a directory under my context (ie. 
tomcat_install/webapps/MyApp/DownloadedFiles) and generate the corresponding 
internet url for the files (ie. 
http://localhost:8080/MyApp/DownloadedFiles/file1)

How can I get the local and internet paths from my appli. ?

Thanks in advance


Pierre
  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



ajaxified dynamic lists as parts of bigger forms

2008-03-05 Thread Wojciech Biela
Hello

This time my question is not so general.

We have a big form, part of this form there is a component which
should be a dynamic list of fields like this:

|TextField| - remove
|TextField| - remove
|TextField| - remove
|TextField| - add

if you click add another row |TextField| - remove should appear at
the bottom, it you should click remove then this row should be
removed

problem we have is that the add and remove link does not send the
form, it only sends and ajax request to add an element to the list of
components and it operates (target) on a DIV that wraps the whole
list, so afterwards it renders the list again loosing values that were
already put in

what is the preferred method to do such a thing? should the add and
remove link be a submit link with defaultFormProcessing set to false?
or maybe should we try to save values to model objects onchange in the
respective fields themselves

isn't there a way to do it in a neat fashion?

code responsible for the list component is

wrapper = new WebMarkupContainer(attributes-wrapper);
listView = new ListView(attributes, attributeValuesList) {
  public void populateItem(final ListItem listItem) {
final AttributeValue attributeValue = (AttributeValue)
listItem.getModelObject();
Renderer inputRenderer =
attributeValue.getAttribute().getInputRenderer();
Component component = inputRenderer.getComponent(attributeValue);
listItem.add(component);
AjaxLink addLink = new AddLink(add-link);
AjaxLink removeLink = new RemoveLink(remove-link, listItem);
if (listItem.getIndex()  (listView.getViewSize() - 1)) {
  addLink.setVisible(false);
} else {
  removeLink.setVisible(false);
}
listItem.add(addLink);
listItem.add(removeLink);
  }
};
wrapper.setOutputMarkupId(true);

HTML is

div wicket:id=attributes-wrapper class=composit-wrapper
div wicket:id=attributes class=composit
div wicket:id=attributeAndValue 
class=composit-item/div
div class=composit-links
a wicket:id=add-link+ add/a
a wicket:id=remove-link- remove/a
/div
/div
/div

-- 
Wojtek Biela

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



Re: CSS and Javascript Problems

2008-03-05 Thread Andy Czerwonka
currently my code is in src/main/java and my css, images and scripts 
are all in src/main/resources/css, src/main/resources/images and 
src/main/resources/script respectively.  The maven build put all the 
resources at the root, which is of course the issue.  What's standard 
practice for wicket applications to follow?


On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:


http://cwiki.apache.org/WICKET/javascript-and-css-support.html

This page does not talk about how this is done in 1.3.1 and I'm having 
trouble getting the HTML pages to find my CSS and Javascript.  Can 
someone point me in the right direction please?






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



Re: ajaxified dynamic lists as parts of bigger forms

2008-03-05 Thread Maurice Marrink
We usually follow this approach
-load initial list
-clone initial list for working copy
-if the list is likely to be altered often or by multiple persons
store a flag for each item indicating if it was removed or added
-have wicket modify the working copy (and or the flags)
-in the onsubmit load a fresh list from the db, if you have flags use
that to delete / add items. if you do not have flags your working copy
is how the list should end up, so clear list and insert all items from
working copy.

Maurice

On Wed, Mar 5, 2008 at 3:13 PM, Wojciech Biela [EMAIL PROTECTED] wrote:
 I don't know if the code will help, if it doesn't please just
  disregard it and answer my question

  regards
  Wojtek

  2008/3/5, Wojciech Biela [EMAIL PROTECTED]:


  Hello
  
This time my question is not so general.
  
We have a big form, part of this form there is a component which
should be a dynamic list of fields like this:
  
|TextField| - remove
|TextField| - remove
|TextField| - remove
|TextField| - add
  
if you click add another row |TextField| - remove should appear at
the bottom, it you should click remove then this row should be
removed
  
problem we have is that the add and remove link does not send the
form, it only sends and ajax request to add an element to the list of
components and it operates (target) on a DIV that wraps the whole
list, so afterwards it renders the list again loosing values that were
already put in
  
what is the preferred method to do such a thing? should the add and
remove link be a submit link with defaultFormProcessing set to false?
or maybe should we try to save values to model objects onchange in the
respective fields themselves
  
isn't there a way to do it in a neat fashion?
  
code responsible for the list component is
  
   wrapper = new WebMarkupContainer(attributes-wrapper);
   listView = new ListView(attributes, attributeValuesList) {
 public void populateItem(final ListItem listItem) {
   final AttributeValue attributeValue = (AttributeValue)
listItem.getModelObject();
   Renderer inputRenderer =
attributeValue.getAttribute().getInputRenderer();
   Component component = inputRenderer.getComponent(attributeValue);
   listItem.add(component);
   AjaxLink addLink = new AddLink(add-link);
   AjaxLink removeLink = new RemoveLink(remove-link, listItem);
   if (listItem.getIndex()  (listView.getViewSize() - 1)) {
 addLink.setVisible(false);
   } else {
 removeLink.setVisible(false);
   }
   listItem.add(addLink);
   listItem.add(removeLink);
 }
   };
   wrapper.setOutputMarkupId(true);
  
HTML is
  
   div wicket:id=attributes-wrapper class=composit-wrapper
   div wicket:id=attributes class=composit
   div wicket:id=attributeAndValue 
 class=composit-item/div
   div class=composit-links
   a wicket:id=add-link+ add/a
   a wicket:id=remove-link- remove/a
   /div
   /div
   /div
  
  
--
Wojtek Biela
  


  --
  Wojtek Biela

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



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



Re: CSS and Javascript Problems

2008-03-05 Thread Andy Czerwonka
oh ya... and all the css and javascript is static, meaning that it 
doesn't have to be referenced in code, but either way


On 2008-03-05 07:36:43 -0700, Andy Czerwonka [EMAIL PROTECTED] said:

currently my code is in src/main/java and my css, images and scripts 
are all in src/main/resources/css, src/main/resources/images and 
src/main/resources/script respectively.  The maven build put all the 
resources at the root, which is of course the issue.  What's standard 
practice for wicket applications to follow?


On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:


http://cwiki.apache.org/WICKET/javascript-and-css-support.html

This page does not talk about how this is done in 1.3.1 and I'm having 
trouble getting the HTML pages to find my CSS and Javascript.  Can 
someone point me in the right direction please?








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



Re: CSS and Javascript Problems

2008-03-05 Thread Maurice Marrink
We too, have images / css in a folder located at the root of the
webapp, this works just fine as long as you only reference them in
your html, it gets a bit trickier if you try to use the Image
component. So we don't use it (much) ;)
The html is however located besides the java just like wicket prefers.

Maurice

On Wed, Mar 5, 2008 at 3:36 PM, Andy Czerwonka
[EMAIL PROTECTED] wrote:
 currently my code is in src/main/java and my css, images and scripts
  are all in src/main/resources/css, src/main/resources/images and
  src/main/resources/script respectively.  The maven build put all the
  resources at the root, which is of course the issue.  What's standard
  practice for wicket applications to follow?



  On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:

   http://cwiki.apache.org/WICKET/javascript-and-css-support.html
  
   This page does not talk about how this is done in 1.3.1 and I'm having
   trouble getting the HTML pages to find my CSS and Javascript.  Can
   someone point me in the right direction please?
  



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



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



RE: Re: CSS and Javascript Problems

2008-03-05 Thread Hoover, William
According to the 
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
 they should reside in src/main/webapp

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Andy Czerwonka
Sent: Wednesday, March 05, 2008 9:43 AM
To: users@wicket.apache.org
Subject: Re: CSS and Javascript Problems


oh ya... and all the css and javascript is static, meaning that it 
doesn't have to be referenced in code, but either way

On 2008-03-05 07:36:43 -0700, Andy Czerwonka [EMAIL PROTECTED] said:

 currently my code is in src/main/java and my css, images and scripts 
 are all in src/main/resources/css, src/main/resources/images and 
 src/main/resources/script respectively.  The maven build put all the 
 resources at the root, which is of course the issue.  What's standard 
 practice for wicket applications to follow?
 
 On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:
 
 http://cwiki.apache.org/WICKET/javascript-and-css-support.html
 
 This page does not talk about how this is done in 1.3.1 and I'm having 
 trouble getting the HTML pages to find my CSS and Javascript.  Can 
 someone point me in the right direction please?
 
 



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



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



Re: Re: CSS and Javascript Problems

2008-03-05 Thread Maurice Marrink
True,
Fortunately the war plugin allows for a warSourceDirectory config
property http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

It is customary in our company to have a src/webapp dir where most of
the images/ css/ web.xml etc are located.

Maurice

On Wed, Mar 5, 2008 at 3:50 PM, Hoover, William [EMAIL PROTECTED] wrote:
 According to the 
 http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
  they should reside in src/main/webapp



  -Original Message-
  From: news [mailto:[EMAIL PROTECTED] Behalf Of Andy Czerwonka
  Sent: Wednesday, March 05, 2008 9:43 AM
  To: users@wicket.apache.org
  Subject: Re: CSS and Javascript Problems


  oh ya... and all the css and javascript is static, meaning that it
  doesn't have to be referenced in code, but either way

  On 2008-03-05 07:36:43 -0700, Andy Czerwonka [EMAIL PROTECTED] said:

   currently my code is in src/main/java and my css, images and scripts
   are all in src/main/resources/css, src/main/resources/images and
   src/main/resources/script respectively.  The maven build put all the
   resources at the root, which is of course the issue.  What's standard
   practice for wicket applications to follow?
  
   On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:
  
   http://cwiki.apache.org/WICKET/javascript-and-css-support.html
  
   This page does not talk about how this is done in 1.3.1 and I'm having
   trouble getting the HTML pages to find my CSS and Javascript.  Can
   someone point me in the right direction please?
  
  



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



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



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



Guide for html designers

2008-03-05 Thread Alex Jacoby
I searched the wiki and the list archives, but I haven't found any  
sort of wicket reference appropriate for a web designer who doesn't  
speak Java.  The list of xhtml tags in the wiki is the closest, but  
it's definitely written more for the programmers.


Am I missing something?  If not, I'll contribute the guide I write to  
the wiki.


Thanks,
Alex

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



Re: Upload file

2008-03-05 Thread Pierre G

Thanks Nino,

Sorry, I dont understand. Please be more detailed.
I try to use Folder from util.file package
uploadFolder = new Folder(?, DownloadedFiles);
then can I use the folder as resource ? how ?

I still dont have any idea how to have my uploadFolder in the context 


Nino.Martinez wrote:
 
 Theres file in utils package.. Producing a  url for that  could be  
 mounting a  resource and  using the urlfor...
 
 Pierre Gilquin wrote:
 I try to modify the upload example
 (http://www.wicket-library.com/wicket-examples/upload/single)  for my own
 need.
 I would like to be able to upload the file in a directory under my
 context (ie. tomcat_install/webapps/MyApp/DownloadedFiles) and generate
 the corresponding internet url for the files (ie.
 http://localhost:8080/MyApp/DownloadedFiles/file1)

 How can I get the local and internet paths from my appli. ?

 Thanks in advance


 Pierre
   
 
 -- 
 -Wicket for love
 -Jme for fun
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Upload-file-tp15849850p15852279.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: ajaxified dynamic lists as parts of bigger forms

2008-03-05 Thread Wojciech Biela
Thank you for our opinion Maurice,

problem is that what you're telling me is not exactly my problem
(although it will be further on, so thank you anyway)

as I see I have to submit the whole form in order to retain (not yet
save do DB!) those values from this particular dynamic list component,
I update (by setting the ajax target) only this one component but yet
the whole form must be submitted and it's a big form, what if it
contains fileuploads and stuff that is not needed for this ajax
component, that would be an overkill

or am I missing something?

regards
Wojtek

2008/3/5, Maurice Marrink [EMAIL PROTECTED]:
 We usually follow this approach
  -load initial list
  -clone initial list for working copy
  -if the list is likely to be altered often or by multiple persons
  store a flag for each item indicating if it was removed or added
  -have wicket modify the working copy (and or the flags)
  -in the onsubmit load a fresh list from the db, if you have flags use
  that to delete / add items. if you do not have flags your working copy
  is how the list should end up, so clear list and insert all items from
  working copy.

  Maurice


  On Wed, Mar 5, 2008 at 3:13 PM, Wojciech Biela [EMAIL PROTECTED] wrote:
   I don't know if the code will help, if it doesn't please just
disregard it and answer my question
  
regards
Wojtek
  
2008/3/5, Wojciech Biela [EMAIL PROTECTED]:
  
  
Hello

  This time my question is not so general.

  We have a big form, part of this form there is a component which
  should be a dynamic list of fields like this:

  |TextField| - remove
  |TextField| - remove
  |TextField| - remove
  |TextField| - add

  if you click add another row |TextField| - remove should appear at
  the bottom, it you should click remove then this row should be
  removed

  problem we have is that the add and remove link does not send the
  form, it only sends and ajax request to add an element to the list of
  components and it operates (target) on a DIV that wraps the whole
  list, so afterwards it renders the list again loosing values that were
  already put in

  what is the preferred method to do such a thing? should the add and
  remove link be a submit link with defaultFormProcessing set to false?
  or maybe should we try to save values to model objects onchange in the
  respective fields themselves

  isn't there a way to do it in a neat fashion?

  code responsible for the list component is

 wrapper = new WebMarkupContainer(attributes-wrapper);
 listView = new ListView(attributes, attributeValuesList) {
   public void populateItem(final ListItem listItem) {
 final AttributeValue attributeValue = (AttributeValue)
  listItem.getModelObject();
 Renderer inputRenderer =
  attributeValue.getAttribute().getInputRenderer();
 Component component = 
 inputRenderer.getComponent(attributeValue);
 listItem.add(component);
 AjaxLink addLink = new AddLink(add-link);
 AjaxLink removeLink = new RemoveLink(remove-link, listItem);
 if (listItem.getIndex()  (listView.getViewSize() - 1)) {
   addLink.setVisible(false);
 } else {
   removeLink.setVisible(false);
 }
 listItem.add(addLink);
 listItem.add(removeLink);
   }
 };
 wrapper.setOutputMarkupId(true);

  HTML is

 div wicket:id=attributes-wrapper class=composit-wrapper
 div wicket:id=attributes class=composit
 div wicket:id=attributeAndValue 
 class=composit-item/div
 div class=composit-links
 a wicket:id=add-link+ add/a
 a wicket:id=remove-link- remove/a
 /div
 /div
 /div


  --
  Wojtek Biela

  
  
--
Wojtek Biela
  

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

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




-- 
Wojtek Biela

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



File upload weird problem

2008-03-05 Thread Piller Sébastien




Hello,

I have a weird problem with the file upload using Wicket. 

I have a flex application on client side, and the user can upload some
files. Flex code is as simple as:
var fr:FileReference=new FileReference();
  fr.addEventListener(Event.SELECT, function(e:Event):void {
   var postVariables:URLVariables = new URLVariables;
   postVariables.sessionid = "qwerttrew"; // some content here
  
   var req:URLRequest = new URLRequest;
   req.url = "" class="moz-txt-link-rfc2396E" href="http://localhost:8080/path/to/my/wicket/script/">"http://localhost:8080/path/to/my/wicket/script/";
   req.method = URLRequestMethod.POST;
   req.data = "">
   
   fr.upload(req);
  });
   
  fr.addEventListener(HTTPStatusEvent.HTTP_STATUS,
function(e:HTTPStatusEvent):void { 
   if(e.status == 500) Alert.show("Une erreur a t rencontre.
Veuillez ressayer!");
  });
   
  fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,
function(e:Event):void { 
   trace("upload complete"); 
  });
   
  fr.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event):void
{
   Alert.show("IOError: "+e);
  });
   
  fr.browse([new FileFilter("Fichiers autoriss",
"*.jpeg;*.jpg;*.png;*.swf")]);


On the wicket side, the code is:
Request request = getRequest();
  if (!(request instanceof ServletWebRequest)) {
   return;
  }
  
  ServletWebRequest swr = (ServletWebRequest) request;
  HttpServletRequest hsr = swr.getHttpServletRequest();
  
  if (!ServletFileUpload.isMultipartContent(hsr)) { return; }
  
  MultipartServletWebRequest mswr;
  try {
   mswr = new MultipartServletWebRequest(hsr,
Bytes.megabytes(2));
  } catch (FileUploadException e) {
   e.printStackTrace();
   throw new RuntimeException("Unable to get uploaded file!", e);
  }
   
  String sessionid = mswr.getParameter("sessionid");
  Map map = mswr.getFiles();
   
  for (Object o : map.keySet()) {
   Object object = map.get(o);
   
   if (object instanceof DiskFileItem) {
   DiskFileItem dfi = (DiskFileItem) object;
   File originalFile = dfi.getStoreLocation();
   
   if (originalFile.length() = 0) {
   throw new IOException("No data were sent!"); //
-- THROW THIS EXCEPTION WITH SOME FILES!!
   }
   
   File directory = new
File(AbstractApplication.get().getUploadFolder(), "logos");
   directory = new File(directory, "temp");
   directory.mkdirs();
   
  File tempFile = new File(directory, sessionid + "_" +
tref + "." + FileUtils.getExt(dfi.getName()));
   
   try {
   if (!FileUtils.move(originalFile, tempFile)) {
   throw new IOException("Unable to move file from
source to target!");
   }
  
   } catch (IOException e) {
   throw new AbortWithHttpStatusException(500, false);
   }
   break;
   }
  }
  
  
Well, this works fine, except with some specific files. I've a file
"a.png", and it is always uploaded successfully. And I've a file
"b.png", which always fail!! (they are both very close on theire size,
several KB).

When it comes on the wicket code, the file length is 0 bytes... I'm not
very sure that it's a wicket problem, it may also be a Flex one... But
I never saw any thread on the Flex forums that speak about upload
problems...

Could anybody explain what is the problem?

Thank you very much!



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



Re: Re: CSS and Javascript Problems

2008-03-05 Thread Andy Czerwonka

Thanks.. all good now.

On 2008-03-05 07:50:06 -0700, Hoover, William  [EMAIL PROTECTED] said:


According to the
http://maven.apache.org/guides/introduction/introduction-to-the-standard-
directory-layout.html they should reside in src/main/webapp

[snip]




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



Markup Rendering issues

2008-03-05 Thread Jörn Zaefferer
Hi,

I've got a few rendering issues with wicket:

I'd like to use IDs to select elements via jQuery on the clientside,
eg. a form with wicket:id=commentForm should also have
id=commentForm. Wicket generates id=commentForm4 or
id=commentForm5 - I've got no idea where that number comes from.
Specifying an id-attribute doesn't help, it gets overwritten. So far I
was unable to select elements via jQuery using the wicket:id
attribute, most likely the namespace and colon kills the attribute
selector.

In other words: How can I instruct Wicket to render and static id-attribute?

Another, similar issue: Wicket renders stuff like wicket:child and
wicket:panel into the HTML markup. While the browser ignores it, I
don't know why Wicket doesn't filter out those instructional markups
instead. Is that configurable?

All in all, I'd like to use Wicket without making it obvious to
someone reading the markup that Wicket is used to generate it. So not
tags and attributes with the wicket namespace should appear in the
markup - I'm not using Wickets Ajax stuff anyway.
For completeness, the action attribute of my form must be modified,
too. Currently the contain something like
../?wicket:interface=:1:loginForm::IFormSubmitListener::. How can I
replace that, eg. mount a static URL for that form?

I guess most of this is easy to resolve and I just don't know enough
about Wicket, yet. Pointers or solutions are both highly appreciated.

Thanks
Jörn Zaefferer

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



RE: Re: CSS and Javascript Problems

2008-03-05 Thread Hoover, William
The simplest solution (if your company will allow) would be just to place them 
in src/main/webapp/css and src/main/webapp/images ;o)

-Original Message-
From: Maurice Marrink [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 10:02 AM
To: users@wicket.apache.org
Subject: Re: Re: CSS and Javascript Problems


True,
Fortunately the war plugin allows for a warSourceDirectory config
property http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

It is customary in our company to have a src/webapp dir where most of
the images/ css/ web.xml etc are located.

Maurice

On Wed, Mar 5, 2008 at 3:50 PM, Hoover, William [EMAIL PROTECTED] wrote:
 According to the 
 http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
  they should reside in src/main/webapp



  -Original Message-
  From: news [mailto:[EMAIL PROTECTED] Behalf Of Andy Czerwonka
  Sent: Wednesday, March 05, 2008 9:43 AM
  To: users@wicket.apache.org
  Subject: Re: CSS and Javascript Problems


  oh ya... and all the css and javascript is static, meaning that it
  doesn't have to be referenced in code, but either way

  On 2008-03-05 07:36:43 -0700, Andy Czerwonka [EMAIL PROTECTED] said:

   currently my code is in src/main/java and my css, images and scripts
   are all in src/main/resources/css, src/main/resources/images and
   src/main/resources/script respectively.  The maven build put all the
   resources at the root, which is of course the issue.  What's standard
   practice for wicket applications to follow?
  
   On 2008-03-05 07:29:14 -0700, Andy Czerwonka [EMAIL PROTECTED] said:
  
   http://cwiki.apache.org/WICKET/javascript-and-css-support.html
  
   This page does not talk about how this is done in 1.3.1 and I'm having
   trouble getting the HTML pages to find my CSS and Javascript.  Can
   someone point me in the right direction please?
  
  



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



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



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



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



Re: Markup Rendering issues

2008-03-05 Thread richardwilko

afaik you can set a static id using component.setMarkupId(some id);  you
can also get at the wicket markup id using component.getMarkupId() (so long
as you set component.setOutputMarkupId(true) on your component), this is
useful when you are writing your javascript in java as a string then
outputting it.

for removing the wicket tags you can look here
http://cwiki.apache.org/confluence/display/WICKET/How+to+remove+wicket+markup+from+output

Can't help with the form one, I dont know if that is possible.

Richard



Jörn Zaefferer-2 wrote:
 
 Hi,
 
 I've got a few rendering issues with wicket:
 
 I'd like to use IDs to select elements via jQuery on the clientside,
 eg. a form with wicket:id=commentForm should also have
 id=commentForm. Wicket generates id=commentForm4 or
 id=commentForm5 - I've got no idea where that number comes from.
 Specifying an id-attribute doesn't help, it gets overwritten. So far I
 was unable to select elements via jQuery using the wicket:id
 attribute, most likely the namespace and colon kills the attribute
 selector.
 
 In other words: How can I instruct Wicket to render and static
 id-attribute?
 
 Another, similar issue: Wicket renders stuff like wicket:child and
 wicket:panel into the HTML markup. While the browser ignores it, I
 don't know why Wicket doesn't filter out those instructional markups
 instead. Is that configurable?
 
 All in all, I'd like to use Wicket without making it obvious to
 someone reading the markup that Wicket is used to generate it. So not
 tags and attributes with the wicket namespace should appear in the
 markup - I'm not using Wickets Ajax stuff anyway.
 For completeness, the action attribute of my form must be modified,
 too. Currently the contain something like
 ../?wicket:interface=:1:loginForm::IFormSubmitListener::. How can I
 replace that, eg. mount a static URL for that form?
 
 I guess most of this is easy to resolve and I just don't know enough
 about Wicket, yet. Pointers or solutions are both highly appreciated.
 
 Thanks
 Jörn Zaefferer
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Markup-Rendering-issues-tp15852773p15853077.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: ajaxified dynamic lists as parts of bigger forms

2008-03-05 Thread Erik van Oosten

Hi Wojciech,

You should use Buttons instead of links. Button (or AjaxFallbackButton) 
does submit the form. The only thing you need to do is disable 
validation on the button (call button.setDefaultFormProcessing(false)), 
otherwise the onSubmit of the button is not called when some field in 
the form does not validate. You can optionally call form.validate() in 
the onSubmit of the button so that validation messages do not disappear.


OT: personally, in forms I prefer RefreshingView instead of ListView.

Regards,
   Erik.

--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


Wojciech Biela wrote:

Hello

This time my question is not so general.

We have a big form, part of this form there is a component which
should be a dynamic list of fields like this:

|TextField| - remove
|TextField| - remove
|TextField| - remove
|TextField| - add

if you click add another row |TextField| - remove should appear at
the bottom, it you should click remove then this row should be
removed

problem we have is that the add and remove link does not send the
form, it only sends and ajax request to add an element to the list of
components and it operates (target) on a DIV that wraps the whole
list, so afterwards it renders the list again loosing values that were
already put in

what is the preferred method to do such a thing? should the add and
remove link be a submit link with defaultFormProcessing set to false?
or maybe should we try to save values to model objects onchange in the
respective fields themselves

isn't there a way to do it in a neat fashion?

code responsible for the list component is

wrapper = new WebMarkupContainer(attributes-wrapper);
listView = new ListView(attributes, attributeValuesList) {
  public void populateItem(final ListItem listItem) {
final AttributeValue attributeValue = (AttributeValue)
listItem.getModelObject();
Renderer inputRenderer =
attributeValue.getAttribute().getInputRenderer();
Component component = inputRenderer.getComponent(attributeValue);
listItem.add(component);
AjaxLink addLink = new AddLink(add-link);
AjaxLink removeLink = new RemoveLink(remove-link, listItem);
if (listItem.getIndex()  (listView.getViewSize() - 1)) {
  addLink.setVisible(false);
} else {
  removeLink.setVisible(false);
}
listItem.add(addLink);
listItem.add(removeLink);
  }
};
wrapper.setOutputMarkupId(true);

HTML is

div wicket:id=attributes-wrapper class=composit-wrapper
div wicket:id=attributes class=composit
div wicket:id=attributeAndValue 
class=composit-item/div
div class=composit-links
a wicket:id=add-link+ add/a
a wicket:id=remove-link- remove/a
/div
/div
/div

  



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



Re: Markup Rendering issues

2008-03-05 Thread Erik van Oosten

Hi Jörn,

-- Ids
This one of the exceptions in just taking existing HTML. Our designers 
also use jquery and solved the problem by using classes. Something like: 
class=idCommentForm. For jquery it doesn't matter much, and by 
including id in the class name the intend is still clear.


-- Wicket tags
This is all time high FAQ :)  Do 
getMarkupSettings().setStripWicketTags(true) in the init() of your 
application class. (I still wonder why it is not the default.)


-- Url handling
There is a lot to say on this topic (and a lot has been said). Its best 
to search the lists and ask again with more specific questions. Mounting 
bookmarkable pages could indeed alleviate your problem. Mounting is 
typically done in the init() method of your application.


Regards,
   Erik.

--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/



Jörn Zaefferer wrote:

Hi,

I've got a few rendering issues with wicket:

I'd like to use IDs to select elements via jQuery on the clientside,
eg. a form with wicket:id=commentForm should also have
id=commentForm. Wicket generates id=commentForm4 or
id=commentForm5 - I've got no idea where that number comes from.
Specifying an id-attribute doesn't help, it gets overwritten. So far I
was unable to select elements via jQuery using the wicket:id
attribute, most likely the namespace and colon kills the attribute
selector.

In other words: How can I instruct Wicket to render and static id-attribute?

Another, similar issue: Wicket renders stuff like wicket:child and
wicket:panel into the HTML markup. While the browser ignores it, I
don't know why Wicket doesn't filter out those instructional markups
instead. Is that configurable?

All in all, I'd like to use Wicket without making it obvious to
someone reading the markup that Wicket is used to generate it. So not
tags and attributes with the wicket namespace should appear in the
markup - I'm not using Wickets Ajax stuff anyway.
For completeness, the action attribute of my form must be modified,
too. Currently the contain something like
../?wicket:interface=:1:loginForm::IFormSubmitListener::. How can I
replace that, eg. mount a static URL for that form?

I guess most of this is easy to resolve and I just don't know enough
about Wicket, yet. Pointers or solutions are both highly appreciated.

Thanks
Jörn Zaefferer

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

  



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



Re: File upload weird problem

2008-03-05 Thread Igor Vaynberg
can you try not casting to DiskFileItem and just use FileItem.getinputstrema()?

-igor


On Wed, Mar 5, 2008 at 7:25 AM, Piller Sébastien [EMAIL PROTECTED] wrote:

  Hello,

  I have a weird problem with the file upload using Wicket.

  I have a flex application on client side, and the user can upload some
 files. Flex code is as simple as:

 var fr:FileReference=new FileReference();
  fr.addEventListener(Event.SELECT, function(e:Event):void {
  var postVariables:URLVariables = new URLVariables;
  postVariables.sessionid = qwerttrew; // some content here

  var req:URLRequest = new URLRequest;
  req.url = http://localhost:8080/path/to/my/wicket/script/;;
  req.method = URLRequestMethod.POST;
  req.data = postVariables;

  fr.upload(req);
  });

  fr.addEventListener(HTTPStatusEvent.HTTP_STATUS,
 function(e:HTTPStatusEvent):void {
  if(e.status == 500) Alert.show(Une erreur a été rencontrée. Veuillez
 réessayer!);
  });

  fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, function(e:Event):void
 {
  trace(upload complete);
  });

  fr.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event):void {
  Alert.show(IOError: +e);
  });

  fr.browse([new FileFilter(Fichiers autorisés,
 *.jpeg;*.jpg;*.png;*.swf)]);

  On the wicket side, the code is:

 Request request = getRequest();
  if (!(request instanceof ServletWebRequest)) {
  return;
  }

  ServletWebRequest swr = (ServletWebRequest) request;
  HttpServletRequest hsr = swr.getHttpServletRequest();

  if (!ServletFileUpload.isMultipartContent(hsr)) { return; }

  MultipartServletWebRequest mswr;
  try {
  mswr = new MultipartServletWebRequest(hsr, Bytes.megabytes(2));
  } catch (FileUploadException e) {
  e.printStackTrace();
  throw new RuntimeException(Unable to get uploaded file!, e);
  }

  String sessionid = mswr.getParameter(sessionid);
  Map map = mswr.getFiles();

  for (Object o : map.keySet()) {
  Object object = map.get(o);

  if (object instanceof DiskFileItem) {
  DiskFileItem dfi = (DiskFileItem) object;
  File originalFile = dfi.getStoreLocation();

  if (originalFile.length() = 0) {
  throw new IOException(No data were sent!); // -- THROW THIS
 EXCEPTION WITH SOME FILES!!
  }

  File directory = new
 File(AbstractApplication.get().getUploadFolder(), logos);
  directory = new File(directory, temp);
  directory.mkdirs();

  File tempFile = new File(directory, sessionid + _ + tref + . +
 FileUtils.getExt(dfi.getName()));

  try {
  if (!FileUtils.move(originalFile, tempFile)) {
  throw new IOException(Unable to move file from source to
 target!);
  }

  } catch (IOException e) {
  throw new AbortWithHttpStatusException(500, false);
  }
  break;
  }
  }

  Well, this works fine, except with some specific files. I've a file
 a.png, and it is always uploaded successfully. And I've a file b.png,
 which always fail!! (they are both very close on theire size, several KB).

  When it comes on the wicket code, the file length is 0 bytes... I'm not
 very sure that it's a wicket problem, it may also be a Flex one... But I
 never saw any thread on the Flex forums that speak about upload problems...

  Could anybody explain what is the problem?

  Thank you very much!
  - To
 unsubscribe, e-mail: [EMAIL PROTECTED] For additional
 commands, e-mail: [EMAIL PROTECTED]

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



overriding the shift/ctrl in shift-click

2008-03-05 Thread Kirk Israel
Inside of a Modal Window, I have a Panel with a Fragment that has
AjaxFallbackLink that we use for indicating selection.
(The onClick toggles a selection status in the underlying model)
The trouble is a shift or ctrl click opens up a new window or tab with an
Internal Error showing-
ideally we'd capture the shift or click state so we can do the UI
appropriate thing, but for now, is there any easy way of treating a shift or
ctrl click as a normal click?

I know this (the shift- and ctrl- behavior) might be browser specific and
happening at a low level, but I'm trying to find a workaround without
revamping the whole structure of what I'm working with...

Thanks!


Re: Markup Rendering issues

2008-03-05 Thread Gin Yeah
-- Wicket tags
This is all time high FAQ :)  Do
getMarkupSettings().setStripWicketTags(true) in the init() of your
application class. (I still wonder why it is not the default.)

Don't explicitly turn off wicket tag, unless you have real good reason to.
This setting is automatically determined by the development/deployment
configuration.  When run in 'deployment' mode, wicket tags are stripped.  In
development mode, they are not to help debugging.

You control the development/deployment mode in web.xml:

init-param
param-nameconfiguration/param-name
param-valuedevelopment or deployment/param-value
init-param




On Wed, Mar 5, 2008 at 8:01 AM, Erik van Oosten [EMAIL PROTECTED]
wrote:

 Hi Jörn,

 -- Ids
 This one of the exceptions in just taking existing HTML. Our designers
 also use jquery and solved the problem by using classes. Something like:
 class=idCommentForm. For jquery it doesn't matter much, and by
 including id in the class name the intend is still clear.

 -- Wicket tags
 This is all time high FAQ :)  Do
 getMarkupSettings().setStripWicketTags(true) in the init() of your
 application class. (I still wonder why it is not the default.)

 -- Url handling
 There is a lot to say on this topic (and a lot has been said). Its best
 to search the lists and ask again with more specific questions. Mounting
 bookmarkable pages could indeed alleviate your problem. Mounting is
 typically done in the init() method of your application.

 Regards,
Erik.

 --
 Erik van Oosten
 http://www.day-to-day-stuff.blogspot.com/



 Jörn Zaefferer wrote:
  Hi,
 
  I've got a few rendering issues with wicket:
 
  I'd like to use IDs to select elements via jQuery on the clientside,
  eg. a form with wicket:id=commentForm should also have
  id=commentForm. Wicket generates id=commentForm4 or
  id=commentForm5 - I've got no idea where that number comes from.
  Specifying an id-attribute doesn't help, it gets overwritten. So far I
  was unable to select elements via jQuery using the wicket:id
  attribute, most likely the namespace and colon kills the attribute
  selector.
 
  In other words: How can I instruct Wicket to render and static
 id-attribute?
 
  Another, similar issue: Wicket renders stuff like wicket:child and
  wicket:panel into the HTML markup. While the browser ignores it, I
  don't know why Wicket doesn't filter out those instructional markups
  instead. Is that configurable?
 
  All in all, I'd like to use Wicket without making it obvious to
  someone reading the markup that Wicket is used to generate it. So not
  tags and attributes with the wicket namespace should appear in the
  markup - I'm not using Wickets Ajax stuff anyway.
  For completeness, the action attribute of my form must be modified,
  too. Currently the contain something like
  ../?wicket:interface=:1:loginForm::IFormSubmitListener::. How can I
  replace that, eg. mount a static URL for that form?
 
  I guess most of this is easy to resolve and I just don't know enough
  about Wicket, yet. Pointers or solutions are both highly appreciated.
 
  Thanks
  Jörn Zaefferer
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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




Re: Markup Rendering issues

2008-03-05 Thread Erik van Oosten

Hi Gin,

I understand the reasoning. I have just never ever had any use for this 
debugging feature.


Oh, well. It is only one line of code ;)

Regards,
   Erik.


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


Gin Yeah wrote:

-- Wicket tags
This is all time high FAQ :)  Do
getMarkupSettings().setStripWicketTags(true) in the init() of your
application class. (I still wonder why it is not the default.)



Don't explicitly turn off wicket tag, unless you have real good reason to.
This setting is automatically determined by the development/deployment
configuration.  When run in 'deployment' mode, wicket tags are stripped.  In
development mode, they are not to help debugging.

You control the development/deployment mode in web.xml:

init-param
param-nameconfiguration/param-name
param-valuedevelopment or deployment/param-value
init-param

  



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



Re: Anyone thinking about an OLAP4J component?

2008-03-05 Thread Shudoman

Hi,

I'm Bill Seyler of Pentaho and I am currently overseeing the Halogen
development.  The Halogen project has moved from a 'proof of concept' into
an 'incubator' project.  The goal is much as stated above.  Give the
commercial guys a run for their money and update/replace the
long-in-the-tooth JPivot.

Halogen leverages olap4j and gwt to attempt to create a rich web OLAP
viewer.  In that respect it would not be tightly coupled with mondrian since
Olap4J support XMLA.  In theory any OLAP provider that included XMLA support
(like most of them do) would be able to use Halogen as their viewer.

If anyone is interested in contributing code, GUI mockups, test code, or
would like to contribute to the road map then please become a member of the
halogen project and by all means start contributing.  I personally am stoked
about this product.  I wrote the Hyperion Analyzer OLAP grid component and
am looking forward to raising the bar while leveraging new technologies.

Reguards,

Bill


Nino.Martinez wrote:
 
 Sounds like a great idea, and maybe give companies like SAS institute 
 and SPSS a little run for it:)
 
 I'd love to do that, but unfortunalty I'ts not a business case for my 
 company.. I'd be glad to help out a little though:)
 
 
 regards Nino
 
 Jay Hogan wrote:
 Has anyone thought about writing a Wicket OLAP viewer using the new
 (still
 beta) olap4j API? (http://www.olap4j.org/) I would kill (ok, maim) for
 something like that and Wicket is a great platform for it IMHO. I have
 not
 been very impressed with the Java OLAP pivot tools I have seen, of which
 JPivot is the best.

 Some of the Pentaho developers have put together a proof of concept
 called
 Halogen using GWT. http://code.google.com/p/halogen/

   
 
 -- 
 -Wicket for love
 -Jme for fun
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Anyone-thinking-about-an-OLAP4J-component--tp15771058p15855916.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Anyone thinking about an OLAP4J component?

2008-03-05 Thread Shudoman



Nino.Martinez wrote:
 
 Sounds like a great idea, and maybe give companies like SAS institute 
 and SPSS a little run for it:)
 
 I'd love to do that, but unfortunalty I'ts not a business case for my 
 company.. I'd be glad to help out a little though:)
 
 
 regards Nino
 
 Jay Hogan wrote:
 Has anyone thought about writing a Wicket OLAP viewer using the new
 (still
 beta) olap4j API? (http://www.olap4j.org/) I would kill (ok, maim) for
 something like that and Wicket is a great platform for it IMHO. I have
 not
 been very impressed with the Java OLAP pivot tools I have seen, of which
 JPivot is the best.

 Some of the Pentaho developers have put together a proof of concept
 called
 Halogen using GWT. http://code.google.com/p/halogen/

   
 
 -- 
 -Wicket for love
 -Jme for fun
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Anyone-thinking-about-an-OLAP4J-component--tp15771058p15856082.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Anyone thinking about an OLAP4J component?

2008-03-05 Thread Jay Hogan
Thanks for the feedback Bill. I have some questions about Halogen but I
don't want to get too far off-track. This is a Wicket forum after all! I'll
head over to the Halogen site and post them there.

Thanks!

On Wed, Mar 5, 2008 at 2:54 PM, Shudoman [EMAIL PROTECTED] wrote:


 Hi,

 I'm Bill Seyler of Pentaho and I am currently overseeing the Halogen
 development.  The Halogen project has moved from a 'proof of concept' into
 an 'incubator' project.  The goal is much as stated above.  Give the
 commercial guys a run for their money and update/replace the
 long-in-the-tooth JPivot.

 Halogen leverages olap4j and gwt to attempt to create a rich web OLAP
 viewer.  In that respect it would not be tightly coupled with mondrian
 since
 Olap4J support XMLA.  In theory any OLAP provider that included XMLA
 support
 (like most of them do) would be able to use Halogen as their viewer.

 If anyone is interested in contributing code, GUI mockups, test code, or
 would like to contribute to the road map then please become a member of
 the
 halogen project and by all means start contributing.  I personally am
 stoked
 about this product.  I wrote the Hyperion Analyzer OLAP grid component and
 am looking forward to raising the bar while leveraging new technologies.

 Reguards,

 Bill


 Nino.Martinez wrote:
 
  Sounds like a great idea, and maybe give companies like SAS institute
  and SPSS a little run for it:)
 
  I'd love to do that, but unfortunalty I'ts not a business case for my
  company.. I'd be glad to help out a little though:)
 
 
  regards Nino
 
  Jay Hogan wrote:
  Has anyone thought about writing a Wicket OLAP viewer using the new
  (still
  beta) olap4j API? (http://www.olap4j.org/) I would kill (ok, maim) for
  something like that and Wicket is a great platform for it IMHO. I have
  not
  been very impressed with the Java OLAP pivot tools I have seen, of
 which
  JPivot is the best.
 
  Some of the Pentaho developers have put together a proof of concept
  called
  Halogen using GWT. http://code.google.com/p/halogen/
 
 
 
  --
  -Wicket for love
  -Jme for fun
 
  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Anyone-thinking-about-an-OLAP4J-component--tp15771058p15855916.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 

Computer Science: solving today's problems tomorrow.


link onClick add panel

2008-03-05 Thread taygolf

I have a problem and I have thought of 2 ways to get it done but I can not
make either work nor am I sure which one is the best.

I want the user to be able to add as many customers as they want.

So I have thought of 2 ways to do this.

1) I have a link that when clicked creates a popup with all the necessary
form fields that need to be filled out to create a customer. When the the
page is submitted I want the information to be stored on the parent page in
a table. I also want the customer name to be a link so they can edit the
customer if need be.

I have the popup working and collecting all the data but the only way I see
to get it to put the data on the parent page is with javascript and I can
not seem to get the customer name to be a wicket link. so I guess the
problem with this method is how can I get javascript to create a new wicket
link on the fly or how can I populate the parent page from the onSubmit of
the form on the popup page.

2) I have a link and when that link is clicked it opens a panel with all the
necessary fields that need to be filled out. For some reason I can not get
the link to add the panel to the parent page so I am stuck there.

I would prefer option one because I think it looks cleaner. How can I fix
these issues? am I thinking in the right direction for what I want to do? If
not what do I need to be looking at?

Thanks

T
-- 
View this message in context: 
http://www.nabble.com/link-onClick-add-panel-tp15860001p15860001.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: link onClick add panel

2008-03-05 Thread Maurice Marrink
Assuming you are using a listview or dataview to display all the
customers you can simply add a link to the items, attach a label
displaying the name and you have your clickable name. You could rig
the link to open the popup.
To get the customer data from the popup to the page i would choose to
simply store the customer in the db using a form submit before closing
the popup, from there you can use ajax or a simple setResponsePage to
the parentpage to update its content.
Alternatively if you do not yet want to store your customer you need
to add it to the model of the listview. Note do not replace the
listviews model but do something like
((List)model.getObject()).add(myCustomer); then you could use either
ajax or setresponsepage to trigger a refresh on the parentpage.

If you are using ModalWindow as your popup you might need to add a
WindowClosedCallbackHandler to redraw the listview.

Maurice

On Wed, Mar 5, 2008 at 9:52 PM, taygolf [EMAIL PROTECTED] wrote:

  I have a problem and I have thought of 2 ways to get it done but I can not
  make either work nor am I sure which one is the best.

  I want the user to be able to add as many customers as they want.

  So I have thought of 2 ways to do this.

  1) I have a link that when clicked creates a popup with all the necessary
  form fields that need to be filled out to create a customer. When the the
  page is submitted I want the information to be stored on the parent page in
  a table. I also want the customer name to be a link so they can edit the
  customer if need be.

  I have the popup working and collecting all the data but the only way I see
  to get it to put the data on the parent page is with javascript and I can
  not seem to get the customer name to be a wicket link. so I guess the
  problem with this method is how can I get javascript to create a new wicket
  link on the fly or how can I populate the parent page from the onSubmit of
  the form on the popup page.

  2) I have a link and when that link is clicked it opens a panel with all the
  necessary fields that need to be filled out. For some reason I can not get
  the link to add the panel to the parent page so I am stuck there.

  I would prefer option one because I think it looks cleaner. How can I fix
  these issues? am I thinking in the right direction for what I want to do? If
  not what do I need to be looking at?

  Thanks

  T
  --
  View this message in context: 
 http://www.nabble.com/link-onClick-add-panel-tp15860001p15860001.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Guide for html designers

2008-03-05 Thread Ned Collyer

A web designer being a graphics or a HTML guy (or a combination thereof)?

Seriously tho, design your site, give the output to the programmer to
wicket up.

I don't see how wicket will work for you if you don't understand the basic
bits of java.  If you do, the tutorials and examples on the website
http://wicket.apache.org/examples.html then that should be an easy enough
stepping stone to forage deeper.

Things you are probably interested in are panels, borders, includes and
fragments.
http://wicketstuff.org/wicket13/compref/

But I think you will find it tough with zero java knowledge.  It may work
well if you are working with a programmer :), but solo - good luck!


Alex Jacoby-2 wrote:
 
 I searched the wiki and the list archives, but I haven't found any  
 sort of wicket reference appropriate for a web designer who doesn't  
 speak Java.  The list of xhtml tags in the wiki is the closest, but  
 it's definitely written more for the programmers.
 
 Am I missing something?  If not, I'll contribute the guide I write to  
 the wiki.
 
 Thanks,
 Alex
 

-- 
View this message in context: 
http://www.nabble.com/Guide-for-html-designers-tp15852223p15861127.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: ajaxified dynamic lists as parts of bigger forms

2008-03-05 Thread Maurice Marrink
Actually AjaxFormComponentUpdatingBehavior accomplishes the desired
behavior without submitting the entire form. I can see the tricky part
in loosing changes to the text in the textfields if you replace the
div surrounding them but i thought nested forms in wicket 1.3.? solved
this by only submitting the child formcomponents, or am i mistaken?

Maurice

On Wed, Mar 5, 2008 at 4:50 PM, Erik van Oosten [EMAIL PROTECTED] wrote:
 Hi Wojciech,

  You should use Buttons instead of links. Button (or AjaxFallbackButton)
  does submit the form. The only thing you need to do is disable
  validation on the button (call button.setDefaultFormProcessing(false)),
  otherwise the onSubmit of the button is not called when some field in
  the form does not validate. You can optionally call form.validate() in
  the onSubmit of the button so that validation messages do not disappear.

  OT: personally, in forms I prefer RefreshingView instead of ListView.

  Regards,
 Erik.

  --
  Erik van Oosten
  http://www.day-to-day-stuff.blogspot.com/




  Wojciech Biela wrote:
   Hello
  
   This time my question is not so general.
  
   We have a big form, part of this form there is a component which
   should be a dynamic list of fields like this:
  
   |TextField| - remove
   |TextField| - remove
   |TextField| - remove
   |TextField| - add
  
   if you click add another row |TextField| - remove should appear at
   the bottom, it you should click remove then this row should be
   removed
  
   problem we have is that the add and remove link does not send the
   form, it only sends and ajax request to add an element to the list of
   components and it operates (target) on a DIV that wraps the whole
   list, so afterwards it renders the list again loosing values that were
   already put in
  
   what is the preferred method to do such a thing? should the add and
   remove link be a submit link with defaultFormProcessing set to false?
   or maybe should we try to save values to model objects onchange in the
   respective fields themselves
  
   isn't there a way to do it in a neat fashion?
  
   code responsible for the list component is
  
   wrapper = new WebMarkupContainer(attributes-wrapper);
   listView = new ListView(attributes, attributeValuesList) {
 public void populateItem(final ListItem listItem) {
   final AttributeValue attributeValue = (AttributeValue)
   listItem.getModelObject();
   Renderer inputRenderer =
   attributeValue.getAttribute().getInputRenderer();
   Component component = inputRenderer.getComponent(attributeValue);
   listItem.add(component);
   AjaxLink addLink = new AddLink(add-link);
   AjaxLink removeLink = new RemoveLink(remove-link, listItem);
   if (listItem.getIndex()  (listView.getViewSize() - 1)) {
 addLink.setVisible(false);
   } else {
 removeLink.setVisible(false);
   }
   listItem.add(addLink);
   listItem.add(removeLink);
 }
   };
   wrapper.setOutputMarkupId(true);
  
   HTML is
  
 div wicket:id=attributes-wrapper class=composit-wrapper
 div wicket:id=attributes class=composit
 div wicket:id=attributeAndValue 
 class=composit-item/div
 div class=composit-links
 a wicket:id=add-link+ add/a
 a wicket:id=remove-link- remove/a
 /div
 /div
 /div
  
  




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



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



Wicket - Servlet - Wicket

2008-03-05 Thread Steve Thompson
My team is currently working on a web project composed of a entirely
of plain old servlets.  We are looking at potentially replacing it
with Wicket, but we do not have the luxury of rewriting the entire
project, and would need to integrate Wicket gradually with the
existant functionality.

Is there an easy way via Wicket to create the request parameters that
would need to be passed to the servlets?  Any examples you could
provide would be very much appreciated, as would any insights from
those who might have taken such a hybrid approach in the past.

Thanks and best regards,


Steve

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



Re: Wicket - Servlet - Wicket

2008-03-05 Thread Igor Vaynberg
maybe this will help

http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

-igor


On Wed, Mar 5, 2008 at 2:46 PM, Steve Thompson [EMAIL PROTECTED] wrote:
 My team is currently working on a web project composed of a entirely
  of plain old servlets.  We are looking at potentially replacing it
  with Wicket, but we do not have the luxury of rewriting the entire
  project, and would need to integrate Wicket gradually with the
  existant functionality.

  Is there an easy way via Wicket to create the request parameters that
  would need to be passed to the servlets?  Any examples you could
  provide would be very much appreciated, as would any insights from
  those who might have taken such a hybrid approach in the past.

  Thanks and best regards,


  Steve

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



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



Re: Use Ajax for loading form dropdowns, but query params for search?

2008-03-05 Thread steviezz

Thanks.  Yes, your code is similar to what I am doing.  

But trying to sych the Ajax dropdown state with the page parameters is
defeating me.  There are effectively two ways of getting to the results page
- search form post and directly from a bookmarked URL.

I'm using a CompoundPropertyModel containing my own SearchModel class -
holds the values selected in the dropdowns - not the actual dropdown
objects, eg: 

public class SearchModel implements Serializable {

private String area;
private String country;
private String region;


public String getArea() {
return area;
}

public void setArea(String area) {
this.area = area;
}

   // more getters and setters 

   }

Then in the panel class, I have something like: 


  final CompoundPropertyModel searchPropertyModel = ((WholSession)
Session.get()).getSearchModel();

  setModel(searchPropertyModel);

  DropDownChoice areaDDC = getAreaDDC(searchPropertyModel);

  private DropDownChoice getAreaDDC(final CompoundPropertyModel model) {

PropertyModel areaModel = new PropertyModel(model, AREA);

LoadableDetachableModel areaLDModel = new 
LoadableDetachableModel() {
public Object load() {
return ((WholApplication) 
getApplication()).getAreas();
}
};

DropDownChoice areaDDC = new DropDownChoice(AREA, areaModel, 
areaLDModel)
{
protected CharSequence getDefaultChoice(Object 
selected) {
return ALL_AREAS;
}
};

areaDDC.add(new AjaxFormComponentUpdatingBehavior(ONCHANGE) {
protected void onUpdate(AjaxRequestTarget target) {
countryDDC.clearInput();
countryDDC.setModelObject(null);
regionDDC.clearInput();
regionDDC.setModelObject(null);
target.addComponent(countryDDC);
target.addComponent(regionDDC);
}
});

areaDDC.setNullValid(false);
areaDDC.setOutputMarkupId(true);

return areaDDC;
}


SearchModel is set in the session in my panel constructor like: 

 final CompoundPropertyModel searchPropertyModel = ((WholSession)
Session.get()).getSearchModel();
 setModel(searchPropertyModel);

and again in the form's onSubmit() 

This mostly works (I still get some unpredictable state with some
combinations of dropdown changes and backbutton clicks when I don't submit
the form).  I have set no-cache headers on the pages with the search panel
to make it reload from the server instead of browser cache.  I can just
about live with this, but it's clunky.  

Essentially, the model I'm using to keep state for the related Ajax
dropdowns gets automatically updated by Wicket.  It seems like a backwards
step to somehow manually try to update this from the page query params (not
even sure this is possible).  I still can't work out how to do this - but
suspect it's a bad idea. 

No doubt my code can be improved (I'm still trying to get my head around
Wicket - I'm struggling because I have no Swing background, and still try to
do everything like Struts / Servlet / JSP).  

I've spent far too long on this already - good for learning, but frustrating
because I'm failing.  Not blaming Wicket - this particular problem was
beyond me using Struts with DWR for the AJAX bits, so I ended up not using
AJAX and just refreshing the whole page on dropdown onchange events and
building the search box contents and selectins on the server.  I suspect I
may have to go the same way if I want to use Wicket - or drop my requirement
for AJAX with synchonised search box widgets, search params and search
results.

I can feel a user interface redesign coming soon. 

I seem to spend most of my time trying to work around Wicket rather than
with it - my problem, I know.  But mostly it has been easy to bolt Wicket
onto my backend application in place of the existing Struts / JSP front end
- many things are much easier to code in Java than in JSP taglibs.  





lars vonk wrote:
 
 We are building a somewhat similar application. The only difference is
 that we don't need to synch the search criteria with the search panel
 (the Ajax dropdowns in your case), since the search panel in our
 application will do a clean search when used from the results page.
 
 The code looks something like this, which I don't think is too messy:
 
 ResultPage extends WebPage {
   private SearchCriteria criteria
 
   // via bookmarked page
   ResultPage(PageParameters params) {
 searchCriteria = new SearchCriteria();
 

Sorting a list

2008-03-05 Thread jeredm

I am looking for an easy way to sort single items within a list...basically I
need to re-order a list.  For example, I have 30 table rows and I want to
move row 13 to be before row 10.  An example I found that is similar to what
I am looking for is located at http://demos.mootools.net/Sortables.  Does
anybody know an easy way to implement this type of solution (an easy to
re-order list) in Wicket?  My list size is probably more than 10 and less
than 100.  Thanks for any help!
-- 
View this message in context: 
http://www.nabble.com/Sorting-a-list-tp15862619p15862619.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Sorting a list

2008-03-05 Thread Ryan Sonnek
there's a wicket project that integrates the scriptaculous sortable
object which might be what you're looking for:
http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+SortableListView


On Wed, Mar 5, 2008 at 5:00 PM, jeredm [EMAIL PROTECTED] wrote:

  I am looking for an easy way to sort single items within a list...basically I
  need to re-order a list.  For example, I have 30 table rows and I want to
  move row 13 to be before row 10.  An example I found that is similar to what
  I am looking for is located at http://demos.mootools.net/Sortables.  Does
  anybody know an easy way to implement this type of solution (an easy to
  re-order list) in Wicket?  My list size is probably more than 10 and less
  than 100.  Thanks for any help!
  --
  View this message in context: 
 http://www.nabble.com/Sorting-a-list-tp15862619p15862619.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



How to make a PopupWindow non-resizable?

2008-03-05 Thread MYoung

The default new PopupSettings() makes a resizable popup and I don't see a
flag to turn resizable to off.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-PopupWindow-non-resizable--tp15863664p15863664.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Adding wicket-ajax.js file to my wicket page

2008-03-05 Thread hjuturu

Hi All,
I am trying to do an inline edit ajax label . 
This is the snippet of code i am using 
 add(new EditableSNLabel(title+snote.getId(),new Model(snote.getName(; 
in my wicket panel. 
EditableSNLabel extends AjaxEditableLabel class.
When i click the label nothing happens. So i am wondering how the
necessarily javascript i.e wicket-ajax.js gets included in the wicket page.
Thanks
Haritha
-- 
View this message in context: 
http://www.nabble.com/Adding-wicket-ajax.js-file-to-my-wicket-page-tp15863695p15863695.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread MYoung

I must be doing it wrong.  I have this in my  popup template:

lt;a wicket:id=closeMegt;Closelt;/agt;


In java:

add(new PopupCloseLink(closeMe) {
 @Override public void onClick() {
   // HERE HERE
}
});

onClick() is called but the popup window stays.

Another question, how to get notify  when the popup is close by clicking on
the close box on the browser window's title bar?
-- 
View this message in context: 
http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread Igor Vaynberg
any javascript errors in your browser? is the popupcloselink inside
the popup window - which is another window that is NOT a modal
window...?

-igor


On Wed, Mar 5, 2008 at 4:28 PM, MYoung [EMAIL PROTECTED] wrote:

  I must be doing it wrong.  I have this in my  popup template:

  lt;a wicket:id=closeMegt;Closelt;/agt;


  In java:

  add(new PopupCloseLink(closeMe) {
  @Override public void onClick() {
// HERE HERE
 }
  });

  onClick() is called but the popup window stays.

  Another question, how to get notify  when the popup is close by clicking on
  the close box on the browser window's title bar?
  --
  View this message in context: 
 http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



java.lang.IllegalAccessError: tried to access method org.apache.wicket.Component.onModelChanging()V::: when using AjaxEditableLabel

2008-03-05 Thread hjuturu

Hi All,
I have a edit in place label in my wicket page .
When i try to edit it i get this exception. I am using wicket 1.3.1 and
Tomcat 6.0.14.
Can anyone tell me what is the problem.

DEBUG - EditableSNLabel.onSubmit(41) | == in
SUBMIT===
Mar 5, 2008 5:58:01 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.IllegalAccessError: tried to access method
org.apache.wicket.Component.onModelChanging()V from class
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1
at
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1.onModelChanging(AjaxEditableLabel.java:294)
at org.apache.wicket.Component.modelChanging(Component.java:2097)
at org.apache.wicket.Component.setModelObject(Component.java:2863)
-- 
View this message in context: 
http://www.nabble.com/java.lang.IllegalAccessError%3A-tried-to-access-method-org.apache.wicket.Component.onModelChanging%28%29V%3A%3A%3A-when-using-AjaxEditableLabel-tp15864917p15864917.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How and when to retrieve messages from Session

2008-03-05 Thread Warren
I need to display messages from the Session in a plain JavaScript alert
window instead of a feedback panel. I wrote something that seems to work
only part of the time. I am writing my messages to error(...) on the Session
and retrieving them from the  Session with
getFeedbackMessages().messages(null). I retrieve them when I construct my
page and then add them to the body tag's onload event. It will work if I
call error(...) right before when I call
getFeedbackMessages().messages(null). It seems that the messages have
already been retrieved or deleted before I get to them.

How can I get a hold of the messages that are displayed on a feedback panel
so I can display them on a JS alert window instead?

Thanks,

Warren


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



Re:RE: getPageParameters() NullPointer

2008-03-05 Thread zhangjunfeng21
 thanks,but there is no method of Page.getPageParameters(), how to use it ? 
may you show me in detial ?

 
 
 



Stephan, what you want is not PageParameters.getKey(id), but 
PageParameters.getInt(id);


 PageParameters params = new PageParameters(); 
 System.out.print(pid= + params.getKey(pid));--the output is null

yes, the output is null, you just created a new, empty page parameters object. 
use Page.getPageParameters()

Thomas



 Sent: Mittwoch, 5. März 2008 10:31
 To: users@wicket.apache.org
 Subject: Re:getPageParameters() NullPointer
 
  hello,i got the same problem.
  
PageParameters params = new PageParameters();
params.put(pid, pid);
this.setResponsePage(FirstLogin.class,
  new PageParameters(params));
  
 in FirstLogin.java ---
 PageParameters params = new PageParameters(); 
 System.out.print(pid= + params.getKey(pid));--the 
 output is null;how to get the parameter?
 
 
 
 Hi all,
 
 I'm experiencing a problem using getPageParameters().
 
 The parameter id is passed to MyPage:
 setResponsePage(MyPage.class, new PageParameters(id=+evalId));
 
 In the constructor of MyPage I try to access the parameter id:
 Integer evalId = Integer.parseInt(getPageParameters().getKey(id));
 
 This fails with a NullPointerException. I thought the usage 
 of PageParameters was pretty straightforward- did I miss 
 something here?
 
 I'm using Wicket 1.3.
 
 Regards,
 Stephan
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


Re: java.lang.IllegalAccessError: tried to access method org.apache.wicket.Component.onModelChanging()V::: when using AjaxEditableLabel

2008-03-05 Thread Igor Vaynberg
this should be fixed in trunk...

-igor


On Wed, Mar 5, 2008 at 6:00 PM, hjuturu [EMAIL PROTECTED] wrote:

  Hi All,
  I have a edit in place label in my wicket page .
  When i try to edit it i get this exception. I am using wicket 1.3.1 and
  Tomcat 6.0.14.
  Can anyone tell me what is the problem.

  DEBUG - EditableSNLabel.onSubmit(41) | == in
  SUBMIT===
  Mar 5, 2008 5:58:01 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet default threw exception
  java.lang.IllegalAccessError: tried to access method
  org.apache.wicket.Component.onModelChanging()V from class
  org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1
 at
  
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1.onModelChanging(AjaxEditableLabel.java:294)
 at org.apache.wicket.Component.modelChanging(Component.java:2097)
 at org.apache.wicket.Component.setModelObject(Component.java:2863)
  --
  View this message in context: 
 http://www.nabble.com/java.lang.IllegalAccessError%3A-tried-to-access-method-org.apache.wicket.Component.onModelChanging%28%29V%3A%3A%3A-when-using-AjaxEditableLabel-tp15864917p15864917.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: How and when to retrieve messages from Session

2008-03-05 Thread Igor Vaynberg
feedback messages are not cleaned up until the end fo request, so you
should be able to retrieve them...

if you are doing this across pages make sure you call
getsession().error(..) not just error(..)

-igor


On Wed, Mar 5, 2008 at 6:01 PM, Warren [EMAIL PROTECTED] wrote:
 I need to display messages from the Session in a plain JavaScript alert
  window instead of a feedback panel. I wrote something that seems to work
  only part of the time. I am writing my messages to error(...) on the Session
  and retrieving them from the  Session with
  getFeedbackMessages().messages(null). I retrieve them when I construct my
  page and then add them to the body tag's onload event. It will work if I
  call error(...) right before when I call
  getFeedbackMessages().messages(null). It seems that the messages have
  already been retrieved or deleted before I get to them.

  How can I get a hold of the messages that are displayed on a feedback panel
  so I can display them on a JS alert window instead?

  Thanks,

  Warren


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



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



wicket-datetime

2008-03-05 Thread Ned Collyer

I'd potentially like to use this component, but its putting a ridiculous
amount of markup into the script section in the head.  Including a copy of
the license...

Is there an easy way to move this into a separate request/resource - 1 per
locale used?

Also, if I add 2 date pickers it puts all the JS in the head... twice!!
(including the license), .. how can I get it to reuse the same javascript.

Is this library intended for demo only?


-- 
View this message in context: 
http://www.nabble.com/wicket-datetime-tp15866334p15866334.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: How and when to retrieve messages from Session

2008-03-05 Thread Warren
I was trying to retrieve the messages before they were placed into the
Session. I now am retrieving them in the page's onBeforeRender() method and
it seems to be working. Do you see any problems doing it this way?

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 05, 2008 7:06 PM
 To: users@wicket.apache.org
 Subject: Re: How and when to retrieve messages from Session


 feedback messages are not cleaned up until the end fo request, so you
 should be able to retrieve them...

 if you are doing this across pages make sure you call
 getsession().error(..) not just error(..)

 -igor


 On Wed, Mar 5, 2008 at 6:01 PM, Warren [EMAIL PROTECTED] wrote:
  I need to display messages from the Session in a plain JavaScript alert
   window instead of a feedback panel. I wrote something that
 seems to work
   only part of the time. I am writing my messages to error(...)
 on the Session
   and retrieving them from the  Session with
   getFeedbackMessages().messages(null). I retrieve them when I
 construct my
   page and then add them to the body tag's onload event. It will
 work if I
   call error(...) right before when I call
   getFeedbackMessages().messages(null). It seems that the messages have
   already been retrieved or deleted before I get to them.
 
   How can I get a hold of the messages that are displayed on a
 feedback panel
   so I can display them on a JS alert window instead?
 
   Thanks,
 
   Warren
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



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



Re: Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread Gin Yeah
There is no Javascript generated at the browser end at all:

a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
wicket:id=closeLinkClose/a

The popup is open with this:

Java:

PopupSettings ps = new PopupSettings()
.setHeight(200)
.setWidth(100)
.setTop(50)
.setLeft(200)
.setWindowName(Salumonunu);

add(new PageLink(popupPageLink, AnotherPage.class
).setPopupSettings(ps));

html:

lia wicket:id=popupPageLinkPopup another page/a/li


AnotherPage.java:

public class AnotherPage extends ExtendFromBasePage {
private static final long serialVersionUID = 1L;
public AnotherPage() {
add(new PopupCloseLink(closeLink) {
private static final long serialVersionUID = 1L;
@Override public void onClick() {
System.out.println(HERE HERE HERE);
}
});
}



AnotherPage.html:

html
a wicket:id=closeLinkClose/a
/html



The generated code in the browser:

a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
wicket:id=closeLinkClose/a





On Wed, Mar 5, 2008 at 5:37 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 any javascript errors in your browser? is the popupcloselink inside
 the popup window - which is another window that is NOT a modal
 window...?

 -igor


 On Wed, Mar 5, 2008 at 4:28 PM, MYoung [EMAIL PROTECTED] wrote:
 
   I must be doing it wrong.  I have this in my  popup template:
 
   lt;a wicket:id=closeMegt;Closelt;/agt;
 
 
   In java:
 
   add(new PopupCloseLink(closeMe) {
   @Override public void onClick() {
 // HERE HERE
  }
   });
 
   onClick() is called but the popup window stays.
 
   Another question, how to get notify  when the popup is close by
 clicking on
   the close box on the browser window's title bar?
   --
   View this message in context:
 http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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




Re: wicket-datetime

2008-03-05 Thread Peter Thomas
On 3/6/08, Ned Collyer [EMAIL PROTECTED] wrote:


 I'd potentially like to use this component, but its putting a ridiculous

 amount of javascript into the script section in the head.  Including a
 copy

 of the license...

 Is there an easy way to move this into a separate request/resource - 1 per
 locale used?

 Also, if I add 2 date pickers it puts all the JS in the head... twice!!
 (including the license), .. how can I get it to reuse the same javascript.

 Is this library intended for demo only?


I rolled my own datepicker (based on YUI) which was easy, you can have a
look at the code here:

http://fisheye3.cenqua.com/browse/j-trac/trunk/jtrac/src/main/java/info/jtrac/wicket/yui/YuiCalendar.java?r=1090

It does not support internationalization at all, but it may help, I also
wrote a small piece of javascript that reduces the amount of js needed in
head:
http://fisheye3.cenqua.com/browse/j-trac/trunk/jtrac/src/main/webapp/resources/yui/calendar/calendar-utils.js?r=1004

--
 View this message in context:
 http://www.nabble.com/wicket-datetime-tp15866334p15866334.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread Igor Vaynberg
ok, but do you see javascript errors after you press the link? because
that outputs a window.close() javascript to close the window...

-igor


On Wed, Mar 5, 2008 at 9:03 PM, Gin Yeah [EMAIL PROTECTED] wrote:
 There is no Javascript generated at the browser end at all:

  a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
  wicket:id=closeLinkClose/a

  The popup is open with this:

  Java:

 PopupSettings ps = new PopupSettings()
 .setHeight(200)
 .setWidth(100)
 .setTop(50)
 .setLeft(200)
 .setWindowName(Salumonunu);

 add(new PageLink(popupPageLink, AnotherPage.class
  ).setPopupSettings(ps));

  html:

 lia wicket:id=popupPageLinkPopup another page/a/li


  AnotherPage.java:

  public class AnotherPage extends ExtendFromBasePage {
 private static final long serialVersionUID = 1L;
 public AnotherPage() {
 add(new PopupCloseLink(closeLink) {
 private static final long serialVersionUID = 1L;
 @Override public void onClick() {
 System.out.println(HERE HERE HERE);
 }
 });
 }



  AnotherPage.html:

  html
 a wicket:id=closeLinkClose/a
  /html



  The generated code in the browser:

  a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
  wicket:id=closeLinkClose/a





  On Wed, Mar 5, 2008 at 5:37 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:



   any javascript errors in your browser? is the popupcloselink inside
   the popup window - which is another window that is NOT a modal
   window...?
  
   -igor
  
  
   On Wed, Mar 5, 2008 at 4:28 PM, MYoung [EMAIL PROTECTED] wrote:
   
 I must be doing it wrong.  I have this in my  popup template:
   
 lt;a wicket:id=closeMegt;Closelt;/agt;
   
   
 In java:
   
 add(new PopupCloseLink(closeMe) {
 @Override public void onClick() {
   // HERE HERE
}
 });
   
 onClick() is called but the popup window stays.
   
 Another question, how to get notify  when the popup is close by
   clicking on
 the close box on the browser window's title bar?
 --
 View this message in context:
   
 http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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



Re: How and when to retrieve messages from Session

2008-03-05 Thread Igor Vaynberg
should be fine

-igor


On Wed, Mar 5, 2008 at 8:40 PM, Warren [EMAIL PROTECTED] wrote:
 I was trying to retrieve the messages before they were placed into the
  Session. I now am retrieving them in the page's onBeforeRender() method and
  it seems to be working. Do you see any problems doing it this way?



   -Original Message-
   From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, March 05, 2008 7:06 PM
   To: users@wicket.apache.org
   Subject: Re: How and when to retrieve messages from Session
  
  
   feedback messages are not cleaned up until the end fo request, so you
   should be able to retrieve them...
  
   if you are doing this across pages make sure you call
   getsession().error(..) not just error(..)
  
   -igor
  
  
   On Wed, Mar 5, 2008 at 6:01 PM, Warren [EMAIL PROTECTED] wrote:
I need to display messages from the Session in a plain JavaScript alert
 window instead of a feedback panel. I wrote something that
   seems to work
 only part of the time. I am writing my messages to error(...)
   on the Session
 and retrieving them from the  Session with
 getFeedbackMessages().messages(null). I retrieve them when I
   construct my
 page and then add them to the body tag's onload event. It will
   work if I
 call error(...) right before when I call
 getFeedbackMessages().messages(null). It seems that the messages have
 already been retrieved or deleted before I get to them.
   
 How can I get a hold of the messages that are displayed on a
   feedback panel
 so I can display them on a JS alert window instead?
   
 Thanks,
   
 Warren
   
   
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  


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



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



Re: wicket-datetime

2008-03-05 Thread Igor Vaynberg
it seems to be working just fine here

http://wicketstuff.org/wicket13/dates/


-igor


On Wed, Mar 5, 2008 at 8:33 PM, Ned Collyer [EMAIL PROTECTED] wrote:

  I'd potentially like to use this component, but its putting a ridiculous
  amount of markup into the script section in the head.  Including a copy of
  the license...

  Is there an easy way to move this into a separate request/resource - 1 per
  locale used?

  Also, if I add 2 date pickers it puts all the JS in the head... twice!!
  (including the license), .. how can I get it to reuse the same javascript.

  Is this library intended for demo only?


  --
  View this message in context: 
 http://www.nabble.com/wicket-datetime-tp15866334p15866334.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread Gin Yeah
How to see Javascript error?  Something to turn on in the browser?

On Wed, Mar 5, 2008 at 10:22 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 ok, but do you see javascript errors after you press the link? because
 that outputs a window.close() javascript to close the window...

 -igor


 On Wed, Mar 5, 2008 at 9:03 PM, Gin Yeah [EMAIL PROTECTED] wrote:
  There is no Javascript generated at the browser end at all:
 
   a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
   wicket:id=closeLinkClose/a
 
   The popup is open with this:
 
   Java:
 
  PopupSettings ps = new PopupSettings()
  .setHeight(200)
  .setWidth(100)
  .setTop(50)
  .setLeft(200)
  .setWindowName(Salumonunu);
 
  add(new PageLink(popupPageLink, AnotherPage.class
   ).setPopupSettings(ps));
 
   html:
 
  lia wicket:id=popupPageLinkPopup another page/a/li
 
 
   AnotherPage.java:
 
   public class AnotherPage extends ExtendFromBasePage {
  private static final long serialVersionUID = 1L;
  public AnotherPage() {
  add(new PopupCloseLink(closeLink) {
  private static final long serialVersionUID = 1L;
  @Override public void onClick() {
  System.out.println(HERE HERE HERE);
  }
  });
  }
 
 
 
   AnotherPage.html:
 
   html
  a wicket:id=closeLinkClose/a
   /html
 
 
 
   The generated code in the browser:
 
   a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
   wicket:id=closeLinkClose/a
 
 
 
 
 
   On Wed, Mar 5, 2008 at 5:37 PM, Igor Vaynberg [EMAIL PROTECTED]
   wrote:
 
 
 
any javascript errors in your browser? is the popupcloselink inside
the popup window - which is another window that is NOT a modal
window...?
   
-igor
   
   
On Wed, Mar 5, 2008 at 4:28 PM, MYoung [EMAIL PROTECTED] wrote:

  I must be doing it wrong.  I have this in my  popup template:

  lt;a wicket:id=closeMegt;Closelt;/agt;


  In java:

  add(new PopupCloseLink(closeMe) {
  @Override public void onClick() {
// HERE HERE
 }
  });

  onClick() is called but the popup window stays.

  Another question, how to get notify  when the popup is close by
clicking on
  the close box on the browser window's title bar?
  --
  View this message in context:
   
 http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
  Sent from the Wicket - User mailing list archive at Nabble.com.



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


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

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




Re: Guide for html designers

2008-03-05 Thread Nino Saturnino Martinez Vazquez Wael
I actually thought your question to be good, I think using markup 
inheritance could help some inorder for web designers since the could 
have a larger base of the html in one file..


But again all your panels html are still fragmented.

btw I belive that designers should just ignore the wicket specific tags, 
and maybe dont rely too much on id's since they could change..



regards Nino

Alex Jacoby wrote:
Heh, slight misunderstanding -- I *am* the programmer, and my site is 
just about done, and I'm going to be passing it on to the web folk 
(HTML, CSS, graphics people who don't program) to prettify it asap.


I know that it will involve me teaching them some of the basics of 
wicket, but I was wondering if there were resources out there for 
helping in this type of situation... a Wicket for non-programmers 
type guide.  I've written a few pages so far...


Thanks again for the suggestions,
Alex

On Mar 5, 2008, at 4:54 PM, Ned Collyer wrote:



A web designer being a graphics or a HTML guy (or a combination 
thereof)?


Seriously tho, design your site, give the output to the programmer to
wicket up.

I don't see how wicket will work for you if you don't understand the 
basic

bits of java.  If you do, the tutorials and examples on the website
http://wicket.apache.org/examples.html then that should be an easy 
enough

stepping stone to forage deeper.

Things you are probably interested in are panels, borders, includes and
fragments.
http://wicketstuff.org/wicket13/compref/

But I think you will find it tough with zero java knowledge.  It may 
work

well if you are working with a programmer :), but solo - good luck!



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




--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread Gin Yeah
Ok, I got it.  I need to call super.onClick().  Thanks!

On Wed, Mar 5, 2008 at 10:22 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 ok, but do you see javascript errors after you press the link? because
 that outputs a window.close() javascript to close the window...

 -igor


 On Wed, Mar 5, 2008 at 9:03 PM, Gin Yeah [EMAIL PROTECTED] wrote:
  There is no Javascript generated at the browser end at all:
 
   a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
   wicket:id=closeLinkClose/a
 
   The popup is open with this:
 
   Java:
 
  PopupSettings ps = new PopupSettings()
  .setHeight(200)
  .setWidth(100)
  .setTop(50)
  .setLeft(200)
  .setWindowName(Salumonunu);
 
  add(new PageLink(popupPageLink, AnotherPage.class
   ).setPopupSettings(ps));
 
   html:
 
  lia wicket:id=popupPageLinkPopup another page/a/li
 
 
   AnotherPage.java:
 
   public class AnotherPage extends ExtendFromBasePage {
  private static final long serialVersionUID = 1L;
  public AnotherPage() {
  add(new PopupCloseLink(closeLink) {
  private static final long serialVersionUID = 1L;
  @Override public void onClick() {
  System.out.println(HERE HERE HERE);
  }
  });
  }
 
 
 
   AnotherPage.html:
 
   html
  a wicket:id=closeLinkClose/a
   /html
 
 
 
   The generated code in the browser:
 
   a href=?wicket:interface=Salumonunu:0:closeLink::ILinkListener::
   wicket:id=closeLinkClose/a
 
 
 
 
 
   On Wed, Mar 5, 2008 at 5:37 PM, Igor Vaynberg [EMAIL PROTECTED]
   wrote:
 
 
 
any javascript errors in your browser? is the popupcloselink inside
the popup window - which is another window that is NOT a modal
window...?
   
-igor
   
   
On Wed, Mar 5, 2008 at 4:28 PM, MYoung [EMAIL PROTECTED] wrote:

  I must be doing it wrong.  I have this in my  popup template:

  lt;a wicket:id=closeMegt;Closelt;/agt;


  In java:

  add(new PopupCloseLink(closeMe) {
  @Override public void onClick() {
// HERE HERE
 }
  });

  onClick() is called but the popup window stays.

  Another question, how to get notify  when the popup is close by
clicking on
  the close box on the browser window's title bar?
  --
  View this message in context:
   
 http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
  Sent from the Wicket - User mailing list archive at Nabble.com.



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


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

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




RE: RE: getPageParameters() NullPointer

2008-03-05 Thread Maeder Thomas
Yes there is, it's in Page.java at line 319 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Donnerstag, 6. März 2008 03:11
 To: users@wicket.apache.org
 Subject: Re:RE: getPageParameters() NullPointer
 
  thanks,but there is no method of Page.getPageParameters(), 
 how to use it ? may you show me in detial ?
 
  
  
  
 
 
 
 Stephan, what you want is not PageParameters.getKey(id), 
 but PageParameters.getInt(id);
 
 
  PageParameters params = new PageParameters(); 
 System.out.print(pid= 
  + params.getKey(pid));--the output is null
 
 yes, the output is null, you just created a new, empty page 
 parameters object. use Page.getPageParameters()
 
 Thomas
 
 
 
  Sent: Mittwoch, 5. März 2008 10:31
  To: users@wicket.apache.org
  Subject: Re:getPageParameters() NullPointer
  
   hello,i got the same problem.
   
 PageParameters params = new PageParameters();
 params.put(pid, pid);
 this.setResponsePage(FirstLogin.class,
   new PageParameters(params));
   
  in FirstLogin.java ---
  PageParameters params = new PageParameters(); 
 System.out.print(pid= 
  + params.getKey(pid));--the output is null;how to get the 
  parameter?
  
  
  
  Hi all,
  
  I'm experiencing a problem using getPageParameters().
  
  The parameter id is passed to MyPage:
  setResponsePage(MyPage.class, new PageParameters(id=+evalId));
  
  In the constructor of MyPage I try to access the parameter id:
  Integer evalId = Integer.parseInt(getPageParameters().getKey(id));
  
  This fails with a NullPointerException. I thought the usage of 
  PageParameters was pretty straightforward- did I miss 
 something here?
  
  I'm using Wicket 1.3.
  
  Regards,
  Stephan
  
  
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 

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