Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Design questions about viewbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Design questions about viewbox

    Hi
    I am trying to implement viewboxes for the first time ( mainly as list replacements ), but i have a few questions...
    Viewbox based on sql

    1) how can i show/hide specific fields, based on their value? ( for instance hide if value=0)

    2) how can i use conditional templating in the output? For instance, if quantity > 10, amount field should have a Green color...

    Thanks!
    Jaime

    #2
    Hi Jamie,

    I have done some hiding of fields in a list representation in a viewbox, but have not done any colour changing however I imagine it would be done the same way. It needs to be done in a template as in

    Code:
    {*if QUANTITY!=0}
    <div style="flex-grow:1;">
    {QUANTITY}&nbsp;
    </div>
    {*else}
    <div style="flex-grow:1;">
    &nbsp;
    </div>
    {*endif}

    Comment


      #3
      {*if QUANTITY <10}
      <div style="color:red">This row is less than 10.</div>
      {*else}
      <div style="color:blue">This row is 10 or more.</div>
      {*endif}

      Comment


        #4
        Another option, which I have used in LIST controls, is to let CSS and SQL do most of the work. (I have included an arbitrary ViewBox example below.) I'm supporting multiple customers with the same code base and I use CSS to record customer preferences for color display in a “rating scale”. Each customer's color choices are recorded in a unique CSS file which gets downloaded before any UX that needs them.

        The class names in this CSS file consist of a “base” name with a “suffix”. The “base” name is associated to a field and a property. For example, if I conditionally wanted red or green background colors for a field named “myField1” then I’d create two CSS classes:
        . myField1BGG{ background-color:green;}
        .myField1BGR{ background-color:red;}

        The “base name” is “myField1BG” and the suffix is either “G” or “R”

        If there is a row condition that turns the field display on or off then I’d have another pair of CSS class:
        . myField1ShowS{visibility: visible;}
        .myField1ShowH{ visibility: hidden;}

        The “trick” is to make SQL create the data values to substitute in for the “suffix” of the class and then use that calculated field value in the template. The AlphaDAO SQL builder provides quite a few functions you can use to create calculated fields. I use the “if(e, T, F)” command a lot. In this example I would create two calculated fields, "ShowFld1" and "Fld1BGColor" that would return "S" or "H" and "G" or "R", respectively.

        In the template for the ViewBox, to display "myField1", I might have something like:
        <div class="myCell myFieldShow{ShowFld1} myField1BG{Fld1BGColor}>{myField1}</div>


        To try out this completely crazy example, create a new UX, place a ViewBox control on it. Go into the ViewBox Builder, click the “More…” button on the bottom, select “Import Settings”, and copy and paste the following into it. Save and run the UX.

        Code:
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"formview": {[/FONT]
        [FONT=Calibri]"datasource": {[/FONT]
        [FONT=Calibri]"type": "Static JSON",[/FONT]
        [FONT=Calibri]"listName": "",[/FONT]
        [FONT=Calibri]"sampleData": "",[/FONT]
        [FONT=Calibri]"staticJson": "[\n{\n\t\"Firstname\": \"John\",\n\t\"Lastname\": \"Smith\",\n\t\"City\": \"Boston\",\n\t\"State\": \"MA\",\n\t\"fnbg\": \"R\",\n\t\"fnsw\": \"S\"\n},\n{\n\t\"Firstname\": \"Henry\",\n\t\"Lastname\": \"Rhodes\",\n\t\"City\": \"New York\",\n\t\"State\": \"NY\",\n\t\"fnbg\": \"G\",\n\t\"fnsw\": \"H\"\n},\n{\n\t\"Firstname\": \"Allison\",\n\t\"Lastname\": \"Berman\",\n\t\"City\": \"Los Angeles\",\n\t\"State\": \"CA\",\n\t\"fnbg\": \"R\",\n\t\"fnsw\": \"H\"\n},\n{\n\t\"Firstname\": \"Amanda\",\n\t\"Lastname\": \"Higgins\",\n\t\"City\": \"Chicago\",\n\t\"State\": \"IL\",\n\t\"fnbg\": \"G\",\n\t\"fnsw\": \"S\"\n},\n{\n\t\"Firstname\": \"Nancy\",\n\t\"Lastname\": \"Clark\",\n\t\"City\": \"Boston\",\n\t\"State\": \"MA\",\n\t\"fnbg\": \"R\",\n\t\"fnsw\": \"S\"\n},\n{\n\t\"Firstname\": \"Cecelia\",\n\t\"Lastname\": \"Dawkins\",\n\t\"City\": \"Boulder\",\n\t\"State\": \"CO\",\n\t\"fnbg\": \"G\",\n\t\"fnsw\": \"H\"\n},\n{\n\t\"Firstname\": \"Kathy\",\n\t\"Lastname\": \"Morton\",\n\t\"City\": \"New York\",\n\t\"State\": \"NY\",\n\t\"fnbg\": \"R\",\n\t\"fnsw\": \"S\"\n}]",[/FONT]
        [FONT=Calibri]"databasequeryType": "SQL query",[/FONT]
        [FONT=Calibri]"sql": {[/FONT]
        [FONT=Calibri]"connectionString": "",[/FONT]
        [FONT=Calibri]"selectType": "FieldsFromTable",[/FONT]
        [FONT=Calibri]"tablename": "",[/FONT]
        [FONT=Calibri]"fieldlist": "",[/FONT]
        [FONT=Calibri]"filter": "",[/FONT]
        [FONT=Calibri]"distinct": false,[/FONT]
        [FONT=Calibri]"order": "",[/FONT]
        [FONT=Calibri]"sqlstatement": "",[/FONT]
        [FONT=Calibri]"portableSQL": true,[/FONT]
        [FONT=Calibri]"first": -1,[/FONT]
        [FONT=Calibri]"primaryKey": "",[/FONT]
        [FONT=Calibri]"serverSideAfterQueryEvent": "",[/FONT]
        [FONT=Calibri]"dataReturnType": "PrimaryKey",[/FONT]
        [FONT=Calibri]"dataReturnField": "",[/FONT]
        [FONT=Calibri]"dataReturnExpression": "",[/FONT]
        [FONT=Calibri]"sqlSecurityJSON": "",[/FONT]
        [FONT=Calibri]"delayRenderTillVisible": false,[/FONT]
        [FONT=Calibri]"delayRenderTillRefresh": false,[/FONT]
        [FONT=Calibri]"serversidedatenumberformatjson": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"nestedsql": {[/FONT]
        [FONT=Calibri]"definitionJSON": "",[/FONT]
        [FONT=Calibri]"delayRenderTillVisible": false,[/FONT]
        [FONT=Calibri]"delayRenderTillRefresh": false,[/FONT]
        [FONT=Calibri]"primaryKey": "",[/FONT]
        [FONT=Calibri]"serverSideAfterQueryEvent": "",[/FONT]
        [FONT=Calibri]"dataReturnType": "PrimaryKey",[/FONT]
        [FONT=Calibri]"dataReturnField": "",[/FONT]
        [FONT=Calibri]"dataReturnExpression": "",[/FONT]
        [FONT=Calibri]"serversidedatenumberformatjson": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"custom": {[/FONT]
        [FONT=Calibri]"delayRenderTillVisible": false,[/FONT]
        [FONT=Calibri]"delayRenderTillRefresh": false[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"restapi": {[/FONT]
        [FONT=Calibri]"delayRenderTillVisible": false,[/FONT]
        [FONT=Calibri]"delayRenderTillRefresh": false,[/FONT]
        [FONT=Calibri]"endpoint": "",[/FONT]
        [FONT=Calibri]"authenticated": false,[/FONT]
        [FONT=Calibri]"namedprovider": "",[/FONT]
        [FONT=Calibri]"hascustomheaders": false,[/FONT]
        [FONT=Calibri]"customheadersjson": "",[/FONT]
        [FONT=Calibri]"customheadersjavascript": "",[/FONT]
        [FONT=Calibri]"enpointjavascript": "",[/FONT]
        [FONT=Calibri]"makecallfrom": "Server",[/FONT]
        [FONT=Calibri]"postprocessjavascript": "",[/FONT]
        [FONT=Calibri]"postprocessxbasic": "",[/FONT]
        [FONT=Calibri]"jsonpath": ""[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"formProperties": {[/FONT]
        [FONT=Calibri]"hasMultipleLayouts": false,[/FONT]
        [FONT=Calibri]"autoSelectOnOrientationChange": false,[/FONT]
        [FONT=Calibri]"portraitLayout": "",[/FONT]
        [FONT=Calibri]"landscapeLayout": "",[/FONT]
        [FONT=Calibri]"multipleSelection": false,[/FONT]
        [FONT=Calibri]"selectionMode": "Default",[/FONT]
        [FONT=Calibri]"separator": "",[/FONT]
        [FONT=Calibri]"loopNavigate": false,[/FONT]
        [FONT=Calibri]"loopNavigateNullSelection": true,[/FONT]
        [FONT=Calibri]"allowNullSelection": false,[/FONT]
        [FONT=Calibri]"allowNullDeselection": false,[/FONT]
        [FONT=Calibri]"allowTextSelection": false,[/FONT]
        [FONT=Calibri]"allowAnimation": true,[/FONT]
        [FONT=Calibri]"autoRefresh": false,[/FONT]
        [FONT=Calibri]"allowAnyValue": false,[/FONT]
        [FONT=Calibri]"captureFocus": true,[/FONT]
        [FONT=Calibri]"preserveLineBreaksInFreeformTemplates": false,[/FONT]
        [FONT=Calibri]"container": {[/FONT]
        [FONT=Calibri]"allowScrolling": false,[/FONT]
        [FONT=Calibri]"scrolling": {[/FONT]
        [FONT=Calibri]"axis": "Both",[/FONT]
        [FONT=Calibri]"stopPropogation": false,[/FONT]
        [FONT=Calibri]"isDefined": false,[/FONT]
        [FONT=Calibri]"indicator": {[/FONT]
        [FONT=Calibri]"m": {[/FONT]
        [FONT=Calibri]"show": true,[/FONT]
        [FONT=Calibri]"className": "",[/FONT]
        [FONT=Calibri]"barClassName": "",[/FONT]
        [FONT=Calibri]"location": "right",[/FONT]
        [FONT=Calibri]"offset": "0px",[/FONT]
        [FONT=Calibri]"top": "0px",[/FONT]
        [FONT=Calibri]"bottom": "0px"[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"h": {[/FONT]
        [FONT=Calibri]"show": true,[/FONT]
        [FONT=Calibri]"className": "",[/FONT]
        [FONT=Calibri]"barClassName": "",[/FONT]
        [FONT=Calibri]"location": "top",[/FONT]
        [FONT=Calibri]"offset": "0px",[/FONT]
        [FONT=Calibri]"left": "0px",[/FONT]
        [FONT=Calibri]"right": "0px"[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"pull": {[/FONT]
        [FONT=Calibri]"isDefined": false,[/FONT]
        [FONT=Calibri]"javascript": {[/FONT]
        [FONT=Calibri]"onPullRelease": "",[/FONT]
        [FONT=Calibri]"onPullEnd": "",[/FONT]
        [FONT=Calibri]"onPull": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"pullpastEnd": {[/FONT]
        [FONT=Calibri]"YSetting": "auto",[/FONT]
        [FONT=Calibri]"XSetting": "auto"[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"javascript": {[/FONT]
        [FONT=Calibri]"onDraw": "",[/FONT]
        [FONT=Calibri]"onBeforeDraw": "",[/FONT]
        [FONT=Calibri]"onBeforePopulate": "",[/FONT]
        [FONT=Calibri]"onPopulate": "",[/FONT]
        [FONT=Calibri]"onBeforeSelect": "",[/FONT]
        [FONT=Calibri]"onBeforeSelectBegin": "",[/FONT]
        [FONT=Calibri]"onSelect": "",[/FONT]
        [FONT=Calibri]"onSelectComplete": "",[/FONT]
        [FONT=Calibri]"onChange": "",[/FONT]
        [FONT=Calibri]"onClick": "",[/FONT]
        [FONT=Calibri]"onDblClick": "",[/FONT]
        [FONT=Calibri]"onRightClick": "",[/FONT]
        [FONT=Calibri]"onDown": "",[/FONT]
        [FONT=Calibri]"onUp": "",[/FONT]
        [FONT=Calibri]"onSwipe": "",[/FONT]
        [FONT=Calibri]"onDownHold": "",[/FONT]
        [FONT=Calibri]"onFocus": "",[/FONT]
        [FONT=Calibri]"onBlur": "",[/FONT]
        [FONT=Calibri]"onInitialize": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"css": {[/FONT]
        [FONT=Calibri]"focusClassName": "",[/FONT]
        [FONT=Calibri]"className": "",[/FONT]
        [FONT=Calibri]"disabledClassname": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"overrides": "",[/FONT]
        [FONT=Calibri]"partialTemplatesJSON": "",[/FONT]
        [FONT=Calibri]"postProcessJavascript": "",[/FONT]
        [FONT=Calibri]"statePropertiesJSON": "{\n}"[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"lowLevelMode": "Data",[/FONT]
        [FONT=Calibri]"htmlMode": "DefineNow",[/FONT]
        [FONT=Calibri]"htmlJavascript": "",[/FONT]
        [FONT=Calibri]"javascriptObjectName": "",[/FONT]
        [FONT=Calibri]"fields": [[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "Firstname",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=Firstname}{T=0}{I:'$$control.text'}Firstname",[/FONT]
        [FONT=Calibri]"lookup": {[/FONT]
        [FONT=Calibri]"has": false[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "Lastname",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=Lastname}{T=0}{I:'$$control.text'}Lastname",[/FONT]
        [FONT=Calibri]"lookup": {[/FONT]
        [FONT=Calibri]"has": false[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "City",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=City}{T=0}{I:'$$control.text'}City",[/FONT]
        [FONT=Calibri]"lookup": {[/FONT]
        [FONT=Calibri]"has": false[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "State",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=State}{T=0}{I:'$$control.text'}State",[/FONT]
        [FONT=Calibri]"lookup": {[/FONT]
        [FONT=Calibri]"has": false[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "fnbg",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=fnbg}{T=0}{I:'$$control.text'}fnbg"[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"fieldName": "fnsw",[/FONT]
        [FONT=Calibri]"display": "{B=White,Light Blue}{data=fnsw}{T=0}{I:'$$control.text'}fnsw"[/FONT]
        [FONT=Calibri]}],[/FONT]
        [FONT=Calibri]"layouts": [[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"layoutName": "Default",[/FONT]
        [FONT=Calibri]"defaultLayout": false,[/FONT]
        [FONT=Calibri]"layoutDataType": "Data",[/FONT]
        [FONT=Calibri]"layoutDefinition": "<div class=\"aRow\">\n <div class=\"aCell fnameShow{fnsw} fnameBG{fnbg}\" style=\"width:10em\">{Firstname}</div>\n <div class=\"aCell\" style=\"width:10em\">{Lastname} </div>\n <div class=\"aCell\" style=\"width:10em\">{City}</div>\n <div class=\"aCell\" style=\"width:3em\">{State}</div>\n</div>\n",[/FONT]
        [FONT=Calibri]"defaultTemplate": "",[/FONT]
        [FONT=Calibri]"postProcessJavascript": "",[/FONT]
        [FONT=Calibri]"layoutType": "Freeform",[/FONT]
        [FONT=Calibri]"last_layoutGenieFieldSelected_c": "",[/FONT]
        [FONT=Calibri]"itemsArray": [[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"idInternal": "0ae88436-e714-4145-84c9-b43322ebcbd2",[/FONT]
        [FONT=Calibri]"controltype": "DataField_Label",[/FONT]
        [FONT=Calibri]"displayName": "Item1_1",[/FONT]
        [FONT=Calibri]"indentLevel": 0,[/FONT]
        [FONT=Calibri]"isContainer": false,[/FONT]
        [FONT=Calibri]"firstIndex": -1,[/FONT]
        [FONT=Calibri]"LastIndex": -1,[/FONT]
        [FONT=Calibri]"parentSectionIndex": -1,[/FONT]
        [FONT=Calibri]"parentContainerIndex": -1,[/FONT]
        [FONT=Calibri]"__currentcontainer": "",[/FONT]
        [FONT=Calibri]"W": {[/FONT]
        [FONT=Calibri]"controlType": "Label",[/FONT]
        [FONT=Calibri]"fieldName": "Firstname",[/FONT]
        [FONT=Calibri]"friendlyName": "Firstname",[/FONT]
        [FONT=Calibri]"break": "None",[/FONT]
        [FONT=Calibri]"fieldNameFullPath": "Firstname",[/FONT]
        [FONT=Calibri]"template": "",[/FONT]
        [FONT=Calibri]"showHideExpression": "",[/FONT]
        [FONT=Calibri]"itemClassName": "",[/FONT]
        [FONT=Calibri]"allowEditing": true,[/FONT]
        [FONT=Calibri]"width": "100%",[/FONT]
        [FONT=Calibri]"flowstyle": "",[/FONT]
        [FONT=Calibri]"flowclass": ""[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"idInternal": "9e03f352-841c-48cd-a3a3-911f2ed8196c",[/FONT]
        [FONT=Calibri]"controltype": "DataField_Label",[/FONT]
        [FONT=Calibri]"displayName": "Item1_1",[/FONT]
        [FONT=Calibri]"indentLevel": 0,[/FONT]
        [FONT=Calibri]"isContainer": false,[/FONT]
        [FONT=Calibri]"W": {[/FONT]
        [FONT=Calibri]"controlType": "Label",[/FONT]
        [FONT=Calibri]"fieldName": "Lastname",[/FONT]
        [FONT=Calibri]"friendlyName": "Lastname",[/FONT]
        [FONT=Calibri]"break": "None",[/FONT]
        [FONT=Calibri]"fieldNameFullPath": "Lastname",[/FONT]
        [FONT=Calibri]"template": "",[/FONT]
        [FONT=Calibri]"showHideExpression": "",[/FONT]
        [FONT=Calibri]"itemClassName": "",[/FONT]
        [FONT=Calibri]"allowEditing": true,[/FONT]
        [FONT=Calibri]"width": "100%",[/FONT]
        [FONT=Calibri]"flowstyle": "",[/FONT]
        [FONT=Calibri]"flowclass": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"firstIndex": -1,[/FONT]
        [FONT=Calibri]"LastIndex": -1,[/FONT]
        [FONT=Calibri]"parentSectionIndex": -1,[/FONT]
        [FONT=Calibri]"parentContainerIndex": -1,[/FONT]
        [FONT=Calibri]"__currentcontainer": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"idInternal": "8fa8a74b-2725-4063-b8d3-f30fe2acaad5",[/FONT]
        [FONT=Calibri]"controltype": "DataField_Label",[/FONT]
        [FONT=Calibri]"displayName": "Item1_1",[/FONT]
        [FONT=Calibri]"indentLevel": 0,[/FONT]
        [FONT=Calibri]"isContainer": false,[/FONT]
        [FONT=Calibri]"W": {[/FONT]
        [FONT=Calibri]"controlType": "Label",[/FONT]
        [FONT=Calibri]"fieldName": "City",[/FONT]
        [FONT=Calibri]"friendlyName": "City",[/FONT]
        [FONT=Calibri]"break": "None",[/FONT]
        [FONT=Calibri]"fieldNameFullPath": "City",[/FONT]
        [FONT=Calibri]"template": "",[/FONT]
        [FONT=Calibri]"showHideExpression": "",[/FONT]
        [FONT=Calibri]"itemClassName": "",[/FONT]
        [FONT=Calibri]"allowEditing": true,[/FONT]
        [FONT=Calibri]"width": "100%",[/FONT]
        [FONT=Calibri]"flowstyle": "",[/FONT]
        [FONT=Calibri]"flowclass": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"firstIndex": -1,[/FONT]
        [FONT=Calibri]"LastIndex": -1,[/FONT]
        [FONT=Calibri]"parentSectionIndex": -1,[/FONT]
        [FONT=Calibri]"parentContainerIndex": -1,[/FONT]
        [FONT=Calibri]"__currentcontainer": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]{[/FONT]
        [FONT=Calibri]"idInternal": "ea2fe194-684b-41b6-befc-3ecd978abd96",[/FONT]
        [FONT=Calibri]"controltype": "DataField_Label",[/FONT]
        [FONT=Calibri]"displayName": "Item1_1",[/FONT]
        [FONT=Calibri]"indentLevel": 0,[/FONT]
        [FONT=Calibri]"isContainer": false,[/FONT]
        [FONT=Calibri]"W": {[/FONT]
        [FONT=Calibri]"controlType": "Label",[/FONT]
        [FONT=Calibri]"fieldName": "State",[/FONT]
        [FONT=Calibri]"friendlyName": "State",[/FONT]
        [FONT=Calibri]"break": "None",[/FONT]
        [FONT=Calibri]"fieldNameFullPath": "State",[/FONT]
        [FONT=Calibri]"template": "",[/FONT]
        [FONT=Calibri]"showHideExpression": "",[/FONT]
        [FONT=Calibri]"itemClassName": "",[/FONT]
        [FONT=Calibri]"allowEditing": true,[/FONT]
        [FONT=Calibri]"width": "100%",[/FONT]
        [FONT=Calibri]"flowstyle": "",[/FONT]
        [FONT=Calibri]"flowclass": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"firstIndex": -1,[/FONT]
        [FONT=Calibri]"LastIndex": -1,[/FONT]
        [FONT=Calibri]"parentSectionIndex": -1,[/FONT]
        [FONT=Calibri]"parentContainerIndex": -1,[/FONT]
        [FONT=Calibri]"__currentcontainer": ""[/FONT]
        [FONT=Calibri]}],[/FONT]
        [FONT=Calibri]"_temp": {[/FONT]
        [FONT=Calibri]"objectType": "ViewBox"[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"errorStyle": "inline"[/FONT]
        [FONT=Calibri]}],[/FONT]
        [FONT=Calibri]"css": ".aRow {\ndisplay: block;\n}\n.aCell {\ndisplay: inline-block;\n}\n.fnameShowS {\nvisibility: visible;\n}\n.fnameShowH {\nvisibility: hidden;\n}\n.fnameBGG {\nbackground-color: #c7ffc7;\n}\n.fnameBGR {\nbackground-color: #ffafaf;\n}",[/FONT]
        [FONT=Calibri]"Javascript": ""[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"_state": {[/FONT]
        [FONT=Calibri]"showPane": {[/FONT]
        [FONT=Calibri]"css": true,[/FONT]
        [FONT=Calibri]"javascript": true,[/FONT]
        [FONT=Calibri]"items": true,[/FONT]
        [FONT=Calibri]"preview": true[/FONT]
        [FONT=Calibri]},[/FONT]
        [FONT=Calibri]"tabPage": "FormLayout",[/FONT]
        [FONT=Calibri]"LayoutSelected_n": 1,[/FONT]
        [FONT=Calibri]"fieldSelected_n": 1,[/FONT]
        [FONT=Calibri]"layoutGenieFieldSelected_c": "",[/FONT]
        [FONT=Calibri]"fieldselected_c": "",[/FONT]
        [FONT=Calibri]"itemSelected_c": "",[/FONT]
        [FONT=Calibri]"groupSelected_c": "",[/FONT]
        [FONT=Calibri]"cssMode": 1,[/FONT]
        [FONT=Calibri]"jsmode": 1,[/FONT]
        [FONT=Calibri]"selected_javascriptLocal_c": ""[/FONT]
        [FONT=Calibri]}[/FONT]
        [FONT=Calibri]}[/FONT]

        Comment


          #5
          Thanks guys.
          Inspiring stuff Rich:-)

          Comment


            #6
            Originally posted by Lance Gurd View Post
            Hi Jamie,

            I have done some hiding of fields in a list representation in a viewbox, but have not done any colour changing however I imagine it would be done the same way. It needs to be done in a template as in

            Code:
            {*if QUANTITY!=0}
            <div style="flex-grow:1;">
            {QUANTITY}&nbsp;
            </div>
            {*else}
            <div style="flex-grow:1;">
            &nbsp;
            </div>
            {*endif}
            I am trying this with varchar fields, so i have something like:
            Code:
            {*if MyField!=''}
            <div style="flex-grow:1;">
            {MyField}&nbsp;
            </div>
            {*else}
            <div style="flex-grow:1;">
            &nbsp;
            </div>
            {*endif}
            ...but it still tries to display {MyField}, i suspect because it is NULL in the MariaDB table it comes from. How can i test for either NULL or empty string in this scenario??
            <g>i miss so much Visual Foxpro, where i could put : if empty(myField) , where myField could be an empty string, null, 0, an empty date and what not :-)

            Comment


              #7
              {*if MyField == '' ||MyField === null}
              <div style = "flex-grow:1">
              &nbsp;
              </div>
              {*else}
              <div style ="flex-grow:1">
              {MyField}
              </div>
              {*endif}

              Comment


                #8
                euwwwww that notation hurts...
                Thanks Greg

                Comment


                  #9
                  It hurts? That should solve the NULL issue...but it does flip the order of the client side template a bit

                  Comment


                    #10
                    Well i hear you...no pain no gain

                    Comment


                      #11
                      Where can i find help on the notation used in the viewbox template editing?
                      I am trying now the following:
                      if myField = 2 then div with red background
                      if myField = 3 then div with orange Background
                      otherwise do not show at all the div

                      Currently no matter what the value of myField it always shows with red background. My code looks like this:
                      Code:
                      {*if Tyroid=2}
                      <div class="aCell fnameBGR" ><p><u>Tyroid:</u>&nbsp;<b>{tyrdisp}&nbsp;&nbsp;&nbsp;</b></p></div>
                      {*else}
                      {*if Tyroid=3}
                      <div class="aCell fnameBGO" ><p><u>Tyroid:</u>&nbsp;<b>{tyrdisp}&nbsp;&nbsp;&nbsp;</b></p></div>
                      {*else}
                      {*endif}
                      {*endif}
                      What am i doing wrong?

                      Comment


                        #12
                        Forgot to mention in the code above, fnameBGR is the class for red background and fnameBGO is the class for orange background...(Thanks Rich!)

                        Comment


                          #13
                          Need to use double equal signs otherwise you are assigning the value of 2 to the first one.

                          HTML Code:
                          {*if Tyroid == 2}
                          <div class="aCell fnameBGR" ><p><u>Tyroid:</u>&nbsp;<b>{tyrdisp}&nbsp;&nbsp;&nbsp;</b></p></div>
                          {*elseif Tyroid == 3}
                          <div class="aCell fnameBGO" ><p><u>Tyroid:</u>&nbsp;<b>{tyrdisp}&nbsp;&nbsp;&nbsp;</b></p></div>
                          {*else}
                          <div> Else is the final option if all else fails. It should appear after the else if statements </div>
                          {*endif}

                          Comment


                            #14
                            {*if MyField} returns true if the value is not null empty string or 0. I have used it to solve the null problem and it works great.
                            David Weinstein
                            Best Tech
                            [email protected]t

                            Comment


                              #15
                              Thanks Greg and besttech
                              What kind of notation is it in the templating? Seems like a mixture of javascript and html...I'd like to read somewhere about what tricks and tips i can use there ...

                              Comment

                              Working...
                              X