How can I update a Wicket DataView with AJAX?

I need to AJAXfully filter by users list of PsDoctrans which is shown in a Wicket DataView.

final TextField txtName= new TextField("user");

final PSDocDP dp = new PSDocDP("username");
DataView<PsDoctrans> dataView = new DataView<PsDoctrans>("unproc", dp)
{
    @Override
    protected void populateItem(final Item<PsDoctrans> item)
    ...
};

PSDocDP is:

public class PSDocDP extends SortableDataProvider<PsDoctrans>
{...}

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

AjaxButton butFind=new AjaxButton("find"){
    @Override
    protected void onSubmit(AjaxRequestTarget target, Form<?> form)
    {               
        String value=(String)txtName.getModelObject();
        dp = new PSDocDP(value);

        target.addComponent(wmc);
    }
};

After submitting, nothing changes. The program shows some data, but it isn't filtering. How can I make filtering happen?

Answers


I use constructions comparable to this, so it should work.

Do you really create a new "dp" object in the callback. You should simply change the state of the data provider - how should the component ever get the changed provider.

    @Override
    protected void onSubmit(AjaxRequestTarget target, Form<?> form)
    {               
        String value=(String)txtName.getModelObject();
-->        dp.setName(value);
        target.addComponent(wmc);
    }

Need Your Help

Library to extract data from html string

c# .net html html-parsing

Is there any free/open source c# libraries to extract data from html?

Is it possible to modify PDF Form Field Names?

.net pdf itextsharp abcpdf

Here's the situation. I have a PDF with automatically generated pdf form field names. The problem is that these names are not very user friendly. They look something like :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.