The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu May 10, 2012 7:33 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Mar 09, 2012 7:31 pm
Posts: 15
Hello,

I am trying to do a form with some select inputs and I want to use options for that select list which are stored in DB. So let's assume that form XML file will look like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<form>
   <fieldset>
      <field
         name="test"
         type="list"
         label="test"
         class="inputbox"
         default=""
      />
   </fieldset>
</form>


Now I need to load options dynamically from database. What is the right way to do so? In JForm class and neither in JFormField(List) class there isn't any method to edit those options.

Temporarily I found a solution but I needed to edit core libraries. I added getter method to JForm class which returns SimpleXMLElement Object of that select list and then I am able to add my options using its addChild() method.

Is there any regular solution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 



Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group