Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
import java.util.Map;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.form.model.Element;
import org.joget.apps.form.model.FormData;
import org.joget.apps.form.model.FormRow;
import org.joget.apps.form.model.FormRowSet;
import org.joget.apps.form.service.FormUtil;
import org.joget.commons.util.TimeZoneUtil;

public FormRowSet load(Element element, String usernameprimaryKey, FormData formData) { 
    FormRowSet rows = new FormRowSet();
    
    //Get timezones using timezone util
    for(Map.Entry entry : TimeZoneUtil.getList().entrySet()){
        FormRow option = new FormRow();
        option.setProperty(FormUtil.PROPERTY_VALUE, (String) entry.getKey());
        option.setProperty(FormUtil.PROPERTY_LABEL, (String) entry.getValue());
        rows.add(option);
    }
    
    return rows;
}

//call load method with injected variable
return load(element, primaryKey, formData);

...