Re: DateTimeField question

2008-03-29 Thread Ryan Gravener
Do you want the component or whether or not its a am or pm?

MutableDateTime mdt = new MutableDateTime(startField.getModelObject());

mdt.set(DateTimeFieldType type, int value);

startField.setModelObject(mdt.toDate());

http://joda-time.sourceforge.net/api-release/org/joda/time/MutableDateTime.html

On Sat, Mar 29, 2008 at 12:47 AM, Martin Makundi
[EMAIL PROTECTED] wrote:
 Sorry, got confused with DateTextField.. DateTimeField indeed has this
  AM_PM stuff.

  2008/3/29, Martin Makundi [EMAIL PROTECTED]:


  What is AM_PM? At least 1.3.1 does not have such feature. I would
rather use java.util.Calendar to figure out internals of the
startField.getModelObject() which should be a date.
  
**
Martin
  
2008/3/28, Pinger [EMAIL PROTECTED]:
  
   
  So I am a noob with Wicket.. so I have a dumb question..


  I have a DateTimeField

  I do this

  DateTimeField  startField = new DateTimeField(starttime, new
  PropertyModel(properties, starttime));
  form.add(startField);

  Ok I want to be able to set and get this field.. I can do that with
  everything.. but AM_PM

  this does not work

  AM_PM amOrPm = startField .getAmOrPm();

  Please help.. pulling my hair out.

  Thanks

 --
  View this message in context: 
 http://www.nabble.com/DateTimeField-question-tp16359499p16359499.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]





-- 
Ryan Gravener
http://ryangravener.com

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



Re: setResponsePage(Class c) versus setResponsePage(Page p)

2008-03-29 Thread Johan Compagner
yes it does
do you see the ILinkListener part is your browser url?
no because the cleanest url: wicket:interface=:15 is the
IRedirectListener but we dont print that in the url because that one is
assumed
if no interface string is given

johan


On Sat, Mar 29, 2008 at 1:43 AM, James Carman [EMAIL PROTECTED]
wrote:

 Nevermind, I thought it was a link listener URL, but maybe it's not.
 Here's what I'm seeing.  I have my home page (a quickstart app) set up
 to do a link to AnotherPage in two different ways:

public HomePage()
{
add(new Link(link1)
{
public void onClick()
{
setResponsePage(new AnotherPage());
setRedirect(true);
}
});
add(new Link(link2)
{
public void onClick()
{
setResponsePage(AnotherPage.class);
setRedirect(true);
}
});
}

 html
 head
titleWicket Quickstart Archetype Homepage/title
 /head
 body
 a href=# wicket:id=link1Page Instance Link/a
 br/
 a href=# wicket:id=link2Class Link/a
 /body
 /html

 I also have HomePage mounted as such (AnotherPage is in the same package):

 mount(new PackageRequestTargetUrlCodingStrategy(/home,
 PackageName.forClass(HomePage.class)));

 So, here's what I get when HomePage renders:

 html
 head
titleWicket Quickstart Archetype Homepage/title
 /head
 body
 a href=../../?wicket:interface=:14:link1::ILinkListener::
 wicket:id=link1Page Instance Link/a
 br/
 a href=../../?wicket:interface=:14:link2::ILinkListener::
 wicket:id=link2Class Link/a
 /body
 /html

 When I click link1, the browser's URL is:

 http://localhost:8080/myproject/?wicket:interface=:15

 When I click link2, the browser's URL is:

 http://localhost:8080/myproject/home/AnotherPage/

 So, it looked like a redirect wasn't happening in the first case.  Is it?
 On Fri, Mar 28, 2008 at 8:16 PM, James Carman
 [EMAIL PROTECTED] wrote:
  Well, I tried it with doing setResponsePage(new MyOtherPage()) and URL
   still looked like the link listener URL.  But, when I did
   setResponsePage(MyOtherPage.class), the URL changed to whatever I
   mounted it to.  I assumed that meant that the redirect wasn't
   happening.  I could be wrong.
 
 
 
 
   On Fri, Mar 28, 2008 at 7:47 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:
what do you mean redirect does't work?
 90% of the time if you do setResponsePage(new Page())
 a redirect is done anyway. (for example if you do that in onSubmit)
 To go around for example the double post problem if you go back in
 history
 or refresh the page.
   
 johan
   
 On Sat, Mar 29, 2008 at 12:15 AM, James Carman 
 [EMAIL PROTECTED]
   
   
wrote:
   
  Oh, and redirect doesn't work with the Page version (at least in
 my
  tests it didn't).
 
  On Fri, Mar 28, 2008 at 7:13 PM, James Carman
  [EMAIL PROTECTED] wrote:
   If you need to initialize the page instance in some way (by
 passing
constructor params, for instance), you use the Page version.
  The
other version just uses Class.newInstance() to instantiate the
 page
object.
  
  
  
On Fri, Mar 28, 2008 at 6:44 PM, Timm Helbig 
  [EMAIL PROTECTED] wrote:
 Hi,

  I have read several times in the mailing list, that it is
 bad to use
  setRespsonsePage(Page p). What is the backdraw compared to
  setResponsePage(Class c) ?

  In my case a Form Submit redirects to another Page, that
 needs some
  initial
  data given through the Constructor, e.g.
 MyPage(MyInitialData data)
  {} .

  Regards,
  Timm


 
  -
  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]




Page-dependent timeout values for session

2008-03-29 Thread Per Newgro
Hi *,

we added an IFRAME to out homepage. This gets an url to he wicket-application 
by assignment to src attribute. If the user uses the button in IFRAME a new 
window is open and the application is displayed.

We set the session timeout limit in web.xml. Everything ok so far. But we have 
the effect, that the part displayed in the IFRAME runs into timeout. This 
looks always a bit ugly.

Now my question: Can we set the timeout to different values for a page?
Stateless stuff seems not to be relevant here because we use some ajax 
behavior in IFRAME part.

Hope i made my point clear.
Cheers
Per

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



Re: Lazy load exception wicket and hibernate

2008-03-29 Thread lars vonk
What is the order of the filters you defined in your filter-mapping element
in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
definition in the filter-mapping after the WicketFilter otherwise the
WicketFilter will come first.

Lars

On Fri, Mar 28, 2008 at 9:11 PM, cjlyth [EMAIL PROTECTED] wrote:


 I have been getting the same error. I feel like im missing something.
 Maybe I
 am doing something horibly wrong but I haven't been able to figure out
 what
 it is.

 I am using spring 2.5, Wicket 1.3.2, and I have put the
 OpenEntityManagerInViewFilter  in my web xml. The filter is loading ok, im
 not sure what to do next...

 If anyone can help please let me know what you need to see. I even have an
 example application i can upload.
 I am using a DataView, I have tried to inject the spring beans into every
 part (data provider, etc) and I always get the same result...
 For now I will include the wicket stuff:


 public class Home extends WebPage {
@SpringBean
private TestService testService;

public Home() {
init();
}

public Home(PageParameters parameters) {
super(parameters);
init();
}

private void init() {
add(new DataView(container, new ListOwnerProvider()) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(Item item) {
/*ListOwner owner =
 (ListOwner)item.getModelObject();*/
item.add(new Label(name));
item.add(new ListView(entries){
private static final long
 serialVersionUID = 1L;

@Override
protected void
 populateItem(ListItem item) {
item.add(new
 Label(value));
}
});
}
});
}

class ListOwnerProvider implements IDataProvider {

private static final long serialVersionUID = 1L;

@Override
public void detach() {


}

@Override
public Iterator iterator(int first, int count) {
return testService.getListOwners
 (first,count).iterator();
}

@Override
public IModel model(Object object) {

return new CompoundPropertyModel(new
 ListOwnerModel((ListOwner)object));
}

@Override
public int size() {
return testService.getListOwners().size();
}
}

class ListOwnerModel extends LoadableDetachableModel {
private static final long serialVersionUID = 1L;
private Integer id;

public ListOwnerModel(ListOwner listOwner) {
this.id = listOwner.getId();
}

@Override
protected Object load() {
return testService.getListOwner(id);
 }
}
 }



 Mathias P.W Nilsson wrote:
 
  I'm using wicket with hibernate and spring. In my web.xml I have
  OpenEntityManagerInViewFilter. But when trying to add a dataview to my
  wicket page I get the org.hibernate.LazyInitializationException
 

 --
 View this message in context:
 http://www.nabble.com/Lazy-load-exception-wicket-and-hibernate-tp15976668p16361116.html
 Sent from the Wicket - User mailing list archive at Nabble.com.



Re: setResponsePage(Class c) versus setResponsePage(Page p)

2008-03-29 Thread James Carman
On Sat, Mar 29, 2008 at 4:18 AM, Johan Compagner [EMAIL PROTECTED] wrote:
 yes it does
  do you see the ILinkListener part is your browser url?
  no because the cleanest url: wicket:interface=:15 is the
  IRedirectListener but we dont print that in the url because that one is
  assumed
  if no interface string is given


Ok, my bad.  I just saw all those dots in the URL and assumed it was
the link listener's URL still.  That's good to know that if the
listener interface isn't included that it's the IRedirectListener.
Thanks for the explanation.  Sorry for the misinformation.

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



Fileupload?

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael
As I am getting very used to the wicket way,  using compound models with 
my form fields labels an so on.


I suddenly are a bit stomped why you have todo so much when it comes to 
uploading files (and yes I am aware that it is only a few more lines of 
code).. I think the fileupload field should work just as text field etc..


But as with other stuff I get puzzled by there are probably a very good 
reason why it dosent?


--
-Wicket for love

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: create email with wicket/javamail

2008-03-29 Thread greeklinux

Hello,

I looked into the source code, but I do not find some line
that helped me. I was using the online SVN view. But I think
checkout the source will be much better...




jwcarman wrote:
 
 I would maybe take a look at WicketTester.  It does what you're
 looking for (renders to a String) I believe.
 
 On Thu, Mar 27, 2008 at 4:43 AM, greeklinux [EMAIL PROTECTED] wrote:

  I found the method Component.render(MarkupStream markupStream).

  I am thinking about to create this page and then render it, save the
 stream,
  and set it as email body...

  Or is there a more elegant and better wicket-way to achieve this?






  greeklinux wrote:
  
   Hello,
  
   I would like to create an email body with wicket and send
   it with javamail. I read that it is possible to create a page
   and get it from a buffer.
  
   I do not want to use other template languages like velocity.
   I think wicket schould be enough.
  
   I read about StringRequestTarget and the RequestCycle.setRequestTarget
   but I do not know how to use them. I new to wicket.
  
   If someone can give me a hint it would be great.
  
  
  
  
  

  --
  View this message in context:
 http://www.nabble.com/create-email-with-wicket-javamail-tp16289600p16323360.html


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


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


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

-- 
View this message in context: 
http://www.nabble.com/create-email-with-wicket-javamail-tp16289600p16369989.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]



Dynamic creation of CSS

2008-03-29 Thread Eric Rotick
I have a requirement to allow users to change such things as colour, font
etc. for certain markup. Currently this is all 'wrapped' by CSS ids/classes
but the use of varying ids/classes seems wrong.

The use case if for engineers viewing data from sensors. Some engineers
require values below a certain value to be highlighted whereas other
engineers want values above a certain value to be highlighted. The
highlighting might means changing the font to bold, the background colour to
yellow, the foreground colour to red and the surrounding box to double
lines. I could have CSS classes of highlight1, highlight2 etc but read on.

In essence the markup is exactly the same but for the highlighting rules so
having a number of sub classed pages is not correct. In addition, the rules
at which something may change might change at run time. For example, one
particular engineer may be monitoring a system where a value is highlighted
if it goes outside of a range and another highlight if the erroneous value
has been out of range for an extended time period. Basically, each engineer
can choose their own colour scheme. Also, for very complex situations an
engineer would be overloaded by too much information. In these cases they
dim down the non important data so that the important data becomes more
prominent.

OK, I could define a bigger set of CSS classes for each situation but each
engineer has a different way of solving the viewing problem and the current
system (not web based) does what they want.

So, I think the solution lies in the dynamic generation of the CSS at run
time from the database. I then thought I would create a small servlet to
handle this but then, I already have Wicket running, maybe I should sub
class Page and make a CssPage class. I need to have a pop at doing this in
the future anyway for WML so the research would not be wasted.

I was wondering if anyone had any experience or advice before I look into
this in more detail.

Eric.


Re: Dynamic creation of CSS

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael
if you need to do it dynamicly, you could just use the 
textressourcetemplate approach, something similar what I've done with 
the js in wicket input events (I stole the idea from the datepicker)..



regards Nino

Eric Rotick wrote:

I have a requirement to allow users to change such things as colour, font
etc. for certain markup. Currently this is all 'wrapped' by CSS ids/classes
but the use of varying ids/classes seems wrong.

The use case if for engineers viewing data from sensors. Some engineers
require values below a certain value to be highlighted whereas other
engineers want values above a certain value to be highlighted. The
highlighting might means changing the font to bold, the background colour to
yellow, the foreground colour to red and the surrounding box to double
lines. I could have CSS classes of highlight1, highlight2 etc but read on.

In essence the markup is exactly the same but for the highlighting rules so
having a number of sub classed pages is not correct. In addition, the rules
at which something may change might change at run time. For example, one
particular engineer may be monitoring a system where a value is highlighted
if it goes outside of a range and another highlight if the erroneous value
has been out of range for an extended time period. Basically, each engineer
can choose their own colour scheme. Also, for very complex situations an
engineer would be overloaded by too much information. In these cases they
dim down the non important data so that the important data becomes more
prominent.

OK, I could define a bigger set of CSS classes for each situation but each
engineer has a different way of solving the viewing problem and the current
system (not web based) does what they want.

So, I think the solution lies in the dynamic generation of the CSS at run
time from the database. I then thought I would create a small servlet to
handle this but then, I already have Wicket running, maybe I should sub
class Page and make a CssPage class. I need to have a pop at doing this in
the future anyway for WML so the research would not be wasted.

I was wondering if anyone had any experience or advice before I look into
this in more detail.

Eric.

  


--
-Wicket for love

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: create email with wicket/javamail

2008-03-29 Thread James Carman
You can do WicketTester.getServletResponse().getDocument() to get the
rendered HTML.

On Sat, Mar 29, 2008 at 9:27 AM, greeklinux [EMAIL PROTECTED] wrote:

  Hello,

  I looked into the source code, but I do not find some line
  that helped me. I was using the online SVN view. But I think
  checkout the source will be much better...






  jwcarman wrote:
  
   I would maybe take a look at WicketTester.  It does what you're
   looking for (renders to a String) I believe.
  
   On Thu, Mar 27, 2008 at 4:43 AM, greeklinux [EMAIL PROTECTED] wrote:
  
I found the method Component.render(MarkupStream markupStream).
  
I am thinking about to create this page and then render it, save the
   stream,
and set it as email body...
  
Or is there a more elegant and better wicket-way to achieve this?
  
  
  
  
  
  
greeklinux wrote:

 Hello,

 I would like to create an email body with wicket and send
 it with javamail. I read that it is possible to create a page
 and get it from a buffer.

 I do not want to use other template languages like velocity.
 I think wicket schould be enough.

 I read about StringRequestTarget and the RequestCycle.setRequestTarget
 but I do not know how to use them. I new to wicket.

 If someone can give me a hint it would be great.





  
--
View this message in context:
   
 http://www.nabble.com/create-email-with-wicket-javamail-tp16289600p16323360.html
  
  
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/create-email-with-wicket-javamail-tp16289600p16369989.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: Dynamic creation of CSS

2008-03-29 Thread Eric Rotick
Where can I find out more about this approach?

On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 if you need to do it dynamicly, you could just use the
 textressourcetemplate approach, something similar what I've done with
 the js in wicket input events (I stole the idea from the datepicker)..


 regards Nino

 Eric Rotick wrote:
  I have a requirement to allow users to change such things as colour,
 font
  etc. for certain markup. Currently this is all 'wrapped' by CSS
 ids/classes
  but the use of varying ids/classes seems wrong.
 
  The use case if for engineers viewing data from sensors. Some engineers
  require values below a certain value to be highlighted whereas other
  engineers want values above a certain value to be highlighted. The
  highlighting might means changing the font to bold, the background
 colour to
  yellow, the foreground colour to red and the surrounding box to double
  lines. I could have CSS classes of highlight1, highlight2 etc but read
 on.
 
  In essence the markup is exactly the same but for the highlighting rules
 so
  having a number of sub classed pages is not correct. In addition, the
 rules
  at which something may change might change at run time. For example, one
  particular engineer may be monitoring a system where a value is
 highlighted
  if it goes outside of a range and another highlight if the erroneous
 value
  has been out of range for an extended time period. Basically, each
 engineer
  can choose their own colour scheme. Also, for very complex situations an
  engineer would be overloaded by too much information. In these cases
 they
  dim down the non important data so that the important data becomes more
  prominent.
 
  OK, I could define a bigger set of CSS classes for each situation but
 each
  engineer has a different way of solving the viewing problem and the
 current
  system (not web based) does what they want.
 
  So, I think the solution lies in the dynamic generation of the CSS at
 run
  time from the database. I then thought I would create a small servlet to
  handle this but then, I already have Wicket running, maybe I should sub
  class Page and make a CssPage class. I need to have a pop at doing this
 in
  the future anyway for WML so the research would not be wasted.
 
  I was wondering if anyone had any experience or advice before I look
 into
  this in more detail.
 
  Eric.
 
 

 --
 -Wicket for love

 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: Dynamic creation of CSS

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael

http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events

essentially its this which are interesting:

private String generateString(TextTemplate textTemplate) {
   // variables for the initialization script
   MapString, String variables = new HashMapString, String();
 


   variables.put(disable_in_input, getDisable_in_input().toString());
   variables.put(type, getType().toString());
   variables.put(propagate, getPropagate().toString());
   variables.put(target, getTarget());

   textTemplate.interpolate(variables);
   return textTemplate.asString();

   }

in your case the text template could look like this:

   private final TextTemplate css = new PackagedTextTemplate(
   InputBehavior.class, mystyle.css);

you notate in your text file like this:

 input {
   color:${color};
}

Basicly you have a textfile and a map, when you interpolate the values 
the are replaced by what are inside your map... Ask if you have 
questions..:)


regards Nino

Eric Rotick wrote:

Where can I find out more about this approach?

On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

  

if you need to do it dynamicly, you could just use the
textressourcetemplate approach, something similar what I've done with
the js in wicket input events (I stole the idea from the datepicker)..


regards Nino

Eric Rotick wrote:


I have a requirement to allow users to change such things as colour,
  

font


etc. for certain markup. Currently this is all 'wrapped' by CSS
  

ids/classes


but the use of varying ids/classes seems wrong.

The use case if for engineers viewing data from sensors. Some engineers
require values below a certain value to be highlighted whereas other
engineers want values above a certain value to be highlighted. The
highlighting might means changing the font to bold, the background
  

colour to


yellow, the foreground colour to red and the surrounding box to double
lines. I could have CSS classes of highlight1, highlight2 etc but read
  

on.


In essence the markup is exactly the same but for the highlighting rules
  

so


having a number of sub classed pages is not correct. In addition, the
  

rules


at which something may change might change at run time. For example, one
particular engineer may be monitoring a system where a value is
  

highlighted


if it goes outside of a range and another highlight if the erroneous
  

value


has been out of range for an extended time period. Basically, each
  

engineer


can choose their own colour scheme. Also, for very complex situations an
engineer would be overloaded by too much information. In these cases
  

they


dim down the non important data so that the important data becomes more
prominent.

OK, I could define a bigger set of CSS classes for each situation but
  

each


engineer has a different way of solving the viewing problem and the
  

current


system (not web based) does what they want.

So, I think the solution lies in the dynamic generation of the CSS at
  

run


time from the database. I then thought I would create a small servlet to
handle this but then, I already have Wicket running, maybe I should sub
class Page and make a CssPage class. I need to have a pop at doing this
  

in


the future anyway for WML so the research would not be wasted.

I was wondering if anyone had any experience or advice before I look
  

into


this in more detail.

Eric.


  

--
-Wicket for love

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

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: newbie title attribute question

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael

You could also use a attribute modifer...

regards Nino

Andrew Broderick wrote:

Hi,

I want to put a title attribute in a td tag. However, my markup would then look 
like this:

td title=span wicket:id=title /  blah blah  /td

Now, I know I could output the td with a label and set escaping to false, 
thus passing the markup through to the browser. However, that would mean that 
everything inside it would also have to be in the label, and I want to keep markup 
out of my code. There must be a more elegant, Wicket-ish way to do this 

Thanks in advance

Andrew

___

The  information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial  use  of  the individual or entity to which it is
addressed and may contain information that is  propri-
etary  and  confidential.  If you are not the intended
recipient of this message you are hereby notified that
any  review, dissemination, distribution or copying of
this message is strictly prohibited.  This  communica-
tion  is  for information purposes only and should not
be regarded as an offer to sell or as  a  solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be  secure  or  error-
free. P6070214

  


--
-Wicket for love

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: Dynamic creation of CSS

2008-03-29 Thread Eric Rotick
Now I see. I had not discovered these classes!

I was hoping to avoid embedding the CSS within the HTML as this does not
benefit from the size reduction that CSS separation gives. However, you've
given me another idea. CSS allows for definitions to be overridden locally
in each page so I could arrange for the differences to be embedded and leave
the rest in the external CSS file.

Actually, now I think of it, the idea of a 'standard' set would mean that I
have to manage what is the default and what is the exception which is
currently done in a hierarchical fashion which is pretty slow to resolve.

The concept is that whenever a user changes anything to do with CSS the
system recreated the file username.css which is then included in each page
dynamically according to the user. The problem comes in where to write the
file when in a war deployment situation. I could write it to a database but
that still means it has to be 'produced' by the servlet engine and so we are
back to the same question.

Eric.

On Sat, Mar 29, 2008 at 3:37 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:


 http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events

 essentially its this which are interesting:

 private String generateString(TextTemplate textTemplate) {
// variables for the initialization script
MapString, String variables = new HashMapString, String();


variables.put(disable_in_input,
 getDisable_in_input().toString());
variables.put(type, getType().toString());
variables.put(propagate, getPropagate().toString());
variables.put(target, getTarget());

textTemplate.interpolate(variables);
return textTemplate.asString();

}

 in your case the text template could look like this:

private final TextTemplate css = new PackagedTextTemplate(
InputBehavior.class, mystyle.css);

 you notate in your text file like this:

  input {
color:${color};
 }

 Basicly you have a textfile and a map, when you interpolate the values
 the are replaced by what are inside your map... Ask if you have
 questions..:)

 regards Nino

 Eric Rotick wrote:
  Where can I find out more about this approach?
 
  On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez Wael 
  [EMAIL PROTECTED] wrote:
 
 
  if you need to do it dynamicly, you could just use the
  textressourcetemplate approach, something similar what I've done with
  the js in wicket input events (I stole the idea from the datepicker)..
 
 
  regards Nino
 
  Eric Rotick wrote:
 
  I have a requirement to allow users to change such things as colour,
 
  font
 
  etc. for certain markup. Currently this is all 'wrapped' by CSS
 
  ids/classes
 
  but the use of varying ids/classes seems wrong.
 
  The use case if for engineers viewing data from sensors. Some
 engineers
  require values below a certain value to be highlighted whereas other
  engineers want values above a certain value to be highlighted. The
  highlighting might means changing the font to bold, the background
 
  colour to
 
  yellow, the foreground colour to red and the surrounding box to double
  lines. I could have CSS classes of highlight1, highlight2 etc but read
 
  on.
 
  In essence the markup is exactly the same but for the highlighting
 rules
 
  so
 
  having a number of sub classed pages is not correct. In addition, the
 
  rules
 
  at which something may change might change at run time. For example,
 one
  particular engineer may be monitoring a system where a value is
 
  highlighted
 
  if it goes outside of a range and another highlight if the erroneous
 
  value
 
  has been out of range for an extended time period. Basically, each
 
  engineer
 
  can choose their own colour scheme. Also, for very complex situations
 an
  engineer would be overloaded by too much information. In these cases
 
  they
 
  dim down the non important data so that the important data becomes
 more
  prominent.
 
  OK, I could define a bigger set of CSS classes for each situation but
 
  each
 
  engineer has a different way of solving the viewing problem and the
 
  current
 
  system (not web based) does what they want.
 
  So, I think the solution lies in the dynamic generation of the CSS at
 
  run
 
  time from the database. I then thought I would create a small servlet
 to
  handle this but then, I already have Wicket running, maybe I should
 sub
  class Page and make a CssPage class. I need to have a pop at doing
 this
 
  in
 
  the future anyway for WML so the research would not be wasted.
 
  I was wondering if anyone had any experience or advice before I look
 
  into
 
  this in more detail.
 
  Eric.
 
 
 
  --
  -Wicket for love
 
  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: 

Re: Dynamic creation of CSS

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael
You dont have to embed it, you could mount it as a resource... But still 
it needs to be generated. However you could cache this, it totally up to 
you..



regards Nin

Eric Rotick wrote:

Now I see. I had not discovered these classes!

I was hoping to avoid embedding the CSS within the HTML as this does not
benefit from the size reduction that CSS separation gives. However, you've
given me another idea. CSS allows for definitions to be overridden locally
in each page so I could arrange for the differences to be embedded and leave
the rest in the external CSS file.

Actually, now I think of it, the idea of a 'standard' set would mean that I
have to manage what is the default and what is the exception which is
currently done in a hierarchical fashion which is pretty slow to resolve.

The concept is that whenever a user changes anything to do with CSS the
system recreated the file username.css which is then included in each page
dynamically according to the user. The problem comes in where to write the
file when in a war deployment situation. I could write it to a database but
that still means it has to be 'produced' by the servlet engine and so we are
back to the same question.

Eric.

On Sat, Mar 29, 2008 at 3:37 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

  

http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events

essentially its this which are interesting:

private String generateString(TextTemplate textTemplate) {
   // variables for the initialization script
   MapString, String variables = new HashMapString, String();


   variables.put(disable_in_input,
getDisable_in_input().toString());
   variables.put(type, getType().toString());
   variables.put(propagate, getPropagate().toString());
   variables.put(target, getTarget());

   textTemplate.interpolate(variables);
   return textTemplate.asString();

   }

in your case the text template could look like this:

   private final TextTemplate css = new PackagedTextTemplate(
   InputBehavior.class, mystyle.css);

you notate in your text file like this:

 input {
   color:${color};
}

Basicly you have a textfile and a map, when you interpolate the values
the are replaced by what are inside your map... Ask if you have
questions..:)

regards Nino

Eric Rotick wrote:


Where can I find out more about this approach?

On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:


  

if you need to do it dynamicly, you could just use the
textressourcetemplate approach, something similar what I've done with
the js in wicket input events (I stole the idea from the datepicker)..


regards Nino

Eric Rotick wrote:



I have a requirement to allow users to change such things as colour,

  

font



etc. for certain markup. Currently this is all 'wrapped' by CSS

  

ids/classes



but the use of varying ids/classes seems wrong.

The use case if for engineers viewing data from sensors. Some
  

engineers


require values below a certain value to be highlighted whereas other
engineers want values above a certain value to be highlighted. The
highlighting might means changing the font to bold, the background

  

colour to



yellow, the foreground colour to red and the surrounding box to double
lines. I could have CSS classes of highlight1, highlight2 etc but read

  

on.



In essence the markup is exactly the same but for the highlighting
  

rules


so



having a number of sub classed pages is not correct. In addition, the

  

rules



at which something may change might change at run time. For example,
  

one


particular engineer may be monitoring a system where a value is

  

highlighted



if it goes outside of a range and another highlight if the erroneous

  

value



has been out of range for an extended time period. Basically, each

  

engineer



can choose their own colour scheme. Also, for very complex situations
  

an


engineer would be overloaded by too much information. In these cases

  

they



dim down the non important data so that the important data becomes
  

more


prominent.

OK, I could define a bigger set of CSS classes for each situation but

  

each



engineer has a different way of solving the viewing problem and the

  

current



system (not web based) does what they want.

So, I think the solution lies in the dynamic generation of the CSS at

  

run



time from the database. I then thought I would create a small servlet
  

to


handle this but then, I already have Wicket running, maybe I should
  

sub


class Page and make a CssPage class. I need to have a pop at doing
  

this


in

Re: Lazy load exception wicket and hibernate

2008-03-29 Thread Igor Vaynberg
erm, i thought filters were executed in the order they were defined in
web.xml. so open..inview should be declared before wicket. and its not
the filter-mapping but the filter element...

-igor

On Sat, Mar 29, 2008 at 4:15 AM, lars vonk [EMAIL PROTECTED] wrote:
 What is the order of the filters you defined in your filter-mapping element
  in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
  definition in the filter-mapping after the WicketFilter otherwise the
  WicketFilter will come first.

  Lars



  On Fri, Mar 28, 2008 at 9:11 PM, cjlyth [EMAIL PROTECTED] wrote:

  
   I have been getting the same error. I feel like im missing something.
   Maybe I
   am doing something horibly wrong but I haven't been able to figure out
   what
   it is.
  
   I am using spring 2.5, Wicket 1.3.2, and I have put the
   OpenEntityManagerInViewFilter  in my web xml. The filter is loading ok, im
   not sure what to do next...
  
   If anyone can help please let me know what you need to see. I even have an
   example application i can upload.
   I am using a DataView, I have tried to inject the spring beans into every
   part (data provider, etc) and I always get the same result...
   For now I will include the wicket stuff:
  
  
   public class Home extends WebPage {
  @SpringBean
  private TestService testService;
  
  public Home() {
  init();
  }
  
  public Home(PageParameters parameters) {
  super(parameters);
  init();
  }
  
  private void init() {
  add(new DataView(container, new ListOwnerProvider()) {
  private static final long serialVersionUID = 1L;
  
  @Override
  protected void populateItem(Item item) {
  /*ListOwner owner =
   (ListOwner)item.getModelObject();*/
  item.add(new Label(name));
  item.add(new ListView(entries){
  private static final long
   serialVersionUID = 1L;
  
  @Override
  protected void
   populateItem(ListItem item) {
  item.add(new
   Label(value));
  }
  });
  }
  });
  }
  
  class ListOwnerProvider implements IDataProvider {
  
  private static final long serialVersionUID = 1L;
  
  @Override
  public void detach() {
  
  
  }
  
  @Override
  public Iterator iterator(int first, int count) {
  return testService.getListOwners
   (first,count).iterator();
  }
  
  @Override
  public IModel model(Object object) {
  
  return new CompoundPropertyModel(new
   ListOwnerModel((ListOwner)object));
  }
  
  @Override
  public int size() {
  return testService.getListOwners().size();
  }
  }
  
  class ListOwnerModel extends LoadableDetachableModel {
  private static final long serialVersionUID = 1L;
  private Integer id;
  
  public ListOwnerModel(ListOwner listOwner) {
  this.id = listOwner.getId();
  }
  
  @Override
  protected Object load() {
  return testService.getListOwner(id);
   }
  }
   }
  
  
  
   Mathias P.W Nilsson wrote:
   
I'm using wicket with hibernate and spring. In my web.xml I have
OpenEntityManagerInViewFilter. But when trying to add a dataview to my
wicket page I get the org.hibernate.LazyInitializationException
   
  
   --
   View this message in context:
   
 http://www.nabble.com/Lazy-load-exception-wicket-and-hibernate-tp15976668p16361116.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: Dynamic creation of CSS

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael

If you want to write it to a file you can do that too btw...

regards

Nino Saturnino Martinez Vazquez Wael wrote:
You dont have to embed it, you could mount it as a resource... But 
still it needs to be generated. However you could cache this, it 
totally up to you..



regards Nin

Eric Rotick wrote:

Now I see. I had not discovered these classes!

I was hoping to avoid embedding the CSS within the HTML as this does not
benefit from the size reduction that CSS separation gives. However, 
you've
given me another idea. CSS allows for definitions to be overridden 
locally
in each page so I could arrange for the differences to be embedded 
and leave

the rest in the external CSS file.

Actually, now I think of it, the idea of a 'standard' set would mean 
that I

have to manage what is the default and what is the exception which is
currently done in a hierarchical fashion which is pretty slow to 
resolve.


The concept is that whenever a user changes anything to do with CSS the
system recreated the file username.css which is then included in each 
page
dynamically according to the user. The problem comes in where to 
write the
file when in a war deployment situation. I could write it to a 
database but
that still means it has to be 'produced' by the servlet engine and so 
we are

back to the same question.

Eric.

On Sat, Mar 29, 2008 at 3:37 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events 



essentially its this which are interesting:

private String generateString(TextTemplate textTemplate) {
   // variables for the initialization script
   MapString, String variables = new HashMapString, String();


   variables.put(disable_in_input,
getDisable_in_input().toString());
   variables.put(type, getType().toString());
   variables.put(propagate, getPropagate().toString());
   variables.put(target, getTarget());

   textTemplate.interpolate(variables);
   return textTemplate.asString();

   }

in your case the text template could look like this:

   private final TextTemplate css = new PackagedTextTemplate(
   InputBehavior.class, mystyle.css);

you notate in your text file like this:

 input {
   color:${color};
}

Basicly you have a textfile and a map, when you interpolate the values
the are replaced by what are inside your map... Ask if you have
questions..:)

regards Nino

Eric Rotick wrote:
   

Where can I find out more about this approach?

On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez 
Wael 

[EMAIL PROTECTED] wrote:


 

if you need to do it dynamicly, you could just use the
textressourcetemplate approach, something similar what I've done with
the js in wicket input events (I stole the idea from the 
datepicker)..



regards Nino

Eric Rotick wrote:

   

I have a requirement to allow users to change such things as colour,

  

font

   

etc. for certain markup. Currently this is all 'wrapped' by CSS

  

ids/classes

   

but the use of varying ids/classes seems wrong.

The use case if for engineers viewing data from sensors. Some
  

engineers
   

require values below a certain value to be highlighted whereas other
engineers want values above a certain value to be highlighted. The
highlighting might means changing the font to bold, the background

  

colour to

   
yellow, the foreground colour to red and the surrounding box to 
double
lines. I could have CSS classes of highlight1, highlight2 etc but 
read


  

on.

   

In essence the markup is exactly the same but for the highlighting
  

rules
   

so

   
having a number of sub classed pages is not correct. In addition, 
the


  

rules

   

at which something may change might change at run time. For example,
  

one
   

particular engineer may be monitoring a system where a value is

  

highlighted

   

if it goes outside of a range and another highlight if the erroneous

  

value

   

has been out of range for an extended time period. Basically, each

  

engineer

   
can choose their own colour scheme. Also, for very complex 
situations
  

an
   

engineer would be overloaded by too much information. In these cases

  

they

   

dim down the non important data so that the important data becomes
  

more
   

prominent.

OK, I could define a bigger set of CSS classes for each situation 
but


  

each

   

engineer has a different way of solving the viewing problem and the

  

current

   

system (not web based) does what they want.

So, I think the solution lies in the dynamic generation of the 
CSS at


  

run

   
time from the database. I then thought I would create a small 
servlet
  

to
   

handle this but then, I already have Wicket running, maybe I 

Re: Dynamic creation of CSS

2008-03-29 Thread Igor Vaynberg
isnt it that much easier to define one highlight css class and then
dynamically add it to elements that need to be highlighted?

-igor


On Sat, Mar 29, 2008 at 6:55 AM, Eric Rotick [EMAIL PROTECTED] wrote:
 I have a requirement to allow users to change such things as colour, font
  etc. for certain markup. Currently this is all 'wrapped' by CSS ids/classes
  but the use of varying ids/classes seems wrong.

  The use case if for engineers viewing data from sensors. Some engineers
  require values below a certain value to be highlighted whereas other
  engineers want values above a certain value to be highlighted. The
  highlighting might means changing the font to bold, the background colour to
  yellow, the foreground colour to red and the surrounding box to double
  lines. I could have CSS classes of highlight1, highlight2 etc but read on.

  In essence the markup is exactly the same but for the highlighting rules so
  having a number of sub classed pages is not correct. In addition, the rules
  at which something may change might change at run time. For example, one
  particular engineer may be monitoring a system where a value is highlighted
  if it goes outside of a range and another highlight if the erroneous value
  has been out of range for an extended time period. Basically, each engineer
  can choose their own colour scheme. Also, for very complex situations an
  engineer would be overloaded by too much information. In these cases they
  dim down the non important data so that the important data becomes more
  prominent.

  OK, I could define a bigger set of CSS classes for each situation but each
  engineer has a different way of solving the viewing problem and the current
  system (not web based) does what they want.

  So, I think the solution lies in the dynamic generation of the CSS at run
  time from the database. I then thought I would create a small servlet to
  handle this but then, I already have Wicket running, maybe I should sub
  class Page and make a CssPage class. I need to have a pop at doing this in
  the future anyway for WML so the research would not be wasted.

  I was wondering if anyone had any experience or advice before I look into
  this in more detail.

  Eric.


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



Re: Dynamic creation of CSS

2008-03-29 Thread Eric Rotick
Aha, I only covered the resources section of the ebook very briefly. Now
having read it again I think this is exactly what I need.

The caching that the browser does itself is good enough for this I think but
I could add something later via AOP.

Thanks for your help.

Eric.

On Sat, Mar 29, 2008 at 4:55 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 If you want to write it to a file you can do that too btw...

 regards

 Nino Saturnino Martinez Vazquez Wael wrote:
  You dont have to embed it, you could mount it as a resource... But
  still it needs to be generated. However you could cache this, it
  totally up to you..
 
 
  regards Nin
 
  Eric Rotick wrote:
  Now I see. I had not discovered these classes!
 
  I was hoping to avoid embedding the CSS within the HTML as this does
 not
  benefit from the size reduction that CSS separation gives. However,
  you've
  given me another idea. CSS allows for definitions to be overridden
  locally
  in each page so I could arrange for the differences to be embedded
  and leave
  the rest in the external CSS file.
 
  Actually, now I think of it, the idea of a 'standard' set would mean
  that I
  have to manage what is the default and what is the exception which is
  currently done in a hierarchical fashion which is pretty slow to
  resolve.
 
  The concept is that whenever a user changes anything to do with CSS the
  system recreated the file username.css which is then included in each
  page
  dynamically according to the user. The problem comes in where to
  write the
  file when in a war deployment situation. I could write it to a
  database but
  that still means it has to be 'produced' by the servlet engine and so
  we are
  back to the same question.
 
  Eric.
 
  On Sat, Mar 29, 2008 at 3:37 PM, Nino Saturnino Martinez Vazquez Wael 
  [EMAIL PROTECTED] wrote:
 
 
 
 http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events
 
 
  essentially its this which are interesting:
 
  private String generateString(TextTemplate textTemplate) {
 // variables for the initialization script
 MapString, String variables = new HashMapString, String();
 
 
 variables.put(disable_in_input,
  getDisable_in_input().toString());
 variables.put(type, getType().toString());
 variables.put(propagate, getPropagate().toString());
 variables.put(target, getTarget());
 
 textTemplate.interpolate(variables);
 return textTemplate.asString();
 
 }
 
  in your case the text template could look like this:
 
 private final TextTemplate css = new PackagedTextTemplate(
 InputBehavior.class, mystyle.css);
 
  you notate in your text file like this:
 
   input {
 color:${color};
  }
 
  Basicly you have a textfile and a map, when you interpolate the values
  the are replaced by what are inside your map... Ask if you have
  questions..:)
 
  regards Nino
 
  Eric Rotick wrote:
 
  Where can I find out more about this approach?
 
  On Sat, Mar 29, 2008 at 2:07 PM, Nino Saturnino Martinez Vazquez
  Wael 
  [EMAIL PROTECTED] wrote:
 
 
 
  if you need to do it dynamicly, you could just use the
  textressourcetemplate approach, something similar what I've done
 with
  the js in wicket input events (I stole the idea from the
  datepicker)..
 
 
  regards Nino
 
  Eric Rotick wrote:
 
 
  I have a requirement to allow users to change such things as
 colour,
 
 
  font
 
 
  etc. for certain markup. Currently this is all 'wrapped' by CSS
 
 
  ids/classes
 
 
  but the use of varying ids/classes seems wrong.
 
  The use case if for engineers viewing data from sensors. Some
 
  engineers
 
  require values below a certain value to be highlighted whereas
 other
  engineers want values above a certain value to be highlighted. The
  highlighting might means changing the font to bold, the background
 
 
  colour to
 
 
  yellow, the foreground colour to red and the surrounding box to
  double
  lines. I could have CSS classes of highlight1, highlight2 etc but
  read
 
 
  on.
 
 
  In essence the markup is exactly the same but for the highlighting
 
  rules
 
  so
 
 
  having a number of sub classed pages is not correct. In addition,
  the
 
 
  rules
 
 
  at which something may change might change at run time. For
 example,
 
  one
 
  particular engineer may be monitoring a system where a value is
 
 
  highlighted
 
 
  if it goes outside of a range and another highlight if the
 erroneous
 
 
  value
 
 
  has been out of range for an extended time period. Basically, each
 
 
  engineer
 
 
  can choose their own colour scheme. Also, for very complex
  situations
 
  an
 
  engineer would be overloaded by too much information. In these
 cases
 
 
  they
 
 
  dim down the non important data so that the important data becomes
 
  more
 
  prominent.
 
  OK, I could define a bigger set of CSS classes for each situation
  but
 
 
  each
 
 
  engineer has a different 

Re: How to use an action level authorization?

2008-03-29 Thread Timo Rantalaiho
On Fri, 28 Mar 2008, Vitaly Tsaplin wrote:
My question is simple... :) How to use an action level
 authorization. I cannot find any info or example.

Action level sounds strange to me, as Wicket is a
component-based framework and does not have actions in the
traditional model 2 sense. 

I have used wicket-auth-roles to do simple component
creation authorisation checks, and as far as I can tell, the
security frameworks Wasp and Swarm offer something more
sophisticated for Wicket.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: How to use an action level authorization?

2008-03-29 Thread Maurice Marrink
Using either wicket-auth-roles or swarm you typically only declare
which action you want to check and don't do the actual check yourself
unless you plan on doing something special.
How you declare which action is required depends on the security
framework you are using.
In wicket-auth-roles you add an AuthorizeActions annotation.
In swarm you declare permissions in a policy file, which are or are
not granted to the user.

Maurice

On Fri, Mar 28, 2008 at 4:42 PM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
Hi people,

My question is simple... :) How to use an action level
  authorization. I cannot find any info or example.
As I can guess I have to associate a role using setMetaData () with
  a component and then in IAuthorizationStrategy.isActionAuthorized () I
  do an actual check by taking the associated role from the given
  component by key and comparing it with a role of a current user. Is it
  correct guess?

Vitaly

  -
  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: body onunload=GUnload() for Google Maps in child pages

2008-03-29 Thread Igor Vaynberg
body onunload=if (GUnload!='undefined') GUnload();

-igor


On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox [EMAIL PROTECTED] wrote:
 I'm using markup inheritance to reuse a base page template for all
  pages on my site.  Some of these pages include Google Maps.  According
  to  best practices, the body element of the page needs an onunload
  event handler that calls the GUnload() function to eliminate memory
  leaks:

  http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap

  I can't put this on the body element of the base page, since only a
  few pages need it.  I tried adding a BodyTagAttributeModifier in the
  child page constructor but it did absolutely nothing to the body
  element:

  add(new BodyTagAttributeModifier(onunload, true, new
  Model(GUnload();), this));

  I understand the proper way to call onload Javascript is to use
  IHeaderResponse.renderOnLoadJavasript() but there's nothing for
  onunload.  Is there any way for a child page to dynamically add an
  onunload attribute to the page's body element?

  Thanks,
  Zach

  -
  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: JavaScript w/ Flash Player - Need guidance on to generate session-relative url's

2008-03-29 Thread Maurice Marrink
wicket urls contain page /component id's and versions that are
generated based on the session (id counters etc), if that is what you
mean by session relative urls.
Your javascript will probably have a hard time figuring out which
sound to play if you use those urls as mapping, it might work if you
trigger using onclick, i don't know which is used.
Mounting bookkmarkable pages / resources will ease the mapping as you
said. So i am a bit confused as to what else you need.

If you use Link's or ResourceLink's you can simply override onclick to
increment your counter / do logging. Or am i missing something?

Maurice

On Sat, Mar 29, 2008 at 4:04 AM, jpswain [EMAIL PROTECTED] wrote:

  I have some JavaScript on my main page that contains a special Flash player
  that loads and starts playing a specific mp3 file for each associated link
  that the user clicks on.  This currently works fine when I use
  mountSharedResource within my application subclass, then my JavaScript calls
  something (basically) like
  playFile('mpl','resource/track/trackId/1');

  What I would like to do create is session-relative URL's (correct term?)
  that allows my JavaScript to request the appropriate file from Wicket and
  also perform other actions at the same time, for example, increment download
  count of file or log user's download.  Any guidance would be very welcome.
  I have spent a lot of time searching online and trying to understand the
  source code, but I'm still not grasping what's going on.
  Thanks,
  Jamie
  --
  View this message in context: 
 http://www.nabble.com/JavaScript-w--Flash-Player---Need-guidance-on-to-generate-session-relative-url%27s-tp16366136p16366136.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: Fileupload?

2008-03-29 Thread Matthew Young
 I suddenly are a bit stomped why you have todo so much when it comes to
uploading files (and yes I am aware that it is only a few more lines of
code)..

What is todo so much? You need to tell people what it is exactly, like put
up some code?  Otherwise no one can tell exactly what you are doing.

Anyway, isn't fileupoad just as simple as textfield?

upload = new FileUploadField(upload);
form.add(upload);


On Sat, Mar 29, 2008 at 4:53 AM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 As I am getting very used to the wicket way,  using compound models with
 my form fields labels an so on.

 I suddenly are a bit stomped why you have todo so much when it comes to
 uploading files (and yes I am aware that it is only a few more lines of
 code).. I think the fileupload field should work just as text field etc..

 But as with other stuff I get puzzled by there are probably a very good
 reason why it dosent?

 --
 -Wicket for love

 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: body onunload=GUnload() for Google Maps in child pages

2008-03-29 Thread Zach Cox

Seriously?  There's no AttributeModifier I can use to add an onunload
attribute to body element?

If not, is it just a matter of it hasn't been implemented?  Or is there
some philosophical reason it isn't available?

Thanks,
Zach



igor.vaynberg wrote:
 
 body onunload=if (GUnload!='undefined') GUnload();
 
 -igor
 
 
 On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox [EMAIL PROTECTED] wrote:
 I'm using markup inheritance to reuse a base page template for all
  pages on my site.  Some of these pages include Google Maps.  According
  to  best practices, the body element of the page needs an onunload
  event handler that calls the GUnload() function to eliminate memory
  leaks:

 
 http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap

  I can't put this on the body element of the base page, since only a
  few pages need it.  I tried adding a BodyTagAttributeModifier in the
  child page constructor but it did absolutely nothing to the body
  element:

  add(new BodyTagAttributeModifier(onunload, true, new
  Model(GUnload();), this));

  I understand the proper way to call onload Javascript is to use
  IHeaderResponse.renderOnLoadJavasript() but there's nothing for
  onunload.  Is there any way for a child page to dynamically add an
  onunload attribute to the page's body element?

  Thanks,
  Zach

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


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

-- 
View this message in context: 
http://www.nabble.com/%3Cbody-onunload%3D%22GUnload%28%29%22%3E-for-Google-Maps-in-child-pages-tp16372664p16373185.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: body onunload=GUnload() for Google Maps in child pages

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael

if I were you i'd use the gmap2 contrib...

Zach Cox wrote:

I'm using markup inheritance to reuse a base page template for all
pages on my site.  Some of these pages include Google Maps.  According
to  best practices, the body element of the page needs an onunload
event handler that calls the GUnload() function to eliminate memory
leaks:

http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap

I can't put this on the body element of the base page, since only a
few pages need it.  I tried adding a BodyTagAttributeModifier in the
child page constructor but it did absolutely nothing to the body
element:

add(new BodyTagAttributeModifier(onunload, true, new
Model(GUnload();), this));

I understand the proper way to call onload Javascript is to use
IHeaderResponse.renderOnLoadJavasript() but there's nothing for
onunload.  Is there any way for a child page to dynamically add an
onunload attribute to the page's body element?

Thanks,
Zach

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


  


--
-Wicket for love

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: Page-dependent timeout values for session

2008-03-29 Thread Matthew Young
Can you put a ajaxtimerbehavior in the iframe to call the server to keep the
session alive?

On Sat, Mar 29, 2008 at 2:32 AM, Per Newgro [EMAIL PROTECTED] wrote:

 Hi *,

 we added an IFRAME to out homepage. This gets an url to he
 wicket-application
 by assignment to src attribute. If the user uses the button in IFRAME a
 new
 window is open and the application is displayed.

 We set the session timeout limit in web.xml. Everything ok so far. But we
 have
 the effect, that the part displayed in the IFRAME runs into timeout. This
 looks always a bit ugly.

 Now my question: Can we set the timeout to different values for a page?
 Stateless stuff seems not to be relevant here because we use some ajax
 behavior in IFRAME part.

 Hope i made my point clear.
 Cheers
 Per

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




Re: How to use an action level authorization?

2008-03-29 Thread Vitaly Tsaplin
   Actually I am not going to use anything from wicket staff here. I
have just one role - a user which is logged in :) And so I am just
going to use the RENDER action defined by wicket to avoid an explicit
call of setVisible () and to use authorization mechanism instead to
hide components from guests (who is not logged in). I guess the
isActionAuthorized () method of the IAuthorizationStrategy class is a
rigth place to do the check. The only thing is missing for me is how
to add an auth info to a particular component. This info can be
extracted later by isActionAuthorized () to decide weither rendering
allowed or not.

On Sat, Mar 29, 2008 at 6:54 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 Using either wicket-auth-roles or swarm you typically only declare
  which action you want to check and don't do the actual check yourself
  unless you plan on doing something special.
  How you declare which action is required depends on the security
  framework you are using.
  In wicket-auth-roles you add an AuthorizeActions annotation.
  In swarm you declare permissions in a policy file, which are or are
  not granted to the user.

  Maurice



  On Fri, Mar 28, 2008 at 4:42 PM, Vitaly Tsaplin
  [EMAIL PROTECTED] wrote:
  Hi people,
  
  My question is simple... :) How to use an action level
authorization. I cannot find any info or example.
  As I can guess I have to associate a role using setMetaData () with
a component and then in IAuthorizationStrategy.isActionAuthorized () I
do an actual check by taking the associated role from the given
component by key and comparing it with a role of a current user. Is it
correct guess?
  
  Vitaly
  


   -
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: Lazy load exception wicket and hibernate

2008-03-29 Thread lars vonk
They are initialized in the order they are defined, but executed in the
order of filter-mapping:

Quote from servlet spec 2.4:

The order the container uses in building the chain of filters to be applied
 for a
 particular request URI is as follows:
 1. First, the url-pattern matching filter mappings in the same order
 that these
 elements appear in the deployment descriptor.


 I tested (in jetty) this to be sure and it's correct. So it's the
filter-mapping, not the filter definition.

Lars


On Sat, Mar 29, 2008 at 5:48 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 erm, i thought filters were executed in the order they were defined in
 web.xml. so open..inview should be declared before wicket. and its not
 the filter-mapping but the filter element...

 -igor

 On Sat, Mar 29, 2008 at 4:15 AM, lars vonk [EMAIL PROTECTED] wrote:
  What is the order of the filters you defined in your filter-mapping
 element
   in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
   definition in the filter-mapping after the WicketFilter otherwise the
   WicketFilter will come first.
 
   Lars
 
 
 
   On Fri, Mar 28, 2008 at 9:11 PM, cjlyth [EMAIL PROTECTED] wrote:
 
   
I have been getting the same error. I feel like im missing something.
Maybe I
am doing something horibly wrong but I haven't been able to figure
 out
what
it is.
   
I am using spring 2.5, Wicket 1.3.2, and I have put the
OpenEntityManagerInViewFilter  in my web xml. The filter is loading
 ok, im
not sure what to do next...
   
If anyone can help please let me know what you need to see. I even
 have an
example application i can upload.
I am using a DataView, I have tried to inject the spring beans into
 every
part (data provider, etc) and I always get the same result...
For now I will include the wicket stuff:
   
   
public class Home extends WebPage {
   @SpringBean
   private TestService testService;
   
   public Home() {
   init();
   }
   
   public Home(PageParameters parameters) {
   super(parameters);
   init();
   }
   
   private void init() {
   add(new DataView(container, new ListOwnerProvider())
 {
   private static final long serialVersionUID =
 1L;
   
   @Override
   protected void populateItem(Item item) {
   /*ListOwner owner =
(ListOwner)item.getModelObject();*/
   item.add(new Label(name));
   item.add(new ListView(entries){
   private static final long
serialVersionUID = 1L;
   
   @Override
   protected void
populateItem(ListItem item) {
   item.add(new
Label(value));
   }
   });
   }
   });
   }
   
   class ListOwnerProvider implements IDataProvider {
   
   private static final long serialVersionUID = 1L;
   
   @Override
   public void detach() {
   
   
   }
   
   @Override
   public Iterator iterator(int first, int count) {
   return testService.getListOwners
(first,count).iterator();
   }
   
   @Override
   public IModel model(Object object) {
   
   return new CompoundPropertyModel(new
ListOwnerModel((ListOwner)object));
   }
   
   @Override
   public int size() {
   return testService.getListOwners().size();
   }
   }
   
   class ListOwnerModel extends LoadableDetachableModel {
   private static final long serialVersionUID = 1L;
   private Integer id;
   
   public ListOwnerModel(ListOwner listOwner) {
   this.id = listOwner.getId();
   }
   
   @Override
   protected Object load() {
   return testService.getListOwner(id);
}
   }
}
   
   
   
Mathias P.W Nilsson wrote:

 I'm using wicket with hibernate and spring. In my web.xml I have
 OpenEntityManagerInViewFilter. But when trying to add a dataview to
 my
 wicket page I get the org.hibernate.LazyInitializationException

   
--
View this message in context:
   
 http://www.nabble.com/Lazy-load-exception-wicket-and-hibernate-tp15976668p16361116.html
Sent from the Wicket - User mailing list archive at 

Re: How to use an action level authorization?

2008-03-29 Thread Maurice Marrink
Well if you insist on building your own, even though there are 2
perfectly appliable frameworks for your situation, then why not take a
look at how they add the authentication info to the component.
I'll save you some time: both use component metadata, you could also
like wicket-auth-roles does too, use annotations.
But maybe, since you want to do everything yourself you can come up
with an new way.

Maurice

On Sat, Mar 29, 2008 at 8:04 PM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
Actually I am not going to use anything from wicket staff here. I
  have just one role - a user which is logged in :) And so I am just
  going to use the RENDER action defined by wicket to avoid an explicit
  call of setVisible () and to use authorization mechanism instead to
  hide components from guests (who is not logged in). I guess the
  isActionAuthorized () method of the IAuthorizationStrategy class is a
  rigth place to do the check. The only thing is missing for me is how
  to add an auth info to a particular component. This info can be
  extracted later by isActionAuthorized () to decide weither rendering
  allowed or not.



  On Sat, Mar 29, 2008 at 6:54 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
   Using either wicket-auth-roles or swarm you typically only declare
which action you want to check and don't do the actual check yourself
unless you plan on doing something special.
How you declare which action is required depends on the security
framework you are using.
In wicket-auth-roles you add an AuthorizeActions annotation.
In swarm you declare permissions in a policy file, which are or are
not granted to the user.
  
Maurice
  
  
  
On Fri, Mar 28, 2008 at 4:42 PM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
Hi people,

My question is simple... :) How to use an action level
  authorization. I cannot find any info or example.
As I can guess I have to associate a role using setMetaData () with
  a component and then in IAuthorizationStrategy.isActionAuthorized () I
  do an actual check by taking the associated role from the given
  component by key and comparing it with a role of a current user. Is it
  correct guess?

Vitaly

  
  
 -
  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: Fileupload?

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael



Matthew Young wrote:

I suddenly are a bit stomped why you have todo so much when it comes to
uploading files (and yes I am aware that it is only a few more lines of
code)..



What is todo so much? You need to tell people what it is exactly, like put
up some code?  Otherwise no one can tell exactly what you are doing.

  

Well, I thought it were self explaining...

Anyway, isn't fileupoad just as simple as textfield?

upload = new FileUploadField(upload);
form.add(upload);

  
Well, I suppose adding is, but in order to get it to actually do 
something you need to do this aswell, in the onsubmit part of your form:


   | final FileUpload upload = fileUploadField.getFileUpload();

And this is where it breaks normal procedure.. You could argue that 
whats wicket supposed todo with the file? But since I am giving a 
compoundModel that has a field taking a bytearray wicket could place the 
content in the property...

|

On Sat, Mar 29, 2008 at 4:53 AM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

  

As I am getting very used to the wicket way,  using compound models with
my form fields labels an so on.

I suddenly are a bit stomped why you have todo so much when it comes to
uploading files (and yes I am aware that it is only a few more lines of
code).. I think the fileupload field should work just as text field etc..

But as with other stuff I get puzzled by there are probably a very good
reason why it dosent?

--
-Wicket for love

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

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: Page-dependent timeout values for session

2008-03-29 Thread Nino Saturnino Martinez Vazquez Wael
Hmm that could break the flow is my guess(as it would force the url back 
to whatever was set in the iframe attribute), i'd actually say that it 
were whatever was contained withing the iframe responsability to use 
keepalives...


regards Nino

Matthew Young wrote:

Can you put a ajaxtimerbehavior in the iframe to call the server to keep the
session alive?

On Sat, Mar 29, 2008 at 2:32 AM, Per Newgro [EMAIL PROTECTED] wrote:

  

Hi *,

we added an IFRAME to out homepage. This gets an url to he
wicket-application
by assignment to src attribute. If the user uses the button in IFRAME a
new
window is open and the application is displayed.

We set the session timeout limit in web.xml. Everything ok so far. But we
have
the effect, that the part displayed in the IFRAME runs into timeout. This
looks always a bit ugly.

Now my question: Can we set the timeout to different values for a page?
Stateless stuff seems not to be relevant here because we use some ajax
behavior in IFRAME part.

Hope i made my point clear.
Cheers
Per

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





  


--
-Wicket for love

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]



java.io.StreamCorruptedException: invalid type code: 29

2008-03-29 Thread Daniel Wu

I've updated my wicket application to Wicket 1.3.2, but now, when I try to
switch between my application tabs (my tabs extend
org.apache.wicket.extensions.markup.html.tabs.AbstractTab) I'm getting this
error:

ERROR RequestCycle () - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:411)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311)
at org.apache.wicket.Session.getPage(Session.java:751)
...
Caused by: java.io.StreamCorruptedException: invalid type code: 29
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393)

I've already downloaded and used the latest wicket 1.3 snapshot, which was
suggested to me here: https://issues.apache.org/jira/browse/WICKET-1445 ,
but I'm still having this error.

I'm still using an old release of wicket-extensions. Since I updated to
wicket 1.3, I'm also having this warning:

WARN  AbstractTextComponent () - Couldn't resolve model type of
Model:classname=[...], please set the type yourself.

Could any of these be related to the Serialization error? Does anyone have
any idea of what is causing it? 

Daniel

-- 
View this message in context: 
http://www.nabble.com/java.io.StreamCorruptedException%3A-invalid-type-code%3A-29-tp16374745p16374745.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: Dynamic link wicket:id

2008-03-29 Thread Cristi Manole
I have a project where in a modal window there's an image that's generated
on the fly which contains a graphic with info based on the current day.

Above the graphic there are links so that the user can see a graphic for the
current week or the current year (instead of the day graphic). When he
clicks the current week, below the graphic he will see links to every day in
the month. And above the picture there will be only a link to show year.

Something like that. If i linked elements dynamically to wicket, i could
have only 2 generic divs above and below the img and play with them like i
choose.  Considering I cannot,  i think the easiest way to go about it is to
replace those generic divs with specific divs pre-coded, so to speak... or
... to hide different elements based on what i need. But that means having
all of them predefined.

Is there a better way to accomplish something like this... more dynamic?

Tks,
Cristi Manole

On Fri, Mar 28, 2008 at 7:29 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 what is the usecase?

 -igor


 On Fri, Mar 28, 2008 at 10:08 AM, Cristi Manole [EMAIL PROTECTED]
 wrote:
  Hello,
 
   Is there a possibility dynamically link a wicket:id to a java object at
   runtime?
 
   I'm looking for something similar to this:
 
   Label label = new Label(someid,some text span
 wicket:id=anotherid/);
   label.setEscaped(false);
 
   I didn't manage to find a way.
 
   Tks,
   Cristi Manole
 

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




Re: body onunload=GUnload() for Google Maps in child pages

2008-03-29 Thread Igor Vaynberg
we no longer treat body tags differently, so if you want add a
transparent markupcontainer to your basepage and attach it to your
body tags. then add attribute modifiers to that container.

with the advancement of javascript event handlers people dont use the
body tag for this purpose any longer. also we did have support for
this in the headercontributor but the unload events are very shoddy
and so we decided not to provide it since we did not want to be
bombarded with why does my onunload event dosnt fire emails. unload
events are problematic because some browsers dont implement at all,
others only if you navigate a certain way, etc, etc.

-igor


On Sat, Mar 29, 2008 at 11:46 AM, Zach Cox [EMAIL PROTECTED] wrote:

  Seriously?  There's no AttributeModifier I can use to add an onunload
  attribute to body element?

  If not, is it just a matter of it hasn't been implemented?  Or is there
  some philosophical reason it isn't available?

  Thanks,
  Zach





  igor.vaynberg wrote:
  
   body onunload=if (GUnload!='undefined') GUnload();
  
   -igor
  
  
   On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox [EMAIL PROTECTED] wrote:
   I'm using markup inheritance to reuse a base page template for all
pages on my site.  Some of these pages include Google Maps.  According
to  best practices, the body element of the page needs an onunload
event handler that calls the GUnload() function to eliminate memory
leaks:
  
  
   
 http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap
  
I can't put this on the body element of the base page, since only a
few pages need it.  I tried adding a BodyTagAttributeModifier in the
child page constructor but it did absolutely nothing to the body
element:
  
add(new BodyTagAttributeModifier(onunload, true, new
Model(GUnload();), this));
  
I understand the proper way to call onload Javascript is to use
IHeaderResponse.renderOnLoadJavasript() but there's nothing for
onunload.  Is there any way for a child page to dynamically add an
onunload attribute to the page's body element?
  
Thanks,
Zach
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/%3Cbody-onunload%3D%22GUnload%28%29%22%3E-for-Google-Maps-in-child-pages-tp16372664p16373185.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: Lazy load exception wicket and hibernate

2008-03-29 Thread Igor Vaynberg
thanks. i always thought it was the other way, probably because i
googled it at the time instead of reading the spec. if you google
web.xml filter order the first hit you get is

http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html?page=3

which states that it is the order they are defined...


-igor


On Sat, Mar 29, 2008 at 12:24 PM, lars vonk [EMAIL PROTECTED] wrote:
 They are initialized in the order they are defined, but executed in the
  order of filter-mapping:

  Quote from servlet spec 2.4:

  The order the container uses in building the chain of filters to be applied
   for a
   particular request URI is as follows:
   1. First, the url-pattern matching filter mappings in the same order
   that these
   elements appear in the deployment descriptor.


   I tested (in jetty) this to be sure and it's correct. So it's the
  filter-mapping, not the filter definition.

  Lars


  On Sat, Mar 29, 2008 at 5:48 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:



   erm, i thought filters were executed in the order they were defined in
   web.xml. so open..inview should be declared before wicket. and its not
   the filter-mapping but the filter element...
  
   -igor
  
   On Sat, Mar 29, 2008 at 4:15 AM, lars vonk [EMAIL PROTECTED] wrote:
What is the order of the filters you defined in your filter-mapping
   element
 in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
 definition in the filter-mapping after the WicketFilter otherwise the
 WicketFilter will come first.
   
 Lars
   
   
   
 On Fri, Mar 28, 2008 at 9:11 PM, cjlyth [EMAIL PROTECTED] wrote:
   
 
  I have been getting the same error. I feel like im missing something.
  Maybe I
  am doing something horibly wrong but I haven't been able to figure
   out
  what
  it is.
 
  I am using spring 2.5, Wicket 1.3.2, and I have put the
  OpenEntityManagerInViewFilter  in my web xml. The filter is loading
   ok, im
  not sure what to do next...
 
  If anyone can help please let me know what you need to see. I even
   have an
  example application i can upload.
  I am using a DataView, I have tried to inject the spring beans into
   every
  part (data provider, etc) and I always get the same result...
  For now I will include the wicket stuff:
 
 
  public class Home extends WebPage {
 @SpringBean
 private TestService testService;
 
 public Home() {
 init();
 }
 
 public Home(PageParameters parameters) {
 super(parameters);
 init();
 }
 
 private void init() {
 add(new DataView(container, new ListOwnerProvider())
   {
 private static final long serialVersionUID =
   1L;
 
 @Override
 protected void populateItem(Item item) {
 /*ListOwner owner =
  (ListOwner)item.getModelObject();*/
 item.add(new Label(name));
 item.add(new ListView(entries){
 private static final long
  serialVersionUID = 1L;
 
 @Override
 protected void
  populateItem(ListItem item) {
 item.add(new
  Label(value));
 }
 });
 }
 });
 }
 
 class ListOwnerProvider implements IDataProvider {
 
 private static final long serialVersionUID = 1L;
 
 @Override
 public void detach() {
 
 
 }
 
 @Override
 public Iterator iterator(int first, int count) {
 return testService.getListOwners
  (first,count).iterator();
 }
 
 @Override
 public IModel model(Object object) {
 
 return new CompoundPropertyModel(new
  ListOwnerModel((ListOwner)object));
 }
 
 @Override
 public int size() {
 return testService.getListOwners().size();
 }
 }
 
 class ListOwnerModel extends LoadableDetachableModel {
 private static final long serialVersionUID = 1L;
 private Integer id;
 
 public ListOwnerModel(ListOwner listOwner) {
 this.id = listOwner.getId();
 }

Re: Dynamic link wicket:id

2008-03-29 Thread Igor Vaynberg
you can have two generic divs that hold panels. then you can create
panels for every kind of situation you have and swap them in and out
of those two divs.

so like an image panel, month menu panel, year menu panel, and what not..

-igor


On Sat, Mar 29, 2008 at 4:18 PM, Cristi Manole [EMAIL PROTECTED] wrote:
 I have a project where in a modal window there's an image that's generated
  on the fly which contains a graphic with info based on the current day.

  Above the graphic there are links so that the user can see a graphic for the
  current week or the current year (instead of the day graphic). When he
  clicks the current week, below the graphic he will see links to every day in
  the month. And above the picture there will be only a link to show year.

  Something like that. If i linked elements dynamically to wicket, i could
  have only 2 generic divs above and below the img and play with them like i
  choose.  Considering I cannot,  i think the easiest way to go about it is to
  replace those generic divs with specific divs pre-coded, so to speak... or
  ... to hide different elements based on what i need. But that means having
  all of them predefined.

  Is there a better way to accomplish something like this... more dynamic?

  Tks,
  Cristi Manole

  On Fri, Mar 28, 2008 at 7:29 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:



   what is the usecase?
  
   -igor
  
  
   On Fri, Mar 28, 2008 at 10:08 AM, Cristi Manole [EMAIL PROTECTED]
   wrote:
Hello,
   
 Is there a possibility dynamically link a wicket:id to a java object at
 runtime?
   
 I'm looking for something similar to this:
   
 Label label = new Label(someid,some text span
   wicket:id=anotherid/);
 label.setEscaped(false);
   
 I didn't manage to find a way.
   
 Tks,
 Cristi Manole
   
  
   -
   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]



PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
   Hi,

   How do I change an appearance of a link pointing to a currently
presented page? It seems I am supposed to implement my own navigator
component from scratch? Any ideas?

   Vitalz

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



Re: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Matthew Young
The current page is like this:

span id=pageLink21 wicket:id=pageLinkemspan
wicket:id=pageNumber7/span/em/span

So you can just style the em tag to whichever way you like.

On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED]
wrote:

   Hi,

   How do I change an appearance of a link pointing to a currently
 presented page? It seems I am supposed to implement my own navigator
 component from scratch? Any ideas?

   Vitalz

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




Re: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
   It simply doesn't work. That's why I am asking... em tag is
created for surrounding disabled links and a for active ones. I do
not see any way how to distinguish the current page...

On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote:
 The current page is like this:

  span id=pageLink21 wicket:id=pageLinkemspan
  wicket:id=pageNumber7/span/em/span

  So you can just style the em tag to whichever way you like.

  On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED]
  wrote:



 Hi,
  
 How do I change an appearance of a link pointing to a currently
   presented page? It seems I am supposed to implement my own navigator
   component from scratch? Any ideas?
  
 Vitalz
  
   -
   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: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Igor Vaynberg
div class=nav wicket:id=navigator

style div.nav em { color:red; } /style

-igor


On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
It simply doesn't work. That's why I am asking... em tag is
  created for surrounding disabled links and a for active ones. I do
  not see any way how to distinguish the current page...



  On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote:
   The current page is like this:
  
span id=pageLink21 wicket:id=pageLinkemspan
wicket:id=pageNumber7/span/em/span
  
So you can just style the em tag to whichever way you like.
  
On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED]
wrote:
  
  
  
   Hi,

   How do I change an appearance of a link pointing to a currently
 presented page? It seems I am supposed to implement my own navigator
 component from scratch? Any ideas?

   Vitalz

 -
 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: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
   It works but as I said it highlights not only the link to a current
page, but also links to next and previous pages (increments) if you
navigate to the leftmost or rightmost page since em is created for
links to which a navigation is impossible or makes no sense.

On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 div class=nav wicket:id=navigator

  style div.nav em { color:red; } /style

  -igor


  On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin


 [EMAIL PROTECTED] wrote:
  It simply doesn't work. That's why I am asking... em tag is
created for surrounding disabled links and a for active ones. I do
not see any way how to distinguish the current page...
  
  
  
On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote:
 The current page is like this:

  span id=pageLink21 wicket:id=pageLinkemspan
  wicket:id=pageNumber7/span/em/span

  So you can just style the em tag to whichever way you like.

  On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED]
  wrote:



 Hi,
  
 How do I change an appearance of a link pointing to a currently
   presented page? It seems I am supposed to implement my own navigator
   component from scratch? Any ideas?
  
 Vitalz
  
   -
   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: java.io.StreamCorruptedException: invalid type code: 29

2008-03-29 Thread Johan Compagner
No that warning doesnt anything todo with serialization.

But do you have a reproduceable testcase? That would be very nice to
have, can you attach that to the jira (there is already  one
describing this i think)

On 3/29/08, Daniel Wu [EMAIL PROTECTED] wrote:

 I've updated my wicket application to Wicket 1.3.2, but now, when I try to
 switch between my application tabs (my tabs extend
 org.apache.wicket.extensions.markup.html.tabs.AbstractTab) I'm getting this
 error:

 ERROR RequestCycle () - Could not deserialize object using
 `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
 object factory
 java.lang.RuntimeException: Could not deserialize object using
 `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
 object factory
   at 
 org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:411)
   at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706)
   at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311)
   at org.apache.wicket.Session.getPage(Session.java:751)
 ...
 Caused by: java.io.StreamCorruptedException: invalid type code: 29
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
   at java.io.ObjectInputStream.readSerialData(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.readObject(Unknown Source)
   at 
 org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393)

 I've already downloaded and used the latest wicket 1.3 snapshot, which was
 suggested to me here: https://issues.apache.org/jira/browse/WICKET-1445 ,
 but I'm still having this error.

 I'm still using an old release of wicket-extensions. Since I updated to
 wicket 1.3, I'm also having this warning:

 WARN  AbstractTextComponent () - Couldn't resolve model type of
 Model:classname=[...], please set the type yourself.

 Could any of these be related to the Serialization error? Does anyone have
 any idea of what is causing it?

 Daniel

 --
 View this message in context:
 http://www.nabble.com/java.io.StreamCorruptedException%3A-invalid-type-code%3A-29-tp16374745p16374745.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: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
   Probably you can add a class attribute to incrementing links or
change its tag... The reason is to be able to apply a styling to this
links separately.

On Sun, Mar 30, 2008 at 1:56 AM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
It works but as I said it highlights not only the link to a current
  page, but also links to next and previous pages (increments) if you
  navigate to the leftmost or rightmost page since em is created for
  links to which a navigation is impossible or makes no sense.



  On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   div class=nav wicket:id=navigator
  
style div.nav em { color:red; } /style
  
-igor
  
  
On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin
  
  
   [EMAIL PROTECTED] wrote:
It simply doesn't work. That's why I am asking... em tag is
  created for surrounding disabled links and a for active ones. I do
  not see any way how to distinguish the current page...



  On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] 
 wrote:
   The current page is like this:
  
span id=pageLink21 wicket:id=pageLinkemspan
wicket:id=pageNumber7/span/em/span
  
So you can just style the em tag to whichever way you like.
  
On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED]
wrote:
  
  
  
   Hi,

   How do I change an appearance of a link pointing to a currently
 presented page? It seems I am supposed to implement my own 
 navigator
 component from scratch? Any ideas?

   Vitalz

 
 -
 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: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Matthew Young
Ok, I see what your problem really is.  Here is your solution:

final IBehavior currentPageLinkClassifier = new AbstractBehavior() {
private static final long serialVersionUID = 1L;
@Override public void onComponentTag(Component c, ComponentTag tag)
{
if (((Link) c).isEnabled() == false) {
CharSequence current = tag.getString(class);
tag.put(class, current_page_link 
+ (current == null ?  : current));
}
}
};



  navigator = new PagingNavigator(navigator, photoListView) {
private static final long serialVersionUID = 1L;
@Override protected PagingNavigation newNavigation(final
IPageable pageable,
final IPagingLabelProvider labelProvider) {
return new AjaxPagingNavigation(navigation, pageable,
labelProvider) {
private static final long serialVersionUID = 1L;
@Override protected Link newPagingNavigationLink(String
id, IPageable pageable, int pageIndex) {
Link link = super.newPagingNavigationLink(id,
pageable, pageIndex);
link.add(currentPageLinkClassifier);
return link;
}
};
}
};


.current_page_link {

   whatever

}

On Sat, Mar 29, 2008 at 5:56 PM, Vitaly Tsaplin [EMAIL PROTECTED]
wrote:

   It works but as I said it highlights not only the link to a current
 page, but also links to next and previous pages (increments) if you
 navigate to the leftmost or rightmost page since em is created for
 links to which a navigation is impossible or makes no sense.

 On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
  div class=nav wicket:id=navigator
 
   style div.nav em { color:red; } /style
 
   -igor
 
 
   On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin
 
 
  [EMAIL PROTECTED] wrote:
   It simply doesn't work. That's why I am asking... em tag is
 created for surrounding disabled links and a for active ones. I
 do
 not see any way how to distinguish the current page...
   
   
   
 On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED]
 wrote:
  The current page is like this:
 
   span id=pageLink21 wicket:id=pageLinkemspan
   wicket:id=pageNumber7/span/em/span
 
   So you can just style the em tag to whichever way you like.
 
   On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin 
 [EMAIL PROTECTED]
   wrote:
 
 
 
  Hi,
   
  How do I change an appearance of a link pointing to a
 currently
presented page? It seems I am supposed to implement my own
 navigator
component from scratch? Any ideas?
   
  Vitalz
   
   
 -
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: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
  Thanks for your help, Matthew, but it seems doesn't help me
neither... I still cannot distinguish a regular page link and a
incrementing link (which is made of angle brackets).

On Sun, Mar 30, 2008 at 3:18 AM, Matthew Young [EMAIL PROTECTED] wrote:
 Ok, I see what your problem really is.  Here is your solution:

 final IBehavior currentPageLinkClassifier = new AbstractBehavior() {
 private static final long serialVersionUID = 1L;
 @Override public void onComponentTag(Component c, ComponentTag tag)
  {
 if (((Link) c).isEnabled() == false) {
 CharSequence current = tag.getString(class);
 tag.put(class, current_page_link 
 + (current == null ?  : current));
 }
 }
 };



   navigator = new PagingNavigator(navigator, photoListView) {
 private static final long serialVersionUID = 1L;
 @Override protected PagingNavigation newNavigation(final
  IPageable pageable,
 final IPagingLabelProvider labelProvider) {
 return new AjaxPagingNavigation(navigation, pageable,
  labelProvider) {
 private static final long serialVersionUID = 1L;
 @Override protected Link newPagingNavigationLink(String
  id, IPageable pageable, int pageIndex) {
 Link link = super.newPagingNavigationLink(id,
  pageable, pageIndex);
 link.add(currentPageLinkClassifier);
 return link;
 }
 };
 }
 };


  .current_page_link {

whatever

  }

  On Sat, Mar 29, 2008 at 5:56 PM, Vitaly Tsaplin [EMAIL PROTECTED]


 wrote:

 It works but as I said it highlights not only the link to a current
   page, but also links to next and previous pages (increments) if you
   navigate to the leftmost or rightmost page since em is created for
   links to which a navigation is impossible or makes no sense.
  
   On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED]
   wrote:
div class=nav wicket:id=navigator
   
 style div.nav em { color:red; } /style
   
 -igor
   
   
 On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin
   
   
[EMAIL PROTECTED] wrote:
 It simply doesn't work. That's why I am asking... em tag is
   created for surrounding disabled links and a for active ones. I
   do
   not see any way how to distinguish the current page...
 
 
 
   On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED]
   wrote:
The current page is like this:
   
 span id=pageLink21 wicket:id=pageLinkemspan
 wicket:id=pageNumber7/span/em/span
   
 So you can just style the em tag to whichever way you like.
   
 On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin 
   [EMAIL PROTECTED]
 wrote:
   
   
   
Hi,
 
How do I change an appearance of a link pointing to a
   currently
  presented page? It seems I am supposed to implement my own
   navigator
  component from scratch? Any ideas?
 
Vitalz
 
 
   -
  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]
  
  


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



Re: PagingNavigator: styling a link to a current page?

2008-03-29 Thread Vitaly Tsaplin
   Ohh, sorry. I see :) It should work...

On Sun, Mar 30, 2008 at 3:27 AM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
   Thanks for your help, Matthew, but it seems doesn't help me
  neither... I still cannot distinguish a regular page link and a
  incrementing link (which is made of angle brackets).



  On Sun, Mar 30, 2008 at 3:18 AM, Matthew Young [EMAIL PROTECTED] wrote:
   Ok, I see what your problem really is.  Here is your solution:
  
   final IBehavior currentPageLinkClassifier = new AbstractBehavior() {
   private static final long serialVersionUID = 1L;
   @Override public void onComponentTag(Component c, ComponentTag tag)
{
   if (((Link) c).isEnabled() == false) {
   CharSequence current = tag.getString(class);
   tag.put(class, current_page_link 
   + (current == null ?  : current));
   }
   }
   };
  
  
  
 navigator = new PagingNavigator(navigator, photoListView) {
   private static final long serialVersionUID = 1L;
   @Override protected PagingNavigation newNavigation(final
IPageable pageable,
   final IPagingLabelProvider labelProvider) {
   return new AjaxPagingNavigation(navigation, pageable,
labelProvider) {
   private static final long serialVersionUID = 1L;
   @Override protected Link newPagingNavigationLink(String
id, IPageable pageable, int pageIndex) {
   Link link = super.newPagingNavigationLink(id,
pageable, pageIndex);
   link.add(currentPageLinkClassifier);
   return link;
   }
   };
   }
   };
  
  
.current_page_link {
  
  whatever
  
}
  
On Sat, Mar 29, 2008 at 5:56 PM, Vitaly Tsaplin [EMAIL PROTECTED]
  
  
   wrote:
  
   It works but as I said it highlights not only the link to a current
 page, but also links to next and previous pages (increments) if you
 navigate to the leftmost or rightmost page since em is created for
 links to which a navigation is impossible or makes no sense.

 On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
  div class=nav wicket:id=navigator
 
   style div.nav em { color:red; } /style
 
   -igor
 
 
   On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin
 
 
  [EMAIL PROTECTED] wrote:
   It simply doesn't work. That's why I am asking... em tag is
 created for surrounding disabled links and a for active ones. 
 I
 do
 not see any way how to distinguish the current page...
   
   
   
 On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL 
 PROTECTED]
 wrote:
  The current page is like this:
 
   span id=pageLink21 wicket:id=pageLinkemspan
   wicket:id=pageNumber7/span/em/span
 
   So you can just style the em tag to whichever way you like.
 
   On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin 
 [EMAIL PROTECTED]
   wrote:
 
 
 
  Hi,
   
  How do I change an appearance of a link pointing to a
 currently
presented page? It seems I am supposed to implement my own
 navigator
component from scratch? Any ideas?
   
  Vitalz
   
   
 -
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]


  


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



Re: Lazy load exception wicket and hibernate

2008-03-29 Thread James Carman
On Sat, Mar 29, 2008 at 7:15 AM, lars vonk [EMAIL PROTECTED] wrote:
 What is the order of the filters you defined in your filter-mapping element
  in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
  definition in the filter-mapping after the WicketFilter otherwise the
  WicketFilter will come first.

I don't understand what you mean here.  Are you saying that if I do this:

filter-mapping
  filter-nameoemiv/filter-name
  url-pattern/*/url-pattern
/filter-mapping

filter-mapping
  filter-namewicket/filter-name
  url-pattern/*/url-pattern
/filter-mapping

then the WicketFilter will execute first and the oemiv filter won't
ever execute?

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



Re: Lazy load exception wicket and hibernate

2008-03-29 Thread Igor Vaynberg
it will execute _after_ the wicket filter. which is no good because
you need lazy loading to work inside wicket filter, so you need oemiv
to execute before. and possibly, if wicket filter never calls
chain.dofilter it will never execute.

-igor


On Sat, Mar 29, 2008 at 7:02 PM, James Carman
[EMAIL PROTECTED] wrote:
 On Sat, Mar 29, 2008 at 7:15 AM, lars vonk [EMAIL PROTECTED] wrote:

  What is the order of the filters you defined in your filter-mapping element
in the web.xml. IIRC you should put the OpenEntityManagerInViewFilter
definition in the filter-mapping after the WicketFilter otherwise the
WicketFilter will come first.

  I don't understand what you mean here.  Are you saying that if I do this:

  filter-mapping
   filter-nameoemiv/filter-name
   url-pattern/*/url-pattern
  /filter-mapping

  filter-mapping
   filter-namewicket/filter-name
   url-pattern/*/url-pattern
  /filter-mapping

  then the WicketFilter will execute first and the oemiv filter won't
  ever execute?



  -
  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: Lazy load exception wicket and hibernate

2008-03-29 Thread James Carman
On Sat, Mar 29, 2008 at 10:14 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 it will execute _after_ the wicket filter. which is no good because
  you need lazy loading to work inside wicket filter, so you need oemiv
  to execute before. and possibly, if wicket filter never calls
  chain.dofilter it will never execute.

I mean, are you sure it will execute after?  I just did a simple test:

public class Filter1 implements Filter
{
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse, FilterChain filterChain) throws
IOException, ServletException
{
System.out.println(Entering Filter1...);
filterChain.doFilter(servletRequest, servletResponse);
System.out.println(Exiting Filter1...);
}
}

public class Filter2 implements Filter
{
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse, FilterChain filterChain) throws
IOException, ServletException
{
System.out.println(Entering Filter2...);
filterChain.doFilter(servletRequest, servletResponse);
System.out.println(Exiting Filter2...);
}
}

filter
  filter-namefilter1/filter-name
  filter-classcom.mycompany.Filter1/filter-class
/filter
filter
  filter-namefilter2/filter-name
  filter-classcom.mycompany.Filter2/filter-class
/filter
filter-mapping
  filter-namefilter1/filter-name
  url-pattern/*/url-pattern
/filter-mapping
filter-mapping
  filter-namefilter2/filter-name
  url-pattern/*/url-pattern
/filter-mapping
filter-mapping
  filter-namewicket.myproject/filter-name
  url-pattern/*/url-pattern
/filter-mapping

When I access my HomePage, it prints out:

Entering Filter1...
Entering Filter2...
Exiting Filter2...
Exiting Filter1...

So, I think you just have it backwards.  The
OpenEntityManagerInViewFilter should be mapped before the
WicketFilter.

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