Re: Links

2010-02-24 Thread Azzeddine Daddah
public class MyLink extends Link {
public MyLink(String id) {
super(id);
}

@Override
public void onClick() {
// Your code here
}
}

add(new MyLink("restartLink"));
add(new MyLink("cancelLink"));


On Wed, Feb 24, 2010 at 4:22 PM, hill180  wrote:

> Is there an easy way to point two wicket:id link tags to the same link.  I
> just have the link on the Nav Bar, and in the footer bar, and they do the
> same thing.
>
>
>
> IE:
>
> CANCEL BUTTON
>
> 
>
> CANCEL BUTTON
>
> Java:
>
> restartLink = new Link("restartLink") {
>
>@Override
>public void onClick() {
>   //.
>}
>};
> cancelLink = new Link("cancelLink") {
>
>@Override
>public void onClick() {
>   //same as restart Link Code.
>}
>};
>
>
> }
>
> Thanks!
>



-- 
Hbiloo
www.hbiloo.com


Component.getPage() always returns null

2009-06-26 Thread Azzeddine Daddah
Hi everybody,

I want to create a text blur effect behavior so that when the text
field gets focussed, the value will be empty and when blurred the
value will be set to the default value.
I use the Wickext library which integrates jQuery in Wicket. The
problem is that the component's page in the bind() method always
returns null and I get this exception message:
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = test]].
Below my code:

BlurFieldBehavior.java

public class BlurFieldBehavior extends AbstractBehavior {
private static final String BLUR_FIELD_SCRIPT = "res/blurField.js";

private static final ResourceReference PLUGINS_RESOURCE = new
JavascriptResourceReference(BlurFieldBehavior.class,
BLUR_FIELD_SCRIPT);

/**
 * The behavior is attached to this component.
 */
private Component component;

public BlurFieldBehavior() {
}

@Override
public void bind(final Component component) {
super.bind(component);
this.component = component;
Page componentPage = component.getPage();
componentPage.add(new HeaderContributor(new
CoreJavaScriptHeaderContributor()));
componentPage.add(new HeaderContributor(new 
IHeaderContributor() {
public void renderHead(IHeaderResponse response) {

response.renderJavascriptReference(PLUGINS_RESOURCE);
}
}));
}

@Override
public void renderHead(IHeaderResponse response) {
JsQuery query = new JsQuery(component);
query.$().chain("blurInput");
query.renderHead(response);
}
}

TestPage.java

public class TestPage extends WebPage {
public TestPage() {
add(new TextField("test", new Model("This is a
test!!!")).add(new BlurFieldBehavior()));
}
}

Does someone see what's going wrong with this code?

Kind Regards,
Hbiloo

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



Re: Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-25 Thread Azzeddine Daddah
Martijn,

I tried your solustion(s), but the CSS class of the topicLabel still
not updated.

public TestPage() {
final WebMarkupContainer container = new
WebMarkupContainer("container");
container.setOutputMarkupId(true);

container.add(new ListView("categories", buildCategories()) {
@Override
protected void populateItem(ListItem item) {
Category category = item.getModelObject();
item.add(new Label("category", category.getName() + ": "));
ListView topicListView;
item.add(topicListView = new ListView("topics",
category.getTopics()) {
@Override
protected void populateItem(final ListItem item) {
Topic topic= item.getModelObject();
final Label topicLabel = new Label("topic",
topic.getName());
item.add(new AjaxLink("topicLink") {
@Override
public void onClick(AjaxRequestTarget target) {
topicLabel.add(new
AttributeModifier("class", true, new AbstractReadOnlyModel() {
@Override
public String getObject() {
return "highlight";
}
}));
target.addComponent(container);
}
}.add(topicLabel));
}
});
topicListView.setReuseItems(true);
}
});
add(container);
}





Category A: 


Link






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



Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Azzeddine Daddah
Thanks again Vasu,

I've tried your solution but it does not work yet. Below my code:

public TestPage() {
final WebMarkupContainer container = new
WebMarkupContainer("container");
container.setOutputMarkupId(true);

container.add(new ListView("categories", buildCategories()) {
@Override
protected void populateItem(ListItem item) {
Category category = item.getModelObject();
item.add(new Label("category", category.getName()));
item.add(new ListView("topics", category.getTopics()) {
@Override
protected void populateItem(final ListItem item) {
final Topic topic = item.getModelObject();
final Label topicLabel = new Label("topic",
topic.getName());
item.add(new AjaxLink("topicLink") {
@Override
public void onClick(AjaxRequestTarget target) {
item.add(topicLabel).add(new
AttributeModifier("class", true, new AbstractReadOnlyModel() {
@Override
public String getObject() {
return "highlight";
}
}));
target.addComponent(container);
}
}.add(topicLabel));
}
});
}
});
add(container);
}

Any other suggestions?


Regards,
Hbiloo


On Wed, Jun 24, 2009 at 3:48 PM, Vasu Srinivasan wrote:
> I see you are trying to add the class modifier to "item" which is ListItem
> and thats not a HTML component.
> In my case, I was adding it to the link or label. I think you may have to do
> something like
>
> item.add(new Label(...).add(new AttributeModifier("class", new
> AbstractReadOnlyModel() ...
>
> etc.
>
>
> On Wed, Jun 24, 2009 at 7:28 AM, Azzeddine Daddah wrote:
>
>> Thanks Vasu for your replay.
>>
>> I've tried your suggestion, but didn't work. This is what I get in the
>> Ajax debuger when I click a certain item:
>> ...
>> 
>>   Yeeh
>> 
>> ...
>>
>> Does someone else already got the same issue?
>>
>> Regards,
>> Hbiloo
>>
>>
>> On Wed, Jun 24, 2009 at 12:36 PM, Vasu Srinivasan
>> wrote:
>> > Ive got a very similar thing working.
>> >
>> > I think you may have to return the "highlight" value dynamically. Try
>> this
>> > alternative:
>> >
>> > item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
>> {
>> > �...@override public Object getObject() {
>> >      return "highlight"
>> >  }
>> > });
>> >
>> > On Tue, Jun 23, 2009 at 5:56 PM, Azzeddine Daddah > >wrote:
>> >
>> >> Hi Wicket users,
>> >>
>> >> I've a ListView in a ListView. The 1st ListVeiw holds "categories".
>> >> The 2nd ListView holds links (topics) which I want to be highlighted
>> >> if the link (topic) is clicked. The problem is that the wrapped list
>> >> (container) is getting refreshed, but the CSS class is not set for the
>> >> corresponding list item.
>> >> Below my code:
>> >>
>> >> TestPage.java
>> >> 
>> >> import java.io.Serializable;
>> >> import java.util.ArrayList;
>> >> import java.util.Arrays;
>> >> import java.util.List;
>> >>
>> >> import org.apache.wicket.AttributeModifier;
>> >> import org.apache.wicket.ajax.AjaxRequestTarget;
>> >> import org.apache.wicket.ajax.markup.html.AjaxLink;
>> >> import org.apache.wicket.markup.html.WebMarkupContainer;
>> >> import org.apache.wicket.markup.html.basic.Label;
>> >> import org.apache.wicket.markup.html.list.ListItem;
>> >> import org.apache.wicket.markup.html.list.ListView;
>> >> import org.apache.wicket.model.Model;
>> >> import org.wicketstuff.annotation.mount.MountPath;
>> >>
>> >> import com.hbiloo.receptino.web.page.template.PageWithoutSideBar;
>> >>
>> >> @MountPath(path = "test")
>> >> public class TestPage extends PageWithoutSideBar {
>> >>
>> >>       �...@suppresswarnings("serial"

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Azzeddine Daddah
Thanks Vasu for your replay.

I've tried your suggestion, but didn't work. This is what I get in the
Ajax debuger when I click a certain item:
...

   Yeeh

...

Does someone else already got the same issue?

Regards,
Hbiloo


On Wed, Jun 24, 2009 at 12:36 PM, Vasu Srinivasan wrote:
> Ive got a very similar thing working.
>
> I think you may have to return the "highlight" value dynamically. Try this
> alternative:
>
> item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel() {
> �...@override public Object getObject() {
>      return "highlight"
>  }
> });
>
> On Tue, Jun 23, 2009 at 5:56 PM, Azzeddine Daddah wrote:
>
>> Hi Wicket users,
>>
>> I've a ListView in a ListView. The 1st ListVeiw holds "categories".
>> The 2nd ListView holds links (topics) which I want to be highlighted
>> if the link (topic) is clicked. The problem is that the wrapped list
>> (container) is getting refreshed, but the CSS class is not set for the
>> corresponding list item.
>> Below my code:
>>
>> TestPage.java
>> 
>> import java.io.Serializable;
>> import java.util.ArrayList;
>> import java.util.Arrays;
>> import java.util.List;
>>
>> import org.apache.wicket.AttributeModifier;
>> import org.apache.wicket.ajax.AjaxRequestTarget;
>> import org.apache.wicket.ajax.markup.html.AjaxLink;
>> import org.apache.wicket.markup.html.WebMarkupContainer;
>> import org.apache.wicket.markup.html.basic.Label;
>> import org.apache.wicket.markup.html.list.ListItem;
>> import org.apache.wicket.markup.html.list.ListView;
>> import org.apache.wicket.model.Model;
>> import org.wicketstuff.annotation.mount.MountPath;
>>
>> import com.hbiloo.receptino.web.page.template.PageWithoutSideBar;
>>
>> @MountPath(path = "test")
>> public class TestPage extends PageWithoutSideBar {
>>
>>       �...@suppresswarnings("serial")
>>        public TestPage() {
>>                final WebMarkupContainer container = new
>> WebMarkupContainer("container");
>>                container.setOutputMarkupId(true);
>>
>>                container.add(new ListView("categories",
>> buildCategories()) {
>>                       �...@override
>>                        protected void populateItem(ListItem item)
>> {
>>                                Category category = item.getModelObject();
>>                                item.add(new Label("category",
>> category.getName()));
>>                                item.add(new ListView("topics",
>> category.getTopics()) {
>>                                       �...@override
>>                                        protected void populateItem(final
>> ListItem item) {
>>                                                Topic topic =
>> item.getModelObject();
>>                                                AjaxLink topicLink =
>> (new AjaxLink("topicLink") {
>>                                                       �...@override
>>                                                        public void
>> onClick(AjaxRequestTarget target) {
>>
>>  target.addComponent(container);
>>                                                                item.add(new
>> AttributeModifier("class", true, new
>> Model("highlight")));
>>                                                        }
>>                                                });
>>                                                topicLink.add(new
>> Label("topic", topic.getName()));
>>                                                item.add(topicLink);
>>                                        }
>>                                });
>>                        }
>>                });
>>                add(container);
>>        }
>>
>>       �...@suppresswarnings("serial")
>>        private class Category implements Serializable {
>>                private String name;
>>                private List topics;
>>
>>                public Category(String name, List topics) {
>>                        this.name = name;
>>                        this.topics = topics;
>>                }
>>
>>                public String getName() {
>>                        return name;
>>                }
>>
>>                public List getTopics() {
>>                        return topics;
>>                }
>&g

AttributeModifier not added to a ListView item via an AjaxLink

2009-06-23 Thread Azzeddine Daddah
Hi Wicket users,

I've a ListView in a ListView. The 1st ListVeiw holds "categories".
The 2nd ListView holds links (topics) which I want to be highlighted
if the link (topic) is clicked. The problem is that the wrapped list
(container) is getting refreshed, but the CSS class is not set for the
corresponding list item.
Below my code:

TestPage.java

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;

import com.hbiloo.receptino.web.page.template.PageWithoutSideBar;

@MountPath(path = "test")
public class TestPage extends PageWithoutSideBar {

@SuppressWarnings("serial")
public TestPage() {
final WebMarkupContainer container = new 
WebMarkupContainer("container");
container.setOutputMarkupId(true);

container.add(new ListView("categories", 
buildCategories()) {
@Override
protected void populateItem(ListItem item) {
Category category = item.getModelObject();
item.add(new Label("category", 
category.getName()));
item.add(new ListView("topics", 
category.getTopics()) {
@Override
protected void populateItem(final 
ListItem item) {
Topic topic = 
item.getModelObject();
AjaxLink topicLink = 
(new AjaxLink("topicLink") {
@Override
public void 
onClick(AjaxRequestTarget target) {

target.addComponent(container);
item.add(new 
AttributeModifier("class", true, new
Model("highlight")));
}
});
topicLink.add(new 
Label("topic", topic.getName()));
item.add(topicLink);
}
});
}
});
add(container);
}

@SuppressWarnings("serial")
private class Category implements Serializable {
private String name;
private List topics;

public Category(String name, List topics) {
this.name = name;
this.topics = topics;
}

public String getName() {
return name;
}

public List getTopics() {
return topics;
}
}

@SuppressWarnings("serial")
private class Topic implements Serializable {
private String name;

public Topic(String name) {
this.name = name;
}

public String getName() {
return name;
}
}

private List buildCategories() {
List categories = new ArrayList();
categories.add(new Category("Movies", Arrays.asList(new 
Topic("Mamma"),
new Topic("USA"), new Topic("NL";
categories.add(new Category("Articles", Arrays.asList(
new Topic("Test"), new Topic("Nederland";
categories.add(new Category("Images", Arrays.asList(new 
Topic("Mag"),
new Topic("Spullen"), new Topic("Mamma mia";
categories.add(new Category("Links", Arrays.asList(new 
Topic("Ana"),
new Topic("Smiti"), new Topic("Hbiloo"), new 
Topic("Yeeh";
return categories;
}
}

TestPage.html




Category A: 

Link






Kind regards,

Hbiloo

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



Re: New site developed in wicket - www.inlaconia.gr

2009-04-23 Thread Azzeddine Daddah
Looks great. Yet another cool website built in Wicket :).
I liked especially the integration of the photo gallery, it's beautiful.

Cheers,

Azzeddine Daddah
www.hbiloo.com


On Thu, Apr 23, 2009 at 10:18 AM, Giannis Koutsoubos
wrote:

> Inlaconia.gr is a travel and business guide for the prefecture of Laconia
> in Greece.
> The site uses :
> Wicket 1.4
> Wicket GMap2
> Tomcat with apache frontend
> Spring, Hibernate, Mysql
>
> The site is multilingual and wicket made the development a complete fun.
> Many thanks to everyone involved in Wicket.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: New site developed in wicket - WWW.FITCOMPLEX.SK

2009-04-20 Thread Azzeddine Daddah
Looks great, and you can see that it's PRO. I think that the tabs do not
work under Safari. You can see the selected tab is active but the content
does not change.
Congratulations anyway.

Regards,

Hbiloo

On Mon, Apr 20, 2009 at 7:22 PM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> The same theme as my exerciselog.eu although I've taken the exercise
> view of it :) Maybe we should have some interaction (provided you do a
> international site)?
>
> My software setup are almost the same :) With the exception of wicket
> 1.3 and tomcat.. Although my server are a p3 500mhz 512mb-ram if it
> gets more serious or runs too slow i'll upgrade it..
>
> 2009/4/20 Stefan Simik :
> > New site about health, nutrition, exercise and life
> > style
> >
> > We are using stateless pages for public interface, and stateful ajaxified
> > pages for admin interface.
> > Stateless ajax in public is developed using jquery + wicket.
> >
> > The site is running on:
> >
> >   - *Wicket *1.4rc2
> >   - *Web server*: Jetty 6.1.14  (with Apache front-end)
> >   - *Db*: mysql (ehcache + hibernate)
> >   - *OS*: Ubuntu 8.04 (Hardy Heron)
> >
> >
> > *Wicket performance* is very good - the slowest element is mysql
> database.
> > It's able to serve up to ~130 pages /sec on modern notebook (2Ghz
> Montevina,
> > 5400 rpm, 3GB RAM).
> > On server we haven't tested, but it should be much more.
> >
> > *Thanks to the community for patiently answering many questions and for
> all
> > the support.*
> >
> > Štefan Šimík
> > www.fitcomplex.sk
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: GWT vs. Wicket?

2009-04-08 Thread Azzeddine Daddah
Hi,

You may also take a look at ZK framework. It's also a kind of framework
which can be used to build beautiful RIA's. You can chose to use it by
writing your app in just Java or in Java/Zul.
http://www.zkoss.org

But in my opinion, Wicket stills beter then these kind of frameworks :)

Regards,

Azzeddine Daddah
www.hbiloo.com


On Wed, Apr 8, 2009 at 4:46 PM, Casper Bang  wrote:

> > Peter Thomas did a great side by side you should checkout:
>
> Good article, if perhaps a bit one-sided. I can understand how
> separation-of-concerns/composability comes slightly more natural to Wicket.
> However the performance, flexibility and component repertoire of GWT along
> with steadily more capable browsers leaves me with a feeling that "I'll get
> more bang for my buck".
>
> > Until GWT has a build system that is better I'll stay away from it.
> Since version 1.6 today, it uses normal Ant scripts (which I suppose is
> easy
> to mavenize).
>
> Thanks guys,
>
> /Casper
>


Re: wicket & log4j MDC

2009-03-30 Thread Azzeddine Daddah
You can create a custom request cycle which extends the Wicket
WebRequestCycle. This logs the user name in your logs of the user who does
the request.

public class MyRequestCycle extends WebRequestCycle {
private static final Logger logger =
Logger.getLogger(MyRequestCycle.class);

public static final String USER = "USER";

private Time requestStart;
private Time requestEnd;

/**
 * Creates a new request cycle.
 *
 * @param application the application
 * @param request the request
 * @param response the response
 */
public MyRequestCycle(WebApplication application, WebRequest request,
Response response) {
super(application, request, response);
}

@Override
protected void onBeginRequest() {
requestStart = Time.now();
MDC.put(USER, YourUser.getUsername());
logger.debug("Begin Request");
}

@Override
protected void onEndRequest() {
requestEnd = Time.now();
logger.debug("End Request. Request took " +
TimeFrame.valueOf(requestStart, requestEnd).getDuration());
MDC.remove(USER);
}

@Override
public Page onRuntimeException(Page page, RuntimeException e) {
    return null;
}

}


Azzeddine Daddah
www.hbiloo.com


On Mon, Mar 30, 2009 at 4:11 PM,  wrote:

> Hi
>
> I would like to add MDC information(i.e. user login) to my loggs (log4j).
> To do that I have to call MDC.put at the beggining of request
> handling. Im looking for 'interception' functionality in Wicket to add
> MDC code there. Where I should add such code ? RequestCycle ?
>
> Regards
> Daniel
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DropDownChoice always sets its model to null

2009-02-28 Thread Azzeddine Daddah
The category is still null. Could someone tell me where it goes wrong?
Thanks,

Hbiloo


On Sat, Feb 28, 2009 at 6:39 PM, Azzeddine Daddah wrote:

> The Recipe object is indeed serializable. Below some code from
> the AddRecipeForm and Recipe:
>
> public class Recipe implements Serializable {
> public static final int NAME_LENGTH   = 50;
> public static final int DIFFICULTY_LENGTH   = 6;
> public static final int INTRODUCTION_LENGTH = 150;
>
> @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> "recipe_seq")
> private Long id;
> ...
>
> @ManyToOne
> @org.hibernate.annotations.Cascade(CascadeType.SAVE_UPDATE)
> @JoinColumn(name = "CATEGORY_ID")
> @ForeignKey(name = "FK_RECIPE_CATEGORY")
> private Category category;
> ...
>
> public Category getCategory() {
> return category;
> }
>
> public void setCategory(Category category) {
> assert category != null;
> this.category = category;
> }
> }
>
> public class AddRecipeForm extends Form {
> private static final Logger log =
> LoggerFactory.getLogger(AddRecipeForm.class);
>
> private final List uploads = new ArrayList();
> private Recipe recipe = new Recipe();
>
> /**
>  * Creates a new {...@link AddRecipeForm}.
>  *
>  * @param id form id; may not be null
>  */
> public AddRecipeForm(String id) {
> super(id);
> setModel(new Model(recipe));
>
> add(new FeedbackPanel("feedback"));
> addRecipeInfoFormPart();
> ...
> add(createSubmitLink(this));
> }
>
> private void addRecipeInfoFormPart() {
> add(new RequiredTextField("recipeTitle", new
> PropertyModel(recipe, "name"))
> .add(StringValidator.lengthBetween(5,
> Recipe.NAME_LENGTH)));
> add(new CategoriesDropDown("categories", new
> PropertyModel(recipe, "category")).setRequired(true));
> add(new RecipeDifficultiesDropDown("difficulties",
> recipe).setRequired(true));
> add(new TextArea("introduction", new
> PropertyModel(recipe, "introduction")));
> }
>...
> private StyledSubmitLink createSubmitLink(final Form form) {
> StyledSubmitLink submitLink = new StyledSubmitLink("submitLink") {
> @Override
> public void onSubmit() {
> RecipeService recipeService = RecipeService.getInstance();
> Recipe recipe = form.getModelObject();
> Category recipeCategory =
> recipeService.findCategoryByCategoryName(recipe.getCategory().getName());
> Set persistentTags = new HashSet();
> for (Tag tag : recipe.getTags()) {
> Tag persistentTag =
> recipeService.findTagByTagName(tag.getName());
> persistentTags.add(persistentTag == null ? tag :
> persistentTag);
> }
> log.debug(String.format("from persisted cat: %s and from
> form %s", recipeCategory.getName(), recipe.getCategory().getName()));
> Status persistentStatus =
> recipeService.findStatusByStatusName("NEW");
> Recipe newRecipe = new Recipe(recipeCategory,
> recipe.getDifficulty(),
> recipe.getIntroduction(),
> recipe.getMethod(),
> recipe.getName(),
> new Integer(0),
> UserUtils.getUser(),
> recipe.getPreparationTime(),
> recipe.getRecipeImages(),
> new
> HashSet(recipe.getRecipeIngredients()),
> recipe.getServings(),
> persistentStatus == null ? new Status("NEW", "New")
> : persistentStatus,
> persistentTags);
>
> uploadImages();
>
> recipeService.insertNewRecipe(newRecipe);
> setResponsePage(new
> SuccessPage(getString("message.success.addrecipe.title"),
> getString("message.success.addrecipe.body")));
> }
> };
> submitLink.add(new Label("submit", new
> ResourceModel("form.addrecipe.add")));
> return submitLink;
> }
>
> private class CategoriesDropDown extends DropDownChoice {
> public CategoriesDropDown(String id, IModel model) {
> super(id, model,
&

Re: DropDownChoice always sets its model to null

2009-02-28 Thread Azzeddine Daddah
), Arrays.asList(RecipeDifficulty.values()),
new IChoiceRenderer() {
@Override
public Object getDisplayValue(RecipeDifficulty
recipeDifficulty) {
return
recipeDifficulty.getFormattedDifficulty();
}

@Override
public String getIdValue(RecipeDifficulty
recipeDifficulty, int index) {
return recipeDifficulty.getName();
}
    });
}
}
}

On Sat, Feb 28, 2009 at 6:24 PM, Igor Vaynberg wrote:

> where is the code that creates your form? and is Recipe serializable?
>
> -igor
>
> On Sat, Feb 28, 2009 at 8:58 AM, Azzeddine Daddah 
> wrote:
> > Thanks Igor,
> > I've already tried that but still have the same problem.
> > add(new CategoriesDropDown("categories", new
> PropertyModel(recipe,
> > "category")).setRequired(true));
> > ...
> > private class CategoriesDropDown extends DropDownChoice {
> >public CategoriesDropDown(String id, IModel model) {
> >super(id, model,
> > RecipeService.getInstance().getAllPersistentRecipeCategories(),
> >new IChoiceRenderer() {
> >@Override
> >public String getIdValue(Category category, int index) {
> >return category.getName();
> >}
> >
> >@Override
> >public Object getDisplayValue(Category category) {
> >return category.getName();
> >}
> >});
> >}
> >}
> >
> >
> >
> > On Sat, Feb 28, 2009 at 5:54 PM, Igor Vaynberg  >wrote:
> >
> >> use a property model instead of recipe.getcategories()
> >>
> >> -igor
> >>
> >> On Sat, Feb 28, 2009 at 8:17 AM, Azzeddine Daddah  >
> >> wrote:
> >> > Hi,
> >> > I'm trying to use a DropDownChoice to display and store the selected
> >> > category in the database. The value selected in the drop down is
> >> correctly
> >> > set, but when I look to the model (Category) of this drop down, it
> >> returns
> >> > always null. Do I do something wrong? Below some code.
> >> >
> >> > public AddRecipeForm(String id) {
> >> >super(id);
> >> >setModel(new Model(new Recipe()));
> >> >...
> >> >add(new CategoriesDropDown("categories",
> >> > recipe.getCategory()).setRequired(true));
> >> > }
> >> > ...
> >> > public void onSubmit() {
> >> >RecipeService recipeService = RecipeService.getInstance();
> >> >Recipe recipe = form.getModelObject();
> >> >Category cat = recipe.getCategory(); // This returns always null
> >> > }
> >> >
> >> > ...
> >> >
> >> > private class CategoriesDropDown extends DropDownChoice {
> >> >public CategoriesDropDown(String id, Category category) {
> >> >super(id, new Model(category),
> >> > RecipeService.getInstance().getAllPersistentRecipeCategories(), new
> >> > IChoiceRenderer() {
> >> >@Override
> >> >public String getIdValue(Category category, int index)
> {
> >> >return category.getName();
> >> >}
> >> >
> >> >@Override
> >> >public Object getDisplayValue(Category category) {
> >> >return category.getName();
> >> >}
> >> >});
> >> >}
> >> >}
> >> >
> >> >
> >> > Kind regards,
> >> >
> >> > Hbiloo
> >> >
> >>
> >> -
> >> 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
>
>


Re: DropDownChoice always sets its model to null

2009-02-28 Thread Azzeddine Daddah
Thanks Igor,
I've already tried that but still have the same problem.
add(new CategoriesDropDown("categories", new PropertyModel(recipe,
"category")).setRequired(true));
...
private class CategoriesDropDown extends DropDownChoice {
public CategoriesDropDown(String id, IModel model) {
super(id, model,
RecipeService.getInstance().getAllPersistentRecipeCategories(),
new IChoiceRenderer() {
@Override
public String getIdValue(Category category, int index) {
return category.getName();
}

@Override
public Object getDisplayValue(Category category) {
return category.getName();
}
});
}
}



On Sat, Feb 28, 2009 at 5:54 PM, Igor Vaynberg wrote:

> use a property model instead of recipe.getcategories()
>
> -igor
>
> On Sat, Feb 28, 2009 at 8:17 AM, Azzeddine Daddah 
> wrote:
> > Hi,
> > I'm trying to use a DropDownChoice to display and store the selected
> > category in the database. The value selected in the drop down is
> correctly
> > set, but when I look to the model (Category) of this drop down, it
> returns
> > always null. Do I do something wrong? Below some code.
> >
> > public AddRecipeForm(String id) {
> >super(id);
> >setModel(new Model(new Recipe()));
> >...
> >add(new CategoriesDropDown("categories",
> > recipe.getCategory()).setRequired(true));
> > }
> > ...
> > public void onSubmit() {
> >RecipeService recipeService = RecipeService.getInstance();
> >Recipe recipe = form.getModelObject();
> >Category cat = recipe.getCategory(); // This returns always null
> > }
> >
> > ...
> >
> > private class CategoriesDropDown extends DropDownChoice {
> >public CategoriesDropDown(String id, Category category) {
> >super(id, new Model(category),
> > RecipeService.getInstance().getAllPersistentRecipeCategories(), new
> > IChoiceRenderer() {
> >@Override
> >public String getIdValue(Category category, int index) {
> >return category.getName();
> >}
> >
> >@Override
> >public Object getDisplayValue(Category category) {
> >return category.getName();
> >}
> >});
> >}
> >}
> >
> >
> > Kind regards,
> >
> > Hbiloo
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


DropDownChoice always sets its model to null

2009-02-28 Thread Azzeddine Daddah
Hi,
I'm trying to use a DropDownChoice to display and store the selected
category in the database. The value selected in the drop down is correctly
set, but when I look to the model (Category) of this drop down, it returns
always null. Do I do something wrong? Below some code.

public AddRecipeForm(String id) {
super(id);
setModel(new Model(new Recipe()));
...
add(new CategoriesDropDown("categories",
recipe.getCategory()).setRequired(true));
}
...
public void onSubmit() {
RecipeService recipeService = RecipeService.getInstance();
Recipe recipe = form.getModelObject();
Category cat = recipe.getCategory(); // This returns always null
}

...

private class CategoriesDropDown extends DropDownChoice {
public CategoriesDropDown(String id, Category category) {
super(id, new Model(category),
RecipeService.getInstance().getAllPersistentRecipeCategories(), new
IChoiceRenderer() {
@Override
public String getIdValue(Category category, int index) {
return category.getName();
}

@Override
public Object getDisplayValue(Category category) {
return category.getName();
}
});
}
}


Kind regards,

Hbiloo


Effects library in Wicket

2009-02-15 Thread Azzeddine Daddah
Hi Wicket users,
Is there any effects library integrated in Wicket? In the Wicket examples
they just use the reference of the javascript files in the head of the page
and then append the javascript causing the effect to the component like:
target.appendJavascript("new Effect.Highlight($('" + c2.getMarkupId() +
"'));");

Regards,
Hbiloo


Re: How can I clear the value of an AutoCompleteTextField

2009-02-13 Thread Azzeddine Daddah
target.appendJavascript(String.format("document.getElementById(%s).value =
''", tagsTextfield.getMarkupId()));does not clear the text field.
Any idea how to do this?

Hbiloo


On Thu, Feb 12, 2009 at 10:15 PM, Azzeddine Daddah wrote:

> This is what I've till now. Clearing the text field does not work:
> private void addTagsPart(final Recipe recipe) {
> final WebMarkupContainer tagsContainer = new
> WebMarkupContainer("tagsContainer");
> final TagsAutoCompleteTextField tagsTextfield = new
> TagsAutoCompleteTextField("tags", new Model());
>
> add(tagsTextfield);
> tagsTextfield.add(new AjaxFormComponentUpdatingBehavior("onchange")
> {
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> String inputValue = tagsTextfield.getValue();
> if (StringUtils.isNotBlank(inputValue)) {
> String[] splittedInputValues =
> StringUtils.split(inputValue, ",");
> for (String value : splittedInputValues) {
> recipe.addTag(new Tag(value));
> }
> }
> }
> });
> add(new IndicatingAjaxLink("addTagLink") {
> @Override
> public void onClick(AjaxRequestTarget target) {
> target.addComponent(tagsContainer);
>
>  target.appendJavascript(String.format("document.getElementById(%s).value =
> ''", tagsTextfield.getMarkupId()));
> target.appendJavascript("new Effect.Shake($('" +
> tagsContainer.getMarkupId() + "'));");
> }
> });
> tagsContainer.add(new ListView("tags", new
> PropertyModel>(recipe, "tags")) {
> @Override
> protected void populateItem(ListItem item) {
> Tag tag = item.getModelObject();
> item.add(new Label("tag", tag.getName()));
> }
> });
>
> tagsContainer.setOutputMarkupId(true);
> add(tagsContainer);
> }
>
> ...
>
> private class TagsAutoCompleteTextField extends AutoCompleteTextField
> {
> public TagsAutoCompleteTextField(String id, final IModel
> model) {
> super(id, model, new AbstractAutoCompleteTextRenderer() {
> @Override
> protected String getTextValue(Tag tag) {
> return tag.getName();
> }
> });
> }
>
> @SuppressWarnings("unchecked")
> @Override
> protected Iterator getChoices(String input) {
> if (StringUtils.isBlank(input)) return
> Collections.EMPTY_LIST.iterator();
> List choices = new ArrayList(10);
> List tags =
> RecipeService.getInstance().getAllPersistentTags();
>
> for (Tag tag : tags) {
> if
> (tag.getName().toUpperCase().startsWith(input.toUpperCase())) {
> choices.add(tag);
>         if (choices.size() == 10) break;
> }
> }
>
> return choices.iterator();
> }
>
> }
>
> Regards,
>
> Hbiloo
>
>
> On Thu, Feb 12, 2009 at 5:00 PM, Martin Makundi <
> martin.maku...@koodaripalvelut.com> wrote:
>
>> If you copy-paste your code here we can probably dig into it better  ...
>>
>> **
>> Martin
>>
>> 2009/2/12 Azzeddine Daddah :
>> > Thanks guys for the quick replay.
>> > Martin: What I want to do is to select a value from the auto complete
>> text
>> > field, and when clicking the "Add" button, the selected value should be
>> > added to the tagsContainer (which is in fact a div that wraps the added
>> > values) and cleared from the text field.
>> >
>> > Luca: I've tried your suggestion but it didn't help. I've also tried to
>> > clear the text field using Javascript
>> >
>> target.appendJavascript(String.format("document.getElementById('%s').value =
>> > ''", auto.getOutputMarkupId()));
>> > but it also didn't work.
>> >
>> > Are there any other suggestions ways to implement this?
>> >
>> >
>> >
>> > Kind Regards
>> >
>> > Hbiloo
>> >
>> >
>> >
>> >
>> >
>> > On Thu, Feb 12, 2009 at 11:24 AM, Martin Makundi <
>> > martin.maku...@koodaripalvelu

Re: How can I clear the value of an AutoCompleteTextField

2009-02-12 Thread Azzeddine Daddah
This is what I've till now. Clearing the text field does not work:
private void addTagsPart(final Recipe recipe) {
final WebMarkupContainer tagsContainer = new
WebMarkupContainer("tagsContainer");
final TagsAutoCompleteTextField tagsTextfield = new
TagsAutoCompleteTextField("tags", new Model());

add(tagsTextfield);
tagsTextfield.add(new AjaxFormComponentUpdatingBehavior("onchange")
{
@Override
protected void onUpdate(AjaxRequestTarget target) {
String inputValue = tagsTextfield.getValue();
if (StringUtils.isNotBlank(inputValue)) {
String[] splittedInputValues =
StringUtils.split(inputValue, ",");
for (String value : splittedInputValues) {
recipe.addTag(new Tag(value));
}
}
}
});
add(new IndicatingAjaxLink("addTagLink") {
@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(tagsContainer);

 target.appendJavascript(String.format("document.getElementById(%s).value =
''", tagsTextfield.getMarkupId()));
target.appendJavascript("new Effect.Shake($('" +
tagsContainer.getMarkupId() + "'));");
}
});
tagsContainer.add(new ListView("tags", new
PropertyModel>(recipe, "tags")) {
@Override
protected void populateItem(ListItem item) {
Tag tag = item.getModelObject();
item.add(new Label("tag", tag.getName()));
}
});

tagsContainer.setOutputMarkupId(true);
add(tagsContainer);
}

...

private class TagsAutoCompleteTextField extends AutoCompleteTextField {
public TagsAutoCompleteTextField(String id, final IModel model)
{
super(id, model, new AbstractAutoCompleteTextRenderer() {
@Override
protected String getTextValue(Tag tag) {
return tag.getName();
}
});
}

@SuppressWarnings("unchecked")
@Override
protected Iterator getChoices(String input) {
if (StringUtils.isBlank(input)) return
Collections.EMPTY_LIST.iterator();
List choices = new ArrayList(10);
List tags =
RecipeService.getInstance().getAllPersistentTags();

for (Tag tag : tags) {
if
(tag.getName().toUpperCase().startsWith(input.toUpperCase())) {
choices.add(tag);
if (choices.size() == 10) break;
}
}

return choices.iterator();
}

}

Regards,

Hbiloo


On Thu, Feb 12, 2009 at 5:00 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> If you copy-paste your code here we can probably dig into it better  ...
>
> **
> Martin
>
> 2009/2/12 Azzeddine Daddah :
> > Thanks guys for the quick replay.
> > Martin: What I want to do is to select a value from the auto complete
> text
> > field, and when clicking the "Add" button, the selected value should be
> > added to the tagsContainer (which is in fact a div that wraps the added
> > values) and cleared from the text field.
> >
> > Luca: I've tried your suggestion but it didn't help. I've also tried to
> > clear the text field using Javascript
> >
> target.appendJavascript(String.format("document.getElementById('%s').value =
> > ''", auto.getOutputMarkupId()));
> > but it also didn't work.
> >
> > Are there any other suggestions ways to implement this?
> >
> >
> >
> > Kind Regards
> >
> > Hbiloo
> >
> >
> >
> >
> >
> > On Thu, Feb 12, 2009 at 11:24 AM, Martin Makundi <
> > martin.maku...@koodaripalvelut.com> wrote:
> >
> >> Also depending on your situation, clearInput might be necessary?
> >>
> >> **
> >> Martin
> >>
> >> 2009/2/12 Luca Provenzani :
> >> > i think you can put the field of the model/bean of the form to empty
> and
> >> > then call target.addComponet(tagsContainer);
> >> > what kind of effect do you want? If you need to call javascript you
> can
> >> use
> >> > target.appendJavaScript()...
> >> >
> >> > Luca
> >> >
> >> > 2009/2/12 Azzeddine Daddah 
> >> >
> >> >> Hello everyone,
> >> >>
> >> >> Could someone please tell me how I can clear the selected

Re: How can I clear the value of an AutoCompleteTextField

2009-02-12 Thread Azzeddine Daddah
Thanks guys for the quick replay.
Martin: What I want to do is to select a value from the auto complete text
field, and when clicking the "Add" button, the selected value should be
added to the tagsContainer (which is in fact a div that wraps the added
values) and cleared from the text field.

Luca: I've tried your suggestion but it didn't help. I've also tried to
clear the text field using Javascript
target.appendJavascript(String.format("document.getElementById('%s').value =
''", auto.getOutputMarkupId()));
but it also didn't work.

Are there any other suggestions ways to implement this?



Kind Regards

Hbiloo





On Thu, Feb 12, 2009 at 11:24 AM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Also depending on your situation, clearInput might be necessary?
>
> **
> Martin
>
> 2009/2/12 Luca Provenzani :
> > i think you can put the field of the model/bean of the form to empty and
> > then call target.addComponet(tagsContainer);
> > what kind of effect do you want? If you need to call javascript you can
> use
> > target.appendJavaScript()...
> >
> > Luca
> >
> > 2009/2/12 Azzeddine Daddah 
> >
> >> Hello everyone,
> >>
> >> Could someone please tell me how I can clear the selected value of an
> >> AutoCompleteTextField. I've an AutoCompleteTextField and a link which
> >> should
> >> clear the value of the text field after clicking it. I would also do
> some
> >> effects after clearing this value. Below my code:
> >>
> >> final AutoCompleteTextField auto = new
> >> AutoCompleteTextField("auto", new Model())
> >> ...
> >> form.add(auto);
> >>
> >> form.add(new IndicatingAjaxLink("addLink", new
> >> Model("Add"))
> >> {
> >>@Override
> >>public void onClick(AjaxRequestTarget target) {
> >>String inputValue = auto.getValue();
> >>auto.clearInput();
> >>// How to clear the auto's value and add some effects to the
> >> tagsContainer?
> >>target.addComponent(tagsContainer);
> >>}
> >> });
> >>
> >>
> >> Kind Regards,
> >>
> >> Hbiloo
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


How can I clear the value of an AutoCompleteTextField

2009-02-12 Thread Azzeddine Daddah
Hello everyone,

Could someone please tell me how I can clear the selected value of an
AutoCompleteTextField. I've an AutoCompleteTextField and a link which should
clear the value of the text field after clicking it. I would also do some
effects after clearing this value. Below my code:

final AutoCompleteTextField auto = new
AutoCompleteTextField("auto", new Model())
...
form.add(auto);

form.add(new IndicatingAjaxLink("addLink", new Model("Add"))
{
@Override
public void onClick(AjaxRequestTarget target) {
String inputValue = auto.getValue();
auto.clearInput();
// How to clear the auto's value and add some effects to the
tagsContainer?
target.addComponent(tagsContainer);
}
});


Kind Regards,

Hbiloo


Re: Auto-Complete TextField for selecting multiple values

2009-02-10 Thread Azzeddine Daddah
Hi guys,
Thanks for your replay. I'll also work on the 3th one and add it to the
Wicket hub when finished. The 3th one uses jQuery which is more popular and
you can easy combine/integrate it with WickeXt.

BTW, the new version of Wicket hub is fantastic and looks great :).

Best Regards,

Hbiloo


On Tue, Feb 10, 2009 at 6:59 PM, francisco treacy <
francisco.tre...@gmail.com> wrote:

> ps: actually, once it's done, we should include it in wicket hub so
> next time you can search for it there =)
>
>
> On Tue, Feb 10, 2009 at 6:57 PM, francisco treacy
>  wrote:
> > i have used digitarald one in wicket hub.
> >
> > example: http://wickethub.org/add  (try adding topics like
> > 'javascript' or 'persistence')
> > code:
> http://code.google.com/p/wickethub/source/browse/#svn/trunk/wickethub/src/main/java/wickethub/web/components/autocompleter
> >
> > i have not however wrapped it up in a pretty jar yet (and depending on
> > mootools, etc)
> >
> > if not, you could take a look at this thread
> >
> http://www.nabble.com/AutoCompleteTextField---autocomplete-multiple-fields-td17500271.html
> >
> > francisco
> >
> >
> > On Tue, Feb 10, 2009 at 5:48 PM, Ryan Gravener 
> wrote:
> >> I'll implement the first one in due time.  It is not as fluid as i would
> >> hope though.
> >>
> >>
> >> http://ryangravener.com/flex | http://twitter.com/ryangravener
> >>
> >>
> >> On Tue, Feb 10, 2009 at 11:01 AM, Azzeddine Daddah <
> waarhei...@gmail.com>wrote:
> >>
> >>> Hi guys,
> >>>
> >>> Does somebody knows if there is already such a Wicket lib/component
> where
> >>> you can select more then one value. Something like this one
> >>> http://www.emposha.com/javascript/jquery/jquerymultiselect.html,
> >>> http://digitarald.de/project/autocompleter/1-1/showcase/delicious-tagsor
> >>> http://remysharp.com/wp-content/uploads/2007/12/tagging.php
> >>>
> >>>
> >>> Kind regards,
> >>>
> >>> Hbiloo
> >>>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Auto-Complete TextField for selecting multiple values

2009-02-10 Thread Azzeddine Daddah
Hi guys,

Does somebody knows if there is already such a Wicket lib/component where
you can select more then one value. Something like this one
http://www.emposha.com/javascript/jquery/jquerymultiselect.html,
http://digitarald.de/project/autocompleter/1-1/showcase/delicious-tags or
http://remysharp.com/wp-content/uploads/2007/12/tagging.php


Kind regards,

Hbiloo


Re: Component doesn't disappear when removing it via an ajax link

2009-02-03 Thread Azzeddine Daddah
Thanks guys. The setVisible(false) has solved the problem :).I want now to
let the user add a number of this panel dynamically. Any help is welcome.

My code till now:

private void addIngredientsPart(Recipe recipe) {
if (recipe.getRecipeIngredients().size() == 0 ) {
for (int i = 0; i < 3; i++) {
recipe.addRecipeIngredient(new RecipeIngredient(recipe, new
Ingredient(""), ""));
}
}

final WebMarkupContainer container = new
WebMarkupContainer("container");
container.setOutputMarkupId(true);

container.add(new ListView("ingredients",
recipe.getRecipeIngredients()) {
@Override
protected void populateItem(final ListItem
item) {
RecipeIngredient recipeIngredient = item.getModelObject();
item.add(new IngredientPanel("ingredientPanel", new
Model(recipeIngredient)));
}
});

add(new AjaxLink("addLink") {
@Override
public void onClick(AjaxRequestTarget target) {
// How can I now add a new IngredientPanel to the ListView?
target.addComponent(container);
}
});

add(container);
}

Gr. Hbiloo

On Tue, Feb 3, 2009 at 10:36 AM, Thomas Mäder
wrote:

> And don't forget that you have to add any components you want updated to
> the
> AjaxRequestTarget you get passed into the onClick() method.
>
> Thomas
>
> On Tue, Feb 3, 2009 at 7:43 AM, Jeremy Thomerson
> wrote:
>
> > A couple of problems:
> >
> > 1 - don't remove it. You should make it invisible (setVisible(false))
> >
> > 2 - you're trying to remove the container from the link, but it was added
> > to the panel.  You would have to call IngredientPanel.this.remove (but
> > don't)
> >
> >
> > Jeremy Thomerson
> > http://www.wickettraining.com
> > -- sent from a wireless device
> >
> >
> > -Original Message-
> > From: Martin Makundi 
> > Sent: Tuesday, February 03, 2009 12:16 AM
> > To: users@wicket.apache.org
> > Subject: Re: Component doesn't disappear when removing it via an ajax
> link
> >
> > Run Wicket in development mode and investigate what happens in the
> > "Wicket Ajax Debug" dialog (right bottom corner of your browser).
> >
> > **
> > Martin
> >
> > 2009/2/3 Azzeddine Daddah :
> > > Hi,
> > > I've two text fields wrapped in a container. What I want to do is to
> let
> > the
> > > user remove these fields via a link. This is my code which does not
> work.
> > > The wrapper container stills appear even the link is submitted:
> > >
> > > 
> > >
> > >
> > >
> > >
> > >[x]
> > >
> > >
> > > 
> > >
> > > public class IngredientPanel extends Panel {
> > >
> > >/**
> > > * Creates a new {...@link IngredientPanel}.
> > > *
> > > * @param id the panel id; may not be null
> > > * @param model the panel model; may not be null
> > > */
> > >public IngredientPanel(String id, IModel model) {
> > >super(id, model);
> > >RecipeIngredient recipeIngredient = model.getObject();
> > >
> > >final WebMarkupContainer container = new
> > > WebMarkupContainer("container", model);
> > >container.setOutputMarkupId(true);
> > >container.add(new
> RequiredTextField("recipeIngredientQty",
> > > new Model(recipeIngredient.getQuantity(;
> > >container.add(new RequiredTextField("recipeIngredient",
> > new
> > > Model(recipeIngredient.getIngredient().getName(;
> > >container.add(new AjaxLink("removeLink") {
> > >@Override
> > >public void onClick(AjaxRequestTarget target) {
> > >remove(container);
> > >}
> > >});
> > >add(container);
> > >}
> > > }
> > >
> > > Kind regards,
> > >
> > > Hbiloo
> > >
> >
> > -
> > 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
> >
> >
>
>
> --
> Thomas Mäder
> www.devotek-it.ch
>


Component doesn't disappear when removing it via an ajax link

2009-02-02 Thread Azzeddine Daddah
Hi,
I've two text fields wrapped in a container. What I want to do is to let the
user remove these fields via a link. This is my code which does not work.
The wrapper container stills appear even the link is submitted:






[x]




public class IngredientPanel extends Panel {

/**
 * Creates a new {...@link IngredientPanel}.
 *
 * @param id the panel id; may not be null
 * @param model the panel model; may not be null
 */
public IngredientPanel(String id, IModel model) {
super(id, model);
RecipeIngredient recipeIngredient = model.getObject();

final WebMarkupContainer container = new
WebMarkupContainer("container", model);
container.setOutputMarkupId(true);
container.add(new RequiredTextField("recipeIngredientQty",
new Model(recipeIngredient.getQuantity(;
container.add(new RequiredTextField("recipeIngredient", new
Model(recipeIngredient.getIngredient().getName(;
container.add(new AjaxLink("removeLink") {
@Override
public void onClick(AjaxRequestTarget target) {
remove(container);
}
});
add(container);
}
}

Kind regards,

Hbiloo


Re: wicketstuff-annotation and Wicket 1.4

2009-01-05 Thread Azzeddine Daddah
Thanks guys for the replay.
I've tried to use the wicketstuff-annotation with wicket-1.4-rc1 and
spring-core-2.5.2 but the application couldn't be deployed if I use the
scanPackage("myPackage") methode. The console shows the following message:

SEVERE: Error filterStart
> 5-jan-2009 13:50:55 org.apache.catalina.core.StandardContext start
> SEVERE: Context [/myApp] startup failed due to previous errors


But if I use the scanClass(myPage.class) everything goes well.

Regards,

Hbiloo

On Fri, Jan 2, 2009 at 9:22 PM, Rodolfo Hansen  wrote:

> Yes, I've been using it succesfully with 1.4  make sure you are using the
> project in wicketstuff-core jeremy is pointing out.
>
> On Tue, Dec 30, 2008 at 5:57 AM, Azzeddine Daddah  >wrote:
>
> > Hi guys,
> >
> > Does someone already tried to use wicketstuff-annotation with Wicket 1.4?
> > They say in the wicketstuff site that it depends on wicket 1.3.3 but
> isn't
> > tested yet with 1.4.
> >
> > Gr.
> > Hbiloo
> >
>


wicketstuff-annotation and Wicket 1.4

2008-12-30 Thread Azzeddine Daddah
Hi guys,

Does someone already tried to use wicketstuff-annotation with Wicket 1.4?
They say in the wicketstuff site that it depends on wicket 1.3.3 but isn't
tested yet with 1.4.

Gr.
Hbiloo


Re: debugging

2008-12-23 Thread Azzeddine Daddah
Start tomcat using catalina jpda start :)

   1. Open the startup script in (your_tomcat_home)/bin (WIN: startup.bat,
   UNIX: startup.sh)
   2. Add the following lines at the first blank line in the file
   WINDOWS:
   set JPDA_ADDRESS=8000
   set JPDA_TRANSPORT=dt_socket

   UNIX:
   export JPDA_ADDRESS=8000
   export JPDA_TRANSPORT=dt_socket
   3. Change the execute line at the end to include *jpda start
   *WINDOWS:
   call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

   UNIX:
   exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
   4. Deploy your application as you normally do
   5. Add a new Remote Java Application in your Debug Configurations in
   Eclipse and click on "Debug"

Cheers
Hbiloo


On Tue, Dec 23, 2008 at 11:37 AM, Dipu  wrote:

> use the Sysdeo Eclipse Tomcat Launcher plugin
>
> http://www.eclipsetotale.com/tomcatPlugin.html
>
> Cheers
> Dipu
>
> On Tue, Dec 23, 2008 at 10:34 AM, Björn Tietjens  wrote:
> >
> > Hi,
> >
> > I am developing a webapp with wicket on eclipse, deploying as war, using
> a local tomcat for testing.
> > What is the best/easiest way to debug my app with eclipse?
> > How can I deploy/start the webapp from within eclipse or how can I
>  attach eclipse to tomcat in order to debug my code?
> >
> > Thanx for your help.
> > Cheers Björn
> >
> > -
> > 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
>
>


Re: wickethub.org

2008-12-15 Thread Azzeddine Daddah
+1

On Mon, Dec 15, 2008 at 5:52 PM, francisco treacy <
francisco.tre...@gmail.com> wrote:

> thanks daniel for the input.
>
> wickethub ideally could also be used to keep track of abandoned
> projects, so i might add a date of last activity -something like that-
> if it makes sense.
>
> how many times you don't really know where you're standing with a
> "wicket integration with [put sth here]" (code quality, updates,
> compatibility and so on) ?
>
> anyway, before adding features and fixing stuff  i'd like to make sure
> people are interested.
>
> francisco
>
>
> On Sun, Dec 14, 2008 at 1:42 PM, dtoffe  wrote:
> >
> >I like your idea, there are many wicket related projects in
> sourceforge
> > and googlecode, some are empty but some are very interesting. Added three
> > links.
> >Please check the Topics field, I cannot modify a value and have the
> old
> > values erased, they keep appearing and acumulating with the new values.
> >
> > Cheers,
> >
> > Daniel
> >
> >
> > francisco treacy-2 wrote:
> >>
> >> i came up with an idea during the last weeks, having some trouble
> >> finding wicket resources.
> >>
> >> although we have wicketstuff (which is great, and even more now with
> >> jeremy's awesome job of reorganizing it)  i feel there are still lots
> >> of components, plugins or tools that are lost in cyberspace. thought
> >> it would be neat to keep a sort of "registry" with useful information
> >> for wicket developers.
> >>
> >> so i decided to quickly put some bits together from an old project and
> >> rebaptised it as "the wicket hub" - a simple prototype @
> >> http://wickethub.org.
> >> it's meant to be flexible, so except for the title there are no
> >> required fields when you add/edit a "module". there are already some
> >> examples.
> >>
> >> let me know what you think about features, its relation with
> >> wicketstuff and if it's usable, etc. or even if the whole thing makes
> >> no sense - any suggestions appreciated.
> >>
> >> francisco
> >>
> >> ps: goes without saying, but [disclaimer: it's completely
> >> experimental] and be aware the place it's hosted is more like a
> >> shoebox than a server :)
> >>
> >> -
> >> 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/wickethub.org-tp20995774p2059.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
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Best way to implement OSIV (open session in view) pattern in Wicket

2008-12-06 Thread Azzeddine Daddah
Hi guys,
I want to use Hibernate in my Wicket web application.
I've found a way to to this by creating:

   - a custom WebApplication to initialise and destroy the SessionFactory.
   - a custom WebRequestCycle to handle opening and
   closing/committing connections and transactions

Is this a good way? Are there maybe other/better ways to integrate Hibernate
in Wicket? Examples are welcome :)

P.S. I know that you can use Spring or DataBinder to handle this but I'm not
using them in this project.

Gr. Hbiloo


How to append a javascript code part to the head once

2008-10-16 Thread Azzeddine Daddah
Hi there,

I've a problem with appending a part of a javascript code to the head once
for all my concrete behavior classes.
Below what I do at this moment:

JQueryBehavior class
public abstract class JQueryBehavior extends AbstractBehavior {
private static final String JQUERY_1_2_6 = "res/jquery-1.2.6.pack.js";

private static final CompressedResourceReference JQUERY_RESOURCE = new
CompressedResourceReference(JQueryBehavior.class, JQUERY_1_2_6);

@Override
public void renderHead(IHeaderResponse response) {
response.renderJavascriptReference(JQUERY_RESOURCE);
CharSequence script = getOnReadyScript();
if (StringUtils.isNotBlank((String) script)) {
StringBuilder sb = new StringBuilder()
.append(JavascriptUtils.SCRIPT_OPEN_TAG)
.append("\n$(document).ready(function() {\n")
.append(script)
.append("\n});")
.append(JavascriptUtils.SCRIPT_CLOSE_TAG)
.append("\n");
response.renderString(sb.toString());
}
}

protected abstract CharSequence getOnReadyScript();

}

My problem now is that I want the script open en close tags one time to be
appended to the head tag. And just add the script between these two elements
for each behavior I create. Below an example of a behavior that passes his
script to the super class.
Is there any way, maybe something that Wicket already has, to control if
this part of the script already has been added?

BlurFieldBehavior class
public class BlurFieldBehavior extends JQueryBehavior {
private static final String BLUR_FIELD_SCRIPT = "res/blurField.js";
private static final String BLUR_FIELD_CSS_CALSS_NAME = "blur-input";

private static final ResourceReference PLUGINS_RESOURCE = new
JavascriptResourceReference(BlurFieldBehavior.class, BLUR_FIELD_SCRIPT);

@Override
protected CharSequence getOnReadyScript() {
return String.format("\t$('input.%s').blurInput();",
BLUR_FIELD_CSS_CALSS_NAME);
}

@Override
public void onComponentTag(Component component, ComponentTag tag) {
assert component instanceof TextField;
tag.addBehavior(new AttributeModifier("class", true, new
Model(BLUR_FIELD_CSS_CALSS_NAME)));
}

@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.renderJavascriptReference(PLUGINS_RESOURCE);
}
}

SearchPanel class
...
private TextField createPhoneNumberTextField() {
TextField phoneNumberTextField = new TextField("phoneNumber", new
Model("Phone number"));
TextFieldUtils.addMaxLength(phoneNumberTextField, 11);
phoneNumberTextField.add(new BlurFieldBehavior());
return phoneNumberTextField;
}
...

Thank you,

Hbiloo


Strange exception when trying to use wicketstuff-annotation library

2008-10-15 Thread Azzeddine Daddah
Hi,

When trying to use the wicketstuff-annotation library I got a very strange
Exception: "*log4j:ERROR Error occured while converting date.*". This causes
that my application couldn't be started up.
When removing this jar and his dependencies from the lib and just use the
normal Wicket mounting strategies everything works fine again.
Does someone already got the same problem and knowd what the cause is?

Thank you.

Regards,

Hbiloo


Re: Small question about URL rewriting

2008-10-15 Thread Azzeddine Daddah
Hi Daan,

Thanks for your quick response :). It's a really interesting article to
read.
I don't really want to set the ID's of my product in the URL. I was thinking
to do something like this :) :
http://stuq.nl/weblog/articles/create-restful-urls-with-wicket<http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket>
in stead of
http://stuq.nl/weblog/articles/12345<http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket>

The problem is that you cannot be sure that the article title is unique.

Kind regards,

Hbiloo
<http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket>
On Wed, Oct 15, 2008 at 11:31 AM, Daan van Etten <[EMAIL PROTECTED]> wrote:

> Hi Hbiloo,
>
> Check out the various UrlCodingStrategies. See
> http://cwiki.apache.org/WICKET/url-coding-strategies.html
>
> I wrote something about RESTful urls here:
> http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket
>
> Regards,
>
> Daan
>
>
>
> On 15 okt 2008, at 11:19, Azzeddine Daddah wrote:
>
>  Hi,
>>
>> I wanna just know if there is a way to rewrite URLs. For example to do
>> something like this:
>>
>> From: http://mydomain.com/product/productNumber/12345
>> To: http://mydomain.com/product/this-is-my-product
>>
>>
>> Regards,
>>
>> Hbiloo
>>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Localized string retrieved with a warning message

2008-09-18 Thread Azzeddine Daddah
Thanks Michael,

I did but the warnings are still displayed.

private void addLinks() {
addLink("home", new StringResourceModel("navigationbar.menu.home",
this, null), HomePage.class);
addLink("numberPool", new
StringResourceModel("navigationbar.menu.numberpool", this, null),
NumberPoolPage.class);
addLink("numberPoolLog", new
StringResourceModel("navigationbar.menu.numberpoollog", this, null),
NumberPoolLogPage.class);
addLink("defragment", new
StringResourceModel("navigationbar.menu.defragment", this, null),
DefragmentPage.class);
addLink("search", new
StringResourceModel("navigationbar.menu.search", this, null),
SearchPage.class);
}

private void addLink(String id, StringResourceModel model, final Class pageClass) {
BookmarkablePageLink link = new BookmarkablePageLink(id, pageClass);
link.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
String currentPageName = pageClass.getName();
String parentPageName  = getPage().getClass().getName();
return StringUtils.equals(currentPageName, parentPageName) ?
"current_page_item" : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}

}));
link.add(new Label("title", model));
add(link);
}

Gr. Azzeddine

On Thu, Sep 18, 2008 at 9:29 AM, Michael Sparer <[EMAIL PROTECTED]>wrote:

>
> Don't call getString() on your final StringResourceModels, rather just pass
> the models to the links, then you shouldn't bet the warning anymore
>
> regards,
> Michael
>
> Azzeddine Daddah wrote:
> >
> > Hi,
> >
> > I get the following warning message when trying to retrieve a localized
> > string: *Tried to retrieve a localized string for a component that has
> not
> > yet been added to the page. This can sometimes lead to an invalid or no
> > localized resource returned. Make sure you are not calling
> > Component#getString() inside your Component's constructor. Offending
> > component*
> >
> > This how my code look like:
> > public class NavigationBarPanel extends Panel {
> >
> > private static final long serialVersionUID = 1L;
> > /** The navigation bar links */
> > private final String MENU_MENU = new
> > StringResourceModel("navigationbar.menu.home", this, null).getString();
> > private final String NUMBER_POOL_MENU = new
> > StringResourceModel("navigationbar.menu.numberpool", this,
> > null).getString();
> > private final String NUMBER_POOL_LOG_MENU = new
> > StringResourceModel("navigationbar.menu.numberpoollog", this,
> > null).getString();
> > private final String DEFRAGMENT_MENU = new
> > StringResourceModel("navigationbar.menu.defragment", this,
> > null).getString();
> > private final String SEARCH_MENU = new
> > StringResourceModel("navigationbar.menu.search", this, null).getString();
> >
> > public NavigationBarPanel(String id) {
> > super(id);
> > addLinks();
> > }
> >
> > private void addLinks() {
> > addLink("home", MENU_MENU, HomePage.class);
> > addLink("numberPool", NUMBER_POOL_MENU, NumberPoolPage.class);
> > addLink("numberPoolLog", NUMBER_POOL_LOG_MENU,
> > NumberPoolLogPage.class);
> > addLink("defragment", DEFRAGMENT_MENU, DefragmentPage.class);
> > addLink("search", SEARCH_MENU, SearchPage.class);
> > }
> >
> > private void addLink(String id, String title, final Class > Page> pageClass) {
> > BookmarkablePageLink link = new BookmarkablePageLink(id,
> > pageClass);
> > link.add(new AttributeModifier("class", true, new
> > AbstractReadOnlyModel() {
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > public Object getObject() {
> > String currentPageName = pageClass.getName();
> > String parentPageName  = getPage().getClass().getName();
> > return StringUtils.equals(currentPageName,
> parentPageName)
> > ?
> > "current_page_item" : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
> > }
> >
> > }));
> > link.add(new Label("title", new Model(title)));
> 

Localized string retrieved with a warning message

2008-09-18 Thread Azzeddine Daddah
Hi,

I get the following warning message when trying to retrieve a localized
string: *Tried to retrieve a localized string for a component that has not
yet been added to the page. This can sometimes lead to an invalid or no
localized resource returned. Make sure you are not calling
Component#getString() inside your Component's constructor. Offending
component*

This how my code look like:
public class NavigationBarPanel extends Panel {

private static final long serialVersionUID = 1L;
/** The navigation bar links */
private final String MENU_MENU = new
StringResourceModel("navigationbar.menu.home", this, null).getString();
private final String NUMBER_POOL_MENU = new
StringResourceModel("navigationbar.menu.numberpool", this,
null).getString();
private final String NUMBER_POOL_LOG_MENU = new
StringResourceModel("navigationbar.menu.numberpoollog", this,
null).getString();
private final String DEFRAGMENT_MENU = new
StringResourceModel("navigationbar.menu.defragment", this,
null).getString();
private final String SEARCH_MENU = new
StringResourceModel("navigationbar.menu.search", this, null).getString();

public NavigationBarPanel(String id) {
super(id);
addLinks();
}

private void addLinks() {
addLink("home", MENU_MENU, HomePage.class);
addLink("numberPool", NUMBER_POOL_MENU, NumberPoolPage.class);
addLink("numberPoolLog", NUMBER_POOL_LOG_MENU,
NumberPoolLogPage.class);
addLink("defragment", DEFRAGMENT_MENU, DefragmentPage.class);
addLink("search", SEARCH_MENU, SearchPage.class);
}

private void addLink(String id, String title, final Class pageClass) {
BookmarkablePageLink link = new BookmarkablePageLink(id, pageClass);
link.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
String currentPageName = pageClass.getName();
String parentPageName  = getPage().getClass().getName();
return StringUtils.equals(currentPageName, parentPageName) ?
"current_page_item" : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}

}));
link.add(new Label("title", new Model(title)));
add(link);
}
}

Could you please tell me why am I getting this warning. I use the same
strategy to add localized string to my pages but I don't get warnings.

Gr. Azzeddine


Re: "Attempt to set model object on null model of component" when submitting a form

2008-09-16 Thread Azzeddine Daddah
Thanks Stefan :)

On Tue, Sep 16, 2008 at 3:04 PM, Stefan Lindner <[EMAIL PROTECTED]> wrote:

> Your DropDownChoice element has no Model so the submit code does not know
> where to store your selection. Add a
>
> new Model()
>
> to it's constructor.
>
> -Ursprüngliche Nachricht-
> Von: Azzeddine Daddah [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 16. September 2008 15:01
> An: users@wicket.apache.org
> Betreff: "Attempt to set model object on null model of component" when
> submitting a form
>
> Hi,
>
> I've the following code:
>
> private static final List SEARCH_DOMAINS = Arrays.asList("AA",
> "BB");
> ...
> private void addSearchForm() {
>Form searchForm = new Form("searchForm");
>searchForm.add(new DropDownChoice("searchDomain", SEARCH_DOMAINS));
>searchForm.add(new TextField("areaCode", new Model(""),
> Integer.class));
>
>Button submiButton = new Button("submiButton") {
>private static final long serialVersionUID = 1L;
>
>public void onSubmit() {
>info("submiButton executed");
>}
>};
>
>searchForm.add(submiButton);
>add(searchForm);
>}
>
> When I hit the submit button I get this error: Attempt to set model object
> on null model of component.
>
> Could you please tell me what am I doing wrong?
>
> Gr. Azzeddine
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Azzeddine Daddah
www.hbiloo.com


"Attempt to set model object on null model of component" when submitting a form

2008-09-16 Thread Azzeddine Daddah
Hi,

I've the following code:

private static final List SEARCH_DOMAINS = Arrays.asList("AA",
"BB");
...
private void addSearchForm() {
Form searchForm = new Form("searchForm");
searchForm.add(new DropDownChoice("searchDomain", SEARCH_DOMAINS));
searchForm.add(new TextField("areaCode", new Model(""),
Integer.class));

Button submiButton = new Button("submiButton") {
private static final long serialVersionUID = 1L;

public void onSubmit() {
info("submiButton executed");
}
};

searchForm.add(submiButton);
add(searchForm);
}

When I hit the submit button I get this error: Attempt to set model object
on null model of component.

Could you please tell me what am I doing wrong?

Gr. Azzeddine


Re: idea: automatic component repo

2008-06-18 Thread Azzeddine Daddah
+1

On Wed, Jun 18, 2008 at 1:28 PM, Nino Saturnino Martinez Vazquez Wael <
[EMAIL PROTECTED]> wrote:

> Exactly what I meant with the mail to dev a week ago. So I think it's all
> good. And actually could raise the wicketstuff standard.
>
> +1!, I guess binding since im a wicketstuff developer:)
>
> Jonathan Locke wrote:
>
>> uh, this library is of course a web site... ;-)
>>
>>
>> Jonathan Locke wrote:
>>
>>
>>> my RSI is bad so please forgive the terseness.  the idea:
>>>
>>>  - make an automated wicket component library
>>>  - define packaging structure for wicket library components  - structure
>>> of package would define component metadata like svn, faq,
>>> help, etc (probably in meta.inf created from maven pom info by maven
>>> guru)
>>>  - (only signed) jars could be automatically picked up by some naming
>>> pattern from maven repos and deployed as live demos
>>>  - container would be simple to write (no db hassles... just use maven
>>> and
>>> packaging)
>>>  - everyone makes their components and demos in a standard way so we can
>>> stop asking around about what functionality exists
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> -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]
>
>


-- 
Azzeddine Daddah
www.hbiloo.com


Re: What is the best way to create layouts in Wicket?

2008-04-28 Thread Azzeddine Daddah
Could you or somebody else please provide some code?
I didn't understand your last sentence " Start with one hard coded layout
and then tune it using an internal
state, for example."

Thank you,

Azzeddine

On Mon, Apr 28, 2008 at 10:16 AM, Martin Makundi <
[EMAIL PROTECTED]> wrote:

> I would guess that it is better to use panels or fragments and instead
> of using setXXX, just initialize everyting in its place according to
> an internal state.
>
> Start with one hard coded layout and then tune it using an internal
> state, for example.
>
> **
> Martin
>
> 2008/4/28 Azzeddine Daddah <[EMAIL PROTECTED]>:
> > Hi there,
> >
> >  I'm new to Wicket trying to build my first application :).
> >  I've already token a look at "Creating layouts using markup
> inheritance"
> >  tutorial from the Wicket website, but still have some questions:
> >  Suppose that I've a base page which I want that some of my pages
> inherits
> >  the layout from it. What I want to do is to have some protected methods
> like
> >  f.e. appendComponen(final Component comp, String position) and
> >  setTitle(String title). The position string In the first method
> indicates
> >  the position where the component in the page should be appended.
> >
> >1. How can I implement this?
> >2. Is it possible to define multiple  in the base
> >page?
> >
> >  Gr. Azzeddine
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Azzeddine Daddah
www.hbiloo.com


What is the best way to create layouts in Wicket?

2008-04-27 Thread Azzeddine Daddah
Hi there,

I'm new to Wicket trying to build my first application :).
I've already token a look at "Creating layouts using markup inheritance"
tutorial from the Wicket website, but still have some questions:
Suppose that I've a base page which I want that some of my pages inherits
the layout from it. What I want to do is to have some protected methods like
f.e. appendComponen(final Component comp, String position) and
setTitle(String title). The position string In the first method indicates
the position where the component in the page should be appended.

   1. How can I implement this?
   2. Is it possible to define multiple  in the base
   page?

Gr. Azzeddine


Re: Writing to .properties files and make changes happen?

2008-04-03 Thread Azzeddine Daddah
Why don't you try to use the Apache Commons Configuration?
Take a look http://commons.apache.org/configuration

Azzeddine

On Fri, Apr 4, 2008 at 8:35 AM, unka_hahrry <[EMAIL PROTECTED]> wrote:

>
> I call this method from inside a WebPage:
>
> public static void setNewText(String path, String textId, String
> neuerText)
> throws IOException {
>
>... getting old text as StringBuffer "alt" ...
>
>//create new String from content of .properties file
>String neu = alt.replace(start, ende,
> neuTextTeil).toString();
>
>  File output = new File(path);
>  BufferedWriter out = new BufferedWriter(new
> FileWriter(output));
>
>try {
>out.write(neu);
>}
>finally {
>out.close();
>}
>
>}
> That's all. The .properties file will be changed correctly, but the new
> content will only take effect if I open the .properties file with an
> editor
> and save it, but the overwriting process won't be recognized.
>
>
> Johan Compagner wrote:
> >
> > thats very strange
> > writing  a file in an editor or save it through java that shouldn't
> matter
> > But are you constantly writing properties file from inside the webapp?
> >
> > johan
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Writing-to-.properties-files-and-make-changes-happen--tp16447118p16484561.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]
>
>


-- 
Azzeddine Daddah
www.hbiloo.com


Re: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-17 Thread Azzeddine Daddah
+1

On Mon, Mar 17, 2008 at 9:22 AM, Jan Vissers <[EMAIL PROTECTED]> wrote:

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


-- 
Azzeddine Daddah
www.hbiloo.com