Good Day All,
am trying to customize the document check-in page by making a custom component that have a resource file with std_edit_entry , what i want to do is based on specific value from the list of the field a specific customization will be done.
but the problem is when i make the customization on a optionlist filed, nothing happened; since i cannot affect on it. only can test and check text fields; not optionlist fields.
assume that my std_edit_entry like follow:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<$if not isFieldTreeEdit$>
<$country = "xCountry"$>
<$firstName = "xFirstName"$>
<$curValue = xml(fieldValue)$>
<$if isStrictList and isMultiOption$>
[[% fieldId will point to a popup link (or button) defined later %]]
<$inputFieldId = fieldId & "_hidden"$>
<$inputFieldId = fieldId$>
<input id="<$inputFieldId$>" <$if isStrictList and isMultiOption$>type="hidden"<$elseif fieldType like "Password"$>type="password"<$else$>type="text"<$endif$> name="<$editEntryName$>" size="<$fieldEditWidth$>"
<$if fieldMaxLength and isEditMode$>maxlength="<$fieldMaxLength$>"<$endif$> value="<$curValue$>" <$include text_field_enter_for_search$>
<$if editEntryName like country$> onblur="testFunc()" <$endif$>
alert('This is xCountry Field');
[[% text field can be leaf for dependent choice list %]]
<$if useSchema and not noSchema$>
<$if not hasOptionList and isTrue(#active.IsDependentList)$>
<$useCurrentValue = 1$>
<$viewFieldId = inputFieldId$>
<$jsViewName = ""$>
<$if isStrictList and isMultiOption$>
assume the xCountry field is a Table-View list that have countries. and the xFirstName field is a text field can be filled by your name.
in the above example the onblur function isn't working because the field is List, if i change the field to be text as xFirstName, the onblur function is working fine.
so, i cannot make testing on the value of option list fields. i tried to make my check * <$if editEntryName like country$> onblur="testFunc()" <$endif$> *
inside a special check, also not working like:
- <$if fieldIsOptionList$>
- <$if fieldHasOptionList$>
- <$if isOptionList$>
- <$if hasOptionList$>
any help or any suggestion to reach and affect list fields.
I think I can give you a hint (without analysing the code I can't do more):
- take a look at optionlist fields in GUI. Unlike text fields, there are usually two fields; one for selecting the values, the other for displaying selected values
- you can study the page's source to figure out on which field your event should be hooked
- also, you may try to use different events - if onblur does not work, why not to try onchange, for instance?
The idea that i can reach it to make any modification or any check. The following piece of idocscript code check filed names and set their type to hidden, if the checked field name is input text field it works fine and it hides the text field, where if the checked field name is list with <select> element it can affect is since i cannot reach it.
<input id="<$inputFieldId$>" <$if isStrictList and isMultiOption or editEntryName like checkedField $>type="hidden"
<$elseif fieldType like "Password"$>type="password"<$else$>type="text"<$endif$> name="<$editEntryName$>" size="<$fieldEditWidth$>"
<$if fieldMaxLength and isEditMode$>maxlength="<$fieldMaxLength$>"<$endif$> value="<$curValue$>"
i guess the controlling or to affect a option list the drawn element will be of type *<select>* , and the check process is done within element of type *<input>*; you can check the first post.
i don't know if i can check <select> elements within this std_edit_entry , since once it is included within the resource page of the component the only element that is appear within it: is <input> element
You've done the first part of the analysis - do I get it right that it is copied from the html source of the page?
However, I think you will need to go even deeper (to the source html resources/templates which define the page).
What can be already obtained from the results so far?
a) the select object has already a method hooked to onchange; this method is probably coming from a resource/template - this also might be the reason why your onchange won't apply
b) I'd also take a look at the method updateDependentChoices; maybe you will learn something there
i found through searching that the mentioned resource file std_edit_entry is only for <input> elements that will be drawn on UCM check-in page.
there is another resource file called *"std_option_list_entry"*, that suppose to control the <select> elements, i suppose to use this template now within a custom component to make my control and my check on optionlist fields.
The following is the original code that is contained in std_option_list_entry :
Where did you change it?
Note that the same include can be contained in several components (patches), and you need to change the one with the highest loadOrder or (recommended) create your own custom component with a resource containing the include and having high enough loadOrder (this you will need to do anyway).
Try to do a search for <@dynamichtml std_option_list_entry@> in both custom and standard components. A brute force could be to modify all of them (I'd put a static text in front of the <select...)
Note that sometimes to need to restart the server to activate your changes (here it should not be necessary, but it will do no harm).