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

TOPIC:

dataValue on COMBO Jdom input 09 Jul 2013 11:14 #7928

This is not a real bug, but it gives some problems as shown below.
on file:
dom\html\form\input\select\combo.php

on line 216:
$selected = ($item->$listKey === $this->dataValue);

IF I previously pass a "dataValue" using the jdomOptions AND my purpose is to set a value to a combo list field for a foreign key (the datakey is an integer), THEN when "$selected" value should be matched it still gives FALSE.

this is due to the PHP comparison operator "===", the variable type of $item->$listKey is recognized as string and it should be an integer.

I don't know if in this case the indentical comparison operator should be really used , in my opinion the simple equal operator could be enough, I leave to the admin further investigations.
In my case I just changed it to, and it doesn't give me any problems, until now:
$selected = ($item->$listKey == $this->dataValue);

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

Last edit: by Tomaselli.

dataValue on COMBO Jdom input 21 Jul 2013 11:25 #10543

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Yes it is very important for filters for example.
Because 0 is different than ""

Suggestion :

Reformate the value using
'dataValue' => (int)$this->item->myfield //Parse to integer
...
or
'dataValue' => (string)$this->item->myfield //Parse to string


with dataValue you define the value directly.

Hope it helps.
Coding is now a piece of cake
The following user(s) said Thank You: Tomaselli

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

dataValue on COMBO Jdom input 23 Jul 2013 00:04 #10552

thanks for the reply. I didn't think about that.
Yes, it's needed and thanks for the advice, you saved me to fix this probable bug later.
by the way I saw some of the attributes are not enabled yet on all the type fields, there is a specific reason for that, or it's just because you didn't use them yet?

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

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

I have to say your builder is great! We use for another project in a week we have the system built. For the J!Boleto I convert to j3 in 2 weeks :)
Luiz Felipe Weber 

Get Started