Re: Checking/Dechecking a checkbox multiple choice

2016-01-12 Thread smoothe19
Yes I ended up having to do the below.. basically where i initialize the
variables for storing the values selected pre-select some based on if it was
already toggled in the database


private ArrayList evDecisionsSelect;
private ArrayList mpDecisionsSelect;

evDecisionsSelect = new ArrayList(
evSelectors);
mpDecisionsSelect = new ArrayList(mpSelectors);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Checking-Dechecking-a-checkbox-multiple-choice-tp4673251p4673278.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: Checking/Dechecking a checkbox multiple choice

2016-01-11 Thread smoothe19
Can you display an example?

 I essentially want to be able to have some of the checkboxes checked (based
on a boolean in database) when displayed on the screne 
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Checking-Dechecking-a-checkbox-multiple-choice-tp4673251p4673257.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



Checking/Dechecking a checkbox multiple choice

2016-01-11 Thread smoothe19
How can I check or uncheck one checkbox item from a checkboxmultiple choice

I tried mpCheckBoxes.get(0).setDefaultModel(new Model<>(true)); and also
mpCheckBoxes.get(0).setDefaultObjectModel(new Model<>(true)); both threw an
error




List mpDECISIONS = new ArrayList();


CheckBoxMultipleChoice mpCheckBoxes = 
new CheckBoxMultipleChoice(
 "mpToggles", new Model(mpDecisionsSelect),
mpDECISIONS);

 for (JobAdvStates advanceState: advStatesList){
   
if (advanceState.getRecordState().equals("MP") ){
mpDECISIONS.add(advanceState);
}
 
 }


  
fieldEditForm.add(mpCheckBoxes); 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Checking-Dechecking-a-checkbox-multiple-choice-tp4673251.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



Adding line breaks in MessageDialog

2015-11-18 Thread smoothe19
How can I add line breaks in the message content of a message dialog?

I have tried
String message = "Text here: More text " ;
  Dialog.setEscapeModelStrings(false);
  Dialog.setModelObject(message);

failed to work

HTML:


java:
private void createDialog(){
Dialog = new MessageDialog("dialog", "Information", "Text Here 
Text",
  DialogButtons.YES_NO, DialogIcon.WARN) {
  

 public void onClose(AjaxRequestTarget target, DialogButton button)
{
   
 
  }
   };

   add(Dialog);
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-line-breaks-in-MessageDialog-tp4672659.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



Inserting/Persisting data into the DB

2015-08-26 Thread smoothe19
Having trouble getting my setTestValue method to persist my data in the db ..
i do not see any exceptions but data is not hitting the database.. I am
using Hibernate and postgres db


@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
@Service
public class TestValueService implements ITestValueService
{
   /**
* 
*/
   private static final long serialVersionUID = -1027211428586214287L;

   @Autowired
   GenericDao genericDao;

   private static final Logger LOG =
Logger.getLogger(TestValueService.class);
   private TestValue defaultValue;
 
   public TestValueService()
   {
  
   }

   @Transactional(readOnly = false) 
   private void setTestValue(TestValue defaultValue){
  genericDao.makePersistent(defaultValue);
  LOG.info(ballingss);
   }
   /*
* Method to read the defaults csv file and store into the common table
*/
   @Override
   //@Transactional(readOnly = false)
   public void readCSVFile(String fileLocation, Long clientJobId){
  String csvFile = fileLocation;
  BufferedReader br = null;
  String line = ;
  String cvsSplitBy = ,;

  try {
 br = new BufferedReader(new FileReader(csvFile));
 while ((line = br.readLine()) != null) {

// use comma as separator
String[] currentLine = line.split(cvsSplitBy);

   
TestValue defaultValue = new TestValue();
Date date = new Date();   
defaultValue.setClient_job_id(clientJobId);
defaultValue.setCreate_dt(date);
defaultValue.setActive(true);
defaultValue.setDef_keyfield(currentLine[0].toUpperCase());
defaultValue.setDef_value(currentLine[1].toUpperCase());
setTestValue(defaultValue);

 }

  } catch (FileNotFoundException e) {
 LOG.error(File Not found );
  } catch (IOException e) {
 e.printStackTrace();
  } finally {
 if (br != null) {
try {
   br.close();
} catch (IOException e) {
   e.printStackTrace();
}
 }
  }

   }
   
 
   

}


here is the table object:

@Entity
@Table(name = TEST_VALUE)
public class TestValue implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator =
default_values_def_id_seq)
@SequenceGenerator(name = default_values_def_id_seq, sequenceName =
default_values_def_id_seq)
private Long def_id;

private Long client_job_id;

@Temporal(TemporalType.TIMESTAMP)
private Date create_dt;

@Basic
private String def_keyfield;

@Basic
private String def_value;

@Basic
boolean active  = false;

   public Long getDef_id()
   {
  return def_id;
   }

   public void setDef_id(Long def_id)
   {
  this.def_id = def_id;
   }

   public Long getClient_job_id()
   {
  return client_job_id;
   }

   public void setClient_job_id(Long client_job_id)
   {
  this.client_job_id = client_job_id;
   }

   public Date getCreate_dt()
   {
  return create_dt;
   }

   public void setCreate_dt(Date create_dt)
   {
  this.create_dt = create_dt;
   }

   public String getDef_keyfield()
   {
  return def_keyfield;
   }

   public void setDef_keyfield(String def_keyfield)
   {
  this.def_keyfield = def_keyfield;
   }

   public String getDef_value()
   {
  return def_value;
   }

   public void setDef_value(String def_value)
   {
  this.def_value = def_value;
   }

   public boolean isActive()
   {
  return active;
   }

   public void setActive(boolean active)
   {
  this.active = active;
   }

   public static long getSerialversionuid()
   {
  return serialVersionUID;
   }



}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Inserting-Persisting-data-into-the-DB-tp4671856.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



Add a link to MessageDialog

2015-06-09 Thread smoothe19
I am trying to add a clickable link to my message dialog


  //TrainingDialog associated with save button
trainingDialog = new MessageDialog(trainingdialog, Warning,
,
DialogButtons.OK, DialogIcon.WARN) {
public void onClose(AjaxRequestTarget target, DialogButton
button) {
if (button != null  button.match(LBL_OK)) {   


//note: predefined button text are:
//LBL_OK, LBL_CANCEL, LBL_YES, LBL_NO, LBL_CLOSE,
LBL_SUBMIT
}
}
};  
 
add(trainingDialog);



//Method displays dialog
 public void initiateTrainingMode() {
   
   try {  
  //Training mode logic
  if (trainingmode()){
 
 final String com = trainingEvalService.getMessage();  
 final AjaxLink  link1 = new AjaxLink(link1) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {

}
};
 AjaxEventBehavior event = new AjaxEventBehavior(onload) {
   
@Override
protected void onEvent(final AjaxRequestTarget target) {

// Display popup 
   if (com.length()  0){
  trainingDialog.setModelObject(com); 
 * trainingDialog.add(link1);*
  trainingDialog.open(target); 
  trainingEvalService.setMessage();
 
   }  
   
}
};
add(event);   
   
  }

   }
   catch (NullPointerException e){
  LOG.debug(NullPointer was caught  + e.getMessage());
   }
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-a-link-to-MessageDialog-tp4671115.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



Modifying the message contents of a MessageDialog

2015-06-08 Thread smoothe19
 //Dialog associated with a save button
  Dialog = new MessageDialog(Dialog, Warning, Message contents
here,
DialogButtons.OK, DialogIcon.WARN) {
public void onClose(AjaxRequestTarget target, DialogButton
button) {
if (button != null  button.match(LBL_OK)) {
target.prependJavaScript(return saveClick());
saveButton.add(new AttributeModifier(onclick, return
saveClick()));
target.add(saveButton);
//note: predefined button text are:
//LBL_OK, LBL_CANCEL, LBL_YES, LBL_NO, LBL_CLOSE,
LBL_SUBMIT
}
}
}; 


add(Dialog);
Now before I show the dialog using Dialog.open(target)

is there a way i can update the contents of the dialog?

java java-ee wicket

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Modifying-the-message-contents-of-a-MessageDialog-tp4671101.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



Generating a popup dialog in OnSubmit()

2015-04-27 Thread smoothe19
 protected void onSubmit() {
   if (trainingmode()){
  AjaxRequestTarget target = 
RequestCycle.get().find(AjaxRequestTarget.class);

  MessageDialog dialog = new MessageDialog(dialog, Notice,
Decision Matches   ,
 DialogButtons.OK_CANCEL, DialogIcon.WARN) {

 public void onClose(  AjaxRequestTarget target, DialogButton
button) {

 }
 };
 
 dialog.open(target);
  }

 get an error at dialog.open(target) that says : Caused by:
java.lang.NullPointerException at
com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog.onOpen(MessageDialog.java:170)
at com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog.open(A

I am trying to have an AjaxRequestTarget modal window pop up appear however
i do not have access to AjaxRequestTarget from within the onsubmit()

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-a-popup-dialog-in-OnSubmit-tp4670521.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