Re: How to send a Java object to the ModalWindow

2016-10-21 Thread Iamuser
Hello,

I know this is a long overdue thread, but could you please explain how you
did it?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-send-a-Java-object-to-the-ModalWindow-tp2312589p4675862.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: AjaxLink cannot see updated model values

2016-10-13 Thread Iamuser
I have added
txtName.setOutputMarkupId(true);
and
target.add(TestForm.this);

But it is still not working.

txtName.setOutputMarkupId(true);
AjaxLink clearLink = new AjaxLink("clearLink", model)
{
/**
*
*/
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
model.setObject(new TestBean());
TestForm.this.clearInput();
target.add(TestForm.this);
}

};

On Thu, Oct 13, 2016 at 4:52 PM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4675763...@n4.nabble.com> wrote:

> On Thu, Oct 13, 2016 at 3:38 PM, Iamuser <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4675763=0>> wrote:
>
> > Hello,
> >
> > Yes, adding the behavoiur AjaxFormComponentUpdatingBehavior on the text
> > field, solved the issue.
> >
> > Thank you for solution.
> >
> > Now I'm facing following situation.
> > When another link is clicked I need to clear the input fields (so my
> > textfield).
> >
> > I have the following added, but the form just doesn't get cleared.
> > The model is empty, but the page still remains with the text, even after
> > page refresh.
> > Could you please advise?
> >
> >
> > AjaxLink clearLink = new AjaxLink("clearLink",
> model)
> > {
> > /**
> >  *
> >  */
> > private static final long
> > serialVersionUID = 1L;
> >
> > @Override
> > public void
> > onClick(AjaxRequestTarget target) {
> > model.setObject(new
> > TestBean());
> >
> TestForm.this.clearInput();
> >
>
> target.add(TestForm.this);
>
>
> > }
> >
> > };
> >
> > add(clearLink);
> >
> > PS: I hope I have subscribed to the mailing list. I have sent an email
> to
> > users-allow-subscribe
> >
>
> http://wicket.apache.org/help/email.html#user
> Follow the links.
> Once subscribed just send messages to [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675763=1>. Do not use
> Nabble!
>
>
> >
> >
> > Thank you
> >
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> > n4.nabble.com/AjaxLink-cannot-see-updated-model-values-
> > tp4675743p4675761.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675763=2>
> > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675763=3>
> >
> >
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-
> see-updated-model-values-tp4675743p4675763.html
> To unsubscribe from AjaxLink cannot see updated model values, click here
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=4675743=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc1NzQzfC01MzM2MjU4NzI=>
> .
> NAML
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-see-updated-model-values-tp4675743p4675764.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: AjaxLink cannot see updated model values

2016-10-13 Thread Iamuser
Hello,

Yes, adding the behavoiur AjaxFormComponentUpdatingBehavior on the text
field, solved the issue.

Thank you for solution.

Now I'm facing following situation.
When another link is clicked I need to clear the input fields (so my
textfield).

I have the following added, but the form just doesn't get cleared. 
The model is empty, but the page still remains with the text, even after
page refresh.
Could you please advise?


AjaxLink clearLink = new AjaxLink("clearLink", model)
{
/**
 * 
 */
private static final long 
serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget 
target) {
model.setObject(new TestBean());
TestForm.this.clearInput();
}

};

add(clearLink);

PS: I hope I have subscribed to the mailing list. I have sent an email to 
users-allow-subscribe


Thank you


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-see-updated-model-values-tp4675743p4675761.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: AjaxLink cannot see updated model values

2016-10-12 Thread Iamuser
Hello,

Yes, it is dynamic.

Here is the complete code (html and java):

==My test bean==

public class TestBean implements Serializable{

/**
 * 
 */
private static final long serialVersionUID = 1L;


private String name;
private String code;
private Integer id;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}

}

==HTML page==


http://www.w3.org/1999/xhtml;
xmlns:wicket="http://wicket.apache.org/; lang="en" xml:lang="en">







Name:







  <#>  









==JAVA code==
public class TestPage extends Page {

private static final long serialVersionUID = 311508940740808005L;
private static final Logger logger = 
LogManager.getLogger(TestPage.class);
private ReturnObjectPage returnPage = null;

public TestPage(IModel model, final ReturnObjectPage 
returnPage)
{
super(model);
this.returnPage = returnPage;

add(new TestForm("testForm", model));

}

class TestForm extends Form {
/**
 * 
 */
private static final long serialVersionUID = 1L;

public TestForm(String id, IModel model) {
super(id, model);

TextField txtName = new TextField("txtName", new
PropertyModel(getDefaultModel(), "name"));
add(txtName);

AjaxLink testLink = new AjaxLink("testLink",
getModel())
{
/**
 * 
 */
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
System.out.println("ajax in");
System.out.println("test name= " + 
getModelObject().getName());
}

};

add(testLink);
}
}


}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-see-updated-model-values-tp4675743p4675746.html
Sent from the Users forum 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



AjaxLink cannot see updated model values

2016-10-12 Thread Iamuser
Hi,

I have a form backed by a model.
In this form I have and editable textfield and a image.

When clicking on the image I just need to write the value inserted in the
textfield to the console.

However, it does never display the updated value in the textfield.

Here is the html:
 <#>  

Here is the Java code:

AjaxLink testLink = new AjaxLink("testLink", getModel())
{
/**
 * 
 */
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
System.out.println("test link 1" + 
getModelObject().getName());
}
};

Could you please tell me a solution?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-see-updated-model-values-tp4675743.html
Sent from the Users forum 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



AutoCompleteTextField in input form does not display description, but id

2016-10-03 Thread Iamuser
Hello,
I'm using wicket 7.

I have a page with an input form.
The first input field used to be a DropDownChoice.
When user selected the description from the DropDownChoice, then the id was
provided behind the scenes and on form save, the model bounded to the form
was updated.

The new requirement is to replace the DropDownChoice with
AutoCompleteTextField component.

I have managed to implement the AutoCompleteTextField and alow user to
search for description. However after save of form and then refresh, or
after entering the form in edit mode, the value displayed in the
AutoCompleteTextField is the id, not the description.
 
Could you please indicate how to do so that the description is the one
always displayed? 

Thank you so much.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-in-input-form-does-not-display-description-but-id-tp4675629.html
Sent from the Users forum 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



Wicket 6 - How to fill form based on listview selected row

2016-09-17 Thread Iamuser
Hello,

I have a page with a :
1. a listview 
2. an input form 

When first entering the page, the listview displays all the rows from a
table, and the input form is empty.
One of the columns inside the listview is a link component, that when
clicked should refresh the model of the form and show the data for that row
in order to be able to edit it.

Could you please give me some guidance on how to refresh the model of the
form and show the data for the selected row?

Thank you.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-6-How-to-fill-form-based-on-listview-selected-row-tp4675519.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: empty form input after submit

2016-08-09 Thread Iamuser
Hello,

Could you please provide more details?
What do you mean by swapping the model?

Thank you.

On Wed, Aug 3, 2016 at 8:16 PM, ganea iulia <superbiss...@gmail.com> wrote:

> Hello,
> Could you please give me an example of that?
> Thank you
>
> On Sun, Jul 31, 2016 at 3:08 PM, Sven Meier [via Apache Wicket] <
> ml-node+s1842946n4675243...@n4.nabble.com> wrote:
>
>> Hi,
>>
>> Form2 is always working on the same model object.
>>
>> You have to swap its model object once you select one from the list in
>> form1 - either by setting it into form2's model or by passing a model
>> into form2's constructor, so that you can change the contained model
>> object without having to notify form2 of it.
>>
>> Have fun
>>
>> Sven
>>
>>
>> On 31.07.2016 11:29, Iamuser wrote:
>>
>> > Hello,
>> > Here is the code:
>> >
>> > //MyModel is the model for the bean used in both Form1 and Form2
>> >
>> >
>> > final Form2 inputForm = new Form2("inputForm");
>> >inputForm.setOutputMarkupId(true);
>> > add(inputForm);
>> >  MyModel model = new MyModel();
>> > final Form1 listForm = new Form1("listForm", new
>> Model(model));
>> > listForm.setOutputMarkupId(true);
>> > add(listForm);
>> >
>> > // the Form1 and Form2 classes
>> > private class Form1 extends Form {
>> >
>> > /**
>> > *
>> > */
>> > private static final long serialVersionUID = 1L;
>> >
>> > public Form1(String id, IModel listModel) {
>> > super(id, listModel);
>> > final LoadableDetachableModel<List> detachableMyModel = new
>> > LoadableDetachableModel<List>() {
>> >
>> > private static final long serialVersionUID = 0L;
>> >
>> > @Override
>> > protected List load() {
>> > List lstMyModel = //get a list of MyModel
>> > if (lstMyModel != null)
>> > return lstMyModel;
>> > else
>> > return Collections.emptyList();
>> > }
>> > };
>> >
>> > final WebMarkupContainer itemsContainer = new
>> > WebMarkupContainer("myModelItemsContainer");
>> > itemsContainer.setOutputMarkupId(true);
>> > add(itemsContainer);
>> > final ListView listOfMyModel = new
>> > ListView("forEachItem", detachableMyModel) {
>> > private static final long serialVersionUID = 1L;
>> >
>> > @Override
>> > protected void populateItem(ListItem item) {
>> > final MyModel lineItem = item.getModelObject();
>> >
>> > Label lblNumber = new Label("number", lineItem.getNumber());
>> > item.add(lblNumber);
>> >
>> > Label lblAmount = new Label("amount", lineItem.getAmount());
>> > item.add(lblAmount);
>> > TextField txtStatus = new TextField("amount", new
>> > PropertyModel(lineItem, "status"));
>> > item.add(txtStatus);
>> > Button save = new Button("save") {
>> > private static final long serialVersionUID = -6770575803451248943L;
>> >
>> > @Override
>> > public void onSubmit() {
>> > //assign some values and do the save
>> > }
>> > };
>> > item.add(save);
>> > }
>> > };
>> > itemsContainer.add(listOfMyModel);
>> > listOfMyModel.setOutputMarkupId(true);
>> > }
>> > }
>> >
>> > //
>> > private class Form2 extends Form {
>> >
>> > /**
>> > *
>> > */
>> > private static final long serialVersionUID = 1L;
>> >
>> > private IModel getModelObject = new Model (new
>> MyModel());
>> > public InputForm(String id) {
>> > super(id);
>> > final WebMarkupContainer inputTableContainer = new
>> > WebMarkupContainer("tableInput") {
>> > /**
>> > *
>> > */
>> > private static final long serialVersionUID = 1L;
>> >
>> > @Override
>> > public void onConfigure() {
>> > boolean showInputForm = //check if it shout be shown or not
>> > setVisible(showInputForm);
>> > }
>> > };
>> > inputTableContainer.setOutputMarkupId(true);
>> > TextField inputNumber = new TextField("inputNumber",
>> new
>> > PropertyModel(getModelObject, "number"));
>> > inputTableContainer.add(inputNumber);
>> > TextFie

Re: empty form input after submit

2016-08-03 Thread Iamuser
Hello,
Could you please give me an example of that?
Thank you

On Sun, Jul 31, 2016 at 3:08 PM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n4675243...@n4.nabble.com> wrote:

> Hi,
>
> Form2 is always working on the same model object.
>
> You have to swap its model object once you select one from the list in
> form1 - either by setting it into form2's model or by passing a model
> into form2's constructor, so that you can change the contained model
> object without having to notify form2 of it.
>
> Have fun
>
> Sven
>
>
> On 31.07.2016 11:29, Iamuser wrote:
>
> > Hello,
> > Here is the code:
> >
> > //MyModel is the model for the bean used in both Form1 and Form2
> >
> >
> > final Form2 inputForm = new Form2("inputForm");
> >inputForm.setOutputMarkupId(true);
> > add(inputForm);
> >  MyModel model = new MyModel();
> > final Form1 listForm = new Form1("listForm", new Model(model));
> > listForm.setOutputMarkupId(true);
> > add(listForm);
> >
> > // the Form1 and Form2 classes
> > private class Form1 extends Form {
> >
> > /**
> > *
> > */
> > private static final long serialVersionUID = 1L;
> >
> > public Form1(String id, IModel listModel) {
> > super(id, listModel);
> > final LoadableDetachableModel<List> detachableMyModel = new
> > LoadableDetachableModel<List>() {
> >
> > private static final long serialVersionUID = 0L;
> >
> > @Override
> > protected List load() {
> > List lstMyModel = //get a list of MyModel
> > if (lstMyModel != null)
> > return lstMyModel;
> > else
> > return Collections.emptyList();
> > }
> > };
> >
> > final WebMarkupContainer itemsContainer = new
> > WebMarkupContainer("myModelItemsContainer");
> > itemsContainer.setOutputMarkupId(true);
> > add(itemsContainer);
> > final ListView listOfMyModel = new
> > ListView("forEachItem", detachableMyModel) {
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected void populateItem(ListItem item) {
> > final MyModel lineItem = item.getModelObject();
> >
> > Label lblNumber = new Label("number", lineItem.getNumber());
> > item.add(lblNumber);
> >
> > Label lblAmount = new Label("amount", lineItem.getAmount());
> > item.add(lblAmount);
> > TextField txtStatus = new TextField("amount", new
> > PropertyModel(lineItem, "status"));
> > item.add(txtStatus);
> > Button save = new Button("save") {
> > private static final long serialVersionUID = -6770575803451248943L;
> >
> > @Override
> > public void onSubmit() {
> > //assign some values and do the save
> > }
> > };
> > item.add(save);
> > }
> > };
> > itemsContainer.add(listOfMyModel);
> > listOfMyModel.setOutputMarkupId(true);
> > }
> > }
> >
> > //
> > private class Form2 extends Form {
> >
> > /**
> > *
> > */
> > private static final long serialVersionUID = 1L;
> >
> > private IModel getModelObject = new Model (new
> MyModel());
> > public InputForm(String id) {
> > super(id);
> > final WebMarkupContainer inputTableContainer = new
> > WebMarkupContainer("tableInput") {
> > /**
> > *
> > */
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > public void onConfigure() {
> > boolean showInputForm = //check if it shout be shown or not
> > setVisible(showInputForm);
> > }
> > };
> > inputTableContainer.setOutputMarkupId(true);
> > TextField inputNumber = new TextField("inputNumber", new
> > PropertyModel(getModelObject, "number"));
> > inputTableContainer.add(inputNumber);
> > TextField inputAmount = new TextField("inputAmount", new
> > PropertyModel(getModelObject, "amount"));
> > inputTableContainer.add(inputAmount);
> >
> > add(inputTableContainer);
> > }
> >
> > @Override
> > public void onSubmit() {
> > logger.info("onSubmit Input Form");
> >
> > getModelObject.getObject().setDateCreated(new Date());
> > getModelObject.getObject().setCreatedBy(1);
> > getModelObject.getObject().setStatus(1);
> >
> > //do the insert
> > }
> >
> > }
> >
> >
> >
> >
> >
> > On Sun, Jul 31, 2016 at 11:33 AM, Sven Meier [via A

Re: empty form input after submit

2016-07-31 Thread Iamuser
Hello,
Here is the code:

//MyModel is the model for the bean used in both Form1 and Form2


final Form2 inputForm = new Form2("inputForm");
  inputForm.setOutputMarkupId(true);
add(inputForm);
MyModel model = new MyModel();
final Form1 listForm = new Form1("listForm", new Model(model));
listForm.setOutputMarkupId(true);
add(listForm);

// the Form1 and Form2 classes
private class Form1 extends Form {

/**
*
*/
private static final long serialVersionUID = 1L;

public Form1(String id, IModel listModel) {
super(id, listModel);
final LoadableDetachableModel<List> detachableMyModel = new
LoadableDetachableModel<List>() {

private static final long serialVersionUID = 0L;

@Override
protected List load() {
List lstMyModel = //get a list of MyModel
if (lstMyModel != null)
return lstMyModel;
else
return Collections.emptyList();
}
};

final WebMarkupContainer itemsContainer = new
WebMarkupContainer("myModelItemsContainer");
itemsContainer.setOutputMarkupId(true);
add(itemsContainer);
final ListView listOfMyModel = new
ListView("forEachItem", detachableMyModel) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem item) {
final MyModel lineItem = item.getModelObject();

Label lblNumber = new Label("number", lineItem.getNumber());
item.add(lblNumber);

Label lblAmount = new Label("amount", lineItem.getAmount());
item.add(lblAmount);
TextField txtStatus = new TextField("amount", new
PropertyModel(lineItem, "status"));
item.add(txtStatus);
Button save = new Button("save") {
private static final long serialVersionUID = -6770575803451248943L;

@Override
public void onSubmit() {
//assign some values and do the save
}
};
item.add(save);
}
};
itemsContainer.add(listOfMyModel);
listOfMyModel.setOutputMarkupId(true);
}
}

//
private class Form2 extends Form {

/**
*
*/
private static final long serialVersionUID = 1L;

private IModel getModelObject = new Model (new MyModel());
public InputForm(String id) {
super(id);
final WebMarkupContainer inputTableContainer = new
WebMarkupContainer("tableInput") {
/**
*
*/
private static final long serialVersionUID = 1L;

@Override
   public void onConfigure() {
boolean showInputForm = //check if it shout be shown or not
   setVisible(showInputForm);
   }
};
inputTableContainer.setOutputMarkupId(true);
TextField inputNumber = new TextField("inputNumber", new
PropertyModel(getModelObject, "number"));
inputTableContainer.add(inputNumber);
TextField inputAmount = new TextField("inputAmount", new
PropertyModel(getModelObject, "amount"));
inputTableContainer.add(inputAmount);

add(inputTableContainer);
}

@Override
public void onSubmit() {
logger.info("onSubmit Input Form");

getModelObject.getObject().setDateCreated(new Date());
getModelObject.getObject().setCreatedBy(1);
getModelObject.getObject().setStatus(1);

//do the insert
}

}





On Sun, Jul 31, 2016 at 11:33 AM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n467524...@n4.nabble.com> wrote:

> Seems like form2 is showing previous Raw input (which normally is cleared
> on successful submit) or it is holding to the previous Model object.
>
> Hard to tell without seeing the code.
>
> Regards
> Sven
>
>
>
> Am 31. Juli 2016, 10:55, um 10:55, Iamuser <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4675241=0>> schrieb:
>
> >Hello,
> >I'm using wicket 6
> >I have a page with 2 forms: form1 and form2.
> >
> >Form2 is an input form. After I provide input values for the Form2 and
> >submit, in Form1 a listView is populated with a row containing those
> >values.
> >After each Form2 submit, Form2 is made invisible.
> >
> >Now one field in a line from Form1 can be editable. When changed to a
> >certain value and that value submitted, Form2 should be made visible
> >again.
> >
> >The problem is that Form2 is made visible with that edited lines values
> >already present, but it should always appear as an input form with
> >empty
> >input fields.
> >
> >Could you please indicate a solution?
> >Thank you
> >
> >
> >
> >
> >
> >
> >
> >--
> >View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/empty-form-input-after-submit-tp4675240.html
> >Sent from the Users forum mailing list archive at Nabble.com.
> >
> >-
> >To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675241=1>
> >For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675241=2>
>
>
> -

empty form input after submit

2016-07-31 Thread Iamuser
Hello,
I'm using wicket 6
I have a page with 2 forms: form1 and form2.

Form2 is an input form. After I provide input values for the Form2 and
submit, in Form1 a listView is populated with a row containing those values. 
After each Form2 submit, Form2 is made invisible.

Now one field in a line from Form1 can be editable. When changed to a
certain value and that value submitted, Form2 should be made visible again.

The problem is that Form2 is made visible with that edited lines values
already present, but it should always appear as an input form with empty
input fields.

Could you please indicate a solution?
Thank you







--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/empty-form-input-after-submit-tp4675240.html
Sent from the Users forum 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



ProgressBar not showing progress

2016-07-06 Thread Iamuser
Hello, 
I'm using Wicket 7 and I'm trying to do a test form with a progressbar on
it.
Here is my test java class and the html for it.
The protected Progression getProgression() {..} is never called.
The thread increments the progress variable, but as getProgressing is not
being called, the progress is not 
sown.

Java Code:

public TestProgress() {

Form formtest = new Form("formtest");
add(formtest);
formtest.add(new FeedbackPanel("feedbackPanel"));

final ProgressBar bar;
formtest.add(bar = new ProgressBar("progressBar", new 
ProgressionModel() {
private static final long serialVersionUID = 1L;
protected Progression getProgression() {
// progress is an int instance variable defined 
somewhere
else
return new Progression(progress);
}
 }));

bar.setOutputMarkupPlaceholderTag(true);

formtest.add(new IndicatingAjaxButton("submittest", formtest) {
protected void onSubmit(AjaxRequestTarget target, Form form) {
bar.start(target);

new Thread() {
public void run() {
for(int i = 0; i <= 100; i++) {
try {
Thread.sleep(200);
} catch (InterruptedException e) { }
progress = i;
}
}
}.start();
}
});

}

Html code:
 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ProgressBar-not-showing-progress-tp4675040.html
Sent from the Users forum 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



ProgressBar not drawing on the page

2016-07-05 Thread Iamuser
Hello,

I'm using Wicket 7.
I am trying to show a progress bar, while some files are being processed.

The progress percent is showing fine on the page, however, the progressbar
si now drawn on the page:

Here is how it is showing:
 

Here is the Java code:
 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ProgressBar-not-drawing-on-the-page-tp4675036.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: onsubmit gets called after page reload

2016-07-04 Thread Iamuser
Hello,
Yes, and it works well, so thank you so much.



On Mon, Jul 4, 2016 at 5:36 PM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n467502...@n4.nabble.com> wrote:

> The form is checking whether there are any errors before invoking your
> #onSubmit() method.
>
> Have you tried overriding #onConfigure()?
>
> Regards
> Sven
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020p4675028.html
> To unsubscribe from onsubmit gets called after page reload, click here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020p4675030.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: onsubmit gets called after page reload

2016-07-04 Thread Iamuser
Hello,
Please check the image. Hope this is helpful.
Thank you.

On Mon, Jul 4, 2016 at 9:44 AM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n4675021...@n4.nabble.com> wrote:

> Hi,
>
> I'm not sure which code is calling #isVisible() here, a stacktrace would
> help to identify the caller.
>
> Nevertheless it's quite normal for #isVisible() to be called a number of
> times. Thus it's a recommended practice to override #onConfigure()
> instead:
>
> @Override
> public void onConfigure() {
> List docList = documentsModel.getObject();
> setVisible(docList != null && docList.size() > 0);
>     }
>
> Have fun
> Sven
>
>
>
> On 03.07.2016 21:36, Iamuser wrote:
>
> > Hello,
> > Please help me with the following situation:
> > I'm using wicket 6.
> > I have a page and a form.
> > On this form I have an input, and when user hits Upload button, the list
> > with the inputs should be updated.
> >
> > However, there is a strange behaviour:
> > 1. when hitting the submit button, the onsubmit method is not
> immediatelly
> > called, but instead
> > the isVisible() method is called on a repeated number of times, which
> then
> > calls Load() of the LoadableDetachableModel is called.
> > 2. only after that the onSubmit() is finally called.
> >
> > But this behaviour, because of the isVisible() method being called
> before
> > onSubmit() does not display the new item to the list on the page. Only
> after
> > a new refresh of the page it is finally displayed.
> >
> > Here is the html and the java code:
> >
> > private class UploadForm extends Form {
> >
> > private static final long serialVersionUID = 1L;
> >
> > public UploadForm(String id, IModel docmodel) {
> > super(id, docmodel);
> > TextField fileDescription = new
> > TextField("fileDescription", new
> > PropertyModel(getModelObject(), "description"));
> > add(fileDescription);
> >
> > final LoadableDetachableModel<ListDoc>> documentsModel = new
> > LoadableDetachableModel<ListDoc>>() {
> >
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected List load() {
> > return SpringCtx.getAppDB(DocDao.class).selectByParentId(238);
> > }
> > };
> >
> > final WebMarkupContainer documentsContainer = new
> > WebMarkupContainer("documentsContainer");
> > documentsContainer.setOutputMarkupId(true);
> > add(documentsContainer);
> >
> > documentsContainer.add(new ListView("documentList", documentsModel)
> > {
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected void populateItem(ListItem item) {
> > item.add(new Label("document",
> > item.getModelObject().getDescription()));
> > }
> > @Override
> > public boolean isVisible() {
> > List docList = documentsModel.getObject();
> > return docList != null && docList.size() > 0;
> > }
> > }.setOutputMarkupId(true));
> > }
> >
> > @Override
> > public void onSubmit() {
> > logger.debug("this is onsubmit()");
> >
> > Doc d = new Doc();
> >
> > try {
> >  d.setFileName("test_fn");
> > d.setId(SpringCtx.getAppDB(DocDao.class).selectNextId());
> > d.setFileUrl("url");
> > d.setDescription(getModelObject().getDescription());
> > d.setParentId(238);
> >
> > SpringCtx.getAppDB(DocDao.class).insert(d);
> > getModelObject().clear();
> > feedbackPanel.info(getString("upload.document.success"));
> > } catch (Exception e) {
> > logger.error("Error uploading user file", e);
> > feedbackPanel.error(getString("upload.document.error") + " " +
> > ExceptionUtils.getRootCauseMessage(e));
> > }
> > }
> >
> > };
> >
> > <http://apache-wicket.1842946.n4.nabble.com/file/n4675020/1.png>
> >
> > Please help me understand the issure. Thank you in advance.
> >
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675021=0>
> > For additional co

onsubmit gets called after page reload

2016-07-04 Thread Iamuser
Hello,
Please help me with the following situation:
I'm using wicket 6.
I have a page and a form.
On this form I have an input, and when user hits Upload button, the list
with the inputs should be updated.

However, there is a strange behaviour:
1. when hitting the submit button, the onsubmit method is not immediatelly
called, but instead 
the isVisible() method is called on a repeated number of times, which then
calls Load() of the LoadableDetachableModel is called.
2. only after that the onSubmit() is finally called.

But this behaviour, because of the isVisible() method being called before
onSubmit() does not display the new item to the list on the page. Only after
a new refresh of the page it is finally displayed.

Here is the html and the java code:

private class UploadForm extends Form {

private static final long serialVersionUID = 1L;

public UploadForm(String id, IModel docmodel) {
super(id, docmodel);
TextField fileDescription = new
TextField("fileDescription", new
PropertyModel(getModelObject(), "description"));
add(fileDescription);

final LoadableDetachableModel> 
documentsModel = new
LoadableDetachableModel>() {

private static final long serialVersionUID = 1L;

@Override
protected List load() {
return 
SpringCtx.getAppDB(DocDao.class).selectByParentId(238);
}
};

final WebMarkupContainer documentsContainer = new
WebMarkupContainer("documentsContainer");
documentsContainer.setOutputMarkupId(true);
add(documentsContainer);

documentsContainer.add(new 
ListView("documentList", documentsModel)
{
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem item) 
{
item.add(new Label("document",
item.getModelObject().getDescription()));
}
@Override
public boolean isVisible() {
List docList = 
documentsModel.getObject();
return docList != null && 
docList.size() > 0;
}
}.setOutputMarkupId(true));
}

@Override
public void onSubmit() {
logger.debug("this is onsubmit()");

Doc d = new Doc();

try {
d.setFileName("test_fn");

d.setId(SpringCtx.getAppDB(DocDao.class).selectNextId());
d.setFileUrl("url");

d.setDescription(getModelObject().getDescription());
d.setParentId(238);


SpringCtx.getAppDB(DocDao.class).insert(d);
getModelObject().clear();

feedbackPanel.info(getString("upload.document.success"));
} catch (Exception e) {
logger.error("Error uploading user 
file", e);

feedbackPanel.error(getString("upload.document.error") + " " +
ExceptionUtils.getRootCauseMessage(e));
}
}

};

 

Please help me understand the issure. Thank you in advance.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket:enclosure tag : header of table does not dissappear when list is empty.

2016-07-03 Thread Iamuser
Could you please give me an example of that?
Thank you so much

On Sat, Jul 2, 2016 at 11:23 PM, martin-g [via Apache Wicket] <
ml-node+s1842946n4675010...@n4.nabble.com> wrote:

> You need to repaint the enclosure or any of its parents so that it
> disappears in an Ajax request.
> On Jul 2, 2016 3:52 PM, "Iamuser" <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4675010=0>> wrote:
>
> > Hello,
> >
> > I'm having the following issue:
> >
> > I have a form in which I need to upload files.
> > I give path for file, and after hitting upload, a list with the uploaded
> > files should appear.
> > Each file from the list can be deleted.
> > The problems I face is:
> > When deleting all items in the list, the header of the list does not
> > dissapear;
> > I have used the wicket:enclosure tag.
> > If I hit the refresh button, the header goes away.
> > Please check images below with html code and then backend code.
> >
> > <http://apache-wicket.1842946.n4.nabble.com/file/n4675006/1.png>
> >
> > <http://apache-wicket.1842946.n4.nabble.com/file/n4675006/2.png>
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/wicket-enclosure-tag-header-of-table-does-not-dissappear-when-list-is-empty-tp4675006.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675010=1>
> > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4675010=2>
> >
> >
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/wicket-enclosure-tag-header-of-table-does-not-dissappear-when-list-is-empty-tp4675006p4675010.html
> To unsubscribe from wicket:enclosure tag : header of table does not
> dissappear when list is empty., click here
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=4675006=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc1MDA2fC01MzM2MjU4NzI=>
> .
> NAML
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-enclosure-tag-header-of-table-does-not-dissappear-when-list-is-empty-tp4675006p4675016.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Change column visibility or text based on combo selected value

2016-07-02 Thread Iamuser
Here is a test sample of how constructor for Form2 class looks like:
Form2 should update both childId and parentName, when child changes in
form1.
However, I only get the childId updated; parentName does not change.


public Form2(String id, IModel form1model) {
super(id,model);
Label lblChild = new Label("childId", new PropertyModel(form1model,
"Id"));
add(lblChild);
IModel modelParent = null;
if (form1model.getObject().getId() != null) {
Parent par =
SpringCtx.getAppDB(ParentDao.class).selectById(form1model.getObject().getId());
modelParent = new Model(par);
}
else
modelParent = new Model();
Label lblParentName = new Label("parentName", new
PropertyModel(modelParent, "Name"));
add(lblParentName);
}
Thank you for your help.

On Sun, Jul 3, 2016 at 12:06 AM, ganea iulia  wrote:

> Hello,
>
> In the form2 I need to display values from other models than in form1, but
> that are dependent on the values from the form1 model.
>
>
>
>
> On Tue, Jun 28, 2016 at 4:42 PM, Sven Meier [via Apache Wicket] <
> ml-node+s1842946n4674974...@n4.nabble.com> wrote:
>
>> After form submit the whole page will be re-rendered anyway, including
>> your form2. So you should not need to do anything additional here.
>>
>> Make sure your form2 is properly bound to your model objects:
>>
>> https://ci.apache.org/projects/wicket/guide/6.x/guide/modelsforms.html
>>
>> Have fun
>> Sven
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674974.html
>> To unsubscribe from Change column visibility or text based on combo
>> selected value, click here
>> 
>> .
>> NAML
>> 
>>
>
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4675012.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Change column visibility or text based on combo selected value

2016-07-02 Thread Iamuser
Hello,

In the form2 I need to display values from other models than in form1, but
that are dependent on the values from the form1 model.




On Tue, Jun 28, 2016 at 4:42 PM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n4674974...@n4.nabble.com> wrote:

> After form submit the whole page will be re-rendered anyway, including
> your form2. So you should not need to do anything additional here.
>
> Make sure your form2 is properly bound to your model objects:
>
> https://ci.apache.org/projects/wicket/guide/6.x/guide/modelsforms.html
>
> Have fun
> Sven
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674974.html
> To unsubscribe from Change column visibility or text based on combo
> selected value, click here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4675011.html
Sent from the Users forum 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



wicket:enclosure tag : header of table does not dissappear when list is empty.

2016-07-02 Thread Iamuser
Hello,

I'm having the following issue:

I have a form in which I need to upload files. 
I give path for file, and after hitting upload, a list with the uploaded
files should appear.
Each file from the list can be deleted.
The problems I face is:
When deleting all items in the list, the header of the list does not
dissapear; 
I have used the wicket:enclosure tag.
If I hit the refresh button, the header goes away.
Please check images below with html code and then backend code.

 

 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-enclosure-tag-header-of-table-does-not-dissappear-when-list-is-empty-tp4675006.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: jquery does not work in wicket?

2016-06-29 Thread Iamuser
Hi,
I have found my error.

I needed to add 
Instead I was having 

Thank you for your help.

On Tue, Jun 28, 2016 at 5:10 PM, ganea iulia <superbiss...@gmail.com> wrote:

> Hi,
>
> You are indicating to remove the JQuery namespace?
> I have commented out the line:
>  
>
> but it is still of no use.
> When running the application, textboxed do not get colored.
>
> Thank you
>
> On Thu, Jun 23, 2016 at 12:22 PM, Martin Grigorov-4 [via Apache Wicket] <
> ml-node+s1842946n4674960...@n4.nabble.com> wrote:
>
>> This is your HTML template file.
>> If you use Wicket Ajax components and/or behaviors then Wicket also will
>> include jQuery.js in the final HTML that is sent to the browser.
>> Remove your .
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> <a  rel="nofollow" href="https://twitter.com/mtgrigorov">https://twitter.com/mtgrigorov</a>
>>
>> On Thu, Jun 23, 2016 at 11:05 AM, Iamuser <[hidden email]
>> <<a  rel="nofollow" href="http:///user/SendEmail.jtp?type=node&node=4674960&i=0">http:///user/SendEmail.jtp?type=node&node=4674960&i=0</a>>> wrote:
>>
>> > Hi,
>> >
>> > I have e script element for Javascript and one for jquery.
>> >
>> > Please see below.
>> >
>> >
>> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
>> > <html xmlns="<a  rel="nofollow" href="http://www.w3.org/1999/xhtml&quot">http://www.w3.org/1999/xhtml&quot</a>; xmlns:wicket="
>> > <a  rel="nofollow" href="http://wicket.apache.org/&quot">http://wicket.apache.org/&quot</a>; lang="en" xml:lang="en">
>> > <head>
>> >  <style>
>> > input.colorValuesRed {
>> > color: red;
>> > border: 2px solid red;
>> > }
>> > input.colorValuesGrey {
>> > color: grey;
>> > border: 2px solid grey;
>> > }
>> > input.colorValuesGreen {
>> > color: green;
>> > border: 2px solid green;
>> > }
>> > div.paddedRight {
>> > padding-right: 10px;
>> >   border-right: 1px solid #8D8D8D;
>> > }
>> > div.paddedLeft {
>> > padding-left: 10px;
>> > border-left: 1px solid #8D8D8D;
>> > position: relative;
>> > left: -1px;
>> > }
>> >   </style>
>> >   <script src="
>> > <a  rel="nofollow" href="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js">https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js</a>
>> > ">
>> >
>> > 
>> > $(function() {
>> > //var x = parseInt($('#cici').val());
>> > //var tech = $.trim($('#technology-interf').val());
>> > var tech;
>> > var setColor = function() {
>> > var tech =
>> $.trim($('#technology-interf').val());//$('#technology-interf
>> > option:selected').text();
>> > var value = parseInt($(this).val());
>> > var what = (tech == '2G' && value == 4);
>> > if (tech == '2G') {
>> > $(this).toggleClass("colorValuesRed", (value == 4));
>> >   $(this).toggleClass("colorValuesGreen", (value == 1 || value == 2));
>> >   $(this).toggleClass("colorValuesGrey", (value == 3));
>> > }
>> >   if (tech == '3G') {
>> >   $(this).toggleClass("colorValuesRed", (value > -95));
>> > $(this).toggleClass("colorValuesGreen", (value < -97));
>> >   $(this).toggleClass("colorValuesGrey", (value <= -95 && value >= -
>> 97));
>> >   }
>> > if (tech == '4G') {
>> >   $(this).toggleClass("colorValuesRed", (value > -113));
>> >   $(this).toggleClass("colorValuesGreen", (value < -115));
>> >   $(this).toggleClass("colorValuesGrey", (value <= -113 && value >=
>> -115));
>> > }
>> > }
>> >//tech = $.trim($('#technology-interf').val());
>> > var checkAll = function() {
>> > //tech = $.trim($('#technology-interf').val());
>> > $("#rssi_table tbody tr td:last-child input").each(setColor);
>> > }
>> > $("#rssi_table tbody tr td:last-child input").change(setColor);
>> > $('#technology-interf').change(checkAll);
>> > checkAll();
>> > });
>> >   
>> >
>> >
>> > 
>> >
>> > 
>> > 
>> > 
>> > var wasSubmitted = false;
>> >   function checkBeforeSubmit(){
>> > if(!wasSubmitted) {
>> >   wasSubmitted = true;
>> >   return wasSubmitted;
>> > }
>> > return false;
>> >   }
>> >  
>> >
>> > On Thu, Jun 23, 2016 at 11:15 AM, Martin Grigorov-4 [via Apache Wicket]
>> <
>> > [hidden email] <http:///user/SendEmail.jtp?type=node=4674960=1>>
>> wrote:
>> >
>> > > Hi,
>> > >
>> > > Wicket itself uses jQuery to do its work, so jQuery works with
>> Wicket!
>> > :-)
>> > >
>> > > Make sure you don't have two 

Re: Change column visibility or text based on combo selected value

2016-06-28 Thread Iamuser
Hi,
Thank you for the help.
Now the requirement has changes, to update form2 after the submit of form1.
On form1:
SubmitLink lnk = new SubmitLink("saveSubmitLink") {
---
}
form1.add(lnk);

So, after the save of form1, I need to refresh the date on form2.

Could you please advise?

Thank you so much.

On Wed, Jun 22, 2016 at 3:37 PM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n4674953...@n4.nabble.com> wrote:

> Hi,
>
> you're using a DropDownChoice? Then you have to use
> AjaxFormComponentUpdatingBehavior (note no "Choice" here).
>
> AjaxFormChoiceComponentUpdatingBehavior is to be used with Wicket input
> components which have multiple  tags in the resulting HTML.
>
> Have fun
> Sven
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674953.html
> To unsubscribe from Change column visibility or text based on combo
> selected value, click here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674971.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Change font and border based on value

2016-06-28 Thread Iamuser
Hello,
Thank you so much for this.
However the color does not change if I change the input and leave the text
box.
For that, I was thinking of adding on the textbox component.

add(new AjaxFormComponentUpdatingBehavior("onchange")

Is there any simpler way to have both?
1. when page loads, set the color of existing textbox values. (works with
 override onComponentTag)
2. when editing the textbox values inside the page, change the color
accordinglly (works with AjaxFormComponentUpdatingBehavior)

Thank you.

On Tue, Jun 28, 2016 at 11:15 AM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4674966...@n4.nabble.com> wrote:

> Hi,
>
> You can do something like:
>
> new TextField("someId", ...) {
>   @Override protected void onComponentTag(ComponentTag tag) {
>  super.onComponentTag(tag);
>  int value = getModelObject();
>  if (value < 0 || value > 10) {
> tag.append("style", "color:blue", ";");
>  } else if (value == 4 || value == 5) {
> tag.append("style", "color:red", ";");
>  }
>   }
> }
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jun 28, 2016 at 9:02 AM, Iamuser <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4674966=0>> wrote:
>
> > Hello,
> > I use wicket 6.
> >
> > I need to change the font and border of 6 input texts based on their
> value.
> > For example:
> > - if value is 4 or 5 - change the color to RED.
> > - if value <0 or >10 - change the color to BLUE.
> >
> > In order to change the color I have used:
> > new AttributeAppender("style", Model.of("color: red;"), " ")
> >
> > Please let me know how to change the color based on the values that are
> set
> > in the input texts.
> > Thank you.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/Change-font-and-border-based-on-value-tp4674965.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4674966=1>
> > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4674966=2>
> >
> >
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Change-font-and-border-based-on-value-tp4674965p4674966.html
> To unsubscribe from Change font and border based on value, click here
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=4674965=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc0OTY1fC01MzM2MjU4NzI=>
> .
> NAML
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-font-and-border-based-on-value-tp4674965p4674967.html
Sent from the Users forum 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



Change font and border based on value

2016-06-28 Thread Iamuser
Hello,
I use wicket 6.

I need to change the font and border of 6 input texts based on their value.
For example:
- if value is 4 or 5 - change the color to RED.
- if value <0 or >10 - change the color to BLUE.

In order to change the color I have used: 
new AttributeAppender("style", Model.of("color: red;"), " ")

Please let me know how to change the color based on the values that are set
in the input texts.
Thank you.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-font-and-border-based-on-value-tp4674965.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: jquery does not work in wicket?

2016-06-23 Thread Iamuser
Hi,

I have e script element for Javascript and one for jquery.

Please see below.



http://www.w3.org/1999/xhtml; xmlns:wicket="
http://wicket.apache.org/; lang="en" xml:lang="en">

 
input.colorValuesRed {
color: red;
border: 2px solid red;
}
input.colorValuesGrey {
color: grey;
border: 2px solid grey;
}
input.colorValuesGreen {
color: green;
border: 2px solid green;
}
div.paddedRight {
padding-right: 10px;
  border-right: 1px solid #8D8D8D;
}
div.paddedLeft {
padding-left: 10px;
border-left: 1px solid #8D8D8D;
position: relative;
left: -1px;
}
  
  https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js";>


$(function() {
//var x = parseInt($('#cici').val());
//var tech = $.trim($('#technology-interf').val());
var tech;
var setColor = function() {
var tech = $.trim($('#technology-interf').val());//$('#technology-interf
option:selected').text();
var value = parseInt($(this).val());
var what = (tech == '2G' && value == 4);
if (tech == '2G') {
$(this).toggleClass("colorValuesRed", (value == 4));
  $(this).toggleClass("colorValuesGreen", (value == 1 || value == 2));
  $(this).toggleClass("colorValuesGrey", (value == 3));
}
  if (tech == '3G') {
  $(this).toggleClass("colorValuesRed", (value > -95));
$(this).toggleClass("colorValuesGreen", (value < -97));
  $(this).toggleClass("colorValuesGrey", (value <= -95 && value >= - 97));
  }
if (tech == '4G') {
  $(this).toggleClass("colorValuesRed", (value > -113));
  $(this).toggleClass("colorValuesGreen", (value < -115));
  $(this).toggleClass("colorValuesGrey", (value <= -113 && value >= -115));
}
}
   //tech = $.trim($('#technology-interf').val());
var checkAll = function() {
//tech = $.trim($('#technology-interf').val());
$("#rssi_table tbody tr td:last-child input").each(setColor);
}
$("#rssi_table tbody tr td:last-child input").change(setColor);
$('#technology-interf').change(checkAll);
checkAll();
});
  







var wasSubmitted = false;
  function checkBeforeSubmit(){
if(!wasSubmitted) {
  wasSubmitted = true;
  return wasSubmitted;
}
return false;
  }
 

On Thu, Jun 23, 2016 at 11:15 AM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4674958...@n4.nabble.com> wrote:

> Hi,
>
> Wicket itself uses jQuery to do its work, so jQuery works with Wicket! :-)
>
> Make sure you don't have two 

jquery does not work in wicket?

2016-06-23 Thread Iamuser
Hi,
I'm using wicket 6.

I have the following requirement: to change the color of some input texts
based on the value selected from a combobox and also on the values entered
in these input texts.

For examble: 
*if I select 'A' and type 1 in the input text, the font color should be red.
*if I select 'A' and type 10 in the input text, the font color should be
green.

*if I select 'B' and type 1 in the input text, the font color should be
grey.
*if I select 'B' and type 10 in the input text, the font color should be
yellow.

I have made a JQuery script, and everything works fine when loading the
static html file.
But when running the application and accessing this page, nothing works
anymore. 

Do you have a hint on where to search for the problem?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/jquery-does-not-work-in-wicket-tp4674957.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Change column visibility or text based on combo selected value

2016-06-22 Thread Iamuser
Hi,
Thank you for the tip.

One issue that I'm facing now is that the listView is in one form on the
page (form1), and the table with the column is in another form on the same
page (form2).

=If in my form1 I call:

itemSelect.add(new AjaxFormChoiceComponentUpdatingBehavior() {
private static final long serialVersionUID = 8119676745783499408L;

@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(form2);
}
});


The following error is thrown:

Caused by: org.apache.wicket.WicketRuntimeException: Behavior
gui.proc.management.interference.Page1$Form1$5 can only be added to an
instance of a RadioChoice/CheckboxChoice/RadioGroup/CheckGroup

Thank you so much for your help.


On Mon, Jun 20, 2016 at 3:49 PM, Sven Meier [via Apache Wicket] <
ml-node+s1842946n4674945...@n4.nabble.com> wrote:

> Hi,
>
> you should use a column that always displays the correct text:
>
>   new AbstractColumn(Model.of("Text")) {
> public void populateItem(Item cellItem, String
> componentId, IModel rowModel) {
>   cellItem.add(new Label(componentId), new
> AbstractReadOnlyModel() {
> public String getObject() {
>   return getColumnText();
> }
>   });
> }
>   }
>
> This way you just have to update the whole table via Ajax when your
> dropDown changes, e.g.
>
>   dropDown.add(new AjaxFormChoiceComponentUpdatingBehavior() {
> protected void onUpdate(AjaxRequestTarget target) {
>   target.add(table);
> }
>   });
>
> Hope this helps
> Sven
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674945.html
> To unsubscribe from Change column visibility or text based on combo
> selected value, click here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674952.html
Sent from the Users forum 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



listview with check box does not update model when checked

2016-06-21 Thread Iamuser
Hi,

I have 3 tables
tb1 (id_tb1, description);
tb2 (id_tb1, id_tb3);
tb3(id_tb3, description);

tb3 is a dictionary table, with 3 rows;

I need a form where I can update, insert values in tb1.
On this form there is a listview with checkboxes, that are bound to the tb3. 
When the user enters the form, and checks one of the checkboxes bound to tb3
records, one new record should also be inserted to tb2.

However, I cannot get which of the values was checked. 
In the bean for tb3, I have added a boolean property /selectTB3/, that
should retain true when checkbox checked :

final LoadableDetachableModel> tb3ListModel = new
LoadableDetachableModel>() {
private static final long serialVersionUID = 8374568334297082903L;

@Override
protected List< TB3> load() {

return SpringCtx.getAppDB(TB3Dao.class).select();
}

};


ListView< TB3> att = new ListView< TB3>("listTB3", attendantListModel) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem< TB3> item) {
TB3 myatt = (TB3)item.getModelObject();
CheckBox checkTB3 = new CheckBox("checkTB3", new
PropertyModel(myatt, "selectTB3")); 

item.add(checkTB3);
item.add(new Label("description", new
PropertyModel(item.getModelObject(), "description")));

}
};
att.setReuseItems(true);
add(att);

Inside the OnSubmit for the form, I try to get the list of TB3 but the
selectTB3 column is always null, even if I have checked one or two of the
checkboxes.

List lstAtt = att.getModelObject();

Could you please help me?

Thank you in advance.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/listview-with-check-box-does-not-update-model-when-checked-tp4674950.html
Sent from the Users forum 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



Change column visibility or text based on combo selected value

2016-06-20 Thread Iamuser
Hi,
I'm using wicket 6.

I have a combo and a table that contains a fixed number of rows and columns.
Based on the value chosen inside the combo, the first column of the table
should change it's text. 
Basically the first column contains in every cell, the same text, that needs
to change when something else is selected in the combo.


Could you please advise what is the best approach to do this?
Thank you

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Component disabled if it contains data

2016-04-20 Thread Iamuser
Hello, 

Thank you all for the help. 

Is there a way to only rerender the two components (inputtext fields) and
not all the page? 
  
So submit should remain like this: 

@Override 
protected void onSubmit() { 
//other stuff 
}

The logic is that I should be able to commit changes only if both input
textfields are filled with data, or if both are empty. If both have data,
then components should become disabled, if both are empty, then the
components should remain editable, if only one of them has data then I
should not be let to submit any change.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Component-disabled-if-it-contains-data-tp4674313p4674321.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Component disabled if it contains data

2016-04-20 Thread Iamuser
Hello,

Thank you all for the help.

Is there a way to only rerender the two components (inputtext fields) and
not all the page?
 
So submit should remain like this:

@Override
protected void onSubmit() {
//other stuff
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Component-disabled-if-it-contains-data-tp4674313p4674320.html
Sent from the Users forum 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



Component disabled if it contains data

2016-04-19 Thread Iamuser
Hello,
I'm using Wicket 6, with Java 1.7.
I'm new to Wicket and I would like to know what is the best way to implement
the following:
-I have a webpage with several input fields bound to a db table, and a
submit button.
- two of the fields can be empty when submitting the changes to the db.
- however, if the fields are filled once, after submitting the page, the
user should not be allowed anymore to change the values(even if leaves and
reenters the page for the same registrations)

Could you please tell me what is the best way to achieve this? 

What I have done so far is:
- on the page load, when the wicket components are added to the page, I
check if the db fields have values, and if they do, then I set the
components to disabled:

Component myComp = new TextField("project", new
PropertyModel(getModelObject(), "project"));
if (getModelObject().getProject() != null)  
myComp.setEnabled(false);
dtForm.add(myComp ).add(RangeValidator.range(0, 9));

- also on submit, I check if I have a value in my component and if yes, set
the component to disable:
if (getModelObject().getProject() != null ){
 Component myComp  = get("project");
 if (myComp.isEnabled()){
myComp.setEnabled(false);
dtForm.replace(tf);
 }
}

what bothers me is that I need to do all the validation again in the submit
button, every time the submit will be pressed.

Is there a better way?

Thank you

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Component-disabled-if-it-contains-data-tp4674313.html
Sent from the Users forum 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