Catch Wicket.Error with FireBug

2010-03-30 Thread Martin U
Hi Folks,


have everyone of you any experience in catching the wicket-ajax and
js-errors with the Firebug?

Easily we just need to overwrite WicketAjaxDebug.logError... but how?


Thanks for any advice!


Tree with invisible Nodes

2010-03-18 Thread Martin U
Hi Folks,

i've to implement a tree in which some node are exists under a parent node
but they should not be visible to the user in browser at all.

I tried to overwrite getChild from TreeNode. But it dont works for me. I
need this node existens either they are not visible because the tree is my
data(model)-holder too for further processing


Any Ideas?

Thanks a lot.


Wicketstuff-Push without Dojo?

2010-03-08 Thread Martin U
Hi Folks,

i need some COMETD or something equal implemention in my web-application. So
i found wickestuff-push. But as far as is see, it users dojo to do the
client-side magic.

I dont want to blow up my application more as it still is ;) so i want ask
for an wicket + comet workaround with jQuery or with wicket-own javascript
functionality.


thanks in advance for any hint.


- Martin


Delegate a Modelchange to the child components. Or using a ModalWindow for displaying different Models of a specific Type.

2010-02-15 Thread Martin U
Its not easy to find the right topic, but i will try to explain my problem
as best as i can.

I want to display an user-detail View (User is an BusinessObject in my
Application) inside a specific Modal window.


So at the rendering of the Site i place an empty or dummy UserObject
inside my UserEdit-Panel and later if the user choose one specific user from
a Table i want to replace this dummy-Model with the clicked-User-Model.

public class UserEdit extends Panel {

/**
 * @param id
 * @param model
 */

private IModelUser model;
CompoundPropertyModelUser cpm;

public UserEdit(String id, IModelUser _model) {
super(id, _model);

this.model = _model;

init();
}

private void init(){

cpm = new CompoundPropertyModelUser(this.getDefaultModelObject());

this.add(new TextField(lastname,  cpm.bind(lastName)) );
}
}

I dont know if its the right choice to  use a cpm ... but i think its the
proper way right?

The UserEdit is the content of my ModalWindow implementation so i bore up
the show method with a new Model-Parameter to delegate them to the Inside
Content...

(inside ModelOverlay.class)

public void show(final AjaxRequestTarget target, IModelT model)
{
if (shown == false)
{
getContent().setVisible(true);
getContent().setDefaultModel(model);  // - my new Line ;o)
target.addComponent(this);
target.appendJavascript(getWindowOpenJavascript());
shown = true;
}
}

The Model inside UserEdit is changed. But how can i archieve that the
lastname-Textfield now displays the Value of getLastName() from the new,
submitted Model?
In my opinion i tried everything... tried to override the
onModelChange-Event and tryed to set the new Model with an Visitor of
every childfield... but than i
lost my expression from the CPM and only
pages.adminuserpage$u...@17eea10is shown inside the Textfield.

Thanks for any help. Am i totally lost.. or am i on the right way and few
steps before the solution?

I hope you understand my problem... if not so tell me and i will try to
explain it in another way or even better...


Apologise my english, its not my mothers tongue!

- Martin


Easier using of FormComponentFeedbackIndicator for many fields?!

2010-02-04 Thread Martin U
Hi Folks,

i've to implement many form-pages with a lot of (more than 30) input fields,
and each of them should be validated at least of required or not.
but the request is to show the validation-errors behind the depeding
component.. so iam using FormComponentFeedbackIndicator now and everything
works fine with:

searchfield = new RequiredTextFieldString(seachfield, new
PropertyModelString(SearchPanel.this, searchString));
add(searchfield);

indicator = new FormComponentFeedbackIndicator(searchfield_indicator);
indicator.setIndicatorFor(searchfield);
indicator.setOutputMarkupId(true);
indicator.setOutputMarkupPlaceholderTag(true);
add(indicator);

this is an ajax-form so i have to add this to onSubmit too for each
validating field.

protected void onError(AjaxRequestTarget target, Form? form) {
   target.addComponent(indicator);
}


Is there any Hint to easier this implementation?

What i imagine is something like:

searchfield = new *RequiredValidatedTextField*String(seachfield, new
PropertyModelString(SearchPanel.this, searchString));

and inside this child class iam building a indicator

but how could i add the indicator-Span dynamically to the markup and how
could i do the target.addComponent than?


Thanks for any hints.

- Martin


How to add and remove css classes the right way?

2010-02-04 Thread Martin U
Hi Folks,

I'am getting totally confused how to add and remove css classes to and form
my text-input-fields on ajax-form-validation.

At first i try to add two css classes step by step:

IteratorFeedbackMessage iter =
Session.get().getFeedbackMessages().messages(getFeedbackMessageFilter()).iterator();
if(iter.hasNext()){
indicatorFor.add(new SimpleAttributeModifier(class,validation_error));
indicatorFor.add(new SimpleAttributeModifier(class, test));
}

But gets the Markup only with class='test' 

How can i add more than one value to class?

And how can i remove one special css-class from an component if the
validation is okay to this field?


Thanks in Advance for any help.

- Martin


Howto load StringResources from Database for Iternationalization?

2010-01-28 Thread Martin U
Hello Folks,


i don't know if this question was ever done, but i didn't find anything
suitable for me.

In a huge webapplication which is being in the first steps of
implementation, we want to use a Database (table) to store there
any String Resources by locale for translation.

I have been jumping through the class-hierarchy for many hours but i haven't
found the right point to plug-in a ResourceLoader
from Database.

There are some different Interface of them i could imagine This is the
right place but I am not sure at all.

Have i to Implement my own *IResourceSettings*? I hope not, cause the
Implementation Settings looks very complicated to me.
or is it enough to implement *IStringResourceLoader*? But then, where can i
add my own loader to the Chain of processing?

Thanks a lot for any hints. Its very urgently to know and to understand if
wicket is useful for our wishes before we really
decide which framework we want to use.

Please apologise for my English, its not my mothers tongue.

- Matty


Updating Form Elements by Ajax with new POJO-Model

2009-12-16 Thread Martin U
Iam totally confused.

Iam using the Todo-List-Example from here :
http://www.wicket-library.com/wicket-examples/ajax/todo-list.0
to play around with wicket.

This example works, but i want to display a list of Entities from the
Backend and edit one of them with my new-entity-Form.
So i want to click on edit in a row and want to use the *same* *form *as i
use to add a entity. How could i handle this?

I tried sooo much but nothing works right.


The addForm (showForm(target)) function works right. But in public void
showForm(AjaxRequestTarget _t, Functionsbereich el)
i deliver el which is my POJO and i cant figure out how to treat the Form
to use now my new Model...
I tried with modelChange() und mondelChanging() but nothing works =( allways
the empty Form is shown ;(

Thanks a lot for any help!!

private final class FormContainer extends WebMarkupContainer{

private EditForm f;

public FormContainer(String id) {
super(id);
setOutputMarkupId(true);


add(f = (EditForm) new EditForm(form).setVisible(false));
add(new AjaxFallbackLinkObject(link){

@Override
public void onClick(AjaxRequestTarget target) {
showForm(target);
}

});
}

public void showForm(AjaxRequestTarget _t){
f.setVisible(true);
_t.addComponent(this);

}

/** Shows form with entity **/
public void showForm(AjaxRequestTarget _t, Functionsbereich el){
//add(f = new EditForm(link, el));
f.modelChanging();
f.setModel(new CompoundPropertyModelFunctionsbereich(el));


f.modelChanged();
f.setVisible(true);

_t.addComponent(this);

}


}

private final class EditForm extends FormFunctionsbereich{

public EditForm(String id){
this(id, new CompoundPropertyModelFunctionsbereich(new
Functionsbereich()));
}

public EditForm(String id, Functionsbereich _el){
super(id,new CompoundPropertyModelFunctionsbereich(_el) );
}

public EditForm(String id, CompoundPropertyModelFunctionsbereich
_model) {
super(id, _model);


setOutputMarkupId(true);
add( new TextFieldObject(form_text, _model.bind(label)));

//add(new Label(vendor, _model.bind(vendor.name)));


}

}


How to update an ajax form panel?

2009-12-15 Thread Martin U
Hi, iam totally stuck and get confused at all.

In my DB-based application i want to use the common data-table-lists (this
works) with linked action (edit, delete, create what ever)

But i want to edit a clicked entity under my form. So i think i have to
use a panel for this form i want to update ...

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html
xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.sourceforge.net/;
xml:lang=en
lang=en
body
wicket:panel
table
  tr
tdName/td
td wicket:id=panel_name[Name]/td
  /tr
/table
/wicket:panel
/body
/html

But i cant figure out how to Fill this Panel right. Actual i tried it this
way:



public class MyPanel extends Panel {

public final String LABEL_NAME = panel_name;

public MyPanel (String id) {

super(id);
add(new Label(LABEL_NAME));
// TODO Auto-generated constructor stub
}

public MyPanel (String id, Functionsbereich bo){
this(id);
this.setOutputMarkupId(true);

add(new Label(LABEL_NAME, bo.getLabel()));
}

}

and in my page

item.add(
  new AjaxLinkFunctionsbereich(
action,
(IModelFunctionsbereich)
new LoadableDetachableModelFunctionsbereich() {
@Override
protected Functionsbereich load() {
return el;
}
   }){

@Override
public void onClick(AjaxRequestTarget target) {
target.appendJavascript((String)
dialog.open().render());
target.addComponent(new FunctionsbereichPanel(content,
el));
}

});

but this don't work.. it always tell me that markup with ID panel_name is
still registered and has to be unique,
cause i have to define the panel initially as Member in my Page, else wise
the No definition for markup 'panel_name' markup found raises.

//Empty Panel
final FunctionsbereichPanel panel = new FunctionsbereichPanel(content);

I hope anyone understood my problem.

Thanks in Advance and apologise for my English, its not my mothers tongue.


Markup-Edit in Eclipse = wicket:panel is not recognized

2009-10-22 Thread Martin U
Hi Community,

iam totally new to wicket and i want to use eclipse for editing my
wicket-java and markup files.

But the html-validator fools me with this error in the subject. Iam not able
to disable the validation (Window-Preferences-Validation).
Dont know why eclipse is not recognizing my configuration.

Which Editor inside eclipse use you for editing the markup-pages?

Thanks in Advance and apologise my english. Its not my mothers tongue.

- Martin