You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

To pre-populate a single form select list from an external source, choose the select field and click on 'Edit'.

หากต้องการเติมข้อมูลในรายการเลือกรูปแบบเดียวจากแหล่งภายนอกให้เลือกฟิลด์เลือกแล้วคลิกที่ 'แก้ไข'

Under the 'Choose Options Binder' menu, click on 'Bean Shell Form Binder' in the Options Binder select field.

ใต้เมนู 'เลือกตัวเลือก Binder' คลิกที่ 'Bean Shell Form Binder' ในฟิลด์ตัวเลือก Binder เลือก

Under 'Configure Bean Shell Form Binder', enter your Bean shell script to populate the select fields. For each row that you add to the FormRowSet, be sure to put the 'FormUtil.PROPERTY_VALUE' and 'FormUtil.PROPERTY_LABEL' fields in the FormRow that will be added to the FormRowSet. 

ใต้ 'กำหนดค่า Bean Binder Form Binder' ให้ป้อน Bean Bean script ของคุณเพื่อเติมฟิลด์ที่เลือก สำหรับแต่ละแถวที่คุณเพิ่มลงใน FormRowSet ต้องแน่ใจว่าได้ใส่ 'FormUtil.PROPERTY_VALUE' และ 'FormUtil.PROPERTY_LABEL' ใน FormRow ที่จะถูกเพิ่มลงใน FormRowSet

import org.joget.apps.form.model.*;
import org.joget.apps.form.service.*;

public FormRowSet test() {
FormRowSet f = new FormRowSet();
f.setMultiRow(true);

FormRow r1 = new FormRow();
r1.put(FormUtil.PROPERTY_VALUE, "test1");
r1.put(FormUtil.PROPERTY_LABEL, "tester1");
f.add(r1);

FormRow r2 = new FormRow();
r2.put(FormUtil.PROPERTY_VALUE, "test2");
r2.put(FormUtil.PROPERTY_LABEL, "tester2");
f.add(r2);

return f;
}

return test();

Of course, you would want to populate the values for PROPERTY_LABEL and PROPERTY_VALUE from your external datasource. For more information on how to connect to a database source, see the example code within 'Pre-populate Form Fields with Data from External Source' or this example on the Joget Blog.

แน่นอนคุณต้องการเติมค่าสำหรับ PROPERTY_LABEL และ PROPERTY_VALUE จากแหล่งข้อมูลภายนอกของคุณ สำหรับข้อมูลเพิ่มเติมเกี่ยวกับวิธีเชื่อมต่อกับแหล่งฐานข้อมูลให้ดูตัวอย่างรหัสภายใน 'Pre-populate Form Fields with Data from External Source' หรือ this example on the Joget Blog

Related Elements

องค์ประกอบที่เกี่ยวข้อง




  • No labels