Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Combo default value 28 Dec 2013 09:37 #11859

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
Hi,

Is it possible to set a default value in a combo for a new item ?
In the model, I've got :
$data->idcne = $jinput->get('filter_idcne', $this->getState('filter.idcne'), 'INT');

I've tested :
$data->idcne = 5;
thinking that the combo would take this id : no effect.

Some can help me ?

Thanks!

Please Log in or Create an account to join the conversation.

Combo default value 29 Dec 2013 23:02 #11865

I also have interest in this question!
Complementing the doubt of the partner: And to open the form (NEW) with some fields already filled in?
I noticed that the form fields are generated here:
$this->item		= $item		= $this->get('Item'); 
$this->form		= $form		= $this->get('Form');

But I can not understand how I could modify it to deichar some fields already filled with values.

Please: SomeBody?

Please Log in or Create an account to join the conversation.

Last edit: by neoneper.

Combo default value 30 Dec 2013 13:40 #11869

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
@ewajoom.

Strange, It should work.
Does it work when you use the filter var in the url (original code)
...&filter_idcne=5

@neoneper
You can edit the item, and change the save button for 'save as copy'.
And the original item can be saved only for a specific ACL.
Put this ACL ($model->canSave($item))
- on the save button visibility
- AND in the save controller task.

Hope it helps
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Combo default value 30 Dec 2013 16:58 #11871

I do not know if this applies!!
In my case, I no have a form with values ​​to be edited!

Would be the new form to enter the first values in the table.
I own some fields such as:
Name, Address, ...

This form appears only for users who are already logged into the system joomla, so I wanted to be able to fill the (Name) field with the name of the user who are logged in, this way I will prevent the user having the name field different of the name User field who are logged!.

Please Log in or Create an account to join the conversation.

Combo default value 02 Jan 2014 14:51 #11883

:pinch: Hii Cheff!
	$fieldSet = $this->form->getFieldset('newcandidatos.form'); //My New FORM
	$field = $fieldSet['jform_nome']; 
        echo $field->input;  //This print my InputText name. OK!

I managed to filter the information to catch only the input field which I wish!
In the example above I get the input field for name, in my new form. Its WORK GOOD.

Now I just wish to include a value to this field. This should work perfectly, see below!
	$fieldSet = $this->form->getFieldset('newcandidatos.form'); //My New FORM
	$field = $fieldSet['jform_nome']; 
       $field->value = 'change val test';  // Cannot access protected property JFormFieldCktext::$value (X.x)

The problem is that the variable (value) is a protected variable. She is not a public variable, so I can not modify this value! (T.T).
What could I do?

Please Log in or Create an account to join the conversation.

Last edit: by neoneper.

Combo default value 02 Jan 2014 19:01 #11886

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Did you tried :
$field->set('value', 'change val test');

or
$field->setJdomOptions(array(
    'dataValue' => 'change val test'
));
...Not sure.

If not, fork :
classes/form/field.php
And access to the protected var.

Hope it helps.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Combo default value 03 Jan 2014 13:10 #11894

Thank you Chef.
The options work fine. It is very rewarding to me because clarified me many other questions!

Please Log in or Create an account to join the conversation.

Combo default value 03 Jan 2014 13:12 #11895

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You are welcome.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Combo default value 03 Jan 2014 13:33 #11896

Is there any LINK where I can see more details about the options that I can use in jdom Options?
I see it it possesses a plethora of options, but as I do not know, I'm giving work for you here in the forum. I searched on google but can not find anything about it!

Please Log in or Create an account to join the conversation.

Combo default value 03 Jan 2014 13:43 #11898

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
The options varies with the JDom class.

To know them, you must open the JDom classes, and see the received parameters.
The classes herit from parent, so you need to check in parent files.

JDom documentation is missing.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Combo default value 03 Jan 2014 13:59 #11899

I found what I was looking for!.
Can I check the parameters and functions through use of the library included in the project!

../libraries/jdom/html/form (...)

Tankx Brother!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.076 seconds

Let me first state that this is an amazing and fascinating product exactly what I was looking for. In just a few hours (listening to the very well made and clearly understandable videos learning doing) I completed and installed my first component. I am now in the second refining phase. I will make a recommenation in JED. Thanks for the effort in creating such a great product. Incidentally some of the best Joomla extension I use are of French origin !
Giori (Forum)

Get Started