Wicket - TinyMCE

2011-08-01 Thread ramazan pekin
Hi to everyone,

I am looking for rich text editor and I found TinyMCE. But I couldnt
find any document/example page how can I integrate wicket and TinyMCE
explained detailed. Do you know is there any documentation or example
about this subject?

Thanks, br.
Ramazan

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



on the fly components

2011-07-31 Thread ramazan pekin
Hi to everyone,

I am trying to generate dynamic form elements. I need to add and
remove some components dynamically. I have added listChoice component
succesfuly whenever user select a listChoice item, but when I tried to
remove listChoice component, I received an error like that:

org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:102)
- Unexpected error occurred
org.apache.wicket.markup.MarkupException: Unable to find component
with id 'category' in [ListItem [Component id = 1]]. This means that
you declared wicket:id=category in your markup, but that you either
did not add the component to your page at all, or that the hierarchy
does not match.
.Page.html
td wicket:id=categoryList

select wicket:id=category/select
/td, index = 2, current =  'select
wicket:id=category' (line 16, column 18)]
at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:536)


This is form code:

public class DynamicForm extends Form {

  private static final long serialVersionUID = 1L;

  final ListViewCategoryModel listView;

  private ListCategoryModel categories;

  public DynamicForm(String id) {
super(id);

categories = new ArrayListCategoryModel();
categories.add(new CategoryModel(masterCategories));

final WebMarkupContainer listContainer = new
WebMarkupContainer(categoryContainer);
listView = new ListViewCategoryModel(categoryList, categories) {

  private static final long serialVersionUID = 1L;

  @Override
  protected void populateItem(final ListItemCategoryModel item) {
final CategoryModel category = item.getModelObject();
ListChoiceOmCategory listChoice = new ListChoiceOmCategory(
category,
new PropertyModelOmCategory(category, selectedCategory),
masterCategories,
new IChoiceRendererOmCategory() {
  private static final long serialVersionUID = 1L;

  public Object getDisplayValue(OmCategory omCategory) {
return omCategory.getCategoryCode().getLocalized();
  }

  public String getIdValue(OmCategory omCategory, int index) {
return omCategory.getRowId();
  }
}
);
listChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) {
  private static final long serialVersionUID = 5417882427051940952L;

  @Override
  protected void onUpdate(AjaxRequestTarget target) {
if(categories.size()  1  (categories.indexOf(category)
+ 1) != categories.size()) {
  categories = new
ArrayListCategoryModel(categories.subList(0,
(categories.indexOf(category) + 1)));
}
categories.add(new CategoryModel(masterCategories));
target.add(listContainer);
  }
});
if(categories.indexOf(item.getModelObject()) != -1) {
  item.add(listChoice);
} else {
  item.remove(listChoice);
}
  }
};
listView.setOutputMarkupId(true);
listContainer.add(listView);
listContainer.setOutputMarkupId(true);
add(listContainer);
  }
}


First time I am developing with wicket, and maybe I use wrongly. I'm
new and any feedback is appreciated... Sorry for my english :)

Br.
Ramazan

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



Re: on the fly components

2011-07-31 Thread ramazan pekin
Actually, as you said, when I add new bounded object to the collection
new listChoice has been added to page, but whenever I tried to remove
object from collection, related listChoice is not being removed from
page. I have added wrapping container and I specified as target
component to listChoice's onchange action. As result, I have added
item.remove(listChoice); to code but this time, exception raised.

I think I am using ListView wrongly, main problem looks like ListView
related model object. This is my current markup file content.

body
  form wicket:id=form
table wicket:id=categoryContainer
  tr
td wicket:id=categoryList
  select wicket:id=category/
/td
  /tr
/table
input type=submit value=Submit/
  /form
/body

On Sun, Jul 31, 2011 at 11:02 PM, Christian Huber hub...@butterbrot.org wrote:
 Hi,

 this is just a wild guess but in your code you have line that calls
 item.remove(listChoice); under certain conditions and the listChoice
 instance is bound to the category identifier which does not seem right to
 me.

 As far as I understand ListViews the associated markup block is created for
 each item. If you remove the listChoice from an item then Wicket has no
 object to associate the markup with. So I think you cannot remove the choice
 that way.

 I have a similar use case where I also add and remove objects to and from
 ListViews via Ajax and it was sufficient to just remove the object from the
 collection that the ListView relies on and add the wrappign container to the
 ajax target.

 Since the listChoice is the only thing you add to an item I figure that
 could also be feasible for your case but as said before this is just a
 hunch.

 HTH, Chris

 --
 The Sanity Resort http://sanityresort.blogspot.com/

 Am 31.07.2011 21:06, schrieb ramazan pekin:

 Hi to everyone,

 I am trying to generate dynamic form elements. I need to add and
 remove some components dynamically. I have added listChoice component
 succesfuly whenever user select a listChoice item, but when I tried to
 remove listChoice component, I received an error like that:


 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:102)
 - Unexpected error occurred
 org.apache.wicket.markup.MarkupException: Unable to find component
 with id 'category' in [ListItem [Component id = 1]]. This means that
 you declared wicket:id=category in your markup, but that you either
 did not add the component to your page at all, or that the hierarchy
 does not match.
 .Page.html
 td wicket:id=categoryList

        select wicket:id=category/select
        /td, index = 2, current =  'select
 wicket:id=category' (line 16, column 18)]
        at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:536)


 This is form code:

 public class DynamicForm extends Form {

   private static final long serialVersionUID = 1L;

   final ListViewCategoryModel  listView;

   private ListCategoryModel  categories;

   public DynamicForm(String id) {
     super(id);

     categories = new ArrayListCategoryModel();
     categories.add(new CategoryModel(masterCategories));

     final WebMarkupContainer listContainer = new
 WebMarkupContainer(categoryContainer);
     listView = new ListViewCategoryModel(categoryList, categories) {

       private static final long serialVersionUID = 1L;

       @Override
       protected void populateItem(final ListItemCategoryModel  item) {
         final CategoryModel category = item.getModelObject();
         ListChoiceOmCategory  listChoice = new ListChoiceOmCategory(
             category,
             new PropertyModelOmCategory(category, selectedCategory),
             masterCategories,
             new IChoiceRendererOmCategory() {
               private static final long serialVersionUID = 1L;

               public Object getDisplayValue(OmCategory omCategory) {
                 return omCategory.getCategoryCode().getLocalized();
               }

               public String getIdValue(OmCategory omCategory, int index) {
                 return omCategory.getRowId();
               }
             }
         );
         listChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) {
           private static final long serialVersionUID =
 5417882427051940952L;

           @Override
           protected void onUpdate(AjaxRequestTarget target) {
             if(categories.size()  1  (categories.indexOf(category)
 + 1) != categories.size()) {
               categories = new
 ArrayListCategoryModel(categories.subList(0,
 (categories.indexOf(category) + 1)));
             }
             categories.add(new CategoryModel(masterCategories));
             target.add(listContainer);
           }
         });
         if(categories.indexOf(item.getModelObject()) != -1) {
           item.add(listChoice);
         } else {
           item.remove(listChoice);
         }
       }
     };
     listView.setOutputMarkupId(true);
     listContainer.add

Re: on the fly components

2011-07-31 Thread ramazan pekin
And this is CatogoryModel class:

public class CategoryModel implements Serializable {

private static final long serialVersionUID = 1L;

private ListOmCategory omCategories;

private OmCategory selectedCategory;

public CategoryModel(ListOmCategory omCategories) {
this.omCategories = omCategories;
}

public ListOmCategory getOmCategories() {
return omCategories;
}

public void setOmCategories(ListOmCategory omCategories) {
this.omCategories = omCategories;
}

public OmCategory getSelectedCategory() {
return selectedCategory;
}

public void setSelectedCategory(OmCategory selectedCategory) {
this.selectedCategory = selectedCategory;
}

}


On Mon, Aug 1, 2011 at 12:05 AM, ramazan pekin rep...@gmail.com wrote:
 Actually, as you said, when I add new bounded object to the collection
 new listChoice has been added to page, but whenever I tried to remove
 object from collection, related listChoice is not being removed from
 page. I have added wrapping container and I specified as target
 component to listChoice's onchange action. As result, I have added
 item.remove(listChoice); to code but this time, exception raised.

 I think I am using ListView wrongly, main problem looks like ListView
 related model object. This is my current markup file content.

 body
  form wicket:id=form
    table wicket:id=categoryContainer
      tr
        td wicket:id=categoryList
          select wicket:id=category/
        /td
      /tr
    /table
    input type=submit value=Submit/
  /form
 /body

 On Sun, Jul 31, 2011 at 11:02 PM, Christian Huber hub...@butterbrot.org 
 wrote:
 Hi,

 this is just a wild guess but in your code you have line that calls
 item.remove(listChoice); under certain conditions and the listChoice
 instance is bound to the category identifier which does not seem right to
 me.

 As far as I understand ListViews the associated markup block is created for
 each item. If you remove the listChoice from an item then Wicket has no
 object to associate the markup with. So I think you cannot remove the choice
 that way.

 I have a similar use case where I also add and remove objects to and from
 ListViews via Ajax and it was sufficient to just remove the object from the
 collection that the ListView relies on and add the wrappign container to the
 ajax target.

 Since the listChoice is the only thing you add to an item I figure that
 could also be feasible for your case but as said before this is just a
 hunch.

 HTH, Chris

 --
 The Sanity Resort http://sanityresort.blogspot.com/

 Am 31.07.2011 21:06, schrieb ramazan pekin:

 Hi to everyone,

 I am trying to generate dynamic form elements. I need to add and
 remove some components dynamically. I have added listChoice component
 succesfuly whenever user select a listChoice item, but when I tried to
 remove listChoice component, I received an error like that:


 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:102)
 - Unexpected error occurred
 org.apache.wicket.markup.MarkupException: Unable to find component
 with id 'category' in [ListItem [Component id = 1]]. This means that
 you declared wicket:id=category in your markup, but that you either
 did not add the component to your page at all, or that the hierarchy
 does not match.
 .Page.html
 td wicket:id=categoryList

        select wicket:id=category/select
        /td, index = 2, current =  'select
 wicket:id=category' (line 16, column 18)]
        at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:536)


 This is form code:

 public class DynamicForm extends Form {

   private static final long serialVersionUID = 1L;

   final ListViewCategoryModel  listView;

   private ListCategoryModel  categories;

   public DynamicForm(String id) {
     super(id);

     categories = new ArrayListCategoryModel();
     categories.add(new CategoryModel(masterCategories));

     final WebMarkupContainer listContainer = new
 WebMarkupContainer(categoryContainer);
     listView = new ListViewCategoryModel(categoryList, categories) {

       private static final long serialVersionUID = 1L;

       @Override
       protected void populateItem(final ListItemCategoryModel  item) {
         final CategoryModel category = item.getModelObject();
         ListChoiceOmCategory  listChoice = new ListChoiceOmCategory(
             category,
             new PropertyModelOmCategory(category, selectedCategory),
             masterCategories,
             new IChoiceRendererOmCategory() {
               private static final long serialVersionUID = 1L;

               public Object getDisplayValue(OmCategory omCategory) {
                 return omCategory.getCategoryCode().getLocalized();
               }

               public String getIdValue(OmCategory omCategory, int

Re: on the fly components

2011-07-31 Thread ramazan pekin
I removed item.remove(listChoice); from code and I just changed
ListView definition, I used PropertyModel, and every thing working
well...

listView = new ListViewCategoryModel(categoryList, categories) {
- I changed this line as below
 = listView = new ListViewCategoryModel(categoryList, new
PropertyModelListCategoryModel(this, categories)) {

On Mon, Aug 1, 2011 at 12:09 AM, ramazan pekin rep...@gmail.com wrote:
 And this is CatogoryModel class:

 public class CategoryModel implements Serializable {

        private static final long serialVersionUID = 1L;

        private ListOmCategory omCategories;

        private OmCategory selectedCategory;

        public CategoryModel(ListOmCategory omCategories) {
                this.omCategories = omCategories;
        }

    public ListOmCategory getOmCategories() {
                return omCategories;
        }

    public void setOmCategories(ListOmCategory omCategories) {
                this.omCategories = omCategories;
        }

        public OmCategory getSelectedCategory() {
                return selectedCategory;
        }

        public void setSelectedCategory(OmCategory selectedCategory) {
                this.selectedCategory = selectedCategory;
        }

 }


 On Mon, Aug 1, 2011 at 12:05 AM, ramazan pekin rep...@gmail.com wrote:
 Actually, as you said, when I add new bounded object to the collection
 new listChoice has been added to page, but whenever I tried to remove
 object from collection, related listChoice is not being removed from
 page. I have added wrapping container and I specified as target
 component to listChoice's onchange action. As result, I have added
 item.remove(listChoice); to code but this time, exception raised.

 I think I am using ListView wrongly, main problem looks like ListView
 related model object. This is my current markup file content.

 body
  form wicket:id=form
    table wicket:id=categoryContainer
      tr
        td wicket:id=categoryList
          select wicket:id=category/
        /td
      /tr
    /table
    input type=submit value=Submit/
  /form
 /body

 On Sun, Jul 31, 2011 at 11:02 PM, Christian Huber hub...@butterbrot.org 
 wrote:
 Hi,

 this is just a wild guess but in your code you have line that calls
 item.remove(listChoice); under certain conditions and the listChoice
 instance is bound to the category identifier which does not seem right to
 me.

 As far as I understand ListViews the associated markup block is created for
 each item. If you remove the listChoice from an item then Wicket has no
 object to associate the markup with. So I think you cannot remove the choice
 that way.

 I have a similar use case where I also add and remove objects to and from
 ListViews via Ajax and it was sufficient to just remove the object from the
 collection that the ListView relies on and add the wrappign container to the
 ajax target.

 Since the listChoice is the only thing you add to an item I figure that
 could also be feasible for your case but as said before this is just a
 hunch.

 HTH, Chris

 --
 The Sanity Resort http://sanityresort.blogspot.com/

 Am 31.07.2011 21:06, schrieb ramazan pekin:

 Hi to everyone,

 I am trying to generate dynamic form elements. I need to add and
 remove some components dynamically. I have added listChoice component
 succesfuly whenever user select a listChoice item, but when I tried to
 remove listChoice component, I received an error like that:


 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:102)
 - Unexpected error occurred
 org.apache.wicket.markup.MarkupException: Unable to find component
 with id 'category' in [ListItem [Component id = 1]]. This means that
 you declared wicket:id=category in your markup, but that you either
 did not add the component to your page at all, or that the hierarchy
 does not match.
 .Page.html
 td wicket:id=categoryList

        select wicket:id=category/select
        /td, index = 2, current =  'select
 wicket:id=category' (line 16, column 18)]
        at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:536)


 This is form code:

 public class DynamicForm extends Form {

   private static final long serialVersionUID = 1L;

   final ListViewCategoryModel  listView;

   private ListCategoryModel  categories;

   public DynamicForm(String id) {
     super(id);

     categories = new ArrayListCategoryModel();
     categories.add(new CategoryModel(masterCategories));

     final WebMarkupContainer listContainer = new
 WebMarkupContainer(categoryContainer);
     listView = new ListViewCategoryModel(categoryList, categories) {

       private static final long serialVersionUID = 1L;

       @Override
       protected void populateItem(final ListItemCategoryModel  item) {
         final CategoryModel category = item.getModelObject();
         ListChoiceOmCategory  listChoice = new ListChoiceOmCategory(
             category,
             new PropertyModelOmCategory

Re: on the fly components

2011-07-31 Thread ramazan pekin
Thanks a lot :)

On Mon, Aug 1, 2011 at 12:36 AM, ramazan pekin rep...@gmail.com wrote:
 I removed item.remove(listChoice); from code and I just changed
 ListView definition, I used PropertyModel, and every thing working
 well...

 listView = new ListViewCategoryModel(categoryList, categories) {
 - I changed this line as below
  = listView = new ListViewCategoryModel(categoryList, new
 PropertyModelListCategoryModel(this, categories)) {

 On Mon, Aug 1, 2011 at 12:09 AM, ramazan pekin rep...@gmail.com wrote:
 And this is CatogoryModel class:

 public class CategoryModel implements Serializable {

        private static final long serialVersionUID = 1L;

        private ListOmCategory omCategories;

        private OmCategory selectedCategory;

        public CategoryModel(ListOmCategory omCategories) {
                this.omCategories = omCategories;
        }

    public ListOmCategory getOmCategories() {
                return omCategories;
        }

    public void setOmCategories(ListOmCategory omCategories) {
                this.omCategories = omCategories;
        }

        public OmCategory getSelectedCategory() {
                return selectedCategory;
        }

        public void setSelectedCategory(OmCategory selectedCategory) {
                this.selectedCategory = selectedCategory;
        }

 }


 On Mon, Aug 1, 2011 at 12:05 AM, ramazan pekin rep...@gmail.com wrote:
 Actually, as you said, when I add new bounded object to the collection
 new listChoice has been added to page, but whenever I tried to remove
 object from collection, related listChoice is not being removed from
 page. I have added wrapping container and I specified as target
 component to listChoice's onchange action. As result, I have added
 item.remove(listChoice); to code but this time, exception raised.

 I think I am using ListView wrongly, main problem looks like ListView
 related model object. This is my current markup file content.

 body
  form wicket:id=form
    table wicket:id=categoryContainer
      tr
        td wicket:id=categoryList
          select wicket:id=category/
        /td
      /tr
    /table
    input type=submit value=Submit/
  /form
 /body

 On Sun, Jul 31, 2011 at 11:02 PM, Christian Huber hub...@butterbrot.org 
 wrote:
 Hi,

 this is just a wild guess but in your code you have line that calls
 item.remove(listChoice); under certain conditions and the listChoice
 instance is bound to the category identifier which does not seem right to
 me.

 As far as I understand ListViews the associated markup block is created for
 each item. If you remove the listChoice from an item then Wicket has no
 object to associate the markup with. So I think you cannot remove the 
 choice
 that way.

 I have a similar use case where I also add and remove objects to and from
 ListViews via Ajax and it was sufficient to just remove the object from the
 collection that the ListView relies on and add the wrappign container to 
 the
 ajax target.

 Since the listChoice is the only thing you add to an item I figure that
 could also be feasible for your case but as said before this is just a
 hunch.

 HTH, Chris

 --
 The Sanity Resort http://sanityresort.blogspot.com/

 Am 31.07.2011 21:06, schrieb ramazan pekin:

 Hi to everyone,

 I am trying to generate dynamic form elements. I need to add and
 remove some components dynamically. I have added listChoice component
 succesfuly whenever user select a listChoice item, but when I tried to
 remove listChoice component, I received an error like that:


 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:102)
 - Unexpected error occurred
 org.apache.wicket.markup.MarkupException: Unable to find component
 with id 'category' in [ListItem [Component id = 1]]. This means that
 you declared wicket:id=category in your markup, but that you either
 did not add the component to your page at all, or that the hierarchy
 does not match.
 .Page.html
 td wicket:id=categoryList

        select wicket:id=category/select
        /td, index = 2, current =  'select
 wicket:id=category' (line 16, column 18)]
        at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:536)


 This is form code:

 public class DynamicForm extends Form {

   private static final long serialVersionUID = 1L;

   final ListViewCategoryModel  listView;

   private ListCategoryModel  categories;

   public DynamicForm(String id) {
     super(id);

     categories = new ArrayListCategoryModel();
     categories.add(new CategoryModel(masterCategories));

     final WebMarkupContainer listContainer = new
 WebMarkupContainer(categoryContainer);
     listView = new ListViewCategoryModel(categoryList, categories) {

       private static final long serialVersionUID = 1L;

       @Override
       protected void populateItem(final ListItemCategoryModel  item) {
         final CategoryModel category = item.getModelObject();
         ListChoiceOmCategory

creating datatable with dynamical columns

2007-10-06 Thread Ramazan Pekin
Hi,
  I need to create AjaxFallbackDefaultDataTable with dynamical columns. I am 
reading columns from database and creating AjaxFallbackDefaultDataTable with 
this info. I have classes DataTable and DataRow like .net's data layer 
structure. DataTable have DataRows in ArrayList and DataRows have DataColumns 
in ArrayList. I am defining DataRow as modelObject. I am reaching column value 
like this: 
  ((DataRow)dataTable.getRow(rowIndex)).get/String/Decimal/Date(columnName);.
  Wicket searching set/getColumnName() in the modelObject and these classes and 
functions have been finalized. It looks like, there is no way to create 
dataTable with dynamical columns. If any way you know can you explain?
   
  ---
  I am taking this error:
  WicketMessage: No get method defined for class: class com.elf.data.DataRow 
expression: id
  Root cause:
  org.apache.wicket.WicketRuntimeException: No get method defined for class: 
class com.elf.data.DataRow expression: id
   
  I have codes like these:
  ElfAjaxDataGrid helpDataGrid = new 
ElfAjaxDataGrid(helpDataGrid,help.columns(),help.dataProvider(),50);
   
   
  public ArrayList columns(){
//normally I am reading from db
   ArrayList columns = new ArrayList();
 columns.add(new PropertyColumn(new Model(ID), id));
 columns.add(new PropertyColumn(new Model(First Name), firstName, 
firstName));
 return columns;
}
   
  public HelpDataProvider dataProvider()throws Exception{
//normally I am reading from db
   DataTable dataTable = new DataTable(helpDataTable);
 dataTable.checkAndAddColumn(new StringDataColumn(dataTable,id));
 dataTable.checkAndAddColumn(new StringDataColumn(dataTable,firstName));
 DataRow dataRow = dataTable.NewRow();
 dataRow.set(id, 1);
 dataRow.set(firstName, test);
 dataTable.AddRow(dataRow);
 return new HelpDataProvider(dataTable);
}
   
  public class HelpDataProvider extends SortableDataProvider{
 private static final long serialVersionUID = 1L;
 DataTable dataTable = null;
 
 public HelpDataProvider(DataTable dataTable) {
  this.dataTable = dataTable;
 }
 
 public Iterator iterator(int first, int count) {
  return dataTable.rows().iterator();
 }
   public IModel model(Object object) {
  return new HelpDetachableModel(dataTable);
 }
   public int size() {
  return dataTable.Count();
 }
}
   
  public class HelpDetachableModel extends LoadableDetachableModel{
 private static final long serialVersionUID = 1L;
 private int index = 0;
 private DataTable dataTable;
 
 public HelpDetachableModel(DataTable dataTable) {
  this.dataTable = dataTable;
 }
 
 protected Object load() {
  return dataTable.getRow(index);
 }
}

   
-
Yahoo! kullaniyor musunuz?
Istenmeyen postadan biktiniz mi? Istenmeyen postadan en iyi korunma Yahoo! 
Posta'da
http://tr.mail.yahoo.com

Inter Application Session (Same Context)

2007-09-16 Thread Ramazan Pekin
Hi,
  In the same context, how can I provide inter application session? when I 
reach to new application with wicket.Link session is passing to new 
application, when I try this with html link it needs signin again.
   
  a href=# wicket:id='linkToREQ001A'request/a
  a href=req001arequest/a

   
-
Yahoo! kullaniyor musunuz?
Istenmeyen postadan biktiniz mi? Istenmeyen postadan en iyi korunma Yahoo! 
Posta'da
http://tr.mail.yahoo.com