I am using some dojo currency controls in my form and want to have them right justified (like any number field) however, even though I have specified text-align: right in the field properties, the formatted text still justifies to the left. As the form loads, I can see the values show up on the right, but after the formatting is applied and the field is updated with the masked values it moves to the left.
These fields were initially text boxes and I merged the currency control after the fact if that has any bearing.
These fields were initially text boxes and I merged the currency control after the fact if that has any bearing.
RE: Justification of Currency fields
I'm unsure about the exact layout of your page, but it's possible that in this scenario your right-align instruction is being ignored or overridden by WebMaker or Dojo.
It's worth having your own css overrides file for these types of scenarios. For example, you can include a local css file called my_styles.css. Either select the canvas or the specific page you are working on in the Application Map tab and you should be able to include additional css files using the top right hand side panel. In this file, you can include something like the following:
.dijitCurrencyTextBox .dijitInputInner { text-align: right; }
Depending on the browser you are using you should be able to press F12, select your field and see the css files and styles that are being applied to your currency control. The above style will apply to all your Currency text boxes. You can restrict this to a single grouping or individual fields by referencing a container class or id.
For example, you can use #myCurrencyFieldName{...} instead of .dijitCurrencyTextBox .dijitInputInner{...} to identify a specific currency field.
If you want to apply this to a group of fields then you can use something like #myGroupName .dijitCurrencyTextBox .dijitInputInner{...} or .myCurrencyGroup .dijitCurrencyTextBox .dijitInputInner{...}
Where #myGroupName is the name of your group on the page.
.myCurrencyGroup is a class on the group you would have to add using the properties panel on the Page Design tab.
I hope this helps.
Kind Regards
Abdul
RE: Justification of Currency fields
I added the code above to my css file and it solved the issue. An analysis with firebug prior to this showed that a class, .alignLeft was being applied to a parent object and since it was tagged with !important, my control style override was ignored. This class was in webmaker_layout.css (oddly, the class .alignRight was also being applied and occurs later in the file so I thought it should "win", but I guess the left was somehow more specific. In any case it's working now)
RE: Justification of Currency fields
I think selectors that identify elements more specifically "win" over more general selectors, which might be the case here.
I'm glad you have it working though.
Regards
Abdul