Re: [Wicket-user] Making custom MessageResolver

2007-06-06 Thread Murat Yücel

Well when the developers can help then i have made a hack to solve the
problem :)...
I am changing with wicket tag to become a span and then adding a onclick
method to
the span. Beware that this only works if the following flag is set to false.
getMarkupSettings().setStripWicketTags(false);

Since i only need this on our test environment then it is okey to set the
flag to false.
The flag is default false so i am only setting the flag to true if we are
running on our production
environment.

Here is the code if anybody is interested:

   public static class MyLabel extends Label {
   private static final long serialVersionUID = 1L;

   /**
* Construct.
*
* @param id
* @param value
*/
   public MyLabel(final String id, final String value)
   {
   super(id, value);
   setEscapeModelStrings(false);
   }

   /**
*
* @see wicket.Component#onComponentTag(wicket.markup.ComponentTag)
*/
   protected void onComponentTag(ComponentTag tag)
   {
   // Convert wicket:message / into
   // wicket:message.../wicket:message
   if (tag.isOpenClose())
   {
   tag.setType(XmlTag.OPEN);
   }
   super.onComponentTag(tag);
   tag.setName(span);
   tag.setNamespace(null);
   tag.put(onclick, editText(););
   tag.put(onmouseover, this.style.cursor='hand';
this.style.cursor='pointer';);
   }
   }

2007/6/5, Murat Yücel [EMAIL PROTECTED]:


Hi Juergen

You are probably right about the setEscapeModelString(false) in 1.3. I am
currently using 1.2.6.

If i use a a href tag then it will confuse the developers. Because it is
actually
not a link it is a i18n message that i want to display. Thats why i am
using the
wicket:message tag.

We are actually migrating a application from struts to wicket and in
struts this
was solved my making a i18n tag. If the user had text admin right on the
session
the text would become clickable.

Do you have other suggestion to solve the problem above, because the link
or a href
tag is not what i want.

/Murat

2007/6/5, Juergen Donnerstag  [EMAIL PROTECTED]:

 The current implementation in 1.3 trunk does
 setEscapeModelString(false) (see WicketMessageResolver(line 130)

 I haven't yet understood why you want to add either the Label and/or
 the Link via the IComponentResolver? Why not make the Link a std
 component like
 a wicket:id=myLink href=# onclick=popup();
 and use setVisible(boolean) to either switch it on or off depending
 the user status.

 Juergen

 On 6/4/07, Murat Yücel [EMAIL PROTECTED] wrote:
  Hi All
 
  I have currently made a custom message resolver using the
 IComponentResolver
  interface.
  The reason i have made this is because it is not possible
  setEscapeModelString(false) for
  the wicket:message tag.
 
  Well now i have another issue. If someone logon to my application as
 text
  administrator then
  instead of a Label a Link with a label should be shown.
 
  Example (no rights)
  spanThis is a text/span
 
  Example 2 (text admin)
  a href=# onclick=popup();spanThis is a text/span/a
 
  The link should include PopupSettings and in the popup it should be
 able to
  change the text
  in the database. This way the business can change texts without me
 getting
  involved :)...
 
  The popup part is not a issue. I just have problems with both adding a
 Link
  and a Label in a
  Custom Message Resolver.
 
  Hope that you can help
 
  Kind regards
 
  /Murat Yücel
 
 
 
 -
  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



-
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] Making custom MessageResolver

2007-06-05 Thread Murat Yücel

Hi Juergen

You are probably right about the setEscapeModelString(false) in 1.3. I am
currently using 1.2.6.

If i use a a href tag then it will confuse the developers. Because it is
actually
not a link it is a i18n message that i want to display. Thats why i am using
the
wicket:message tag.

We are actually migrating a application from struts to wicket and in struts
this
was solved my making a i18n tag. If the user had text admin right on the
session
the text would become clickable.

Do you have other suggestion to solve the problem above, because the link or
a href
tag is not what i want.

/Murat

2007/6/5, Juergen Donnerstag [EMAIL PROTECTED]:


The current implementation in 1.3 trunk does
setEscapeModelString(false) (see WicketMessageResolver(line 130)

I haven't yet understood why you want to add either the Label and/or
the Link via the IComponentResolver? Why not make the Link a std
component like
a wicket:id=myLink href=# onclick=popup();
and use setVisible(boolean) to either switch it on or off depending
the user status.

Juergen

On 6/4/07, Murat Yücel [EMAIL PROTECTED] wrote:
 Hi All

 I have currently made a custom message resolver using the
IComponentResolver
 interface.
 The reason i have made this is because it is not possible
 setEscapeModelString(false) for
 the wicket:message tag.

 Well now i have another issue. If someone logon to my application as
text
 administrator then
 instead of a Label a Link with a label should be shown.

 Example (no rights)
 spanThis is a text/span

 Example 2 (text admin)
 a href=# onclick=popup();spanThis is a text/span/a

 The link should include PopupSettings and in the popup it should be able
to
 change the text
 in the database. This way the business can change texts without me
getting
 involved :)...

 The popup part is not a issue. I just have problems with both adding a
Link
 and a Label in a
 Custom Message Resolver.

 Hope that you can help

 Kind regards

 /Murat Yücel



-
 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

-
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] Making custom MessageResolver

2007-06-04 Thread Murat Yücel

Hi All

I have currently made a custom message resolver using the IComponentResolver
interface.
The reason i have made this is because it is not possible
setEscapeModelString(false) for
the wicket:message tag.

Well now i have another issue. If someone logon to my application as text
administrator then
instead of a Label a Link with a label should be shown.

Example (no rights)
spanThis is a text/span

Example 2 (text admin)
a href=# onclick=popup();spanThis is a text/span/a

The link should include PopupSettings and in the popup it should be able to
change the text
in the database. This way the business can change texts without me getting
involved :)...

The popup part is not a issue. I just have problems with both adding a Link
and a Label in a
Custom Message Resolver.

Hope that you can help

Kind regards

/Murat Yücel
-
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] Making custom MessageResolver

2007-06-04 Thread Juergen Donnerstag
The current implementation in 1.3 trunk does
setEscapeModelString(false) (see WicketMessageResolver(line 130)

I haven't yet understood why you want to add either the Label and/or
the Link via the IComponentResolver? Why not make the Link a std
component like
a wicket:id=myLink href=# onclick=popup();
and use setVisible(boolean) to either switch it on or off depending
the user status.

Juergen

On 6/4/07, Murat Yücel [EMAIL PROTECTED] wrote:
 Hi All

 I have currently made a custom message resolver using the IComponentResolver
 interface.
 The reason i have made this is because it is not possible
 setEscapeModelString(false) for
 the wicket:message tag.

 Well now i have another issue. If someone logon to my application as text
 administrator then
 instead of a Label a Link with a label should be shown.

 Example (no rights)
 spanThis is a text/span

 Example 2 (text admin)
 a href=# onclick=popup();spanThis is a text/span/a

 The link should include PopupSettings and in the popup it should be able to
 change the text
 in the database. This way the business can change texts without me getting
 involved :)...

 The popup part is not a issue. I just have problems with both adding a Link
 and a Label in a
 Custom Message Resolver.

 Hope that you can help

 Kind regards

 /Murat Yücel


 -
 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