Re: how to disable the table while it is empty in wicket

2014-06-23 Thread kumar ramanathan
Hi Martin,
My Issue got resolved. I have used the empty list .

Thanks,
Kumar

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308p4666355.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: how to disable the table while it is empty in wicket

2014-06-19 Thread kumar ramanathan
Martin,

I understand we use the empty list.Kindly give me some example code to
achieve this. Am trying this for a long time , still struggling. Please
share some simple example on this. 

Thanks,
Kumar

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308p4666318.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: how to disable the table while it is empty in wicket

2014-06-19 Thread Martin Grigorov
Hi,

Sorry. I don't have time to write sample applications for all the problems
Wicket users have.
If you create a mini application and share it with us (as attachment or a
project at GitHub/BitBucket/...) then we could check it, fix it and send it
back to you.

Martin Grigorov
Wicket Training and Consulting


On Thu, Jun 19, 2014 at 10:06 AM, kumar ramanathan kumarramana...@gmail.com
 wrote:

 Martin,

 I understand we use the empty list.Kindly give me some example code to
 achieve this. Am trying this for a long time , still struggling. Please
 share some simple example on this.

 Thanks,
 Kumar

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308p4666318.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




how to disable the table while it is empty in wicket

2014-06-18 Thread kumar ramanathan


Hi Friends,
Finally i have created a program to display table with links with guidance
of you all.I have the below program which displays the data in a table
format.While the page loads initially an empty table will be shown , once
the submit button is pressed the data is populated in the table.I would like
to disable the empty table while the page loads initially. I am not aware of
ajax, also i have tried dataview.setenabled(false), it did not work.Please
help me.

 
Code:
Homepage.java:

public class HomePage extends WebPage {
  ArrayListAssignmentDB assignments = new ArrayListAssignmentDB();
  DataViewListlt;AssignmentDB dataView ;
  private String memberNumber,lossNumber;
  public HomePage(){
PropertyModel memberIdModel=new PropertyModel(this,memberNumber);
PropertyModel lossIdModel=new PropertyModel(this,lossNumber);
TextField memberIdField = new TextField(memberId,memberIdModel);
TextField lossIdField = new TextField(lossId,lossIdModel);
assignments.add(new AssignmentDB());
  dataView = new DataViewListlt;AssignmentDB(AssignmentList, new
ListDataProvider(assignments)) {
public void populateItem(ItemListlt;AssignmentDB item) {
 final AssignmentDB  assign = (AssignmentDB) item.getModelObject();
 item.add(new Label(AOmemberId, assign.getMemberId()));
 item.add(new Label(AOlossId, assign.getLossId()));
   Link link1 = new Link(AssignmentIdLink){
 public void onClick()
   {
 System.out.println(Linkclicked+ assign.getMemberId() +   +
assign.getLossId() );
//this.setResponsePage(new Output() );
//System.out.println(Linkclicked );
}//populateitem
 };//dataview
   item.add(link1);
   link1.add(new Label(AOassignmentId, assign.getAssignmentId()));
   item.add(new Label(AOdol, assign.getDOL()));
  }
};

dataView.setEnabled(true);

Form form=new Form(form1){
public void onSubmit(){
assignments.clear();
  assignments.add(new AssignmentDB(1234,001,1357,10/12/1067));
  assignments.add(new AssignmentDB(1234,003,1357,10/12/1067));
dataView.setEnabled(true);
dataView = new DataViewListlt;AssignmentDB(AssignmentList, new
ListDataProvider(assignments)) {
public void populateItem(ItemListlt;AssignmentDB item) {
final AssignmentDB assign = (AssignmentDB) 
item.getModelObject();
  item.add(new Label(AOmemberId, assign.getMemberId()));
   item.add(new Label(AOlossId, assign.getLossId()));
   Link link1 = new Link(AssignmentIdLink){
   public void onClick(){
 System.out.println(Linkclicked+ assign.getMemberId() +   +
assign.getLossId() );
   }
   };
item.add(link1);
  link1.add(new Label(AOassignmentId, assign.getAssignmentId());
  item.add(new Label(AOdol, assign.getDOL()));
   }
};

}//form submit
};//form

form.add(dataView);
dataView.setEnabled(false);
   
   
   form.add(memberIdField);
   form.add(lossIdField);
   add(form);
   }//constructor



 public void setMemberNumber(String x){
this.memberNumber=x;
 }
 public void setLossNumber(String x){
this.lossNumber=x;
 }
 public String getMemberNumber(){
return this.memberNumber;
 }
 public String getLossNumber(){
return this.lossNumber;
 }

}//class



HTML FILE:

!DOCTYPE html PUBLIC quot;-//W3C//DTD HTML 4.01 Transitional//ENquot;
quot;http://www.w3.org/TR/html4/loose.dtdquot;
html
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8
titleEstimateSearcher/title
/head
body

form wicket:id=form1
Member Number input type=text wicket:id=memberIdbr/
Loss Number   input type=text wicket:id=lossIdbr/
input type=submit value=search 



MemberNo
LossNo
AssignmentNo
dol

   div wicket:id=AssignmentList
 



  span wicket:id=AOassignmentId # [Address]  

 
   /div
  

 /form

/body
/html

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308.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: how to disable the table while it is empty in wicket

2014-06-18 Thread Martin Grigorov
new DataView() {
@Override
public void onConfigure() {
  super.onConfigure();
  setVisible(getDataProvider().size()  0);
}

}

Martin Grigorov
Wicket Training and Consulting


On Wed, Jun 18, 2014 at 11:24 AM, kumar ramanathan kumarramana...@gmail.com
 wrote:



 Hi Friends,
 Finally i have created a program to display table with links with guidance
 of you all.I have the below program which displays the data in a table
 format.While the page loads initially an empty table will be shown , once
 the submit button is pressed the data is populated in the table.I would
 like
 to disable the empty table while the page loads initially. I am not aware
 of
 ajax, also i have tried dataview.setenabled(false), it did not work.Please
 help me.


 Code:
 Homepage.java:

 public class HomePage extends WebPage {
   ArrayListAssignmentDB assignments = new ArrayListAssignmentDB();
   DataViewListlt;AssignmentDB dataView ;
   private String memberNumber,lossNumber;
   public HomePage(){
 PropertyModel memberIdModel=new PropertyModel(this,memberNumber);
 PropertyModel lossIdModel=new PropertyModel(this,lossNumber);
 TextField memberIdField = new TextField(memberId,memberIdModel);
 TextField lossIdField = new TextField(lossId,lossIdModel);
 assignments.add(new AssignmentDB());
   dataView = new DataViewListlt;AssignmentDB(AssignmentList, new
 ListDataProvider(assignments)) {
 public void populateItem(ItemListlt;AssignmentDB item) {
  final AssignmentDB  assign = (AssignmentDB) item.getModelObject();
  item.add(new Label(AOmemberId, assign.getMemberId()));
  item.add(new Label(AOlossId, assign.getLossId()));
Link link1 = new Link(AssignmentIdLink){
  public void onClick()
{
  System.out.println(Linkclicked+ assign.getMemberId() +   +
 assign.getLossId() );
 //this.setResponsePage(new Output() );
 //System.out.println(Linkclicked );
 }//populateitem
  };//dataview
item.add(link1);
link1.add(new Label(AOassignmentId, assign.getAssignmentId()));
item.add(new Label(AOdol, assign.getDOL()));
   }
 };

 dataView.setEnabled(true);

 Form form=new Form(form1){
 public void onSubmit(){
 assignments.clear();
   assignments.add(new
 AssignmentDB(1234,001,1357,10/12/1067));
   assignments.add(new
 AssignmentDB(1234,003,1357,10/12/1067));
 dataView.setEnabled(true);
 dataView = new DataViewListlt;AssignmentDB(AssignmentList,
 new
 ListDataProvider(assignments)) {
 public void populateItem(ItemListlt;AssignmentDB item) {
 final AssignmentDB assign = (AssignmentDB)
 item.getModelObject();
   item.add(new Label(AOmemberId, assign.getMemberId()));
item.add(new Label(AOlossId, assign.getLossId()));
Link link1 = new Link(AssignmentIdLink){
public void onClick(){
  System.out.println(Linkclicked+ assign.getMemberId() +
   +
 assign.getLossId() );
}
};
 item.add(link1);
   link1.add(new Label(AOassignmentId, assign.getAssignmentId());
   item.add(new Label(AOdol, assign.getDOL()));
}
 };

 }//form submit
 };//form

 form.add(dataView);
 dataView.setEnabled(false);


form.add(memberIdField);
form.add(lossIdField);
add(form);
}//constructor



  public void setMemberNumber(String x){
 this.memberNumber=x;
  }
  public void setLossNumber(String x){
 this.lossNumber=x;
  }
  public String getMemberNumber(){
 return this.memberNumber;
  }
  public String getLossNumber(){
 return this.lossNumber;
  }

 }//class



 HTML FILE:

 !DOCTYPE html PUBLIC quot;-//W3C//DTD HTML 4.01 Transitional//ENquot;
 quot;http://www.w3.org/TR/html4/loose.dtdquot;
 html
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8
 titleEstimateSearcher/title
 /head
 body

 form wicket:id=form1
 Member Number input type=text wicket:id=memberIdbr/
 Loss Number   input type=text wicket:id=lossIdbr/
 input type=submit value=search



 MemberNo
 LossNo
 AssignmentNo
 dol

div wicket:id=AssignmentList




   span wicket:id=AOassignmentId # [Address]


/div


  /form

 /body
 /html

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308.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: how to disable the table while it is empty in wicket

2014-06-18 Thread kumar ramanathan
Hi Martin,

I have added that code in the dataview as below.

dataView = new DataViewListlt;AssignmentDB(AssignmentList, new
ListDataProvider(assignments)) {
   public void onConfigure() {
 *super.onConfigure();* *//am getting error here*
  setVisible(getDataProvider().size()  1);
} 
   public void populateItem(ItemListlt;AssignmentDB 
item) {
   .
   }
  };

Also in the above code in the thread above , i have add a assignmentdb
object with empty values before form submit code, so it is loaded a table
with empty row. while onsubmit i have removed the list values and populate
the table with new values. I believe I should not add the empty values
first.How to correct this ,i have done this because wicket says
labels,dataview Ids are not defined,dataview should not be null am not aware
of how to handle the null values.  please advice and help me. 

code snap:

assignments.add(new AssignmentDB());
 dataView = new DataViewListlt;AssignmentDB(AssignmentList, 
new
ListDataProvider(assignments)) {
 public void populateItem(ItemListlt;AssignmentDB item) {
  final AssignmentDB  assign = (AssignmentDB) 
item.getModelObject();

item.add(new Label(AOmemberId, assign.getMemberId()));
item.add(new Label(AOlossId, assign.getLossId()));

  }};




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308p4666316.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: how to disable the table while it is empty in wicket

2014-06-18 Thread Martin Grigorov
Hi,

On Thu, Jun 19, 2014 at 7:06 AM, kumar ramanathan kumarramana...@gmail.com
wrote:

 Hi Martin,

 I have added that code in the dataview as below.

 dataView = new DataViewListlt;AssignmentDB(AssignmentList, new
 ListDataProvider(assignments)) {
public void onConfigure() {
  *super.onConfigure();* *//am getting error here*


What is the error ?


   setVisible(getDataProvider().size()  1);
 }
public void
 populateItem(ItemListlt;AssignmentDB item) {
.
}
   };

 Also in the above code in the thread above , i have add a assignmentdb
 object with empty values before form submit code, so it is loaded a table
 with empty row. while onsubmit i have removed the list values and populate
 the table with new values. I believe I should not add the empty values
 first.How to correct this ,i have done this because wicket says
 labels,dataview Ids are not defined,dataview should not be null am not
 aware


You should pass an empty IDataProvider.
In your case an empty list.


 of how to handle the null values.  please advice and help me.

 code snap:

 assignments.add(new AssignmentDB());
  dataView = new
 DataViewListlt;AssignmentDB(AssignmentList, new
 ListDataProvider(assignments)) {
  public void populateItem(ItemListlt;AssignmentDB item) {
   final AssignmentDB  assign = (AssignmentDB)
 item.getModelObject();

 item.add(new Label(AOmemberId, assign.getMemberId()));
 item.add(new Label(AOlossId, assign.getLossId()));

   }};




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/how-to-disable-the-table-while-it-is-empty-in-wicket-tp4666308p4666316.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