-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML-555: JavaScript functions like setValue() should have access to … #161
base: master
Are you sure you want to change the base?
Conversation
we have some failing checks here |
Working on them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appear to be some issues with indentation and formatting of the data members declared in the class.
The original repo too has this issue. That's why I didn't bother to check the formatting. |
Is this still a draft? |
ready for review |
@@ -1028,6 +1031,11 @@ else if (parameters.containsKey("commentFieldCode")) { | |||
} else { | |||
context.addFieldToActiveSection(field); | |||
} | |||
|
|||
//if enableParamJS is true | |||
if( "true".equals(parameters.get("enableParamJS")) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can perhaps inline this statement to
enableParamJS = parameters.get("enableParamJS").equals("true");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out, just that it should be
enableParamJS = "true".equals(parameters.get("enableParamJS"));
This way there won't be any case of null pointer exception.
context.registerPropertyAccessorInfo(id + ".date", context.getFieldNameIfRegistered(dateWidget), | ||
"dateFieldGetterFunction", null, "dateSetterFunction"); | ||
ret.append(" "); | ||
String str = dateWidget.generateHiddenHtml(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since, str
isn't used anywhere else, I think it would be better to pass the generated html to ret
direclty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad. Thanks again.
….date and .accessionNumber even if the fields are not displayed
sb.append(" maxlength=\"" + textFieldMaxLength.intValue() + "\""); | ||
} | ||
if (placeholder != null) { | ||
// TODO escape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do you plan to work on the above TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These TODO's were present in generateHtml method at similar positions so I added them here as well. I couldn't understand their meaning that why they were added and what is to be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa Sorry for late reply. These TODO's were present in generateHtml method at similar condition so I added them here as well. I couldn't understand their meaning that why they were added and what is to be done.
sb.append(" maxlength=\"" + textFieldMaxLength.intValue() + "\""); | ||
} | ||
if (placeholder != null) { | ||
// TODO escape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do you plan to work on the above TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same case as previous is here as well.
@Am-Coder kindly look into the merge conflicts ,,, |
….date and .accessionNumber even if the fields are not displayed
Description of what I changed
Link to the issue - https://issues.openmrs.org/browse/HTML-555
To solve this issue I created a generateHiddenHTML method in Date Widget and TextFieldWidget which will be called whenever the date widget, comment widget and accession number widget are left null for obs tag. In order to make these widgets accessible via js an additional attribute "enableParamJS" needs to be set to "true". After setting this attribute these widgets become accessible via java script.
Issue I worked on
see https://issues.openmrs.org/browse/HTML-555
Checklist: I completed these to help reviewers :)
My pull request only contains ONE single commit
(the number above, next to the 'Commits' tab is 1).
No? -> read here on how to squash multiple commits into one
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master