Re: multiple feedback panels in same page

2009-08-21 Thread satar

Thank you for the quick example. I think I actually seen this way of setting
up a feedback panel at one point in time but had forgotten and then bumped
into the problem of having two feedback panels on one page. This got me
moving on quickly -- thank again!
-- 
View this message in context: 
http://www.nabble.com/multiple-feedback-panels-in-same-page-tp22298693p25089341.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Firefox, be afraid be very afraid!!!

2009-08-05 Thread satar

WOW... Thanks Igor and the rest of you for all the responses. I was pretty
burnt last night when I finally discovered that probably several of the the
myriad of approaches I went through to simply center a date picker worked
but because Firefox was caching my first failed attempt I wasn't seeing
them. I will probably just use the SHIFT-F5 so that I can go back to
Firefox, which I definitely prefer as a browser. I also need to make use of
the Firebug I installed a while back but forgot about. 

You all are awesome and Wicket ROCKS! I wrote and released the "first"
webapp I have ever developed, which includes a three table nested
relationship to a forth selected items panel that keeps itself up-to-date by
the minute. It uses the very slick inmethod grids and color coded with
optional colorblind settings. The selected item panel has alternate choices
for each check item selected with corresponding canned text to make
describing a problem easier, validates inputs for consistency, and updates
tables appearance when user updates an item. All this in under 4 months all
due to Wicket and this user forum!

Thank you -- Thank You!!!
-Steve


igor.vaynberg wrote:
> 
> SHIFT-F5 or SHIFT+clicking the refresh button will bypass the cache
> when reloading the page. i use firefox almost exlucisvely as well and
> had this problem happen sometimes to javascript files.
> 
> -igor
> 
> On Tue, Aug 4, 2009 at 7:31 PM, Ben Tilford wrote:
>> It's not Wicket or Firefox its the caching settings (probably on the
>> server). If the cached resources aren't expired the browser is supposed
>> to
>> use what it has cached.
>>
>> Best to set the far future expires to something really short or 0 in
>> development.
>>
>> On Tue, Aug 4, 2009 at 10:17 PM, Jeremy Thomerson
>> >> wrote:
>>
>>> Strange - I use FF almost exclusively and have never had this problem.
>>>  Did you use something like HttpFox or TamperData to look at the
>>> headers and see if the expiry headers were coming back correctly?
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Tue, Aug 4, 2009 at 9:12 PM, Steve Tarlton wrote:
>>> > I just spent the better half of a day WASTED because I use Firefox for
>>> > testing my Wicket development. For the life of me, I couldn't figure
>>> out
>>> why
>>> > I couldn't get a simple data picker to center. I wouldn't call myself
>>> an
>>> > expert at html so I doubted myself. Turns out that Firefox decided
>>> that
>>> > there is no need to update changes if there is something in cache --
>>> WTF!!!
>>> > It wasn't until I got so fed up I tried Internet Explorer and saw that
>>> what
>>> > I was doing was working all along. I "exited" Firefox and restarted it
>>> and
>>> > still not working. It wasn't until I went in and cleared my "private
>>> cache"
>>> > and then visited my app again that it did what it was suppose to do. I
>>> of
>>> > course poked around in Firefox to turn that !...@#$%! cache off but the
>>> only
>>> > thing I found was a setting that would automatically flush it when I
>>> > "exited" (not closed) Firefox. I will probably still use it for normal
>>> > surfing but unless there is a way to stop it from not updating my html
>>> > changes, I will NOT be useing it for Wicket development!
>>> >
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Firefox%2C-be-afraid-be-very-afraid%21%21%21-tp24819632p24831580.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxSelfUpdatingTimerBehavior and ModalWindow

2009-07-21 Thread satar

I know this is an old post but it hits an issue I currently have. I want to
provide the user the ability to turn on/off auto refresh of data from the
database. If all possible, I would like to use the original
AjaxSelfUpdatingTimerBehavior or at least the AbstractAjaxTimerBehavior but
it has the stopped boolean as a private with no way to set it back to true
and the methods that use it use it directly instead of calling a method that
I can override -- am I missing something? 

The man reason I want to do this is for performance trade-offs. I see that
if I set the timer off by calling the stop() method, the interface is much
snappier. It looks like another potential idea may be to override the method
renderHead, but I cannot override the respond method, which uses the stopped
boolean.

Is there a better way to handle such a problem -- I am using Wicket 1.4-r2.
-- 
View this message in context: 
http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p24593467.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: jWicket -- jQuery with Wicket integration

2009-07-21 Thread satar

Just an FYI, the link to the WicketJQueryDemo.war on
"http://subversion.visionet.de/project/WicketJQuery/wiki"; is broke. I think
it should be:

http://subversion.visionet.de/project/WicketJQuery/browser/tags/0.3.6/WicketJQueryDemo.war

instead its:

http://subversion.visionet.de/project/WicketJQuery/browser/tags/0.3./WicketJQueryDemo.war
-- 
View this message in context: 
http://www.nabble.com/jWicketjQuery-with-Wicket-integration-tp24584280p24593132.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How do I set a selected item outside of an inmethod datagrid?

2009-07-21 Thread satar

Not sure if this was a tough question or simply no one on the user forum has
had such a need but I finally figured out a way to get my particular problem
solved and figured I would share. There likely may be a better way but I
tied the selection to an Override of the DataSource of the DataGrid:

...

/*
 * -
 * Create data source for the history grid 
 * -
 */
checkItemHistoryDataSource = new MatrixCheckItemHistoryDataSource(
NUMBER_OF_DAYS) {

  @Override
  public IModel model(Object object) {
MatrixCheckItemModel m = (MatrixCheckItemModel) object;
IModel im = new MatrixDetachableCheckItemModel(m);
/*
 * If we have selected a new item that doesn't match the history
item
 * profile.
 */
if ((historyItemSelected.getId() == null)
|| !historyItemSelected.getMatrixCheckProfile().getId().equals(
listItemSelected.getMatrixCheckProfile().getId())) {
  /*
   * Reset the currently selected history item if it has the same
date
   * as our new list item. This way it selects the current history
   * instance by default, which is what we want.
   */
  if (m.getMatrixShiftReport().getDay().equals(
  listItemSelected.getMatrixShiftReport().getDay())) {
// historyItemSelected = m;
itemSelectedHistoryGrid.selectItem(im, true);
/*
 * Reset our selected item panel.
 */
selectedItemPanel.setSelectedItem(historyItemSelected);
  }
}
return im;
  }
};

/*
 * -
 * Create and add the selected item history grid 
 * -
 */
itemSelectedHistoryGrid = new MatrixCheckItemHistoryGrid(
"selectedItemHistoryGrid", checkItemHistoryDataSource, colorblind) {

  private static final long serialVersionUID = 1L;

  @Override
  public void resetSelectedItems() {
super.resetSelectedItems();

/*
 * When selection changes the item panel needs to be refreshed.
 */
AjaxRequestTarget target = AjaxRequestTarget.get();

/*
 * Refresh ajax target
 */
if (target != null) {
  /*
   * Set the selected item on the panel and refresh it
   */
  selectedItemPanel.setSelectedItem(historyItemSelected);
  target.addComponent(selectedItemPanel);
}
  }

  @Override
  public void selectItem(IModel item, boolean isSelect) {
super.selectItem(item, isSelect);

/*
 * There will only be one item in the collection as this grid
 * has setAllowSelectMultiple() set to false.
 */
Collection selected = getSelectedItems();
for (IModel model : selected) {
  historyItemSelected = (MatrixCheckItemModel) model.getObject();
}

/*
 * When selection changes the item panel needs to be refreshed.
 */
AjaxRequestTarget target = AjaxRequestTarget.get();

/*
 * Refresh ajax target
 */
if (target != null) {
  /*
   * Set the selected item on the panel and refresh it
   */
  selectedItemPanel.setSelectedItem(historyItemSelected);
  target.addComponent(selectedItemPanel);
}
  }
};

...

/*
 * ---
 * Create a grid of check items that are for the current shift and day
 * ---
 */
currentGrid = new MatrixCheckItemGrid("current",
new MatrixCheckListDataSource(), colorblind) {

  private static final long serialVersionUID = 1L;

  @Override
  public void selectItem(IModel item, boolean isSelect) {
super.selectItem(item, isSelect);

/*
 * There will only be one item in the collection as this grid
 * has setAllowSelectMultiple() set to false.
 */
Collection selected = getSelectedItems();
for (IModel model : selected) {
  listItemSelected = (MatrixCheckItemModel) model.getObject();
}

/*
 * When selection changes the item panel needs to be refreshed.
 */
AjaxRequestTarget target = AjaxRequestTarget.get();

/*
 * If we selected something then we can make the panel visible.
 */
itemSelectedHistoryGrid.setVisible(listItemSelected != null);
selectedItemPanel.setVisible(listItemSelected != null);

/*
 * Refresh ajax target
 */
if (target != null) {
 

Re: SpringBean: component-based verses session in scope.

2009-07-17 Thread satar

Oh... I see, so it doesn't matter which way I go because underneath the
covers it is a single instance of the session anyway. Still less code to
manage/write if I define access to the injected sessions within the session
class. Now I just need to learn and understand what you meant by the comment
why not use:

  matrixCheckItemService.foo()

That one is throwing me but I am fairly new with web architectures period so
I probably am not reading into that. What I am doing with:

MatrixCheckItemService matrixCheckItemService =
((MatrixSession)WebSession.get()).getCheckItemService();

is getting a pointer to my service that I injected within my session class,
then I call matrixCheckItemService.foo(). Are you suggesting that I make the
session's injected instance public instead of private beings there can only
be one session level instance anyway because it is handled underneath the
covers at the spring context?

Sorry if I appear ignorant... I am still very green behind the ears.


-- 
View this message in context: 
http://www.nabble.com/SpringBean%3A-component-based-verses-session-in-scope.-tp24539500p24540596.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: SpringBean: component-based verses session in scope.

2009-07-17 Thread satar

Igor, I was more asking for opinions on whether it better to define my
@SpringBean injections in my session class verses within components that
need them. In the later, I may end up injecting the same session class in
more than one component class. What I am doing now is moving those instances
out into the session class and accessing within the component with a call to
a session-level method:

...
// get our Check items from the database
MatrixCheckItemService matrixCheckItemService = ((MatrixSession)
WebSession
.get()).getCheckItemService();
...

I have a working solution either way. I was just looking for insight on what
smart, highly knowledgeable peeps like yourself thought was better.
-- 
View this message in context: 
http://www.nabble.com/SpringBean%3A-component-based-verses-session-in-scope.-tp24539500p24539994.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Update separate current select panel from AjaxSelfUpdatingTimerBehavior of inmethod DataGrid

2009-07-16 Thread satar

Sorry, I should have explored deeper into the user list on this one. It was
basically already answered before in thread:
http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-Panels-td24301204.html#a24301204

I simply changed the scope of my timer to be the whole page beings that is
all it has on it and this worked perfectly! Man I LOVE Wicket... I can do
very powerful things already and I am basically a newbie!
-- 
View this message in context: 
http://www.nabble.com/Update-separate-current-select-panel-from-AjaxSelfUpdatingTimerBehavior--of-inmethod-DataGrid-tp24526412p24526740.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dynamic links in inmethod DataGrid

2009-07-13 Thread satar

James, is this similar to calling
getMarkupSettings().setStripWicketTags(boolean), which I am doing in the
application init for my app? I saw that in some example somewhere during my
reading and wondered why would you want to ever include wicket id's in the
generated html? Is there any good reason one my want the tags in the
rendered HTML?
-- 
View this message in context: 
http://www.nabble.com/Dynamic-links-in-inmethod-DataGrid-tp24424621p24470121.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A packaged resource that has a variable image based on component value

2009-07-10 Thread satar

This is what I ended up with to include a solution for my colored circle
images in case someone else finds the need for such a solution. I am
assuming it was a reasonable way to go:

...
/*
 * Checkbox column for the color blind
 */
if (colorblind) {
  columns.add(new CheckBoxColumn("checkBox"));
}

/*
 * Check Item State column
 */
columns
.add(new PropertyColumn(new ResourceModel("state"), "state",
"state") {
  private static final long serialVersionUID = 1L;

  @Override
  public String getCellCssClass(IModel rowModel, int rowNum) {
return "state";
  }

  @Override
  public boolean isEscapeMarkup() {
return false;
  }

  @Override
  protected IConverter getConverter(final Class varType) {
return new IConverter() {
  // serialVersionUID.
  private static final long serialVersionUID = 1L;

  public Object convertToObject(String value,
  java.util.Locale locale) {
// TODO Auto-generated method stub
return null;
  }

  public String convertToString(Object value,
  java.util.Locale locale) {

String color = "white";

switch ((Integer) value) {
case 0:
  color = "black";
  break;
case 1:
  color = "gray";
  break;
case 2:
  color = "red";
  break;
case 3:
  color = "yellow";
  break;
case 4:
  color = "blue";
  break;
case 5:
  color = "green";
}

if (!colorblind) {
  return "[lt]img src=\"images/".concat(color).concat(
  "-circle.png\"").concat(" alt=\"").concat(
  value.toString()).concat("\[gt]");
} else {
  return value.toString();
}
  }

};
  }
}.setInitialSize(3).setSizeUnit(SizeUnit.EM).setResizable(false)
.setReorderable(true).setHeaderTooltipModel(
new Model("State of the check item")));
...

where [lt]=<
and [gt]=>
Not sure how to address this problem when replying...

I stored all my image files under webapp/images. I am a beginner with Wicket
but this seemed to work fine for me and I can see it coming up for someone
else so figured I would share my outcome. 
-- 
View this message in context: 
http://www.nabble.com/A-packaged-resource-that-has-a-variable-image-based-on-component--value-tp24422634p24434326.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A packaged resource that has a variable image based on component value

2009-07-10 Thread satar

Seems to have chopped of my return line, which was:

return "(less than)font style=\"background-color: " +
color + "\"(greater than)" + value + "(less than)/font(greater than)";

(less than) = <
(greater than) = >

Hope it works this time


satar wrote:
> 
> So I decided that I am not experienced enough yet with Wicket or using
> inmethod DataGrid to try to do images but would like to at least change
> the background color based on an integer value. This is what I did but
> still think it is somewhat lame and probably there is a much better
> approach:
> 
> For my column that contains an Integer in its model I did the following:
> 
>   @Override
>   public boolean isEscapeMarkup() {
> return false;
>   }
>   
>   @Override
>   protected IConverter getConverter(final Class varType) {
>   return new IConverter() {
>   //serialVersionUID.
>   private static final long serialVersionUID = 1L;
> 
>   public Object convertToObject(String value,
>   java.util.Locale locale) {
> // TODO Auto-generated method stub
> return null;
>   }
> 
>   public String convertToString(Object value,
>   java.util.Locale locale) {
> 
> String color = "white";
> 
> switch ((Integer) value) {
> case 0 : color = "gray";
> case 1 : color = "black";
> case 2 : color = "red";
> case 3 : color = "yellow";
> case 4 : color = "blue";
> case 5 : color = "green";
> }
> return "" + value + "";
>   }
> 
>   };
>   } 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/A-packaged-resource-that-has-a-variable-image-based-on-component--value-tp24422634p24424855.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A packaged resource that has a variable image based on component value

2009-07-10 Thread satar

So I decided that I am not experienced enough yet with Wicket or using
inmethod DataGrid to try to do images but would like to at least change the
background color based on an integer value. This is what I did but still
think it is somewhat lame and probably there is a much better approach:

For my column that contains an Integer in its model I did the following:

  @Override
  public boolean isEscapeMarkup() {
return false;
  }
  
  @Override
  protected IConverter getConverter(final Class varType) {
  return new IConverter() {
  //serialVersionUID.
  private static final long serialVersionUID = 1L;

  public Object convertToObject(String value,
  java.util.Locale locale) {
// TODO Auto-generated method stub
return null;
  }

  public String convertToString(Object value,
  java.util.Locale locale) {

String color = "white";

switch ((Integer) value) {
case 0 : color = "gray";
case 1 : color = "black";
case 2 : color = "red";
case 3 : color = "yellow";
case 4 : color = "blue";
case 5 : color = "green";
}
return "" + value + "";
  }

  };
  } 

-- 
View this message in context: 
http://www.nabble.com/A-packaged-resource-that-has-a-variable-image-based-on-component--value-tp24422634p24424827.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A packaged resource that has a variable image based on component value

2009-07-10 Thread satar

Okay, I will see if I can figure out how to do that. Currently, I am
@Override-ing the getCellCssClass and seeing if I can vary the css resource
depending on the corresponding columns value as that is the only idea I had
currently on how I could possibly do this.
-- 
View this message in context: 
http://www.nabble.com/A-packaged-resource-that-has-a-variable-image-based-on-component--value-tp24422634p24423005.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Looking to implement a table that has it all.

2009-07-02 Thread satar

Nice, thanks for the pointers Jeremy!

-- 
View this message in context: 
http://www.nabble.com/Looking-to-implement-a-table-that-has-it-all.-tp24311958p24312781.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Looking to implement a table that has it all.

2009-07-02 Thread satar

Jeremy, those examples are PERFECT! Where does one find the source to them :P
-- 
View this message in context: 
http://www.nabble.com/Looking-to-implement-a-table-that-has-it-all.-tp24311958p24312528.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dirty read/edit problem.

2009-06-23 Thread satar

Thanks for the responses. I feel a little more confident that there isn't
something magical already out there to handle this particular problem
domain. I do want pessimistic locking as I want to inform the user that
someone else is already thinking and in progress of changing something
BEFORE they try to change it themselves, and it is very possible for two
peeps to attempt edit on the same item. I am also using mySQL not Oracle and
wouldn't probably want to rely on a database specific implementation if I
could avoid it. As of now, I have created a lock table in memory at the app
layer and it sounds like a reasonable approach based on my query from fellow
colleges on this forum -- Steve
-- 
View this message in context: 
http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24167367.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dirty read/edit problem.

2009-06-22 Thread satar

Yep, that is what I thought from the reading I have done. I think I will do
it the way I have in the past but using an application-level edit table
instead of having to use a database. This feels more natural to me and I
have spent an absorbent amount of time learning Hibernate already and just
hoping that I get some return from all of the complexities it has
eventually. I do believe that will be the case because all you smart peeps
wouldn't be using it if there was nothing to gain. The dirty read problem
seems like such a normal condition for any application that has multiple
writers, so I thought I would see what is a typical approach within web apps
-- something I am very new at.
-- 
View this message in context: 
http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24158076.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dirty read/edit problem.

2009-06-22 Thread satar

Hum, I may not have a complete understanding of optimistic locking. Bottom
line is that when someone wants to start editing, I want them to know before
they start if someone else is already in the midths of editing a given item.
I do not want to just hope that two people never edit the same thing and if
they do error out on the last to try to save if they didn't have the right
starting version. It seems like that is what could happen in the optimistic
approach but I could be wrong as I have never used the approach. I will
study the LockMode.UPGRADE, but if it doesn't give me a way to give user
feedback when someone else is in edit "thinking" mode, I don't think I would
use it.
-- 
View this message in context: 
http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24157353.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: application-level properties not component properties.

2009-06-18 Thread satar

SWEET, I was able to add it to my application bean directly:

  

  

Of course, I have more properties like this but the first example worked as
expected!

Thanks again Igor!!!



satar wrote:
> 
> Wow, thanks for such a blazing fast response Igor! 
> 
> Actually, I am already using the PropertyPlaceholderConfigurer (I think
> this is what you are talking about), and using different filter files for
> my different environments connected through profiles in my pom.xml file.
> Knew none of this stuff 2-3 months ago so I am trying to come to speed
> fast -- thank you Mystic Coders and WIA. 
> 
> I did of course check for the presence of my application.properties file
> within the tomcat webapp dir:
> 
> C:\Program Files\Apache Software Foundation\Tomcat
> 5.5\webapps\bsmatrix-1.0-beta-1\WEB-INF\classes\application.properties
> 
> I really resisted posting as I felt a bit of a failure as I usually can
> comb through these wonderful user groups and find my answer or a clue to
> what I am doing wrong. However, what really caught my interest and I
> didn't think about before is making them beans in my
> applicationContext.xml file with placeholders that my profile filtering
> can take care of just as it would have if I used a .properties file. That
> seems like a more natural way to do such a thing -- course, I didn't know
> what Spring was 6 months ago other than my favorite time of the year so
> who am I to say what is natural. Anyway, I think I will use beans as I am
> pretty certain that approach would work in both Jetty and Tomcat.
> 
> Thanks again Igor, you ROCK!
> -Steve
> 
> 
> igor.vaynberg wrote:
>> 
>> getClass().getClassLoader().getResourceAsStream() has always worked
>> fine for me. also did you check your war and make sure the properties
>> file was packaged?
>> 
>> i see you are using spring? (ApplicationContext) if so you might want
>> to look at propertyconfigurer - it is easy to setup a bean:
>> 
>> > value="${my.port}"/>> 
>> get spring to do replacement based on a properties file or jndi or
>> what have you, and then simple pull the bean out and access properties
>> via getters
>> 
>> -igor
>> 
>> On Thu, Jun 18, 2009 at 10:21 PM, Steve Tarlton
>> wrote:
>>> I hope I finally figured out how to post to this... I am very knew to
>>> Wicket
>>> and web app development but very experience Java client application
>>> developer (Swing). I read Wicket-in-Action pretty much cover-to-cover
>>> and
>>> would highly recommend it to anyone wanting to learn Wicket!
>>>
>>> Anyway, getting to the point here, I see TONS of examples all over the
>>> net
>>> about how to setup a .properties file for a UI component but none really
>>> for
>>> setting some application-level properties. For example, the host path
>>> changes between different push locations for my app. Even on the same
>>> server
>>> I have a Jetty version at 8090 and a tomcat version at 8080. I need to
>>> know
>>> how to call back to my homepage with parameters that our
>>> single-signon-server returns. There are other things like some cgi's add
>>> to
>>> some of my pages with the Include class, which I believe you want at the
>>> very top level of your directory structure as opposed to burried in some
>>> package path.
>>>
>>> So, I though hey, I would just create a Properties instance and load it
>>> up
>>> with a call to the load() method typically so I thought why not try it
>>> beings I read somewhere that I can get an InputStream of a given class
>>> using
>>> the ClassLoader.getSystemResourceAsStream(). I thought I was clever
>>> because
>>> the following WORKED through Jetty:
>>>
>>> public class MatrixApplication extends WebApplication {
>>>
>>>  private ApplicationContext ctx;
>>>
>>>  // some global application-level properties
>>>  private Properties applicationProperites;
>>>
>>>  private static final String DEFAULT_HOST = "http://localhost:8090/";;
>>>
>>>  /**
>>>   * Constructor
>>>   */
>>>  public MatrixApplication() {
>>>  }
>>>
>>>
>>> �...@override
>>>  protected void init() {
>>>    /*
>>>     * This instructs Wicket to temporarily redirect an incoming request
>>> to
>>> in
>>>     * internal Wicket page that will gather the extended browser info so
>>> I
>>> can pull
>>

Re: application-level properties not component properties.

2009-06-18 Thread satar

Wow, thanks for such a blazing fast response Igor! 

Actually, I am already using the PropertyPlaceholderConfigurer (I think this
is what you are talking about), and using different filter files for my
different environments connected through profiles in my pom.xml file. Knew
none of this stuff 2-3 months ago so I am trying to come to speed fast --
thank you Mystic Coders and WIA. 

I did of course check for the presence of my application.properties file
within the tomcat webapp dir:

C:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\bsmatrix-1.0-beta-1\WEB-INF\classes\application.properties

I really resisted posting as I felt a bit of a failure as I usually can comb
through these wonderful user groups and find my answer or a clue to what I
am doing wrong. However, what really caught my interest and I didn't think
about before is making them beans in my applicationContext.xml file with
placeholders that my profile filtering can take care of just as it would
have if I used a .properties file. That seems like a more natural way to do
such a thing -- course, I didn't know what Spring was 6 months ago other
than my favorite time of the year so who am I to say what is natural.
Anyway, I think I will use beans as I am pretty certain that approach would
work in both Jetty and Tomcat.

Thanks again Igor, you ROCK!
-Steve


igor.vaynberg wrote:
> 
> getClass().getClassLoader().getResourceAsStream() has always worked
> fine for me. also did you check your war and make sure the properties
> file was packaged?
> 
> i see you are using spring? (ApplicationContext) if so you might want
> to look at propertyconfigurer - it is easy to setup a bean:
> 
>  value="${my.port}"/> 
> get spring to do replacement based on a properties file or jndi or
> what have you, and then simple pull the bean out and access properties
> via getters
> 
> -igor
> 
> On Thu, Jun 18, 2009 at 10:21 PM, Steve Tarlton wrote:
>> I hope I finally figured out how to post to this... I am very knew to
>> Wicket
>> and web app development but very experience Java client application
>> developer (Swing). I read Wicket-in-Action pretty much cover-to-cover and
>> would highly recommend it to anyone wanting to learn Wicket!
>>
>> Anyway, getting to the point here, I see TONS of examples all over the
>> net
>> about how to setup a .properties file for a UI component but none really
>> for
>> setting some application-level properties. For example, the host path
>> changes between different push locations for my app. Even on the same
>> server
>> I have a Jetty version at 8090 and a tomcat version at 8080. I need to
>> know
>> how to call back to my homepage with parameters that our
>> single-signon-server returns. There are other things like some cgi's add
>> to
>> some of my pages with the Include class, which I believe you want at the
>> very top level of your directory structure as opposed to burried in some
>> package path.
>>
>> So, I though hey, I would just create a Properties instance and load it
>> up
>> with a call to the load() method typically so I thought why not try it
>> beings I read somewhere that I can get an InputStream of a given class
>> using
>> the ClassLoader.getSystemResourceAsStream(). I thought I was clever
>> because
>> the following WORKED through Jetty:
>>
>> public class MatrixApplication extends WebApplication {
>>
>>  private ApplicationContext ctx;
>>
>>  // some global application-level properties
>>  private Properties applicationProperites;
>>
>>  private static final String DEFAULT_HOST = "http://localhost:8090/";;
>>
>>  /**
>>   * Constructor
>>   */
>>  public MatrixApplication() {
>>  }
>>
>>
>> �...@override
>>  protected void init() {
>>    /*
>>     * This instructs Wicket to temporarily redirect an incoming request
>> to
>> in
>>     * internal Wicket page that will gather the extended browser info so
>> I
>> can pull
>>     * local timezone from client browser.
>>     */
>>    getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
>>
>>    /*
>>     * A special component instantiation listener that analyzes components
>> that
>>     * get constructed and injects proxies for all the
>> Spring-bean-annotated
>>     * members it finds.
>>     *
>>     * Note: This is required if using @SpringBean annotations.
>>     */
>>    addComponentInstantiationListener(new SpringComponentInjector(this));
>>
>>    /*
>>     * Remove the wicket tags from the final output when rendering the
>> pages
>>     */
>>    getMarkupSettings().setStripWicketTags(true);
>>
>>    /*
>>     * Note: Saw this in the Mystic Coder's example. I think it is a way
>> to
>>     * mount a page to a specific path, which could be kewl
>>     */
>>    // mountBookmarkablePage("/home", HomePage.class);
>>    /*
>>     * Added the following from Mystic Coder's example. Will need to
>> analyze
>> and
>>     * understand at some point.
>>     */
>>    // start
>>    ServletContext servletContext = super.getServletContext();
>>    ctx =

Re: 2 questions on Include

2009-06-08 Thread satar

Bumped into this over one year old thread and it answered pretty much the
exact question I had - SWEET. I am an experience Java developer but very new
to Wicket. Just finished the Wicket-in-Action book, which was awesomely put
together at least for someone like myself that loves to follow along by
developing examples. I have already learn all the features I need to pull
off my first web app using Wicket here at work and I am loving the
experience so far!


jWeekend wrote:
> 
> Landry,
> 
> My pleasure. Let's pass that credit on to where it's really due - the
> people who provide the brains and hard work behind this framework, not to
> mention all the support we all get here. 
> 
> I have yet to introduce a serious Java/OO developer to Wicket who (after
> spending an appropriate amount of time to understand the fundamentals) can
> help wanting to use it instead of their current Java web framework.
> 
> Regards - Cemal
>  http://www.jWeekend.co.uk http://jWeekend.co.uk 
> 
> 
> 
> landry soules wrote:
>> 
>> Thanks a lot Cemal, you rock !
>> And please don't blame me for the dumbness of my questions  ;-)
>> 
>> Thanks again
>> 
>> Best regards
>> 
>> 
>> Landry
>> 
>> 
>> 
>> 2008/8/19 jWeekend 
>> 
>>>
>>> Landry,
>>>
>>> Component has a replaceComponentTagBody(markupStream, openTag, content)
>>> method.
>>>
>>> Regards - Cemal
>>> http://www.jWeekend.co.uk http://jWeekend.co.uk
>>>
>>>
>>>
>>> landry soules wrote:
>>> >
>>> > Thanks a lot for your answer, Cemal, my first problem is solved !
>>> > For the second one, i can get the content, thanks to your explanation,
>>> but
>>> > can't figure out how to modify it before it's displayed.
>>> > Here is what i do :
>>> >
>>> > add(new Include("stat",
>>> > "http://myurl";) {
>>> > protected void onComponentTagBody(MarkupStream
>>> markupStream,
>>> > ComponentTag openTag) {
>>> > super.onComponentTagBody(markupStream, openTag);
>>> > String content = importAsString();
>>> >
>>> >logger.debug(content);
>>> > }
>>> > }.setEscapeModelStrings(false));
>>> >
>>> >
>>> > But how can i inject my modified content back to my component ?
>>> >
>>> > Best regards.
>>> >
>>> >
>>> > Landry
>>> >
>>> >
>>> >
>>> > 2008/8/19 jWeekend 
>>> >
>>> >>
>>> >> Landry,
>>> >>
>>> >> 1 - setEscapeModelStrings(false)
>>> >> 2 - Subclass Include. Override onComponentTagBody and use
>>> >> importAsString()
>>> >>
>>> >> Regards - Cemal
>>> >> http://www.jWeekend.co.uk http://jWeekend.co.uk
>>> >>
>>> >>
>>> >> landry soules wrote:
>>> >> >
>>> >> > Hello,
>>> >> >
>>> >> > In my firm, we're currently using a homegrown component-like
>>> framework,
>>> >> > based on cgi-perl scripts calling servlets. I would like to prove
>>> my
>>> >> > boss how smooth the transition towards Wicket could be.
>>> >> > I'm trying to make a first step, replacing the perl scripts with
>>> >> Wicket,
>>> >> > and calling the components (here servlets), with Include. But i
>>> have 2
>>> >> > problems :
>>> >> >
>>> >> > 1/ When i call a servlet that has several parameters, for example
>>> >> > add(*new**
>>> >> >
>>> >> *Include("maxMin","
>>> http://myserver/maxminservlet?id=0001&periodes=1st;1a
>>> >> ;"));
>>> >> > Wicket actually replaces "&" with "&", as shown in the trace :
>>> >> > DEBUG - UrlResourceStream  - cannot convert url:
>>> >> > http://myserver/maxminservlet?id=0001&periodes=1st;1a; to file
>>> (URI
>>> >> > scheme is not "file"), falling back to the inputstream for polling
>>> >> > This alters my servlet's behaviour, is there a mean to avoid this
>>> >> > substitution ?
>>> >> >
>>> >> > 2/ Is it possible to catch the content of the include, and so
>>> possibly
>>> >> > modify it before it is actually displayed in my Wicket page ?
>>> >> >
>>> >> >
>>> >> > Thanks for your help
>>> >> >
>>> >> >
>>> >> > Landry
>>> >> >
>>> >> >
>>> -
>>> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>>> >> >
>>> >> >
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >> http://www.nabble.com/2-questions-on-Include-tp19036146p19041450.html
>>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>>> >>
>>> >>
>>> >> -
>>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/2-questions-on-Include-tp19036146p19045669.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional c