I have the following code. I would like to place the FormItemIcons for the user ID and password fields, in front/left of the fields, or make them appear inside, on the left side of the field. As of now, they appear at the end/right of the fields, outside-right. See attached image.
Please advise. Thank you!
Please advise. Thank you!
Code:
// form creation userLoginForm = new DynamicForm(); userLoginForm.setIsGroup(false); userLoginForm.setNumCols(1); userLoginForm.setCellPadding(10); userLoginForm.setAutoFocus(true); userLoginForm.setWrapItemTitles(false); userLoginForm.setWidth100(); userLoginForm.setHeight100(); // userLoginForm.setBackgroundColor(GlobalFieldMapping.HEAD_FOOT_BACKGROUND); // user id text item usernameTextItem = new TextItem("userId"); usernameTextItem.setShowTitle(false); usernameTextItem.setWidth(300); usernameTextItem.setHeight(24); usernameTextItem.setRequired(true); usernameTextItem.setHintStyle("hintStyle"); usernameTextItem.setHint("User ID"); usernameTextItem.setShowHintInField(true); usernameTextItem.setAlign(Alignment.CENTER); FormItemIcon personIcon = new FormItemIcon(); personIcon.setSrc(PERSON_ICON); usernameTextItem.setIcons(personIcon); // password text item passwordItem = new PasswordItem("password"); passwordItem.setShowTitle(false); passwordItem.setWidth(300); passwordItem.setHeight(24); passwordItem.setRequired(true); passwordItem.setHintStyle("hintStyle"); passwordItem.setHint("Password"); passwordItem.setShowHintInField(true); passwordItem.setAlign(Alignment.CENTER); FormItemIcon passwordIcon = new FormItemIcon(); passwordIcon.setSrc(PASSWORD_ICON); passwordItem.setIcons(passwordIcon); // set fields for form userLoginForm.setFields(usernameTextItem, passwordItem);
Comment