Dynamically Changing the Edit Site View Field Values #1192

Open
opened 2024-11-18 19:14:31 +00:00 by eciudad · 0 comments

Steps to reproduce the issue

Open Admin View as an edit Site View.

Expected result

I went thru the below wiki items and many other topics during the last two weeks.

Field Types
Basic Fields
Admin Views
Advanced Fields
dynamicGet
How to overwrite the custom fields
Setup Site Edit View in JCB

"Setup Site Edit View in JCB" was able to direct me
on how to give the users the ability to add their own record without having access to the administrator view from the admin.

Here is where I am stuck with:

When the site view open on edit mode, the value are the set values in the fields that where setup.

Example: on the enclosed screenshot "roomid" shows value 1 since that is the default. I have a variable named "$newroomid" which value is 831765236I would like to dynamically replace the 1 for 831765236. The way arrive to the new number is that the first 3 digits, 831 is the generic user current user id. The rest, 765236 is a random calculated number with the PHP function mt_rand(100000,1000000). The two are combined to get 831765236. This allows me to have a unique "roomid" since the first 3 digits will prevent me from the random be duplicated and assigned to another user.

In short, I want to override dynamically the values on the edit view as it opens. Is there a way to do this in the JCB function or from your experience is there another short and simple way to do it?

The fields that I would like to dynamically override are:

a.roomid AS roomid
a.roomname AS roomname
a.moderatorid AS moderatorid
a.moderatorpass AS moderatorpass
a.meetdate AS meetdate
a.meettype AS meettype
a.meetstatus AS meetstatus
a.meetlength AS meetlength
a.maxparticipants AS maxparticipants

Actual result

Once the edit Site View opens it shows the default fields values from the Admin View.

System information (as much as possible)

  • OS Name & Version: Linux lamp302.cloudaccess.net 3.10.0-962.3.2.lve1.5.85.el6h.x86_64 #1 SMP Thu Apr 18 09:46:51 UTC 2024 x86_64
  • MySql Version: 8.0.34-cll-lve
  • Apache Version:
  • PHP Version: 8.2.23
  • Joomla Version: Joomla! 5.1.4 Stable [ Kudumisha ] 27-August-2024 16:00 GM
  • JCB Version: 5.04
  • Browser: Microsoft Edge Version 130.0.2849.46 (Official build) (64-bit)

Additional comments

The JCB wiki is great and has a lot of information. JCB has excellent features that I this point I am not
ready to use. I am focusing on basic component building. I was able to rewrite my first Joomla 3.10 component into
my Joomla 5.2 without ever done a Joomla Component before. I am converting my second Joomla 3.10 from also from scratch.

### Steps to reproduce the issue Open Admin View as an edit Site View. ### Expected result I went thru the below wiki items and many other topics during the last two weeks. Field Types Basic Fields Admin Views Advanced Fields dynamicGet How to overwrite the custom fields Setup Site Edit View in JCB "Setup Site Edit View in JCB" was able to direct me on how to give the users the ability to add their own record without having access to the administrator view from the admin. Here is where I am stuck with: When the site view open on edit mode, the value are the set values in the fields that where setup. Example: on the enclosed screenshot "roomid" shows value 1 since that is the default. I have a variable named "$newroomid" which value is 831765236I would like to dynamically replace the 1 for 831765236. The way arrive to the new number is that the first 3 digits, 831 is the generic user current user id. The rest, 765236 is a random calculated number with the PHP function mt_rand(100000,1000000). The two are combined to get 831765236. This allows me to have a unique "roomid" since the first 3 digits will prevent me from the random be duplicated and assigned to another user. In short, I want to override dynamically the values on the edit view as it opens. Is there a way to do this in the JCB function or from your experience is there another short and simple way to do it? The fields that I would like to dynamically override are: a.roomid AS roomid a.roomname AS roomname a.moderatorid AS moderatorid a.moderatorpass AS moderatorpass a.meetdate AS meetdate a.meettype AS meettype a.meetstatus AS meetstatus a.meetlength AS meetlength a.maxparticipants AS maxparticipants ### Actual result Once the edit Site View opens it shows the default fields values from the Admin View. ### System information (as much as possible) - OS Name & Version: Linux lamp302.cloudaccess.net 3.10.0-962.3.2.lve1.5.85.el6h.x86_64 #1 SMP Thu Apr 18 09:46:51 UTC 2024 x86_64 - MySql Version: 8.0.34-cll-lve - Apache Version: - PHP Version: 8.2.23 - Joomla Version: Joomla! 5.1.4 Stable [ Kudumisha ] 27-August-2024 16:00 GM - JCB Version: 5.04 - Browser: Microsoft Edge Version 130.0.2849.46 (Official build) (64-bit) ### Additional comments The JCB wiki is great and has a lot of information. JCB has excellent features that I this point I am not ready to use. I am focusing on basic component building. I was able to rewrite my first Joomla 3.10 component into my Joomla 5.2 without ever done a Joomla Component before. I am converting my second Joomla 3.10 from also from scratch.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1192
No description provided.