Implementation question of WebMarkupContainer

2007-10-18 Thread Bushby

I have a use case where an admin manages html for the user side of an
application.  The html is stored in the database.  When the user selects a
link from a menu the html is then pulled from the database and displayed.

I have created a custom object extending WebMarkupContainer. I override the
onComponentTagBody method to get the response object and write the html to
the response.  Is this the correct way to do this?, meaning clean and
reusable, or should I be looking at creating a resource and adding it with
the application object.

Thanks
Bushby

-- 
View this message in context: 
http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
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: Implementation question of WebMarkupContainer

2007-10-18 Thread Martijn Dashorst
Use:

add(new Label(contents, contentsFromDatabase).setEscapeModelStrings(false)));

instead.

Martijn

On 10/18/07, Bushby [EMAIL PROTECTED] wrote:

 I have a use case where an admin manages html for the user side of an
 application.  The html is stored in the database.  When the user selects a
 link from a menu the html is then pulled from the database and displayed.

 I have created a custom object extending WebMarkupContainer. I override the
 onComponentTagBody method to get the response object and write the html to
 the response.  Is this the correct way to do this?, meaning clean and
 reusable, or should I be looking at creating a resource and adding it with
 the application object.

 Thanks
 Bushby

 --
 View this message in context: 
 http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

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



Re: Implementation question of WebMarkupContainer

2007-10-18 Thread Bushby

I missed a piece of the functionality.  If the user were to select another
menu item, I need to replace the html.  So I could create a new label with
the new html, replace the label within the container, and then render the
container?

Thanks
Bushby


Martijn Dashorst wrote:
 
 Use:
 
 add(new Label(contents,
 contentsFromDatabase).setEscapeModelStrings(false)));
 
 instead.
 
 Martijn
 
 On 10/18/07, Bushby [EMAIL PROTECTED] wrote:

 I have a use case where an admin manages html for the user side of an
 application.  The html is stored in the database.  When the user selects
 a
 link from a menu the html is then pulled from the database and displayed.

 I have created a custom object extending WebMarkupContainer. I override
 the
 onComponentTagBody method to get the response object and write the html
 to
 the response.  Is this the correct way to do this?, meaning clean and
 reusable, or should I be looking at creating a resource and adding it
 with
 the application object.

 Thanks
 Bushby

 --
 View this message in context:
 http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0-beta4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13283133
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: Implementation question of WebMarkupContainer

2007-10-18 Thread Martijn Dashorst
Read up on models [1].

The user selects a menu item, so probably your page has something like this:

class mypage extends webpage {
private MenuItem selectedMenuItem = null;
}

If the menuitem class has a property called itemMarkup you can do this:

add(new Label(contents, new PropertyModel(mypage.this,
selectedMenuItem.itemMarkup)).setEscapeModelStrings(false));

Martijn


On 10/18/07, Bushby [EMAIL PROTECTED] wrote:

 I missed a piece of the functionality.  If the user were to select another
 menu item, I need to replace the html.  So I could create a new label with
 the new html, replace the label within the container, and then render the
 container?

 Thanks
 Bushby


 Martijn Dashorst wrote:
 
  Use:
 
  add(new Label(contents,
  contentsFromDatabase).setEscapeModelStrings(false)));
 
  instead.
 
  Martijn
 
  On 10/18/07, Bushby [EMAIL PROTECTED] wrote:
 
  I have a use case where an admin manages html for the user side of an
  application.  The html is stored in the database.  When the user selects
  a
  link from a menu the html is then pulled from the database and displayed.
 
  I have created a custom object extending WebMarkupContainer. I override
  the
  onComponentTagBody method to get the response object and write the html
  to
  the response.  Is this the correct way to do this?, meaning clean and
  reusable, or should I be looking at creating a resource and adding it
  with
  the application object.
 
  Thanks
  Bushby
 
  --
  View this message in context:
  http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.0-beta4 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13283133
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

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



Re: Implementation question of WebMarkupContainer

2007-10-18 Thread Frank Bille
Use a model on the label instead. If the content changes the label will pull
the latest from the model.

Frank


On 10/18/07, Bushby [EMAIL PROTECTED] wrote:


 I missed a piece of the functionality.  If the user were to select another
 menu item, I need to replace the html.  So I could create a new label with
 the new html, replace the label within the container, and then render the
 container?

 Thanks
 Bushby


 Martijn Dashorst wrote:
 
  Use:
 
  add(new Label(contents,
  contentsFromDatabase).setEscapeModelStrings(false)));
 
  instead.
 
  Martijn
 
  On 10/18/07, Bushby [EMAIL PROTECTED] wrote:
 
  I have a use case where an admin manages html for the user side of an
  application.  The html is stored in the database.  When the user
 selects
  a
  link from a menu the html is then pulled from the database and
 displayed.
 
  I have created a custom object extending WebMarkupContainer. I override
  the
  onComponentTagBody method to get the response object and write the html
  to
  the response.  Is this the correct way to do this?, meaning clean and
  reusable, or should I be looking at creating a resource and adding it
  with
  the application object.
 
  Thanks
  Bushby
 
  --
  View this message in context:
 
 http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.0-beta4 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13283133
 Sent from the Wicket - User mailing list archive at Nabble.com.


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