Note that there are some explanatory texts on larger screens.

plurals
  1. PONot selecting store view in adminhtml Edit Section
    text
    copied!<p>Can anyone please help me. It might be really simple, seems like I am missing something.</p> <p>I am trying to develop a very simple module here.</p> <p>In the edit section, it's not selecting Region </p> <p><img src="https://i.stack.imgur.com/pzZId.jpg" alt="enter image description here"></p> <p>store_id 1 is Australia </p> <p>Code:</p> <pre><code>&lt;?php class Ubt_Faq_Block_Adminhtml_Faq_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form { protected function _prepareForm() { $x = Mage::registry('ubt_faq')-&gt;getData(); var_dump($x); $form = new Varien_Data_Form(); $fieldset = $form-&gt;addFieldset('faq_form', array( 'legend' =&gt; Mage::helper('ubt_faq')-&gt;__('FAQ'), 'class' =&gt; 'fieldset-wide', )); $fieldset-&gt;addField('faq_term', 'text', array( 'name' =&gt; 'faq_term', 'label' =&gt; Mage::helper('ubt_faq')-&gt;__('Term'), 'class' =&gt; 'required-entry', 'required' =&gt; true, )); $fieldset-&gt;addField('faq_answer', 'textarea', array( 'name' =&gt; 'faq_answer', 'label' =&gt; Mage::helper('ubt_faq')-&gt;__('Answer'), 'class' =&gt; 'required-entry', 'required' =&gt; true, )); if (!Mage::app()-&gt;isSingleStoreMode()) { $fieldset-&gt;addField('store_ids', 'multiselect', array( 'label' =&gt; Mage::helper('ubt_faq')-&gt;__('Visible In'), 'required' =&gt; true, 'name' =&gt; 'store_ids[]', 'values' =&gt; Mage::getSingleton('adminhtml/system_store')-&gt;getStoreValuesForForm(), 'value' =&gt; Mage::registry('ubt_faq')-&gt;getStoreId() )); } if (Mage::registry('ubt_faq')) { $form-&gt;setValues(Mage::registry('ubt_faq')-&gt;getData()); } $this-&gt;setForm($form); return parent::_prepareForm(); } } </code></pre> <p>In <code>class Varien_Data_Form_Element_Multiselect extends Varien_Data_Form_Element_Abstract</code></p> <p>$value = $this->getValue(); is coming null in getElementHtml();</p> <p>I think this $value shouldn't be null as I am already assigning value to it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload