Re: [Wicket-user] Tree testing

2007-06-09 Thread Timo Rantalaiho
On Fri, 08 Jun 2007, Ingram Chen wrote:
 I use 1.2.6 and tester.clickLink(foo:bar:navigation:i:6:nodeLink) work for

And instead of using the full path like that (which can be
tedious to maintain when the component hierarchy changes)
you can also use an Ivistor to access the component (and
then ask its path from itself). 

It depends on the case which is wiser. We also use a the
hardcoded path a lot in tests, but with repeaters it can 
get a bit fragile.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] turning off markup validation

2007-06-09 Thread wicket
No, not at all.
See this sample of alerady generated menu:
==
div class=menu
ul
lia href=./menu/index.htmlDEMOS!--[if IE
7]!--/a!--![endif]--
!--[if lte IE 6]tabletrtd![endif]--
ul
lia href=../menu/nodots.htmlactive focus/a/li
lia class=drop
href=../menu/hover_click.html!--[if IE
7]!--/a!--![endif]--
!--[if lte IE 6]tabletrtd![endif]--
ul
lia href=../menu/form.htmlstyled form/a/li
lia href=../menu/nodots.htmlremoving
active/focus borders/a/li
lia
href=../menu/hover_click.htmlhover/click/a/li
/ul
!--[if lte IE 6]/td/tr/table/a![endif]--
/li
lia href=../menu/em_images.htmlem image sizes
compared/a/li
/ul
!--[if lte IE 6]/td/tr/table/a![endif]--
/li
lia href=./boxes/index.htmlBOXES!--[if IE
7]!--/a!--![endif]--
!--[if lte IE 6]tabletrtd![endif]--
ul
lia href=cross.htmlnon-rectangular/a/li
lia href=jigsaw.htmljigsaw links/a/li
lia href=circles.htmlcircular links/a/li
/ul
!--[if lte IE 6]/td/tr/table/a![endif]--
/li
/ul
/div
==

Those parts are important:

!--[if IE 7]!--/a!--![endif]--
!--[if lte IE 6]/td/tr/table/a![endif]--

the markup which is seen by the browser is not illegal, browser see
correct tags a.../a in the ouput, one of the /a tags is always
commented for the browser, which one depends on the browser type, only
wicket can see both closing tags and fires an error.

Vitek


Dne 8 Červen 2007, 16:59, Igor Vaynberg napsal(a):
 so, to clarify, what you are trying to do is output illegal html? like
 a.../a/a?


 -igor



 On 6/8/07, Vit Rozkovec [EMAIL PROTECTED] wrote:


 I am afraid that it will not work.
 I tried it with the Border, but it is the same problem.


 There is one a tag but two /a closing tags in the html, and the
 browser accepts only one /a close tag - it depends on the browser (IE,
  Mozilla..) which one, so the menu works without javascript in all
 modern browsers.

 So whatever I do, there will be always one component, which will have
 inside a tag which was not opened before.

 It still seems to me that I would need to turn off markup validation
 for some component containing this tag. I looked on the settings
 interfaces, but did not find it there.

 Is there some other solution how to solve this?


 Vitek


 Juergen Donnerstag wrote:

 ok understood. And isn't it than a typical Border situation? Please
 take a look at Border and  MarkupComponentBorder and the respective
 javadoc and junit tests to see how they work.

 Juergen


 On 6/8/07, Vit Rozkovec [EMAIL PROTECTED] wrote:


 Actually I do, sometime the conditional text is there (when there
 are subitems for current item), for all the rest the visibility of
 span is set to false.


 Vitek


 Juergen Donnerstag wrote:


 Why do you need the fragments at all? The fragments body is a
 constant text, correct? You don't change it, you don't change the
 visibility.

 Juergen


 On 6/7/07, Ví­t Rozkovec [EMAIL PROTECTED] wrote:



 Good day,
 one more issue - is there some way how to turn of markup
 validation? In my template I am using this:


 
 wicket:panel
 span wicket:id=outerConditionalStart/span
 ul
 li wicket:id=liItem
 a href=# wicket:id=link
 span wicket:id=linkText[text

 odkazu]/span
 span

 wicket:id=innerConditionalStart/span

 /a
 span wicket:id=innerConditionalEnd/span
 span wicket:id=subItemInsertPoint/span
 /li
 /ul
 span wicket:id=outerConditionalEnd/span
 /wicket:panel


 wicket:fragment wicket:id=outerConditionalStart
 !--[if lte IE 6]tabletrtd![endif]--
 /wicket:fragment


 wicket:fragment wicket:id=outerConditionalEnd
 !--[if lte IE 6]/td/tr/table/a![endif]--
 /wicket:fragment


 wicket:fragment wicket:id=innerConditionalStart
 !--[if IE 7]!--
 /wicket:fragment


 wicket:fragment wicket:id=innerConditionalEnd
 !--![endif]--
 /wicket:fragment
 


 The problem is that wicket complains about using fragments this
 way
 with
 message:


 WicketMessage: Tag 'td' (line 20, column 30) has a mismatched
 close tag at '/wicket:fragment' (line 21, column 1)


 My purpose is to first initialize a menu tree and then
 traversing
 whole
 tree, generating drop-down menu with the structure which can be
 seen
 here:

 http://www.cssplay.co.uk/menus/css/final_drop.txt
 The whole working menu can bee seen here:
 http://www.cssplay.co.uk/menus/final_drop.html


 What solution can be for my problem?
 Or does wicket has natively some support for creating dropdown
 menus?
 I

 was unable to find. Thanks for any help.
 Regards Vitek



 ---
 --

 

Re: [Wicket-user] Tree testing

2007-06-09 Thread Ingram Chen

indeed, we internally develop small extension to allow using partial path
to allocate component.

tester.clickLink(foo:bar:navigation:i:6:nodeLink)
can be written like

tester.clickLink(foo, 6, nodeLink)


On 6/9/07, Timo Rantalaiho [EMAIL PROTECTED] wrote:


On Fri, 08 Jun 2007, Ingram Chen wrote:
 I use 1.2.6 and tester.clickLink(foo:bar:navigation:i:6:nodeLink) work
for

And instead of using the full path like that (which can be
tedious to maintain when the component hierarchy changes)
you can also use an Ivistor to access the component (and
then ask its path from itself).

It depends on the case which is wiser. We also use a the
hardcoded path a lot in tests, but with repeaters it can
get a bit fragile.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





--
Ingram Chen
��便��啦: http://dinbendon.net
blog: http://www.javaworld.com.tw/roller/page/ingramchen
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] SimpleConverterAdapter and primitive fields

2007-06-09 Thread John Krasnay
My application stores money amounts as an integer number of cents. I've
written a converter to handle this as follows:

public class MoneyConverter extends SimpleConverterAdapter {
public Object toObject(String value) {
try {
return Math.round(Float.parseFloat(value) * 100);
} catch (NumberFormatException e) {
throw new ConversionException().setSourceValue(value);
}
}
public String toString(Object value) {
float amount = ((Number) value).floatValue() / 100;
return String.format(%.2f, amount);
}
}

When attached to a TextField, this converter is called twice, once
before calling the field validators, and again when saving to the model.
This second call is failing in this part of SimpleConverterAdapter:

  else if (value != null  (!value.getClass().isAssignableFrom(c)))
  {
throw new IllegalArgumentException(unable to convert  +
  value +  to type  + c);
  }

...because value.getClass() is Integer while c is int, and the two
are not assignable from one another (apparently, Java 5 autoboxing does
not apply here). The error message is an unhelpful unable to convert 1
to type int.

So it seems that SimpleAdapterConverter cannot be used with
primitive-typed properties. Does this sound right? Will this limitation
exist in 1.3 (I'm using 1.2.6)? Can anyone think of a workaround other
that implementing IConverter directly and checking explicitly for
Integer - int?

jk


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] File Releases suggestions

2007-06-09 Thread Jean-Baptiste Quenot
* Robert .:
 When a new version is released I would like to get all the new zip files
 quickly. However there are 11 zip files and somehow the download is always
 set to some non-working mirror which I have to change manually. Those are a
 lot of clicks. I would really enjoy if there is a mega-zip file release
 which contains all the other zip files or directories.
 
 Another suggestion is the filename of the releases. They all have the -bin
 part, even though they include source and documentation. Some other open
 source projects use the -bin filename part too, but they usually have
 separate releases with -src. So why not have filenames such as
 wicket-1.2.6.zip

Those problems are addressed in the upcoming releases.  See for
example apache-wicket-1.3.0-incubating-beta1:

http://people.apache.org/~dashorst/releases/apache-wicket-1.3.0-incubating-beta1/dist/
-- 
 Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Resource.getParameters and resource mounting

2007-06-09 Thread Janos Cserep

I've started migrating my applications to 1.3.0 and I think I ran into a 
bug with Resource.getParameters().

If a resource is mounted via Application.mountSharedResource then 
Resource.getParameters returns with an empty valuemap. If it is not 
mounted then the valuemap contains all the parameters passed in via the URL.

Created an issue in JIRA:
https://issues.apache.org/jira/browse/WICKET-631

Regards,

--
Janos Cserep - [EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] WASPSession.logout(object)

2007-06-09 Thread Maurice Marrink
It isn't fixed on username an password because i want people to be
able to use any kind of authentication. e.g. a card reader or retinal
scan. A credentials object could be used in this case, but then i am
introducing yet another class people need to use / extend. But i
already have an idea how to refactor this.

Maurice

On 6/9/07, craigdd [EMAIL PROTECTED] wrote:

 Just out of curiosity why doesn't the login method take a username/password?
 Or if you want it to be more abstracted create some sort of Credentials
 object and update the WASPSession.login to take a LoginContext and
 Credentials object.  Then update the LoginContext login to take the
 Credential.

 -Craig


 Mr Mean wrote:
 
  I just remembered a little snag, this is not going to work because i
  currently use the context to ask if the component, class, model is
  authenticated by this context. So i really need it atm.
 
  Looks like i need to think this trough a little better. but first i
  gotta grab some sleep.
 
  Maurice
 
  On 6/9/07, craigdd [EMAIL PROTECTED] wrote:
 
  Sounds like a pretty good idea, I like that much better than having the
  user
  need to know they need to cleanup data state in their LoginContext.
 
  Another idea might be to have the LoginContext provide a method that
  returns
  a unique identifier.  That value could be store internally and the user
  can
  pass anything they want, I'd assume the default would be to return the
  username which is completely fair to be in the session.
 
  Without looking too closely at the code you could also use this
  identifier
  during logout.
 
  -Craig
 
 
  Mr Mean wrote:
  
   Just thinking out loud here, but it shouldn't be too difficult to
   change this into holding a hash of the logincontext instead of the
   whole context. Since the equals contract already specifies that equal
   object should have equal hashes The equals check can be easily
   performed on the hash, HashMap actually uses the hash before it uses
   the equal, so i do not see much problems here. And it is not like you
   are gonna have an army of logincontexts in each session.
  
   Ill see if i can implement this sometime tomorrow.
  
   Thanks again for pointing this out, if you think there are more of
   this kind of problems just let me know.
  
   Maurice
  
   P.S. i guess an api for getting the original logincontext is out of
   the question then :)
  
  
   On 6/8/07, craigdd [EMAIL PROTECTED] wrote:
  
   Are you saying then that the instance of LoginContext used to login is
   held
   onto in the WASPSession, via the security framework?
  
   If so then this brings up a huge security issue, as least the way the
  API
   sits and the examples showing that a LoginContext takes a username and
   password in its constructor.  This mean that a password(probably plain
   text)
   is available in the session which is usually a big no no when it comes
  to
   a
   secure application.  I've been through a few security probes from
  banks
   on
   various online applications that that is one of the first thing they
  look
   for / ask. Are you holding onto the password?
  
   -Craig
  
  
   Mr Mean wrote:
   
There is currently no way to grab the login context, so you could
store it yourself (there migh be multiple logintexts though). But
  the
good news is you don't have to store it if you don't want to. The
logoff performs an equals check and currently every logincontext of
the same class and level is equal to another. So if you login using
  a
MySingleLoginContext(username, password) you can logoff with any new
instance of that class (logoff(new MySingleLoginContext());)
   
However if you feel you need to have access to the original
  instance,
for instance because you want to know the username, i can always
include such a method in the api.
   
Maurice
   
On 6/8/07, craigdd [EMAIL PROTECTED] wrote:
   
I see that the WASPSession.logout method takes a LoginContext.  Is
   there
somewhere within the SWARM implementation to grab the LoginContext
   used
to
login?  Or when logging in is it up to the developer to put the
LoginContext
somewhere...say maybe the session itself?
   
Thanks
Craig
--
View this message in context:
   
  
  http://www.nabble.com/WASPSession.logout%28object%29-tf3887102.html#a11018551
Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
   
  
  -
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
   
   
  
  

Re: [Wicket-user] WASPSession.logout(object)

2007-06-09 Thread Igor Vaynberg

On 6/9/07, Maurice Marrink [EMAIL PROTECTED] wrote:


retinal scan.



:)

-igor
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] WASPSession.logout(object)

2007-06-09 Thread Maurice Marrink
:D Well i had to come up with something outrageous didn't i? ;)

Maurice

On 6/9/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 On 6/9/07, Maurice Marrink [EMAIL PROTECTED] wrote:
  retinal scan.

 :)

 -igor


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] WASPSession.logout(object)

2007-06-09 Thread Maurice Marrink
Ok, i just committed some refactoring in the authentication module of
swarm. To make sure we do not store user credentials in the session.
For those of you already depending on swarm, here are the changes.

-All is...Authenticated methods from LoginContext are now in  Subject,
just copy paste the relevant code.
-SingleLoginContext has been folded into LoginContext, simply replace
any occurrence of  the word SingleLoginContext with LoginContext as
the constructors remained the same.
-LoginContext equal and hashcode are final
-LoginContext is now a throw away object and therefor is no longer serializable
-LoginContext no longer implements Comparable interface
-Subjects are now considered readonly, and therefor the interface does
no longer define an addPrincipal method. instead implementations will
provide add/remove methods that honor the readonly flag which is set
by swarm as soon as the subject has been passed on.

I haven't had time to update the getting started yet, so be patient there.

Oh and before anyone else says something about it, I'll do it myself :)
I know Subject now has a dependency on the wicket gui, making it a
less ideal candidate for storing it in a database as before. But my
reasoning is this Subject is part of swarm and therefor of wicket, so
the dependency is allowed. Instead use your own entity for database
storage and wrap them in a Subject that will be thrown away when they
logoff.

Maurice

On 6/9/07, Maurice Marrink [EMAIL PROTECTED] wrote:
 :D Well i had to come up with something outrageous didn't i? ;)

 Maurice

 On 6/9/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  On 6/9/07, Maurice Marrink [EMAIL PROTECTED] wrote:
   retinal scan.
 
  :)
 
  -igor
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] turning off markup validation

2007-06-09 Thread Kent Tong
 wicket at rozkovec.info writes:

 Those parts are important:
 
 !--[if IE 7]!--/a!--![endif]--
 !--[if lte IE 6]/td/tr/table/a![endif]--
 
 the markup which is seen by the browser is not illegal, browser see
 correct tags a.../a in the ouput, one of the /a tags is always
 commented for the browser, which one depends on the browser type, only
 wicket can see both closing tags and fires an error.

Try:

public class RawLabel extends Label {
public RawLabel(String id, IModel model) {
super(id, model);
setEscapeModelStrings(false);
}
}

public class RawOutput extends WebPage {
  public RawOutput() {
RawLabel outerConditionalStart = new RawLabel(outerConditionalStart,
new Model(!--[if lte IE 6]tabletrtd![endif]--));
RawLabel outerConditionalEnd = new RawLabel(outerConditionalEnd,
new Model(
!--[if lte IE 6]/td/tr/table/a![endif]--));
add(outerConditionalStart);
add(outerConditionalEnd);
...
  }
}




-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user