option "value" ignored

Jesús Jerez avatarJesús Jerez created an issue

hi, I found a problem trying setting the option "value" in "TinyMce". TinyMce class extends the CInputWidget class, the problem is when evaluates "isset($this->model)" and omit if "value" option is set. I made a patch that is evaluated first "value" and then the "model"

Comments (2)

  1. Bogdan Savluk

    Thanks for report, but this is not bug - this is default behavior for CInputWidgets in Yii framework.

    For example you can see the same behavior in widgets: CAutoComplete, CMaskedTextField, CStarRating. In all of them if "model" property is set - "value" property will be ignored.

    This is because model should be the only place where we store our data(we should not store or change an information in view). So if we need to change value of input we should do this in model.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.