SC version: 8.00.0030
Application: Form -> Editable grid view
Browser: Google Chrome (latest version)
Further explanation: Let’s say I have 2 select’s and don’t want people to change the second one (basically only have it as select for the look-up-functionality) and the first select has an ajax onchange event that refreshes the seconds select which is read-only. Now when it refreshes now when it refreshes at first the field just gets empty, but after actually saving the update it does show the right value.
Hello,
I wasn’t able to reproduce the issue. Could you provide me a few steps so I can reproduce it?
regards,
Bernhard
[QUOTE=bartho;34092]Hello,
I wasn’t able to reproduce the issue. Could you provide me a few steps so I can reproduce it?
regards,
Bernhard[/QUOTE]
Yeah i managed to reproduce it by making a new application in these steps:
Step 1: make a new form as an editable grid view
Step 2: Get 2 selects on it, both with an automatic look-up wherein 1 uses the other field
Step 3: Set the first field to automatically refresh the second field with AJAX
Step 4: Put the second field on read-only
Field settings:
Here is how my look-ups look:
Field 1:
SELECT FILENAME
FROM SCRIPTCASE.SC_UPLOAD
WHERE UPPER(SUBFOLDER) = UPPER('folder/path/') --example
ORDER BY FILENAME
Field 2:
SELECT LASTUPDATE
FROM SCRIPTCASE.SC_UPLOAD
WHERE UPPER(SUBFOLDER) = UPPER('folder/path/') AND FILENAME = '{FILENAME}'
I suspect this could the expected behavior.
How do you change the value of the db field bound to the second select, once the user change the first select?
If that’s done on the server after the form has been submitted, I believe it is expected that the second select is populated correctly only when the form is reloaded.
Well not really, thing is the look-up and all work the way i want them too, and after updating it does insert the right value into it just i’d like it to update straight away after changing the value in the other select.
Which it does when i have the date field as a select without read-only where technically yes you can’t change the value anyways but you still have the dropdown which I don’t really like.
EDIT:
Well sure it might be the expected behaviour but then still I’d like to see some way to achieve this.
Can’t you just retrieve everything you want to show in the first select?
Somethinkg like this:
SELECT FILENAME, CONCAT(FILENAME, "(Last update: ", LASTUPDATE, ")") AS FILENAME_WITH_DETAILS
FROM SCRIPTCASE.SC_UPLOAD
WHERE UPPER(SUBFOLDER) = UPPER('folder/path/') --example
ORDER BY FILENAME
Note: I wrote the select here in the forum, so there maybe errors ypos.
Also the syntax is based on my (limited) mysql knowledge.
YMMV with your DB server.
Yes it would work that way but i’d like to keep things seperated if possible. As I hope others would agree that it’d look nicer with Date as a seperate field instead of just plunked down with the filename.
As for the code it looks like there aren’t any typo’s. And to be honest, I’m not a god at SQL myself either.
Using Oracle btw, not too certain what version in case you wanted to know.
Just one question.
You wrote:
Which it does when i have the date field as a select without read-only
Are you sure it works when it’s not set as read-only?
What I mean is: if you change the first Select, is the second Select always updated correctly and automatically (i.e. by the change of the first select)?
Did you try changing the first Select more time and without submitting the form?
I would expect the second Select to never be updated by the action on the first Select, even if the Second select is not set as readonly.
Yes, i have it on just normal select without read-only for now, quite certain any normal look-up field would do the trick (haven’t tried all of them) i.e. radio buttons and such as well.
To be honest if the second one wouldn’t update when it’s not on read-only I’d put that down as a bug as well because that’s the whole reason they give you the option to let SC automatically generate AJAX code to refresh other selects.